@opentron/tronlink-provider

0.4.41 • Public • Published

@opentron/tronlink-provider

Like @opentron/java-tron-provider but uses the TronLink extension for signing transactions.

See tronlink-provider-demo for a demo.

Install

npm install @opentron/tronlink-provider

Usage

The functionSignatures array must contain all mutable function that will potentially be called. Otherwise, you could get an "cannot find function name mapping for signature" error.

const abi = [
  {
    constant: true,
    inputs: [],
    name: "get",
    outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
    payable: false,
    stateMutability: "view",
    type: "function",
  },
  {
    constant: false,
    inputs: [{ internalType: "uint256", name: "_value", type: "uint256" }],
    name: "set",
    outputs: [],
    payable: false,
    stateMutability: "nonpayable",
    type: "function",
  },
];
const provider = createTronLinkProvider({
  network: "nile",
  functionSignatures: abi,
});
const web3 = new Web3(provider);

TODO

  • eth_requestAccounts

Readme

Keywords

none

Package Sidebar

Install

npm i @opentron/tronlink-provider

Weekly Downloads

561

Version

0.4.41

License

ISC

Unpacked Size

23.8 kB

Total Files

13

Last publish

Collaborators

  • kevholder
  • oikoscash