@@ -12,23 +12,23 @@ set of high-level methods to manage and interact with local and remote chains. B
12
12
13
13
- ` getChain ` retrieves a chain object for the given ` chainName ` to get access to chain-specific methods. See [ getChain] ( https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getChain ) .
14
14
15
- ``` javascript
16
- const chain = await orchestrator .getChain (' chainName' )
15
+ ``` js
16
+ const chain = await orchestrator .getChain (' chainName' );
17
17
```
18
18
19
19
### Brand Utility Functions
20
20
21
21
- ` getBrandInfo ` returns information about a ` denom ` , including the equivalent local Brand, the chain where the denom is
22
22
held, and the chain that issues the corresponding asset. See [ getBrandInfo] ( https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getBrandInfo ) .
23
23
24
- ``` javascript
25
- const brandInfo = orchestrator .getBrandInfo (' denom' )
24
+ ``` js
25
+ const brandInfo = orchestrator .getBrandInfo (' denom' );
26
26
```
27
27
28
28
- ` asAmount ` converts a denom amount to an ` Amount ` with a brand. See [ asAmount] ( https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount ) .
29
29
30
- ``` javascript
31
- const amount = orchestrator .asAmount ({ denom: ' uatom' , value: 1000n })
30
+ ``` js
31
+ const amount = orchestrator .asAmount ({ denom: ' uatom' , value: 1000n });
32
32
```
33
33
34
34
## Orchestration Account
@@ -42,33 +42,33 @@ interactions, providing a unified and simplified interface for developers.
42
42
43
43
- ` makeAccount ` (for a chain object) creates a new account on local and/or remote chain as below.
44
44
45
- ``` javascript
45
+ ``` js
46
46
const [agoric , remoteChain ] = await Promise .all ([
47
47
orch .getChain (' agoric' ),
48
48
orch .getChain (chainName)
49
- ])
49
+ ]);
50
50
const [localAccount , remoteAccount ] = await Promise .all ([
51
51
agoric .makeAccount (),
52
52
remoteChain .makeAccount ()
53
- ])
53
+ ]);
54
54
```
55
55
56
56
### Address Management
57
57
58
58
- ` getAddress ` retrieves the address of the account on the remote chain.
59
59
60
- ``` javascript
61
- const address = await orchestrationAccount .getAddress ()
60
+ ``` js
61
+ const address = await orchestrationAccount .getAddress ();
62
62
```
63
63
64
64
### Balance Management
65
65
66
66
- ` getBalances ` returns an array of amounts for every balance in the account.
67
67
- ` getBalance ` retrieves the balance of a specific denom for the account.
68
68
69
- ``` javascript
70
- const balances = await orchestrationAccount .getBalances ()
71
- const balance = await orchestrationAccount .getBalance (' uatom' )
69
+ ``` js
70
+ const balances = await orchestrationAccount .getBalances ();
71
+ const balance = await orchestrationAccount .getBalance (' uatom' );
72
72
```
73
73
74
74
### Funds Transfer
@@ -79,11 +79,11 @@ const balance = await orchestrationAccount.getBalance('uatom')
79
79
- ` deposit ` deposits payment from Zoe to the account. For remote accounts, an IBC Transfer will be executed to transfer
80
80
funds there.
81
81
82
- ``` javascript
83
- await orchestrationAccount .send (receiverAddress, amount)
84
- await orchestrationAccount .transfer (amount, destinationAddress)
85
- await orchestrationAccount .transferSteps (amount, transferMsg)
86
- await orchestrationAccount .deposit (payment)
82
+ ``` js
83
+ await orchestrationAccount .send (receiverAddress, amount);
84
+ await orchestrationAccount .transfer (amount, destinationAddress);
85
+ await orchestrationAccount .transferSteps (amount, transferMsg);
86
+ await orchestrationAccount .deposit (payment);
87
87
```
88
88
89
89
## ChainHub
@@ -98,9 +98,7 @@ and use of chain and connection information using the following APIs:
98
98
99
99
### Registration APIs
100
100
101
- - ` registerChain ` register a new chain with ` chainHub ` . The name will override a name in well-known chain names. If a
102
- durable zone was not provided, registration will not survive a reincarnation of the vat, and will have to be
103
- registered again.
101
+ - ` registerChain ` register a new chain with ` chainHub ` . The name will override a name in well-known chain names.
104
102
- ` registerConnection ` registers a connections between two given chain IDs.
105
103
- ` registerAsset ` registers an asset that may be held on a chain other than the issuing chain. Both corresponding chains
106
104
should already be registered before this call.
@@ -116,16 +114,16 @@ and use of chain and connection information using the following APIs:
116
114
In the below example, ` chainHub ` is used to register a new chain and establish a connection between the Agoric chain and
117
115
the newly registered chain.
118
116
119
- ``` javascript
120
- const chainHub = makeChainHub (privateArgs .agoricNames , vowTools)
117
+ ``` js
118
+ const chainHub = makeChainHub (privateArgs .agoricNames , vowTools);
121
119
122
120
// Register a new chain with its information
123
- chainHub .registerChain (chainKey, chainInfo)
121
+ chainHub .registerChain (chainKey, chainInfo);
124
122
125
123
// Register a connection between the Agoric chain and the new chain
126
124
chainHub .registerConnection (
127
125
agoricChainInfo .chainId ,
128
126
chainInfo .chainId ,
129
127
connectionInfo
130
- )
128
+ );
131
129
```
0 commit comments