Sui Agent Building
Quick Start: Building Your Bitte Open Agent on Sui
1. Clone the Boilerplate & Install
git clone https://github.com/BitteProtocol/agent-next-boilerplate.git
cd agent-next-boilerplate
pnpm install2. Configure Your Bitte API Key
dotenvCopyEditBITTE_API_KEY="bitte_YOUR_KEY_HERE"
3. Wire Up Sui: Add Your Transaction Tool
const { senderAddress, recipientAddress, amountInSui, network } = args;
const tx = new Transaction();
const MIST_PER_SUI = 1e9;
const amountInMist = Math.floor(amountInSui * MIST_PER_SUI);
if (amountInMist > Number.MAX_SAFE_INTEGER) {
throw new Error('Amount exceeds safe integer limit');
}
const [coin] = tx.splitCoins(tx.gas, [tx.pure.u64(BigInt(amountInMist))]);
tx.setSender(senderAddress);
tx.transferObjects([coin], tx.pure.address(recipientAddress));
const txBytes = await tx.build({ client: suiClientFor(network) });
return { data: { suiTransactionBytes: Buffer.from(txBytes).toString('base64') } };4. Declare Your Tool in the Plugin Manifest
5. Add generate-sui-tx to the Tools Array
generate-sui-tx to the Tools Array6. Define Behaviour
7. Run Locally & Test
7. Deploy Your Agent
Last updated