Skip to content

Orchestration API

The Agoric Orchestration API enables developers to seamlessly manage and interact with accounts across multiple blockchain networks, simplifying the complexities of cross-chain operations.

See Orchestration API Spec

Orchestrator Interface

The Orchestrator interface provides a set of high-level methods to manage and interact with interchain accounts. Below are the primary methods:

getChain

Retrieves the chain information and provides access to chain-specific methods. See getChain.

js
const chain = await orchestrator.getChain('chainName');

makeLocalAccount

Creates a new LocalChainAccount. See makeLocalAccount.

js
const localAccount = await orchestrator.makeLocalAccount();

getBrandInfo

Returns information about a denom, including the equivalent local Brand, the chain where the denom is held, and the chain that issues the corresponding asset. See getBrandInfo.

js
const brandInfo = orchestrator.getBrandInfo('denom');

asAmount

Converts a denom amount to an Amount with a brand. See asAmount.

js
const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n });

OrchestrationAccount

An OrchestrationAccount is a type alias that combines the OrchestrationAccountI interface with additional methods. Below are the primary methods available:

getAddress

Retrieves the address of the account on the remote chain. See getAddress.

js
const address = await orchestrationAccount.getAddress();

getBalances

Returns an array of amounts for every balance in the account. See getBalances.

js
const balances = await orchestrationAccount.getBalances();

getBalance

Retrieves the balance of a specific denom for the account. See getBalance.

js
const balance = await orchestrationAccount.getBalance('uatom');

send

Transfers an amount to another account on the same chain. The promise settles when the transfer is complete. See send.

js
await orchestrationAccount.send(receiverAddress, amount);

transfer

Transfers an amount to another account, typically on another chain. The promise settles when the transfer is complete. See transfer.

js
await orchestrationAccount.transfer(amount, destinationAddress);

transferSteps

Transfers an amount to another account in multiple steps. The promise settles when the entire path of the transfer is complete. See transferSteps.

js
await orchestrationAccount.transferSteps(amount, transferMsg);

deposit

Deposits payment from Zoe to the account. For remote accounts, an IBC Transfer will be executed to transfer funds there.

js
await orchestrationAccount.deposit(payment);