Skip to content

Commit 3d34659

Browse files
committed
chore: more clarity to orch docs
1 parent d9e65eb commit 3d34659

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

main/guides/orchestration/index.md

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ Agoric’s Orchestration capability allows developers to easily build cross-chai
66
<img src="./assets/chains.png" width="100%" />
77
<br/>
88

9-
**From a user’s perspective**, your contract or dapp can coordinate actions across multiple chains without burdening the user to jump through multiple UIs or signing steps. The Orchestration API *handles the complexity behind the scenes*. This empowers smart contracts to, for example,
9+
**From a user’s perspective**, your contract or dapp can coordinate actions across multiple chains without burdening the user to jump through multiple UIs or signing steps. The Orchestration API _handles the complexity behind the scenes_. This empowers smart contracts to, for example,
1010

11-
:::tip Key Orchestration Features
12-
- **_Perform Inter-Chain Staking_** 🔄
13-
Leverage delegated proof-of-stake opportunities on remote Cosmos chains.
11+
:::tip Key Orchestration Use Cases
1412

15-
- **_Automate Multi-Hop Transfers_** 🌉
16-
Bridge tokens from Ethereum to Stride, then stake them or perform actions on Osmosis.
13+
- **Perform Inter-Chain Staking** 🌐
14+
Leverage delegated proof-of-stake opportunities on remote Cosmos chains.
1715

18-
- **_Support Scheduled Operations_**
19-
Enable recurring and delayed tasks like rents and subscription services through the on-chain Timer Service.
20-
:::
16+
- **Automate Multi-Hop Transfers** 🚀
17+
Bridge tokens from Ethereum to Stride, then stake them or perform actions on Osmosis.
18+
19+
- **Support Scheduled Operations**
20+
Enable recurring and delayed tasks like rent collection and subscription services through the on-chain Timer Service.
21+
:::
2122

2223
The Orchestration API sits on top of Agoric’s novel VM that provides three key elements that make multichain applications possible:
2324

@@ -27,10 +28,13 @@ The Orchestration API sits on top of Agoric’s novel VM that provides three key
2728

2829
Agoric’s Orchestration APIs simplify controlling accounts on remote chains, moving assets, and using capabilities on any chain the API reaches.
2930

31+
## Orchestration API Flow
32+
33+
Orchestration allows us to seamlessly create accounts on remote chains by accessing their chain objects. We can then use these chain objects to create accounts, get addresses, and transfer assets between chains. Let's walk through two common scenarios using the Orchestration API:
3034

31-
## Introduction to Orchestration API Flow
35+
### 1. Creating Remote Accounts
3236

33-
Orchestration allows us to seamlessly create accounts on remote chains by accessing their chain objects. We can then use these chain objects to create accounts, get addresses, and transfer assets between chains. The following code snippet demonstrates how to create account Stride chain and get their address.
37+
The following example shows how to create and interact with an account on the Stride chain:
3438

3539
```js
3640
// Get Chain objects
@@ -39,42 +43,35 @@ const stride = await orch.getChain('stride');
3943
// Create account
4044
const strideAccount = await stride.makeAccount();
4145

42-
// Get addresse
46+
// Get address
4347
const strideAddr = strideAccount.getAddress();
4448
```
4549

46-
We can easily transfer assets between chains and execute cross-chain transactions using the Orchestration API. The following code snippet demonstrates how to transfer funds from Osmosis to Agoric, forward funds from Agoric to Stride, and stake tokens on Stride.
50+
### 2. Cross-Chain Asset Transfers and Staking
51+
52+
This example demonstrates a complete flow of transferring and staking assets across multiple chains:
4753

4854
```js
4955
// Transfer funds from Osmosis to Agoric
50-
const osmoToAgoricTransfer = await osmoAccount.transfer(
51-
agoricAddr,
52-
amount
53-
);
56+
const osmoToAgoricTransfer = await osmoAccount.transfer(agoricAddr, amount);
5457

5558
// Forward funds from Agoric to Stride
56-
const agoricToStrideTransfer = await agoricAccount.transfer(
57-
strideAddr,
58-
amount
59-
);
59+
const agoricToStrideTransfer = await agoricAccount.transfer(strideAddr, amount);
6060

6161
// Create liquid stake message for Stride
6262
const liquidStakeMsg = Any.toJSON(
63-
MsgLiquidStake.toProtoMsg({
64-
creator: strideAccount.value,
65-
amount: amount.toString(),
66-
denom: 'uosmo',
67-
})
63+
MsgLiquidStake.toProtoMsg({
64+
creator: strideAccount.value,
65+
amount: amount.toString(),
66+
denom: 'uosmo'
67+
})
6868
);
6969

7070
// Execute staking transaction on Stride
7171
await strideAccount.executeEncodedTx([liquidStakeMsg]);
7272

7373
// Transfer staked tokens back to user's Osmosis address
74-
const finalTransfer = await strideAccount.transfer(
75-
userOsmoAddress,
76-
amount
77-
);
74+
const finalTransfer = await strideAccount.transfer(userOsmoAddress, amount);
7875
```
7976

80-
77+
These examples demonstrate how Orchestration enables seamless cross-chain operations while abstracting away the underlying complexity. Developers can focus on building their applications' logic while the Orchestration API handles the intricate details of cross-chain communication.

0 commit comments

Comments
 (0)