SDK Quickstart
For this guide, we will be using npm
or yarn
as our package manager to install libraries.
1. Install required libraries
npm add @mysten/sui liquidlink
2. Initialize SDK
import { LiquidLinkDappClient } from "liquidlink";
// You can get the dapp_index after registering your Dapp
const liquidLinkDappClient = new LiquidLinkDappClient({
dapp_index: 6,
});
3. Embed event tracker
import { Transaction } from "@mysten/sui/transactions";
const txb = new Transaction();
// other move calls on your transaction block
// Place this line in beteen your move calls
liquidLinkDappClient.MoveCallCreateUpdateRequest({ txb });
// other move calls on your transaction block
4. Sign and execute
const { bytes, signature } = await txb.sign({
client: suiClient,
signer: keypair,
});
const result = await suiClient.executeTransactionBlock({
transactionBlock: bytes,
signature,
});
Last updated