@hyperlane-xyz/radix-sdk
Version:
Hyperlane TypeScript SDK for the Radix Hyperlane SDK module
44 lines (30 loc) • 1.05 kB
Markdown
The Hyperlane Radix SDK is a fully typed TypeScript SDK for the [Radix Implementation](https://github.com/hyperlane-xyz/hyperlane-radix).
It can be used as a standalone SDK for frontend or in backend applications which want to connect to a Radix chain which has the Hyperlane blueprint installed.
```bash
npm install @hyperlane-xyz/radix-sdk
yarn add @hyperlane-xyz/radix-sdk
```
```ts
import { RadixSDK, RadixSigningSDK } from "@hyperlane-xyz/radix-sdk";
const signingSdk = await RadixSigningSDK.fromPrivateKey(
PRIV_KEY,
{
networkId: NetworkId.Stokenet,
},
);
const mailboxAddress = await signingSdk.tx.createMailbox({ domain_id: 75898670 });
const mailbox = await signingSdk.query.getMailbox({ mailbox: mailboxAddress });
...
// performing queries without signer
const sdk = new RadixSDK({
networkId: NetworkId.Stokenet,
})
const mailbox = await signingSdk.query.getMailbox({ mailbox: mailboxAddress });
```
Node 18 or newer is required.