Bot Examples
Example 1: Mint a Fungible Token
import { BitBadgesSigningClient, GenericCosmosAdapter, MsgCreateCollection } from 'bitbadgesjs-sdk';
const adapter = await GenericCosmosAdapter.fromMnemonic(
process.env.BOT_MNEMONIC!,
'bitbadges-2'
);
const client = new BitBadgesSigningClient({
adapter,
network: 'testnet'
});
const result = await client.signAndBroadcast([
MsgCreateCollection.create({
creator: client.address,
// ... collection configuration
// See SDK docs for full MsgCreateCollection fields
})
]);
if (result.success) {
console.log('Collection created! TX:', result.txHash);
} else {
console.error('Failed:', result.error);
}Example 2: Check Balance & Conditional Transfer
Example 3: Gate Access (Verify Ownership)
Example 4: Subscribe to Events & Auto-React
Example 5: MCP Agent Workflow
Tool Call Sequence
Query Sequence (No Signing)
Tips for AI Agents
Last updated