AMP Operations
Tools for the Andromeda Messaging Protocol - enabling cross-chain communication and advanced ADO creation.
Note: All AMP tools support the optional
userIdparameter for session persistence. Include it in every call to maintain wallet and chain state across reconnections.
send_amp_message
Send a message through AMP to another ADO. Supports local and cross-chain messaging.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Recipient address, VFS path, or IBC path |
message | object | Yes | The message to send to the recipient ADO |
funds | array | No | Coins to send with the message |
replyOn | string | No | When to receive a reply: always, error, success, or never (default: never) |
gasLimit | number | No | Gas limit for message execution |
directTransmission | boolean | No | Send directly or route through kernel (default: false) |
exitAtError | boolean | No | Exit on error (default: false) |
ibcRecoveryAddr | string | No | Recovery address for IBC messages |
simulate | boolean | No | Simulate without sending (default: false) |
Recipient Formats
- Raw address:
andr1contractaddress... - VFS path:
/home/username/my-contract - IBC path:
ibc://galileo-4/andr1contractaddress...
Example - Local Message
{
"recipient": "andr1contractaddress...",
"message": {
"transfer_nft": {
"recipient": "andr1recipient...",
"token_id": "token123"
}
}
}Example - Cross-Chain Message
{
"recipient": "ibc://galileo-4/andr1contractaddress...",
"message": {
"execute_operation": {
"data": "value"
}
},
"ibcRecoveryAddr": "andr1myaddress..."
}Example - With Funds and Reply
{
"recipient": "andr1contractaddress...",
"message": {
"purchase": { "token_id": "token123" }
},
"funds": [
{ "denom": "uandr", "amount": "1000000" }
],
"replyOn": "error"
}create_ado_through_amp
Create an ADO through the kernel. This enables special kernel features like auto-registration in the VFS.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
adoType | string | Yes | ADO type (e.g., "cw721"). Can include version: "[email protected]" |
msg | object | Yes | The instantiation message for the ADO |
label | string | Yes | A human-readable label for the contract |
version | string | No | ADO version (if not specified in adoType) |
owner | string | No | Owner address (defaults to sender) |
funds | array | No | Funds to send with instantiation |
simulation | boolean | No | Simulate without creating (default: false) |
Example
{
"adoType": "cw721",
"version": "2.2.0-b.12",
"msg": {
"name": "My NFT Collection",
"symbol": "MNFT",
"minter": "andr1..."
},
"label": "my-nft-collection"
}With Version in Type
{
"adoType": "[email protected]",
"msg": {
"name": "My NFT Collection",
"symbol": "MNFT",
"minter": "andr1..."
},
"label": "my-nft-collection"
}Difference from instantiate_ado
create_ado_through_amp routes through the kernel which provides:
- Automatic registration in kernel's ADO registry
- VFS path creation capabilities
- Cross-chain instantiation support
Use instantiate_ado for direct deployment, create_ado_through_amp for kernel-managed deployment.
send_amp_batch
CURRENTLY UNAVAILABLE - Awaiting kernel support for batch messaging.
This tool will send multiple AMP messages in a single transaction when the kernel adds support.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | array | Yes | Array of AMP messages to send |
Each message in the array follows the same format as send_amp_message.
Future Example
{
"messages": [
{
"recipient": "andr1contract1...",
"message": { "action1": {} }
},
{
"recipient": "andr1contract2...",
"message": { "action2": {} }
}
]
}