@agoric/orchestration 0.1.1-dev-2f0f355.0.2f0f355 → 0.1.1-dev-aa6629d.0.aa6629d
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 +17 -16
- package/src/examples/stake-bld.contract.d.ts +1 -0
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +6 -0
- package/src/examples/stake-ica.contract.d.ts +1 -0
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/stake-ica.contract.js +9 -0
- package/src/exos/cosmos-orchestration-account.d.ts +45 -9
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +184 -10
- package/src/exos/ibc-packet.d.ts.map +1 -1
- package/src/exos/ibc-packet.js +20 -0
- package/src/exos/local-chain-facade.d.ts +36 -0
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.d.ts +5 -2
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +46 -3
- package/src/exos/orchestrator.d.ts +287 -612
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/packet-tools.d.ts +8 -0
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/packet-tools.js +5 -0
- package/src/exos/portfolio-holder-kit.d.ts +6 -0
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.d.ts +36 -0
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/orchestration-api.d.ts +7 -2
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +8 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +6 -1
- package/src/types.d.ts +1 -0
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +1 -0
- package/src/utils/orchestrationAccount.d.ts +79 -0
- package/src/utils/orchestrationAccount.d.ts.map +1 -1
- package/src/utils/orchestrationAccount.js +204 -0
- package/src/utils/progress.d.ts +41 -0
- package/src/utils/progress.d.ts.map +1 -0
- package/src/utils/progress.js +180 -0
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-aa6629d.0.aa6629d",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
39
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
40
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
41
|
-
"@agoric/internal": "0.3.3-dev-
|
|
42
|
-
"@agoric/network": "0.1.1-dev-
|
|
43
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
44
|
-
"@agoric/store": "0.9.3-dev-
|
|
45
|
-
"@agoric/time": "0.3.3-dev-
|
|
46
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
47
|
-
"@agoric/vats": "0.15.2-dev-
|
|
48
|
-
"@agoric/vow": "0.1.1-dev-
|
|
49
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
50
|
-
"@agoric/zone": "0.2.3-dev-
|
|
38
|
+
"@agoric/async-flow": "0.1.1-dev-aa6629d.0.aa6629d",
|
|
39
|
+
"@agoric/cosmic-proto": "0.4.1-dev-aa6629d.0.aa6629d",
|
|
40
|
+
"@agoric/ertp": "0.16.3-dev-aa6629d.0.aa6629d",
|
|
41
|
+
"@agoric/internal": "0.3.3-dev-aa6629d.0.aa6629d",
|
|
42
|
+
"@agoric/network": "0.1.1-dev-aa6629d.0.aa6629d",
|
|
43
|
+
"@agoric/notifier": "0.6.3-dev-aa6629d.0.aa6629d",
|
|
44
|
+
"@agoric/store": "0.9.3-dev-aa6629d.0.aa6629d",
|
|
45
|
+
"@agoric/time": "0.3.3-dev-aa6629d.0.aa6629d",
|
|
46
|
+
"@agoric/vat-data": "0.5.3-dev-aa6629d.0.aa6629d",
|
|
47
|
+
"@agoric/vats": "0.15.2-dev-aa6629d.0.aa6629d",
|
|
48
|
+
"@agoric/vow": "0.1.1-dev-aa6629d.0.aa6629d",
|
|
49
|
+
"@agoric/zoe": "0.26.3-dev-aa6629d.0.aa6629d",
|
|
50
|
+
"@agoric/zone": "0.2.3-dev-aa6629d.0.aa6629d",
|
|
51
51
|
"@cosmjs/encoding": "^0.36.0",
|
|
52
52
|
"@endo/base64": "^1.0.12",
|
|
53
53
|
"@endo/errors": "^1.2.13",
|
|
@@ -55,11 +55,12 @@
|
|
|
55
55
|
"@endo/far": "^1.1.14",
|
|
56
56
|
"@endo/marshal": "^1.8.0",
|
|
57
57
|
"@endo/patterns": "^1.7.0",
|
|
58
|
+
"@endo/promise-kit": "^1.1.13",
|
|
58
59
|
"@noble/hashes": "~1.5.0",
|
|
59
60
|
"bs58": "^6.0.0"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
63
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-aa6629d.0.aa6629d",
|
|
63
64
|
"@chain-registry/client": "^1.53.194",
|
|
64
65
|
"@cosmjs/amino": "^0.36.0",
|
|
65
66
|
"@cosmjs/proto-signing": "^0.36.0",
|
|
@@ -105,5 +106,5 @@
|
|
|
105
106
|
"typeCoverage": {
|
|
106
107
|
"atLeast": 97.46
|
|
107
108
|
},
|
|
108
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "aa6629dd5d80a450843e2916ff9507265610503f"
|
|
109
110
|
}
|
|
@@ -48,6 +48,7 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
48
48
|
};
|
|
49
49
|
}>, undefined>>;
|
|
50
50
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
51
|
+
makeProgressTracker(): import("../utils/progress.js").ProgressTracker;
|
|
51
52
|
asContinuingOffer(): import("@agoric/vow").Vow<{
|
|
52
53
|
invitationMakers: {
|
|
53
54
|
[x: string]: (...args: any[]) => import("@agoric/vow").Vow<import("@endo/marshal").RemotableObject & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-bld.contract.d.ts","sourceRoot":"","sources":["stake-bld.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stake-bld.contract.d.ts","sourceRoot":"","sources":["stake-bld.contract.js"],"names":[],"mappings":"AAwCO,2BAVI,GAAG,eACH;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO;;QA+EZ;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6BH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAaR;yBA5IqB,aAAa;6BAJT,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc;6BAGnB,kBAAkB"}
|
|
@@ -14,6 +14,7 @@ import { makeChainHub } from '../exos/chain-hub.js';
|
|
|
14
14
|
import { prepareLocalOrchestrationAccountKit } from '../exos/local-orchestration-account.js';
|
|
15
15
|
import fetchedChainInfo from '../fetched-chain-info.js';
|
|
16
16
|
import { makeZoeTools } from '../utils/zoe-tools.js';
|
|
17
|
+
import { prepareProgressTracker } from '../utils/progress.js';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* @import {NameHub} from '@agoric/vats';
|
|
@@ -49,6 +50,10 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
49
50
|
cachingMarshaller,
|
|
50
51
|
);
|
|
51
52
|
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
53
|
+
const makeProgressTracker = await prepareProgressTracker(
|
|
54
|
+
zone.subZone('orchestration'),
|
|
55
|
+
{ vowTools },
|
|
56
|
+
);
|
|
52
57
|
|
|
53
58
|
const chainHub = makeChainHub(
|
|
54
59
|
zone.subZone('chainHub'),
|
|
@@ -61,6 +66,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
61
66
|
const makeLocalOrchestrationAccountKit = prepareLocalOrchestrationAccountKit(
|
|
62
67
|
zone,
|
|
63
68
|
{
|
|
69
|
+
makeProgressTracker,
|
|
64
70
|
makeRecorderKit,
|
|
65
71
|
zcf,
|
|
66
72
|
timerService,
|
|
@@ -25,6 +25,7 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
25
25
|
}, baggage: Baggage): Promise<{
|
|
26
26
|
publicFacet: import("@endo/exo").Guarded<{
|
|
27
27
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
28
|
+
makeProgressTracker(): import("@agoric/orchestration").ProgressTracker;
|
|
28
29
|
asContinuingOffer(): import("@agoric/vow").Vow<{
|
|
29
30
|
invitationMakers: {
|
|
30
31
|
[x: string]: (...args: any[]) => import("@agoric/vow").Vow<import("@endo/pass-style").RemotableObject & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stake-ica.contract.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b,aAAa;6BAC3B,cAAc;4BAHvB,kBAAkB;6CAC2B,uBAAuB;kCAGvE,cAAc;6BALnB,kBAAkB;2BAEmC,uBAAuB;mDAItD,uBAAuB;gCAHd,aAAa;qCAC3B,cAAc"}
|
|
@@ -12,6 +12,7 @@ import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
|
12
12
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
13
13
|
import { M } from '@endo/patterns';
|
|
14
14
|
import { prepareCosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
15
|
+
import { prepareProgressTracker } from '../utils/progress.js';
|
|
15
16
|
import { makeChainHub } from '../exos/chain-hub.js';
|
|
16
17
|
|
|
17
18
|
const trace = makeTracer('StakeIca');
|
|
@@ -95,6 +96,13 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
95
96
|
|
|
96
97
|
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
97
98
|
|
|
99
|
+
const makeProgressTracker = prepareProgressTracker(
|
|
100
|
+
zone.subZone('orchestration'),
|
|
101
|
+
{
|
|
102
|
+
vowTools,
|
|
103
|
+
},
|
|
104
|
+
);
|
|
105
|
+
|
|
98
106
|
const chainHub = makeChainHub(
|
|
99
107
|
zone.subZone('chainHub'),
|
|
100
108
|
agoricNames,
|
|
@@ -105,6 +113,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
105
113
|
zone,
|
|
106
114
|
{
|
|
107
115
|
chainHub,
|
|
116
|
+
makeProgressTracker,
|
|
108
117
|
makeRecorderKit,
|
|
109
118
|
timerService: timer,
|
|
110
119
|
vowTools,
|
|
@@ -26,6 +26,7 @@ export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
|
|
|
26
26
|
transferSteps: import("@endo/patterns").MethodGuard;
|
|
27
27
|
asContinuingOffer: import("@endo/patterns").MethodGuard;
|
|
28
28
|
getPublicTopics: import("@endo/patterns").MethodGuard;
|
|
29
|
+
makeProgressTracker: import("@endo/patterns").MethodGuard;
|
|
29
30
|
depositForBurn: import("@endo/patterns").MethodGuard;
|
|
30
31
|
}>;
|
|
31
32
|
export const CosmosOrchestrationInvitationMakersI: import("@endo/patterns").InterfaceGuard<{
|
|
@@ -40,8 +41,9 @@ export const CosmosOrchestrationInvitationMakersI: import("@endo/patterns").Inte
|
|
|
40
41
|
SendAll: import("@endo/patterns").MethodGuard;
|
|
41
42
|
Transfer: import("@endo/patterns").MethodGuard;
|
|
42
43
|
}>;
|
|
43
|
-
export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, makeRecorderKit, timerService, vowTools, zcf }: {
|
|
44
|
+
export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, makeProgressTracker, makeRecorderKit, timerService, vowTools, zcf, }: {
|
|
44
45
|
chainHub: ChainHub;
|
|
46
|
+
makeProgressTracker: MakeProgressTracker;
|
|
45
47
|
makeRecorderKit: MakeRecorderKit;
|
|
46
48
|
timerService: Remote<TimerService>;
|
|
47
49
|
vowTools: VowTools;
|
|
@@ -74,6 +76,25 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
74
76
|
overrideVow<T = undefined>(inputV: Vow<unknown>, newValue?: T): Vow<T>;
|
|
75
77
|
voidVow(inputV: Vow<unknown>): Vow<void>;
|
|
76
78
|
};
|
|
79
|
+
updateTxProgressWatcher: {
|
|
80
|
+
/**
|
|
81
|
+
* @param {readonly [
|
|
82
|
+
* srcChainInfo: ChainInfo<'cosmos'>,
|
|
83
|
+
* la: LocalIbcAddress,
|
|
84
|
+
* ra: RemoteIbcAddress,
|
|
85
|
+
* ]} param0
|
|
86
|
+
* @param {{
|
|
87
|
+
* progressTracker: ProgressTracker;
|
|
88
|
+
* trafficSlice: SliceDescriptor;
|
|
89
|
+
* protocol: 'ibc';
|
|
90
|
+
* }} opts
|
|
91
|
+
*/
|
|
92
|
+
onFulfilled([srcChainInfo, la, ra]: readonly [srcChainInfo: ChainInfo<"cosmos">, la: LocalIbcAddress, ra: RemoteIbcAddress], { progressTracker, trafficSlice, protocol }: {
|
|
93
|
+
progressTracker: ProgressTracker;
|
|
94
|
+
trafficSlice: SliceDescriptor;
|
|
95
|
+
protocol: "ibc";
|
|
96
|
+
}): void;
|
|
97
|
+
};
|
|
77
98
|
balanceQueryWatcher: {
|
|
78
99
|
/**
|
|
79
100
|
* @param {JsonSafe<ResponseQuery>[]} results
|
|
@@ -186,9 +207,21 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
186
207
|
destination: CosmosChainAddress;
|
|
187
208
|
opts?: IBCMsgTransferOptions;
|
|
188
209
|
token: Coin;
|
|
189
|
-
}): Vow<
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
}): Vow<string>;
|
|
211
|
+
};
|
|
212
|
+
fillSequenceWatcher: {
|
|
213
|
+
/**
|
|
214
|
+
* @param {[{ sequence: bigint }]} transferResponse
|
|
215
|
+
* @param {object} opts
|
|
216
|
+
* @param {ProgressTracker} opts.progressTracker
|
|
217
|
+
* @param {SliceDescriptor} opts.trafficSlice
|
|
218
|
+
*/
|
|
219
|
+
onFulfilled([{ sequence }]: [{
|
|
220
|
+
sequence: bigint;
|
|
221
|
+
}], { progressTracker, trafficSlice }: {
|
|
222
|
+
progressTracker: ProgressTracker;
|
|
223
|
+
trafficSlice: SliceDescriptor;
|
|
224
|
+
}): void;
|
|
192
225
|
};
|
|
193
226
|
invitationMakers: {
|
|
194
227
|
/**
|
|
@@ -242,6 +275,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
242
275
|
}>>;
|
|
243
276
|
};
|
|
244
277
|
holder: {
|
|
278
|
+
makeProgressTracker(): ProgressTracker;
|
|
245
279
|
asContinuingOffer(): Vow<{
|
|
246
280
|
invitationMakers: {
|
|
247
281
|
[x: string]: (...args: any[]) => Vow<import("@endo/pass-style").RemotableObject & {
|
|
@@ -831,9 +865,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
831
865
|
opts?: IBCMsgTransferOptions;
|
|
832
866
|
token: Coin;
|
|
833
867
|
}): {
|
|
834
|
-
result: Vow<
|
|
835
|
-
status: string;
|
|
836
|
-
}>;
|
|
868
|
+
result: Vow<string>;
|
|
837
869
|
meta: {};
|
|
838
870
|
};
|
|
839
871
|
};
|
|
@@ -850,8 +882,9 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
850
882
|
onFulfilled(result: string): import("../orchestration-api.ts").DenomAmount[];
|
|
851
883
|
};
|
|
852
884
|
}>;
|
|
853
|
-
export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRecorderKit, timerService, vowTools, zcf }: {
|
|
885
|
+
export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeProgressTracker, makeRecorderKit, timerService, vowTools, zcf, }: {
|
|
854
886
|
chainHub: ChainHub;
|
|
887
|
+
makeProgressTracker: MakeProgressTracker;
|
|
855
888
|
makeRecorderKit: MakeRecorderKit;
|
|
856
889
|
timerService: Remote<TimerService>;
|
|
857
890
|
vowTools: VowTools;
|
|
@@ -880,6 +913,7 @@ export type CosmosOrchestrationAccountKit = ReturnType<ReturnType<typeof prepare
|
|
|
880
913
|
export type CosmosOrchestrationAccount = CosmosOrchestrationAccountKit["holder"];
|
|
881
914
|
import type { Zone } from '@agoric/zone';
|
|
882
915
|
import type { ChainHub } from '../types.js';
|
|
916
|
+
import type { MakeProgressTracker } from '../types.js';
|
|
883
917
|
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
884
918
|
import type { TimerService } from '@agoric/time';
|
|
885
919
|
import type { Remote } from '@agoric/internal';
|
|
@@ -894,6 +928,9 @@ import type { ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.j
|
|
|
894
928
|
import type { Vow } from '@agoric/vow';
|
|
895
929
|
import type { AmountArg } from '../types.js';
|
|
896
930
|
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
931
|
+
import type { ChainInfo } from '../types.js';
|
|
932
|
+
import type { ProgressTracker } from '../types.js';
|
|
933
|
+
import type { SliceDescriptor } from '../utils/orchestrationAccount.js';
|
|
897
934
|
import type { CosmosDelegationResponse } from '../types.js';
|
|
898
935
|
import type { CosmosRewardsResponse } from '../types.js';
|
|
899
936
|
import type { MsgUndelegateResponseType } from '../utils/codecs.js';
|
|
@@ -906,7 +943,6 @@ import type { CosmosValidatorAddress } from '../types.js';
|
|
|
906
943
|
import type { AccountIdArg } from '../types.js';
|
|
907
944
|
import type { CosmosActionOptions } from '../types.js';
|
|
908
945
|
import type { AnyJson } from '@agoric/cosmic-proto';
|
|
909
|
-
import type { ChainInfo } from '../types.js';
|
|
910
946
|
import type { CaipChainId } from '../types.js';
|
|
911
947
|
import type { ICQConnection } from '../types.js';
|
|
912
948
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAiPA,wCAAwC;AACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMG;AAOH;;;;;;;;;;;GAoBE;AAaK,2DATI,IAAI,oFAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACoB,mBAAmB,EAA/C,mBAAmB;IACK,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACI,GAAG,EAAf,GAAG;CACb;kBAgLc,kBAAkB;kBAClB,eAAe;mBACf,gBAAgB;;aAEhB,UAAU;;;;;;;WAGV,OAAO,YAAY,CAAC;;;QA0H3B,wDAAwD;;;QAYxD;;;WAGG;6BAFQ,SAAS,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oCAAoC,CAAC,CACxD,KACE,6BAA6B,CAAC,QAAQ,CAAC,CAsB9C;;kBAhhDa,kBAAkB;;;;;oBA8BnB;IACR,OAAO,EAAE,UAAU,CAAC;IACpB,YAAY,EAAE,kBAAkB,CAAC;IACjC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,YAAY,EAAE,eAAe,CAAC;IAC9B,aAAa,EAAE,gBAAgB,CAAC;IAChC,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,QAAQ,EAAE,YAAY,sCAAsC,CAAC,GAAG,SAAS,CAAC;CAC3E;qDAKS;IACR,YAAY,EAAE,eAAe,CAAC;IAC9B,aAAa,EAAE,gBAAgB,CAAC;CACjC;4CA07CS,UAAU,CAClB,UAAU,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCAuCU,6BAA6B,CAAC,QAAQ,CAAC;0BAtjD9B,cAAc;8BARW,aAAa;yCAAb,aAAa;qCAEd,6CAA6C;kCAI7D,cAAc;4BAFpB,kBAAkB;8BAGX,aAAa;yBANT,aAAa;wCADD,aAAa;qCAaT,iCAAiC;sCAAjC,iCAAiC;gCAbrC,aAAa;8BAWlC,sBAAsB;mCAFjB,+CAA+C;yBAF/C,aAAa;+BAPG,aAAa;0BAGtC,kDAAkD;+BAHzB,aAAa;qCAAb,aAAa;qCAe3B,kCAAkC;8CAfpB,aAAa;2CAAb,aAAa;+CAce,oBAAoB;iCAHrE,sBAAsB;qCAAtB,sBAAsB;iCAAtB,sBAAsB;uCAXD,aAAa;2CAAb,aAAa;4CAAb,aAAa;kCAAb,aAAa;yCAAb,aAAa;6BAWlC,sBAAsB;iCAXD,aAAa;mCAAb,aAAa;iCAEd,6CAA6C"}
|
|
@@ -7,6 +7,7 @@ import { VowShape } from '@agoric/vow';
|
|
|
7
7
|
import { decodeBase64 } from '@endo/base64';
|
|
8
8
|
import { Fail, makeError, q } from '@endo/errors';
|
|
9
9
|
import { E } from '@endo/far';
|
|
10
|
+
import { decodeIbcEndpoint } from '@agoric/vats/tools/ibc-utils.js';
|
|
10
11
|
import {
|
|
11
12
|
AmountArgShape,
|
|
12
13
|
CoinShape,
|
|
@@ -29,7 +30,13 @@ import {
|
|
|
29
30
|
tryDecodeResponses,
|
|
30
31
|
} from '../utils/cosmos.js';
|
|
31
32
|
import { makeVowExoHelpers } from '../utils/exo-helpers.js';
|
|
32
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
orchestrationAccountMethods,
|
|
35
|
+
addTrafficEntries,
|
|
36
|
+
finishTrafficEntries,
|
|
37
|
+
trafficTransforms,
|
|
38
|
+
SliceDescriptorShape,
|
|
39
|
+
} from '../utils/orchestrationAccount.js';
|
|
33
40
|
import { makeTimestampHelper } from '../utils/time.js';
|
|
34
41
|
import { accountIdTo32Bytes, parseAccountId } from '../utils/address.js';
|
|
35
42
|
import {
|
|
@@ -69,7 +76,8 @@ import {
|
|
|
69
76
|
* ICQConnection, StakingAccountActions, StakingAccountQueries, NobleMethods,
|
|
70
77
|
* OrchestrationAccountCommon, CosmosRewardsResponse, IBCConnectionInfo,
|
|
71
78
|
* IBCMsgTransferOptions, ChainHub, CosmosDelegationResponse, CaipChainId,
|
|
72
|
-
* ChainInfo, AccountIdArg, CosmosActionOptions, IcaAccountMethods,
|
|
79
|
+
* ChainInfo, AccountIdArg, CosmosActionOptions, IcaAccountMethods,
|
|
80
|
+
* ProgressTracker, MakeProgressTracker} from '../types.js';
|
|
73
81
|
* @import {OfferHandler, ZCF} from '@agoric/zoe';
|
|
74
82
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
75
83
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
@@ -84,6 +92,8 @@ import {
|
|
|
84
92
|
* @import {Matcher} from '@endo/patterns';
|
|
85
93
|
* @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
86
94
|
* @import {AnyType, MsgDepositForBurnType, MsgUndelegateResponseType} from '../utils/codecs.js';
|
|
95
|
+
* @import {SliceDescriptor} from '../utils/orchestrationAccount.js';
|
|
96
|
+
* @import {ProgressReport} from '../utils/progress.js';
|
|
87
97
|
*/
|
|
88
98
|
|
|
89
99
|
/**
|
|
@@ -270,6 +280,7 @@ harden(CosmosOrchestrationInvitationMakersI);
|
|
|
270
280
|
* @param {Zone} zone
|
|
271
281
|
* @param {object} powers
|
|
272
282
|
* @param {ChainHub} powers.chainHub
|
|
283
|
+
* @param {MakeProgressTracker} powers.makeProgressTracker
|
|
273
284
|
* @param {MakeRecorderKit} powers.makeRecorderKit
|
|
274
285
|
* @param {Remote<TimerService>} powers.timerService
|
|
275
286
|
* @param {VowTools} powers.vowTools
|
|
@@ -277,7 +288,14 @@ harden(CosmosOrchestrationInvitationMakersI);
|
|
|
277
288
|
*/
|
|
278
289
|
export const prepareCosmosOrchestrationAccountKit = (
|
|
279
290
|
zone,
|
|
280
|
-
{
|
|
291
|
+
{
|
|
292
|
+
chainHub,
|
|
293
|
+
makeProgressTracker,
|
|
294
|
+
makeRecorderKit,
|
|
295
|
+
timerService,
|
|
296
|
+
vowTools,
|
|
297
|
+
zcf,
|
|
298
|
+
},
|
|
281
299
|
) => {
|
|
282
300
|
/**
|
|
283
301
|
* Abandon the icaAccountToDetails weakMapStore, since it introduced a caching
|
|
@@ -342,6 +360,20 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
342
360
|
getUpdater: M.call().returns(M.remotable()),
|
|
343
361
|
amountToCoin: M.call(AmountArgShape).returns(M.record()),
|
|
344
362
|
}),
|
|
363
|
+
updateTxProgressWatcher: M.interface('updateTxProgressWatcher', {
|
|
364
|
+
onFulfilled: M.call(
|
|
365
|
+
M.arrayOf(M.any()),
|
|
366
|
+
M.splitRecord(
|
|
367
|
+
{
|
|
368
|
+
progressTracker: M.remotable('ProgressTracker'),
|
|
369
|
+
protocol: M.string(),
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
trafficeSlice: SliceDescriptorShape,
|
|
373
|
+
},
|
|
374
|
+
),
|
|
375
|
+
).returns(),
|
|
376
|
+
}),
|
|
345
377
|
returnVoidWatcher: M.interface('returnVoidWatcher', {
|
|
346
378
|
onFulfilled: M.call().rest(M.any()).returns(M.undefined()),
|
|
347
379
|
}),
|
|
@@ -383,6 +415,12 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
383
415
|
})
|
|
384
416
|
.returns(Vow$(M.any())),
|
|
385
417
|
}),
|
|
418
|
+
fillSequenceWatcher: M.interface('fillSequenceWatcher', {
|
|
419
|
+
onFulfilled: M.call(
|
|
420
|
+
[M.splitRecord({ sequence: M.bigint() })],
|
|
421
|
+
M.record(),
|
|
422
|
+
).returns(),
|
|
423
|
+
}),
|
|
386
424
|
delegationQueryWatcher: M.interface('delegationQueryWatcher', {
|
|
387
425
|
onFulfilled: M.call(M.arrayOf(M.record())).returns(M.record()),
|
|
388
426
|
}),
|
|
@@ -574,6 +612,50 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
574
612
|
return coerceCoin(chainHub, amount);
|
|
575
613
|
},
|
|
576
614
|
},
|
|
615
|
+
|
|
616
|
+
updateTxProgressWatcher: {
|
|
617
|
+
/**
|
|
618
|
+
* @param {readonly [
|
|
619
|
+
* srcChainInfo: ChainInfo<'cosmos'>,
|
|
620
|
+
* la: LocalIbcAddress,
|
|
621
|
+
* ra: RemoteIbcAddress,
|
|
622
|
+
* ]} param0
|
|
623
|
+
* @param {{
|
|
624
|
+
* progressTracker: ProgressTracker;
|
|
625
|
+
* trafficSlice: SliceDescriptor;
|
|
626
|
+
* protocol: 'ibc';
|
|
627
|
+
* }} opts
|
|
628
|
+
*/
|
|
629
|
+
onFulfilled(
|
|
630
|
+
[srcChainInfo, la, ra],
|
|
631
|
+
{ progressTracker, trafficSlice, protocol },
|
|
632
|
+
) {
|
|
633
|
+
protocol;
|
|
634
|
+
const lad = decodeIbcEndpoint(la);
|
|
635
|
+
const rad = decodeIbcEndpoint(ra);
|
|
636
|
+
// TODO(#11994): Need to expose from Network API `conn.sendWithMeta(...)`
|
|
637
|
+
const sequence = /** @type {const} */ ({ status: 'unknown' });
|
|
638
|
+
|
|
639
|
+
const priorReport = progressTracker.getCurrentProgressReport();
|
|
640
|
+
const traffic = finishTrafficEntries(
|
|
641
|
+
priorReport.traffic,
|
|
642
|
+
trafficSlice,
|
|
643
|
+
entries =>
|
|
644
|
+
trafficTransforms.IbcICA.finish(
|
|
645
|
+
entries,
|
|
646
|
+
`${srcChainInfo.namespace}:${srcChainInfo.reference}`,
|
|
647
|
+
lad,
|
|
648
|
+
rad,
|
|
649
|
+
sequence,
|
|
650
|
+
),
|
|
651
|
+
);
|
|
652
|
+
const report = harden({
|
|
653
|
+
...priorReport,
|
|
654
|
+
traffic,
|
|
655
|
+
});
|
|
656
|
+
progressTracker.update(report);
|
|
657
|
+
},
|
|
658
|
+
},
|
|
577
659
|
balanceQueryWatcher: {
|
|
578
660
|
/**
|
|
579
661
|
* @param {JsonSafe<ResponseQuery>[]} results
|
|
@@ -826,10 +908,59 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
826
908
|
],
|
|
827
909
|
restOpts,
|
|
828
910
|
);
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
911
|
+
|
|
912
|
+
const { progressTracker } = restOpts;
|
|
913
|
+
if (progressTracker) {
|
|
914
|
+
const priorReport = progressTracker.getCurrentProgressReport();
|
|
915
|
+
const { traffic, slice: trafficSlice } = addTrafficEntries(
|
|
916
|
+
priorReport.traffic,
|
|
917
|
+
trafficTransforms.IbcTransfer.start(
|
|
918
|
+
`cosmos:${chainAddress.chainId}`,
|
|
919
|
+
`cosmos:${destination.chainId}`,
|
|
920
|
+
transferChannel,
|
|
921
|
+
),
|
|
922
|
+
);
|
|
923
|
+
|
|
924
|
+
const report = harden({
|
|
925
|
+
...priorReport,
|
|
926
|
+
traffic,
|
|
927
|
+
});
|
|
928
|
+
progressTracker.update(report);
|
|
929
|
+
watch(results, this.facets.fillSequenceWatcher, {
|
|
930
|
+
progressTracker,
|
|
931
|
+
trafficSlice,
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
return this.facets.helper.overrideVow(results, 'FOLLOW_TRAFFIC');
|
|
935
|
+
},
|
|
936
|
+
},
|
|
937
|
+
fillSequenceWatcher: {
|
|
938
|
+
/**
|
|
939
|
+
* @param {[{ sequence: bigint }]} transferResponse
|
|
940
|
+
* @param {object} opts
|
|
941
|
+
* @param {ProgressTracker} opts.progressTracker
|
|
942
|
+
* @param {SliceDescriptor} opts.trafficSlice
|
|
943
|
+
*/
|
|
944
|
+
onFulfilled([{ sequence }], { progressTracker, trafficSlice }) {
|
|
945
|
+
const priorReport = progressTracker.getCurrentProgressReport();
|
|
946
|
+
trace('fillSequenceWatcher', {
|
|
947
|
+
sequence,
|
|
948
|
+
priorReport,
|
|
949
|
+
trafficSlice,
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
const traffic = finishTrafficEntries(
|
|
953
|
+
priorReport.traffic,
|
|
954
|
+
trafficSlice,
|
|
955
|
+
entries => trafficTransforms.IbcTransfer.finish(entries, sequence),
|
|
832
956
|
);
|
|
957
|
+
|
|
958
|
+
/** @type {ProgressReport} */
|
|
959
|
+
const report = harden({
|
|
960
|
+
...priorReport,
|
|
961
|
+
traffic,
|
|
962
|
+
});
|
|
963
|
+
progressTracker.update(report);
|
|
833
964
|
},
|
|
834
965
|
},
|
|
835
966
|
invitationMakers: {
|
|
@@ -956,6 +1087,10 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
956
1087
|
},
|
|
957
1088
|
},
|
|
958
1089
|
holder: {
|
|
1090
|
+
/** @type {OrchestrationAccountCommon['makeProgressTracker']} */
|
|
1091
|
+
makeProgressTracker() {
|
|
1092
|
+
return makeProgressTracker();
|
|
1093
|
+
},
|
|
959
1094
|
/** @type {HostOf<OrchestrationAccountCommon['asContinuingOffer']>} */
|
|
960
1095
|
asContinuingOffer() {
|
|
961
1096
|
// @ts-expect-error XXX invitationMakers
|
|
@@ -1365,9 +1500,39 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1365
1500
|
},
|
|
1366
1501
|
/** @type {HostOf<IcaAccountMethods['executeEncodedTx']>} */
|
|
1367
1502
|
executeEncodedTx(msgs, opts = {}) {
|
|
1368
|
-
return asVow(() =>
|
|
1369
|
-
|
|
1370
|
-
|
|
1503
|
+
return asVow(() => {
|
|
1504
|
+
const { progressTracker } = opts;
|
|
1505
|
+
const { helper } = this.facets;
|
|
1506
|
+
const acct = helper.owned();
|
|
1507
|
+
|
|
1508
|
+
if (progressTracker) {
|
|
1509
|
+
const { chainAddress } = this.state;
|
|
1510
|
+
const agoric = chainHub.getChainInfo('agoric');
|
|
1511
|
+
const la = E(acct).getLocalAddress();
|
|
1512
|
+
/** @type {CaipChainId} */
|
|
1513
|
+
const dstChain = `cosmos:${chainAddress.chainId}`;
|
|
1514
|
+
const ra = E(acct).getRemoteAddress();
|
|
1515
|
+
// Identify this as an ICA operation.
|
|
1516
|
+
const priorReport = progressTracker.getCurrentProgressReport();
|
|
1517
|
+
const { traffic, slice: trafficSlice } = addTrafficEntries(
|
|
1518
|
+
priorReport.traffic,
|
|
1519
|
+
trafficTransforms.IbcICA.start(dstChain),
|
|
1520
|
+
);
|
|
1521
|
+
const report = {
|
|
1522
|
+
...priorReport,
|
|
1523
|
+
traffic,
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
progressTracker.update(harden(report));
|
|
1527
|
+
// Update the report when we can.
|
|
1528
|
+
void watch(
|
|
1529
|
+
allVows(/** @type {const} */ ([agoric, la, ra])),
|
|
1530
|
+
this.facets.updateTxProgressWatcher,
|
|
1531
|
+
{ progressTracker, protocol: 'ibc', trafficSlice },
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
return E(acct).executeEncodedTx(msgs, opts);
|
|
1535
|
+
});
|
|
1371
1536
|
},
|
|
1372
1537
|
/** @type {HostOf<IcaAccountMethods['executeTxProto3Undecoded']>} */
|
|
1373
1538
|
executeTxProto3Undecoded(msgs, opts = {}) {
|
|
@@ -1478,6 +1643,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1478
1643
|
* @param {Zone} zone
|
|
1479
1644
|
* @param {object} powers
|
|
1480
1645
|
* @param {ChainHub} powers.chainHub
|
|
1646
|
+
* @param {MakeProgressTracker} powers.makeProgressTracker
|
|
1481
1647
|
* @param {MakeRecorderKit} powers.makeRecorderKit
|
|
1482
1648
|
* @param {Remote<TimerService>} powers.timerService
|
|
1483
1649
|
* @param {VowTools} powers.vowTools
|
|
@@ -1490,10 +1656,18 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1490
1656
|
*/
|
|
1491
1657
|
export const prepareCosmosOrchestrationAccount = (
|
|
1492
1658
|
zone,
|
|
1493
|
-
{
|
|
1659
|
+
{
|
|
1660
|
+
chainHub,
|
|
1661
|
+
makeProgressTracker,
|
|
1662
|
+
makeRecorderKit,
|
|
1663
|
+
timerService,
|
|
1664
|
+
vowTools,
|
|
1665
|
+
zcf,
|
|
1666
|
+
},
|
|
1494
1667
|
) => {
|
|
1495
1668
|
const makeKit = prepareCosmosOrchestrationAccountKit(zone, {
|
|
1496
1669
|
chainHub,
|
|
1670
|
+
makeProgressTracker,
|
|
1497
1671
|
makeRecorderKit,
|
|
1498
1672
|
timerService,
|
|
1499
1673
|
vowTools,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibc-packet.d.ts","sourceRoot":"","sources":["ibc-packet.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ibc-packet.d.ts","sourceRoot":"","sources":["ibc-packet.js"],"names":[],"mappings":"AAUA,2CAA4C,QAAM,CAAC;AACnD,mDAAgF;AAwBzE,gDAHI,GAAG,GACD,OAAO,CAgCnB;AAOM,+CAHI,IAAI,8BACJ,QAAQ,GAAG;IAAE,eAAe,EAAE,eAAe,CAAA;CAAE,IA6IhD,GAA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es, Shape as NetworkShape } from '@agoric/network';
|
|
3
3
|
import { M } from '@endo/patterns';
|
|
4
4
|
import { E } from '@endo/far';
|
|
5
|
+
import {
|
|
6
|
+
finishTrafficEntries,
|
|
7
|
+
trafficTransforms,
|
|
8
|
+
} from '../utils/orchestrationAccount.js';
|
|
5
9
|
|
|
6
10
|
// As specified in ICS20, the success result is a base64-encoded '\0x1' byte.
|
|
7
11
|
export const ICS20_TRANSFER_SUCCESS_BYTES = '\x01';
|
|
@@ -147,6 +151,22 @@ export const prepareIBCTransferSender = (zone, { watch, makeIBCReplyKit }) => {
|
|
|
147
151
|
);
|
|
148
152
|
const resultV = watch(ackDataV, this.facets.verifyTransferSuccess);
|
|
149
153
|
|
|
154
|
+
const { progressTracker, trafficSlice } = opts || {};
|
|
155
|
+
if (progressTracker) {
|
|
156
|
+
const priorReport = progressTracker.getCurrentProgressReport();
|
|
157
|
+
const traffic = finishTrafficEntries(
|
|
158
|
+
priorReport.traffic,
|
|
159
|
+
trafficSlice,
|
|
160
|
+
entries =>
|
|
161
|
+
trafficTransforms.IbcTransfer.finish(entries, sequence),
|
|
162
|
+
);
|
|
163
|
+
const report = harden({
|
|
164
|
+
...priorReport,
|
|
165
|
+
traffic,
|
|
166
|
+
});
|
|
167
|
+
progressTracker.update(report);
|
|
168
|
+
}
|
|
169
|
+
|
|
150
170
|
return harden({ ...rest, resultV });
|
|
151
171
|
},
|
|
152
172
|
},
|