@hyperlane-xyz/tron-sdk
v22.1.3
Published
Hyperlane TypeScript SDK for Tron
Downloads
2,925
Readme
Hyperlane TRON SDK
The Hyperlane TRON SDK is a fully typed TypeScript SDK for the TRON Implementation. It can be used as a standalone SDK for frontend or in backend applications which want to connect to a TRON chain which has the Hyperlane blueprint installed.
Install
# Install with NPM
npm install @hyperlane-xyz/tron-sdk
# Or with pnpm
pnpm add @hyperlane-xyz/tron-sdkUsage
import { TronProvider, TronSigner } from "@hyperlane-xyz/tron-sdk";
const signer = await TronSigner.connectWithSigner(
['http://localhost:3030'],
PRIV_KEY,
{
metadata: {
chainId: 1
}
}
);
const mailboxAddress = await signer.createMailbox({ domainId: 75898670 });
const mailbox = await signer.getMailbox({ mailboxAddress });
...
// performing queries without signer
const provider = await TronProvider.connect(
['http://localhost:3030'],
1
);
const mailbox = await provider.getMailbox({ mailboxAddress });Setup
Node 18 or newer is required.
