rgb_send_assets
Send RGB assets to multiple recipients by specifying asset IDs and corresponding recipient addresses with amounts. This tool facilitates asset transfers within the RGB Lightning Network ecosystem.
Instructions
Send RGB assets to recipients
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recipientMap | Yes | Map of asset IDs to recipient/amount pairs |
Implementation Reference
- src/server.ts:84-102 (registration)Registration of the 'rgb_send_assets' MCP tool, including input schema (recipientMap as record of assetId to array of recipient/amount objects) and handler function that delegates to rgbClient.sendAssets()server.tool( 'rgb_send_assets', 'Send RGB assets to recipients', { recipientMap: z.record(z.string(), z.array(z.object({ recipient: z.string().describe('The recipient address'), amount: z.number().describe('The amount to send'), }))).describe('Map of asset IDs to recipient/amount pairs'), }, async ({ recipientMap }) => { try { const result = await rgbClient.sendAssets(recipientMap); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } } );
- src/server.ts:93-101 (handler)MCP tool handler: receives recipientMap, calls rgbClient.sendAssets(recipientMap), returns JSON stringified result or errorasync ({ recipientMap }) => { try { const result = await rgbClient.sendAssets(recipientMap); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } }
- src/server.ts:87-92 (schema)Zod input schema for recipientMap: object mapping asset IDs (string) to arrays of {recipient: string, amount: number}{ recipientMap: z.record(z.string(), z.array(z.object({ recipient: z.string().describe('The recipient address'), amount: z.number().describe('The amount to send'), }))).describe('Map of asset IDs to recipient/amount pairs'), },
- src/rgb-client.ts:64-66 (helper)Wrapper method in RGBApiClientWrapper: forwards recipientMap to underlying SDK's rgb.sendAssets with {recipient_map}async sendAssets(recipientMap: any) { return await this.client.rgb.sendAssets({ recipient_map: recipientMap }); }
- src/types.ts:106-113 (schema)TypeScript interface defining the structure of SendAssetsParams matching the tool input schemaexport interface SendAssetsParams { recipient_map: { [assetId: string]: Array<{ recipient: string; amount: number; }>; }; }