@agoric/orchestration 0.2.0-upgrade-20-dev-ef71cfd.0 → 0.2.0-upgrade-19-devnet-dev-5428c4d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +27 -29
- package/src/chain-capabilities.d.ts +12 -7
- package/src/chain-capabilities.d.ts.map +1 -1
- package/src/chain-capabilities.js +21 -46
- package/src/chain-info.d.ts +97 -839
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +12 -38
- package/src/cosmos-api.d.ts +13 -41
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +16 -52
- package/src/ethereum-api.d.ts +5 -6
- package/src/ethereum-api.d.ts.map +1 -1
- package/src/ethereum-api.ts +5 -7
- package/src/examples/auto-stake-it-tap-kit.d.ts +4 -4
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +8 -8
- package/src/examples/auto-stake-it.contract.d.ts +23 -5
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +0 -1
- package/src/examples/basic-flows.contract.d.ts +13 -5
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +0 -1
- package/src/examples/send-anywhere.contract.d.ts +27 -7
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +12 -40
- package/src/examples/send-anywhere.flows.d.ts +3 -563
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +31 -112
- package/src/examples/stake-bld.contract.d.ts +7 -8
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +1 -3
- package/src/examples/stake-ica.contract.d.ts +13 -82
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/stake-ica.contract.js +0 -1
- package/src/examples/staking-combinations.contract.d.ts +11 -3
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +4 -5
- package/src/examples/staking-combinations.flows.d.ts +2 -2
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +4 -4
- package/src/examples/swap.contract.d.ts +13 -4
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +2 -2
- package/src/examples/unbond.contract.d.ts +2 -2
- package/src/exos/README.md +0 -1
- package/src/exos/chain-hub-admin.d.ts +9 -9
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +17 -17
- package/src/exos/chain-hub.d.ts +17 -69
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +55 -289
- package/src/exos/cosmos-orchestration-account.d.ts +17 -86
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +26 -111
- package/src/exos/ibc-packet.d.ts +0 -1
- package/src/exos/ibc-packet.d.ts.map +1 -1
- package/src/exos/ibc-packet.js +1 -8
- package/src/exos/ica-account-kit.d.ts +4 -8
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +5 -8
- package/src/exos/local-chain-facade.d.ts +23 -3
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +3 -3
- package/src/exos/local-orchestration-account.d.ts +12 -16
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +8 -13
- package/src/exos/orchestrator.d.ts +15 -5
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +10 -9
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/packet-tools.js +12 -17
- package/src/exos/portfolio-holder-kit.d.ts +0 -1
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/portfolio-holder-kit.js +0 -1
- package/src/exos/remote-chain-facade.d.ts +15 -5
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +13 -23
- package/src/facade.js +1 -1
- package/src/fetched-chain-info.d.ts +86 -676
- package/src/fetched-chain-info.js +41 -553
- package/src/fixtures/query-flows.contract.d.ts +4 -5
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +0 -1
- package/src/orchestration-api.d.ts +16 -73
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +19 -89
- package/src/proposals/start-send-anywhere.js +0 -4
- package/src/typeGuards.d.ts +4 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +13 -52
- package/src/types.d.ts +1 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +1 -2
- package/src/utils/address.d.ts +3 -13
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +5 -97
- package/src/utils/chain-hub-helper.d.ts +2 -2
- package/src/utils/chain-hub-helper.d.ts.map +1 -1
- package/src/utils/chain-hub-helper.js +5 -9
- package/src/utils/cosmos.d.ts +1 -1
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +2 -2
- package/src/utils/orchestrationAccount.js +5 -6
- package/src/utils/registry.d.ts +12 -2
- package/src/utils/registry.d.ts.map +1 -1
- package/src/utils/registry.js +2 -4
- package/src/utils/start-helper.d.ts +6 -20
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +2 -13
- package/src/utils/zoe-tools.d.ts +2 -2
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +2 -5
- package/tools/ibc-mocks.d.ts +5 -6
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +4 -10
- package/tools/make-test-address.d.ts +1 -2
- package/tools/make-test-address.d.ts.map +1 -1
- package/tools/make-test-address.js +2 -6
- package/src/cctp-chain-info.d.ts +0 -65
- package/src/cctp-chain-info.d.ts.map +0 -1
- package/src/cctp-chain-info.js +0 -52
- package/src/utils/chain-info.d.ts +0 -5
- package/src/utils/chain-info.d.ts.map +0 -1
- package/src/utils/chain-info.js +0 -11
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePowers): (remoteChainInfo:
|
|
1
|
+
export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePowers): (remoteChainInfo: Readonly<{
|
|
2
|
+
bech32Prefix?: string;
|
|
3
|
+
chainId: string;
|
|
4
|
+
connections?: Record<string, IBCConnectionInfo>;
|
|
5
|
+
icqEnabled?: boolean;
|
|
6
|
+
pfmEnabled?: boolean;
|
|
7
|
+
stakingTokens?: Readonly<Array<{
|
|
8
|
+
denom: string;
|
|
9
|
+
}>>;
|
|
10
|
+
icaEnabled?: boolean;
|
|
11
|
+
}>, connectionInfo: IBCConnectionInfo) => import("@endo/exo").Guarded<{
|
|
2
12
|
getChainInfo(): Vow<any>;
|
|
3
|
-
makeAccount(): Vow<import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & object> | import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").LocalAccountMethods> | import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").IcaAccountMethods & object
|
|
13
|
+
makeAccount(): Vow<import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & object> | import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").LocalAccountMethods> | import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").IcaAccountMethods & object> | import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").IcaAccountMethods & import("../cosmos-api.js").StakingAccountActions & import("../cosmos-api.js").StakingAccountQueries>>;
|
|
4
14
|
query(msgs: {
|
|
5
15
|
data: string;
|
|
6
16
|
path: string;
|
|
@@ -32,14 +42,13 @@ export type RemoteChainFacadePowers = {
|
|
|
32
42
|
vowTools: VowTools;
|
|
33
43
|
};
|
|
34
44
|
export type RemoteChainFacadeState = {
|
|
35
|
-
remoteChainInfo:
|
|
36
|
-
connectionInfo: IBCConnectionInfo
|
|
45
|
+
remoteChainInfo: CosmosChainInfo;
|
|
46
|
+
connectionInfo: IBCConnectionInfo;
|
|
37
47
|
icqConnection: ICQConnection | undefined;
|
|
38
48
|
};
|
|
39
49
|
export type MakeRemoteChainFacade = ReturnType<typeof prepareRemoteChainFacade>;
|
|
40
50
|
export type RemoteChainFacade = ReturnType<MakeRemoteChainFacade>;
|
|
41
51
|
import type { Zone } from '@agoric/base-zone';
|
|
42
|
-
import type { ChainInfo } from '../types.js';
|
|
43
52
|
import type { IBCConnectionInfo } from '../types.js';
|
|
44
53
|
import type { Vow } from '@agoric/vow';
|
|
45
54
|
import type { prepareCosmosOrchestrationAccount } from './cosmos-orchestration-account.js';
|
|
@@ -47,5 +56,6 @@ import type { CosmosInterchainService } from './exo-interfaces.js';
|
|
|
47
56
|
import type { Remote } from '@agoric/internal';
|
|
48
57
|
import type { TimerService } from '@agoric/time';
|
|
49
58
|
import type { VowTools } from '@agoric/vow';
|
|
59
|
+
import type { CosmosChainInfo } from '../types.js';
|
|
50
60
|
import type { ICQConnection } from '../types.js';
|
|
51
61
|
//# sourceMappingURL=remote-chain-facade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"AAuQO,+CAHI,IAAI,UACJ,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKjC;sCA5OY;IACR,8BAA8B,EAAE,UAAU,CAC9C,wCAA8C,CACzC,CAAC;IACF,aAAa,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC/C,WAAW,EAAE,OAAO,WAAW,CAAC,GAAG,SAAS,CAAC;IAC7C,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACpB;qCAIS;IACR,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,iBAAiB,CAAC;IAClC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;CAC1C;oCA+NU,UAAU,CAAC,OAAO,wBAAwB,CAAC;gCAC3C,UAAU,CAAC,qBAAqB,CAAC;0BA/PxB,mBAAmB;uCAS2D,aAAa;yBAJlF,aAAa;uDAGO,mCAAmC;6CAD7C,qBAAqB;4BAHtC,kBAAkB;kCADZ,cAAc;8BAEb,aAAa;qCAIwD,aAAa;mCAAb,aAAa"}
|
|
@@ -6,7 +6,7 @@ import { M } from '@endo/patterns';
|
|
|
6
6
|
import { pickFacet } from '@agoric/vat-data';
|
|
7
7
|
import { VowShape } from '@agoric/vow';
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
ChainAddressShape,
|
|
10
10
|
chainFacadeMethods,
|
|
11
11
|
ICQMsgShape,
|
|
12
12
|
} from '../typeGuards.js';
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
* @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
23
23
|
* @import {CosmosInterchainService} from './exo-interfaces.js';
|
|
24
24
|
* @import {prepareCosmosOrchestrationAccount} from './cosmos-orchestration-account.js';
|
|
25
|
-
* @import {CosmosChainInfo, IBCConnectionInfo,
|
|
25
|
+
* @import {CosmosChainInfo, IBCConnectionInfo, ChainAddress, IcaAccount, Chain, ICQConnection} from '../types.js';
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
const trace = makeTracer('RemoteChainFacade');
|
|
@@ -41,8 +41,8 @@ const trace = makeTracer('RemoteChainFacade');
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {{
|
|
44
|
-
* remoteChainInfo:
|
|
45
|
-
* connectionInfo: IBCConnectionInfo
|
|
44
|
+
* remoteChainInfo: CosmosChainInfo;
|
|
45
|
+
* connectionInfo: IBCConnectionInfo;
|
|
46
46
|
* icqConnection: ICQConnection | undefined;
|
|
47
47
|
* }} RemoteChainFacadeState
|
|
48
48
|
*/
|
|
@@ -89,22 +89,22 @@ const prepareRemoteChainFacadeKit = (
|
|
|
89
89
|
),
|
|
90
90
|
getAddressesWatcher: M.interface('getAddressWatcher', {
|
|
91
91
|
onFulfilled: M.call(
|
|
92
|
-
[
|
|
92
|
+
[ChainAddressShape, M.string(), M.string()],
|
|
93
93
|
M.remotable(),
|
|
94
94
|
).returns(VowShape),
|
|
95
95
|
}),
|
|
96
96
|
makeChildNodeWatcher: M.interface('makeChildNodeWatcher', {
|
|
97
97
|
onFulfilled: M.call(M.or(M.remotable(), M.undefined()), {
|
|
98
98
|
account: M.remotable(),
|
|
99
|
-
chainAddress:
|
|
99
|
+
chainAddress: ChainAddressShape,
|
|
100
100
|
localAddress: M.string(),
|
|
101
101
|
remoteAddress: M.string(),
|
|
102
102
|
}).returns(M.remotable()),
|
|
103
103
|
}),
|
|
104
104
|
},
|
|
105
105
|
/**
|
|
106
|
-
* @param {
|
|
107
|
-
* @param {IBCConnectionInfo}
|
|
106
|
+
* @param {CosmosChainInfo} remoteChainInfo
|
|
107
|
+
* @param {IBCConnectionInfo} connectionInfo
|
|
108
108
|
*/
|
|
109
109
|
(remoteChainInfo, connectionInfo) => {
|
|
110
110
|
trace('making a RemoteChainFacade');
|
|
@@ -126,21 +126,15 @@ const prepareRemoteChainFacadeKit = (
|
|
|
126
126
|
return asVow(() => {
|
|
127
127
|
const { remoteChainInfo, connectionInfo } = this.state;
|
|
128
128
|
|
|
129
|
-
if (remoteChainInfo.namespace !== 'cosmos') {
|
|
130
|
-
throw Fail`only supported on 'cosmos' chains, not ${remoteChainInfo.namespace}`;
|
|
131
|
-
}
|
|
132
|
-
if (!connectionInfo) throw Fail`IBC connection info not found`;
|
|
133
|
-
|
|
134
129
|
// icqConnection is ultimately retrieved from state, but let's
|
|
135
130
|
// create a connection if it doesn't exist
|
|
136
131
|
const icqConnOrUndefinedV =
|
|
137
|
-
|
|
138
|
-
!this.state.icqConnection
|
|
132
|
+
remoteChainInfo.icqEnabled && !this.state.icqConnection
|
|
139
133
|
? E(orchestration).provideICQConnection(connectionInfo.id)
|
|
140
134
|
: undefined;
|
|
141
135
|
|
|
142
136
|
const makeAccountV = E(orchestration).makeAccount(
|
|
143
|
-
|
|
137
|
+
remoteChainInfo.chainId,
|
|
144
138
|
connectionInfo.counterparty.connection_id,
|
|
145
139
|
connectionInfo.id,
|
|
146
140
|
);
|
|
@@ -159,16 +153,12 @@ const prepareRemoteChainFacadeKit = (
|
|
|
159
153
|
query(msgs) {
|
|
160
154
|
return asVow(() => {
|
|
161
155
|
const {
|
|
162
|
-
/** @type {CosmosChainInfo} */
|
|
163
156
|
remoteChainInfo: { icqEnabled, chainId },
|
|
164
|
-
/** @type {IBCConnectionInfo | undefined} */
|
|
165
157
|
connectionInfo,
|
|
166
|
-
} =
|
|
167
|
-
|
|
158
|
+
} = this.state;
|
|
168
159
|
if (!icqEnabled) {
|
|
169
160
|
throw Fail`Queries not available for chain ${q(chainId)}`;
|
|
170
161
|
}
|
|
171
|
-
if (!connectionInfo) throw Fail`IBC connection info not found`;
|
|
172
162
|
// if none exists, make one and still send the query in the handler
|
|
173
163
|
if (!this.state.icqConnection) {
|
|
174
164
|
return watch(
|
|
@@ -216,7 +206,7 @@ const prepareRemoteChainFacadeKit = (
|
|
|
216
206
|
},
|
|
217
207
|
getAddressesWatcher: {
|
|
218
208
|
/**
|
|
219
|
-
* @param {[
|
|
209
|
+
* @param {[ChainAddress, LocalIbcAddress, RemoteIbcAddress]} chainAddresses
|
|
220
210
|
* @param {IcaAccount} account
|
|
221
211
|
*/
|
|
222
212
|
onFulfilled([chainAddress, localAddress, remoteAddress], account) {
|
|
@@ -236,7 +226,7 @@ const prepareRemoteChainFacadeKit = (
|
|
|
236
226
|
* @param {Remote<StorageNode> | undefined} childNode
|
|
237
227
|
* @param {{
|
|
238
228
|
* account: IcaAccount;
|
|
239
|
-
* chainAddress:
|
|
229
|
+
* chainAddress: ChainAddress;
|
|
240
230
|
* localAddress: LocalIbcAddress;
|
|
241
231
|
* remoteAddress: RemoteIbcAddress;
|
|
242
232
|
* }} ctx
|
package/src/facade.js
CHANGED
|
@@ -118,7 +118,7 @@ export const makeOrchestrationFacade = ({
|
|
|
118
118
|
|
|
119
119
|
const mappedContext = deepMapObject(
|
|
120
120
|
hostCtx,
|
|
121
|
-
val => mappedFlows.get(
|
|
121
|
+
val => mappedFlows.get(val) || val,
|
|
122
122
|
);
|
|
123
123
|
|
|
124
124
|
const orcFns = /** @type {{ [N in keyof GFM]: HostForGuest<GFM[N]> }} */ (
|