|
1 | 1 | # Orchestration API
|
2 | 2 |
|
3 |
| -The Agoric Orchestration API enables developers to seamlessly manage and interact with accounts across multiple blockchain networks, simplifying the complexities of cross-chain operations. |
| 3 | +The Agoric [Orchestration](/glossary/#orchestration) API enables developers to seamlessly manage and interact with accounts across multiple blockchain networks, simplifying the complexities of cross-chain operations. |
4 | 4 |
|
5 | 5 | See [Orchestration API Spec](https://agoric-sdk.pages.dev/modules/_agoric_orchestration)
|
6 | 6 |
|
7 | 7 | ## Orchestrator Interface
|
8 | 8 |
|
9 |
| -The `Orchestrator` interface provides a set of high-level methods to manage and interact with interchain accounts. Below are the primary methods: |
| 9 | +The [`Orchestrator`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator) interface provides a set of high-level methods to manage and interact with interchain accounts. Below are the primary methods: |
10 | 10 |
|
11 |
| -### `getChain` |
12 |
| -Retrieves the chain information and provides access to chain-specific methods. |
| 11 | +### getChain |
| 12 | + |
| 13 | +Retrieves the chain information and provides access to chain-specific methods. See [getChain](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getChain). |
13 | 14 |
|
14 | 15 | ```javascript
|
15 | 16 | const chain = await orchestrator.getChain('chainName');
|
16 | 17 | ```
|
17 | 18 |
|
18 | 19 | ### makeLocalAccount
|
19 |
| -Creates a new LocalChainAccount. |
| 20 | +Creates a new `LocalChainAccount`. See [makeLocalAccount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#makeLocalAccount). |
20 | 21 |
|
21 | 22 | ```javascript
|
22 | 23 | const localAccount = await orchestrator.makeLocalAccount();
|
23 | 24 | ```
|
24 | 25 |
|
25 | 26 | ### getBrandInfo
|
26 |
| -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. |
| 27 | + |
| 28 | +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](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getBrandInfo). |
27 | 29 |
|
28 | 30 | ```javascript
|
29 | 31 | const brandInfo = orchestrator.getBrandInfo('denom');
|
30 | 32 | ```
|
31 | 33 |
|
32 | 34 | ### asAmount
|
33 |
| -Converts a denom amount to an `Amount` with a brand. |
| 35 | + |
| 36 | +Converts a denom amount to an `Amount` with a brand. See [asAmount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount). |
34 | 37 |
|
35 | 38 | ```javascript
|
36 | 39 | const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n });
|
37 | 40 | ```
|
38 | 41 |
|
39 |
| -## OrchestrationAccount Interface |
40 |
| -Orchestration accounts provide high-level operations for managing accounts on remote chains. Below are the primary methods available: |
| 42 | +## OrchestrationAccount |
| 43 | + |
| 44 | +An [`OrchestrationAccount`](https://agoric-sdk.pages.dev/types/_agoric_orchestration.OrchestrationAccount) is a type alias that combines the [`OrchestrationAccountI`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI) interface with additional methods. Below are the primary methods available: |
41 | 45 |
|
42 | 46 | ### getAddress
|
43 |
| -Retrieves the address of the account on the remote chain. |
| 47 | + |
| 48 | +Retrieves the address of the account on the remote chain. See [getAddress](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#getAddress). |
| 49 | + |
44 | 50 | ```javascript
|
45 | 51 | const address = await orchestrationAccount.getAddress();
|
46 | 52 | ```
|
47 | 53 |
|
48 | 54 | ### getBalances
|
49 |
| -Returns an array of amounts for every balance in the account. |
| 55 | + |
| 56 | +Returns an array of amounts for every balance in the account. See [getBalances](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#getBalances). |
50 | 57 |
|
51 | 58 | ```javascript
|
52 | 59 | const balances = await orchestrationAccount.getBalances();
|
53 | 60 | ```
|
54 | 61 |
|
55 | 62 | ### getBalance
|
56 |
| -Retrieves the balance of a specific denom for the account. |
| 63 | + |
| 64 | +Retrieves the balance of a specific denom for the account. See [getBalance](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#getBalance). |
57 | 65 |
|
58 | 66 | ```javascript
|
59 | 67 | const balance = await orchestrationAccount.getBalance('uatom');
|
60 | 68 | ```
|
61 | 69 |
|
62 | 70 | ### send
|
63 |
| -Transfers an amount to another account on the same chain. The promise settles when the transfer is complete. |
| 71 | + |
| 72 | +Transfers an amount to another account on the same chain. The promise settles when the transfer is complete. See [send](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#send). |
64 | 73 |
|
65 | 74 | ```javascript
|
66 | 75 | await orchestrationAccount.send(receiverAddress, amount);
|
67 | 76 | ```
|
68 | 77 |
|
69 | 78 | ### transfer
|
70 |
| -Transfers an amount to another account, typically on another chain. The promise settles when the transfer is complete. |
| 79 | + |
| 80 | +Transfers an amount to another account, typically on another chain. The promise settles when the transfer is complete. See [transfer](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#transfer). |
71 | 81 |
|
72 | 82 | ```javascript
|
73 | 83 | await orchestrationAccount.transfer(amount, destinationAddress);
|
74 | 84 | ```
|
75 | 85 |
|
76 | 86 | ### transferSteps
|
77 |
| -Transfers an amount to another account in multiple steps. The promise settles when the entire path of the transfer is complete. |
| 87 | + |
| 88 | +Transfers an amount to another account in multiple steps. The promise settles when the entire path of the transfer is complete. See [transferSteps](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#transferSteps). |
| 89 | + |
78 | 90 | ```javascript
|
79 | 91 | await orchestrationAccount.transferSteps(amount, transferMsg);
|
80 | 92 | ```
|
81 | 93 |
|
82 | 94 | ### deposit
|
| 95 | + |
83 | 96 | Deposits payment from Zoe to the account. For remote accounts, an IBC Transfer will be executed to transfer funds there.
|
| 97 | + |
84 | 98 | ```javascript
|
85 | 99 | await orchestrationAccount.deposit(payment);
|
86 | 100 | ```
|
0 commit comments