@layerzerolabs/lz-iotamove-oft-sdk-v2
LayerZero V2 IOTA OFT (Omnichain Fungible Token) SDK
Overview
This SDK provides TypeScript bindings for interacting with LayerZero V2 OFT contracts on the IOTA blockchain. It enables developers to create, manage, and transfer omnichain fungible tokens across different blockchains using the LayerZero protocol.
Installation
npm install @layerzerolabs/lz-iotamove-oft-sdk-v2
yarn add @layerzerolabs/lz-iotamove-oft-sdk-v2
pnpm add @layerzerolabs/lz-iotamove-oft-sdk-v2
Features
- Cross-chain Transfers: Send tokens across different blockchains
- OFT & OFT Adapter: Interact with deployed OFT & OFT Adapter
- OFT Composer: Advanced composition functionality for complex cross-chain operations
Usage
Basic OFT Operations
import { OFT } from "@layerzerolabs/lz-iotamove-oft-sdk-v2";
import { SDK } from "@layerzerolabs/lz-iotamove-sdk-v2";
const sdk = new SDK({
client: iotaClient,
packages: packageOptions,
objects: objectOptions,
stage: Stage.MAINNET,
});
const oft = new OFT(
builderPackageId,
builderObjectId,
packageId,
iotaClient,
objects,
oftObjectId,
adminCapId,
coinType,
sdk.moduleManager,
);
const sendParam = {
dstEid: destinationEndpointId,
to: recipientAddress,
amountLd: amount,
minAmountLd: minAmount,
extraOptions: options,
composeMsg: new Uint8Array(0),
oftCmd: new Uint8Array(0),
};
const { nativeFee, zroFee } = await oft.quoteSend(sender, sendParam, false);
OFT Composer
import { OFTComposer } from "@layerzerolabs/lz-iotamove-oft-sdk-v2";
const composer = new OFTComposer(
packageId,
iotaClient,
objects,
oftComposerObjectId,
adminCapId,
oftComposerRegistryId,
coinType,
moduleManager,
);
const lzComposeInfo = await composer.lzComposeInfo();
composer.registerComposerMoveCall(tx, lzComposeInfo);
Documentation
For detailed documentation and examples, please visit the LayerZero documentation.
License
MIT