Skip to content

Commit d0ba308

Browse files
committed
chore: simplify registerChain
1 parent 62424aa commit d0ba308

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

main/guides/orchestration/getting-started/key-concepts.md

+19-21
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set of high-level methods to manage and interact with local and remote chains. B
1313
- `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).
1414

1515
```javascript
16-
const chain = await orchestrator.getChain('chainName')
16+
const chain = await orchestrator.getChain('chainName');
1717
```
1818

1919
### Brand Utility Functions
@@ -22,13 +22,13 @@ const chain = await orchestrator.getChain('chainName')
2222
held, and the chain that issues the corresponding asset. See [getBrandInfo](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getBrandInfo).
2323

2424
```javascript
25-
const brandInfo = orchestrator.getBrandInfo('denom')
25+
const brandInfo = orchestrator.getBrandInfo('denom');
2626
```
2727

2828
- `asAmount` converts a denom amount to an `Amount` with a brand. See [asAmount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount).
2929

3030
```javascript
31-
const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n })
31+
const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n });
3232
```
3333

3434
## Orchestration Account
@@ -45,20 +45,20 @@ interactions, providing a unified and simplified interface for developers.
4545
```javascript
4646
const [agoric, remoteChain] = await Promise.all([
4747
orch.getChain('agoric'),
48-
orch.getChain(chainName)
49-
])
48+
orch.getChain(chainName),
49+
]);
5050
const [localAccount, remoteAccount] = await Promise.all([
5151
agoric.makeAccount(),
52-
remoteChain.makeAccount()
53-
])
52+
remoteChain.makeAccount(),
53+
]);
5454
```
5555

5656
### Address Management
5757

5858
- `getAddress` retrieves the address of the account on the remote chain.
5959

6060
```javascript
61-
const address = await orchestrationAccount.getAddress()
61+
const address = await orchestrationAccount.getAddress();
6262
```
6363

6464
### Balance Management
@@ -67,8 +67,8 @@ const address = await orchestrationAccount.getAddress()
6767
- `getBalance` retrieves the balance of a specific denom for the account.
6868

6969
```javascript
70-
const balances = await orchestrationAccount.getBalances()
71-
const balance = await orchestrationAccount.getBalance('uatom')
70+
const balances = await orchestrationAccount.getBalances();
71+
const balance = await orchestrationAccount.getBalance('uatom');
7272
```
7373

7474
### Funds Transfer
@@ -80,10 +80,10 @@ const balance = await orchestrationAccount.getBalance('uatom')
8080
funds there.
8181

8282
```javascript
83-
await orchestrationAccount.send(receiverAddress, amount)
84-
await orchestrationAccount.transfer(amount, destinationAddress)
85-
await orchestrationAccount.transferSteps(amount, transferMsg)
86-
await orchestrationAccount.deposit(payment)
83+
await orchestrationAccount.send(receiverAddress, amount);
84+
await orchestrationAccount.transfer(amount, destinationAddress);
85+
await orchestrationAccount.transferSteps(amount, transferMsg);
86+
await orchestrationAccount.deposit(payment);
8787
```
8888

8989
## ChainHub
@@ -98,9 +98,7 @@ and use of chain and connection information using the following APIs:
9898

9999
### Registration APIs
100100

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.
104102
- `registerConnection` registers a connections between two given chain IDs.
105103
- `registerAsset` registers an asset that may be held on a chain other than the issuing chain. Both corresponding chains
106104
should already be registered before this call.
@@ -117,15 +115,15 @@ In the below example, `chainHub` is used to register a new chain and establish a
117115
the newly registered chain.
118116

119117
```javascript
120-
const chainHub = makeChainHub(privateArgs.agoricNames, vowTools)
118+
const chainHub = makeChainHub(privateArgs.agoricNames, vowTools);
121119

122120
// Register a new chain with its information
123-
chainHub.registerChain(chainKey, chainInfo)
121+
chainHub.registerChain(chainKey, chainInfo);
124122

125123
// Register a connection between the Agoric chain and the new chain
126124
chainHub.registerConnection(
127125
agoricChainInfo.chainId,
128126
chainInfo.chainId,
129-
connectionInfo
130-
)
127+
connectionInfo,
128+
);
131129
```

0 commit comments

Comments
 (0)