@tronweb3/tronwallet-adapter-tronlink-evm
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@tronweb3/tronwallet-adapter-tronlink-evm

This package provides an adapter to enable DApps to connect to the TronLink Wallet extension.

Demo

import { TronLinkEvmAdapter } from '@tronweb3/tronwallet-adapter-tronlink-evm';

const adapter = new TronLinkEvmAdapter();
// connect
await adapter.connect();

// then you can get address
console.log(adapter.address);

// just use the sendTransaction method to send a transfer transaction.
const transaction = {
    value: '0x' + Number(0.01 * Math.pow(10, 18)).toString(16), // 0.01 is 0.01ETH
    to: 'your target address',
    from: adapter.address,
};
await adapter.sendTransaction(transaction);

Documentation

API

  • Constructor()

    import { TronLinkEvmAdapter } from '@tronweb3/tronwallet-adapter-tronlink-evm';
    const tronLinkEvmAdapter = new TronLinkEvmAdapter();

Caveat Currently TronLink wallet does not support addChain() and signTypedData().

More detailed API can be found in Abstract Adapter.

Package Sidebar

Install

npm i @tronweb3/tronwallet-adapter-tronlink-evm

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

112 kB

Total Files

28

Last publish

Collaborators

  • cathytan
  • troncore
  • tron-dev