@agoric/orchestration 0.1.1-dev-7f12e80.0 → 0.1.1-dev-bef1be9.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 +16 -16
- package/src/examples/sendAnywhere.flows.d.ts.map +1 -1
- package/src/examples/sendAnywhere.flows.js +1 -0
- package/src/examples/stakeBld.contract.js +1 -1
- package/src/examples/stakeIca.contract.d.ts +7 -2
- package/src/examples/stakeIca.contract.d.ts.map +1 -1
- package/src/examples/stakeIca.contract.js +16 -5
- package/src/exos/README.md +1 -0
- package/src/exos/cosmos-orchestration-account.d.ts +46 -7
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +128 -19
- package/src/exos/local-orchestration-account.d.ts +8 -11
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +25 -21
- package/src/exos/packet-tools.js +1 -1
- package/src/proposals/start-stakeAtom.d.ts +2 -1
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +11 -8
- package/src/proposals/start-stakeOsmo.d.ts +2 -1
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.js +11 -8
- package/src/utils/orchestrationAccount.js +2 -1
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +7 -3
- package/src/utils/time.d.ts.map +1 -1
- package/src/utils/time.js +1 -9
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +4 -2
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-bef1be9.0+bef1be9",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/async-flow": "0.1.1-dev-bef1be9.0+bef1be9",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-bef1be9.0+bef1be9",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-bef1be9.0+bef1be9",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-bef1be9.0+bef1be9",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-bef1be9.0+bef1be9",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-bef1be9.0+bef1be9",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-bef1be9.0+bef1be9",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-bef1be9.0+bef1be9",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-bef1be9.0+bef1be9",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-bef1be9.0+bef1be9",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-bef1be9.0+bef1be9",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-bef1be9.0+bef1be9",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-bef1be9.0+bef1be9",
|
|
49
49
|
"@endo/base64": "^1.0.6",
|
|
50
50
|
"@endo/errors": "^1.2.4",
|
|
51
51
|
"@endo/far": "^1.1.4",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "github:paulmillr/noble-hashes#ae060da"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-bef1be9.0+bef1be9",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typeCoverage": {
|
|
95
95
|
"atLeast": 98.1
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "bef1be9b4fd16286ae5ca59a7d8812a775f7c6fe"
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAnywhere.flows.d.ts","sourceRoot":"","sources":["sendAnywhere.flows.js"],"names":[],"mappings":"AAuBO,6BAPI,YAAY,oCAEpB;IAA4E,aAAa,EAAjF;QAAE,YAAY,CAAC,EAAE,qBAAqB,GAAG,mBAAmB,CAAA;KAAE;IACtB,aAAa,EAArD,QAAQ,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC1C,QAAQ,OAAO,aACP;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"sendAnywhere.flows.d.ts","sourceRoot":"","sources":["sendAnywhere.flows.js"],"names":[],"mappings":"AAuBO,6BAPI,YAAY,oCAEpB;IAA4E,aAAa,EAAjF;QAAE,YAAY,CAAC,EAAE,qBAAqB,GAAG,mBAAmB,CAAA;KAAE;IACtB,aAAa,EAArD,QAAQ,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC1C,QAAQ,OAAO,aACP;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,iBAyCjD;kCAxD6F,aAAa;2CAAb,aAAa;yCAAb,aAAa;8BADhF,uBAAuB;6BADxB,oBAAoB"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {Baggage} from '@agoric/vat-data';
|
|
3
|
-
* @import {
|
|
3
|
+
* @import {Remote} from '@agoric/internal';
|
|
4
|
+
* @import {IBCConnectionID, NameHub} from '@agoric/vats';
|
|
4
5
|
* @import {TimerService} from '@agoric/time';
|
|
5
6
|
* @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js';
|
|
6
|
-
* @import {ICQConnection, CosmosInterchainService} from '../types.js';
|
|
7
|
+
* @import {ICQConnection, CosmosInterchainService, ChainHub} from '../types.js';
|
|
7
8
|
*/
|
|
8
9
|
/** @type {ContractMeta<typeof start>} */
|
|
9
10
|
export const meta: ContractMeta<typeof start>;
|
|
10
11
|
export const privateArgsShape: {
|
|
12
|
+
agoricNames: globalThis.Pattern;
|
|
11
13
|
cosmosInterchainService: globalThis.Pattern;
|
|
12
14
|
storageNode: globalThis.Pattern;
|
|
13
15
|
marshaller: globalThis.Pattern;
|
|
14
16
|
timer: globalThis.Pattern;
|
|
15
17
|
} | undefined;
|
|
16
18
|
export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
19
|
+
agoricNames: Remote<NameHub>;
|
|
17
20
|
cosmosInterchainService: CosmosInterchainService;
|
|
18
21
|
storageNode: StorageNode;
|
|
19
22
|
marshaller: Marshaller;
|
|
@@ -47,6 +50,8 @@ export type StakeIcaTerms = {
|
|
|
47
50
|
icqEnabled: boolean;
|
|
48
51
|
};
|
|
49
52
|
export type StakeIcaSF = typeof start;
|
|
53
|
+
import type { NameHub } from '@agoric/vats';
|
|
54
|
+
import type { Remote } from '@agoric/internal';
|
|
50
55
|
import type { CosmosInterchainService } from '../types.js';
|
|
51
56
|
import type { TimerService } from '@agoric/time';
|
|
52
57
|
import type { Baggage } from '@agoric/vat-data';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAgBlC;AAEH;;;;;;cAAsD;AAwB/C,2BAVI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;GAmGjB;4BArHY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,SAAa,EAAE,MAAM,CAAC;IACtB,UAAc,EAAE,OAAO,CAAC;CACrB;yBAkHU,OAAO,KAAK;6BApJiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
|
|
@@ -11,14 +11,16 @@ import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
|
11
11
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
12
12
|
import { M } from '@endo/patterns';
|
|
13
13
|
import { prepareCosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
14
|
+
import { makeChainHub } from '../exos/chain-hub.js';
|
|
14
15
|
|
|
15
16
|
const trace = makeTracer('StakeIca');
|
|
16
17
|
/**
|
|
17
18
|
* @import {Baggage} from '@agoric/vat-data';
|
|
18
|
-
* @import {
|
|
19
|
+
* @import {Remote} from '@agoric/internal';
|
|
20
|
+
* @import {IBCConnectionID, NameHub} from '@agoric/vats';
|
|
19
21
|
* @import {TimerService} from '@agoric/time';
|
|
20
22
|
* @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js';
|
|
21
|
-
* @import {ICQConnection, CosmosInterchainService} from '../types.js';
|
|
23
|
+
* @import {ICQConnection, CosmosInterchainService, ChainHub} from '../types.js';
|
|
22
24
|
*/
|
|
23
25
|
|
|
24
26
|
/** @type {ContractMeta<typeof start>} */
|
|
@@ -31,6 +33,7 @@ export const meta = harden({
|
|
|
31
33
|
icqEnabled: M.boolean(),
|
|
32
34
|
},
|
|
33
35
|
privateArgsShape: {
|
|
36
|
+
agoricNames: M.remotable('agoricNames NameHub'),
|
|
34
37
|
cosmosInterchainService: M.remotable('cosmosInterchainService'),
|
|
35
38
|
storageNode: StorageNodeShape,
|
|
36
39
|
marshaller: M.remotable('marshaller'),
|
|
@@ -54,6 +57,7 @@ harden(privateArgsShape);
|
|
|
54
57
|
/**
|
|
55
58
|
* @param {ZCF<StakeIcaTerms>} zcf
|
|
56
59
|
* @param {{
|
|
60
|
+
* agoricNames: Remote<NameHub>;
|
|
57
61
|
* cosmosInterchainService: CosmosInterchainService;
|
|
58
62
|
* storageNode: StorageNode;
|
|
59
63
|
* marshaller: Marshaller;
|
|
@@ -70,6 +74,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
70
74
|
icqEnabled,
|
|
71
75
|
} = zcf.getTerms();
|
|
72
76
|
const {
|
|
77
|
+
agoricNames,
|
|
73
78
|
cosmosInterchainService: orchestration,
|
|
74
79
|
marshaller,
|
|
75
80
|
storageNode,
|
|
@@ -86,11 +91,17 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
86
91
|
|
|
87
92
|
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
88
93
|
|
|
94
|
+
const chainHub = makeChainHub(agoricNames, vowTools);
|
|
95
|
+
|
|
89
96
|
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
|
|
90
97
|
zone,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
{
|
|
99
|
+
chainHub,
|
|
100
|
+
makeRecorderKit,
|
|
101
|
+
timerService: timer,
|
|
102
|
+
vowTools,
|
|
103
|
+
zcf,
|
|
104
|
+
},
|
|
94
105
|
);
|
|
95
106
|
|
|
96
107
|
async function makeAccountKit() {
|
package/src/exos/README.md
CHANGED
|
@@ -29,7 +29,13 @@ export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
|
|
|
29
29
|
asContinuingOffer: import("@endo/patterns").MethodGuard;
|
|
30
30
|
getPublicTopics: import("@endo/patterns").MethodGuard;
|
|
31
31
|
}>;
|
|
32
|
-
export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
32
|
+
export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, makeRecorderKit, timerService, vowTools: { watch, asVow, when, allVows }, zcf, }: {
|
|
33
|
+
chainHub: ChainHub;
|
|
34
|
+
makeRecorderKit: MakeRecorderKit;
|
|
35
|
+
timerService: Remote<TimerService>;
|
|
36
|
+
vowTools: VowTools;
|
|
37
|
+
zcf: ZCF;
|
|
38
|
+
}): (chainAddress: ChainAddress, bondDenom: string, io: {
|
|
33
39
|
account: IcaAccount;
|
|
34
40
|
storageNode: Remote<StorageNode>;
|
|
35
41
|
icqConnection: ICQConnection | undefined;
|
|
@@ -69,6 +75,26 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
69
75
|
/** @param {string} result */
|
|
70
76
|
onFulfilled(result: string): DenomAmount[];
|
|
71
77
|
};
|
|
78
|
+
transferWatcher: {
|
|
79
|
+
/**
|
|
80
|
+
* @param {[
|
|
81
|
+
* { transferChannel: IBCConnectionInfo['transferChannel'] },
|
|
82
|
+
* bigint,
|
|
83
|
+
* ]} results
|
|
84
|
+
* @param {{
|
|
85
|
+
* destination: ChainAddress;
|
|
86
|
+
* opts?: IBCMsgTransferOptions;
|
|
87
|
+
* token: Coin;
|
|
88
|
+
* }} ctx
|
|
89
|
+
*/
|
|
90
|
+
onFulfilled([{ transferChannel }, timeoutTimestamp]: [{
|
|
91
|
+
transferChannel: IBCConnectionInfo["transferChannel"];
|
|
92
|
+
}, bigint], { opts, token, destination }: {
|
|
93
|
+
destination: ChainAddress;
|
|
94
|
+
opts?: IBCMsgTransferOptions;
|
|
95
|
+
token: Coin;
|
|
96
|
+
}): Vow<undefined>;
|
|
97
|
+
};
|
|
72
98
|
invitationMakers: {
|
|
73
99
|
/**
|
|
74
100
|
* @param {CosmosValidatorAddress} validator
|
|
@@ -100,6 +126,11 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
100
126
|
* transferred.
|
|
101
127
|
*/
|
|
102
128
|
TransferAccount(): never;
|
|
129
|
+
Transfer(): Promise<Invitation<Vow<void>, {
|
|
130
|
+
amount: AmountArg;
|
|
131
|
+
destination: ChainAddress;
|
|
132
|
+
opts: IBCMsgTransferOptions;
|
|
133
|
+
}>>;
|
|
103
134
|
};
|
|
104
135
|
holder: {
|
|
105
136
|
/** @type {HostOf<OrchestrationAccountI['asContinuingOffer']>} */
|
|
@@ -117,13 +148,13 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
117
148
|
/** @type {HostOf<StakingAccountActions['withdrawReward']>} */
|
|
118
149
|
withdrawReward(validator: CosmosValidatorAddress): Vow<DenomAmount[] extends import("@endo/pass-style").Passable ? DenomAmount[] : import("@agoric/async-flow").HostInterface<DenomAmount[]>>;
|
|
119
150
|
/** @type {HostOf<OrchestrationAccountI['getBalance']>} */
|
|
120
|
-
getBalance(denom: DenomArg): Vow<DenomAmount extends import("@endo/pass-style").Passable ? DenomAmount : import("@agoric/async-flow").HostInterface<DenomAmount>>;
|
|
151
|
+
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<DenomAmount extends import("@endo/pass-style").Passable ? DenomAmount : import("@agoric/async-flow").HostInterface<DenomAmount>>;
|
|
121
152
|
/** @type {HostOf<OrchestrationAccountI['send']>} */
|
|
122
153
|
send(toAccount: ChainAddress, amounts: AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
123
154
|
/** @type {HostOf<OrchestrationAccountI['sendAll']>} */
|
|
124
155
|
sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
125
156
|
/** @type {HostOf<OrchestrationAccountI['transfer']>} */
|
|
126
|
-
transfer(amount: AmountArg, destination: ChainAddress, opts?:
|
|
157
|
+
transfer(amount: AmountArg, destination: ChainAddress, opts?: IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
127
158
|
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
128
159
|
transferSteps(amount: AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
129
160
|
/** @type {HostOf<StakingAccountActions['withdrawRewards']>} */
|
|
@@ -132,7 +163,13 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
132
163
|
undelegate(delegations: Omit<Delegation, "delegatorAddress">[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
133
164
|
};
|
|
134
165
|
}>;
|
|
135
|
-
export function prepareCosmosOrchestrationAccount(zone: Zone, makeRecorderKit
|
|
166
|
+
export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRecorderKit, timerService, vowTools, zcf }: {
|
|
167
|
+
chainHub: ChainHub;
|
|
168
|
+
makeRecorderKit: MakeRecorderKit;
|
|
169
|
+
timerService: Remote<TimerService>;
|
|
170
|
+
vowTools: VowTools;
|
|
171
|
+
zcf: ZCF;
|
|
172
|
+
}): (...args: Parameters<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>) => CosmosOrchestrationAccountKit["holder"];
|
|
136
173
|
export type ComosOrchestrationAccountNotification = {
|
|
137
174
|
chainAddress: ChainAddress;
|
|
138
175
|
};
|
|
@@ -147,21 +184,23 @@ export type State = {
|
|
|
147
184
|
export type CosmosOrchestrationAccountKit = ReturnType<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>;
|
|
148
185
|
export type CosmosOrchestrationAccount = CosmosOrchestrationAccountKit["holder"];
|
|
149
186
|
import type { Zone } from '@agoric/zone';
|
|
187
|
+
import type { ChainHub } from '../types.js';
|
|
150
188
|
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
189
|
+
import type { TimerService } from '@agoric/time';
|
|
190
|
+
import type { Remote } from '@agoric/internal';
|
|
151
191
|
import type { VowTools } from '@agoric/vow';
|
|
152
192
|
import type { ChainAddress } from '../types.js';
|
|
153
193
|
import type { IcaAccount } from '../types.js';
|
|
154
|
-
import type { Remote } from '@agoric/internal';
|
|
155
194
|
import type { ICQConnection } from '../types.js';
|
|
156
|
-
import type { TimerService } from '@agoric/time';
|
|
157
195
|
import type { AmountArg } from '../types.js';
|
|
158
196
|
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
159
197
|
import type { ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.js';
|
|
160
198
|
import type { JsonSafe } from '@agoric/cosmic-proto';
|
|
161
199
|
import type { DenomAmount } from '../types.js';
|
|
162
200
|
import type { Vow } from '@agoric/vow';
|
|
201
|
+
import type { IBCConnectionInfo } from '../types.js';
|
|
202
|
+
import type { IBCMsgTransferOptions } from '../types.js';
|
|
163
203
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
164
204
|
import type { Delegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
165
|
-
import type { DenomArg } from '../types.js';
|
|
166
205
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
167
206
|
//# sourceMappingURL=cosmos-orchestration-account.d.ts.map
|
|
@@ -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":"AAyDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,mCAAmC;AACnC;;;;;;;;;;;;;;;GAaG;AAmBI,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACI,GAAG,EAAf,GAAG;CACb;aA2Ec,UAAU;iBACV,OAAO,WAAW,CAAC;mBACnB,aAAa,GAAG,SAAS;WACzB,OAAO,YAAY,CAAC;;;QAc3B,wDAAwD;;;QAWxD;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAejB;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;WAEG;4BADQ,MAAM;;IAgBnB;;;OAGG;;QAED,uDAAuD;4BAA3C,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;QAO5C,6BAA6B;4BAAjB,MAAM;;;QAYlB;;;;;;;;;;WAUG;6DATQ,CACV;YAAM,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;SAAE,EAC7D,MAAU,CACP,gCACO;YACV,WAAe,EAAE,YAAY,CAAC;YAC9B,IAAQ,CAAC,EAAE,qBAAqB,CAAC;YACjC,KAAS,EAAE,IAAI,CAAC;SACb;;;QA2BJ;;;WAGG;4BAFQ,sBAAsB,UACtB,SAAS;QAUpB;;;;WAIG;iCAHQ,sBAAsB,gBACtB,sBAAsB,UACtB,SAAS;QAYpB,gDAAgD;kCAApC,sBAAsB;QASlC,kEAAkE;gCAAtD,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,EAAE;;;uBAgB9B,YAAY;oBAAU,SAAS;;;uBAa/B,YAAY;qBAAW,SAAS,EAAE;;QAStD;;;;WAIG;;;oBASc,SAAS;yBACJ,YAAY;kBACnB,qBAAqB;;;;QAcpC,iEAAiE;;QAsBjE,+DAA+D;;QAiB/D,0DAA0D;;QAI1D,wDAAwD;;QAsBxD,2DAA2D;;QAK3D,0DAA0D;;QAyB1D,8DAA8D;;QAgB9D,0DAA0D;;QAsB1D,oDAAoD;;QAqBpD,uDAAuD;;QAqBvD,wDAAwD;;QAkCxD,6DAA6D;;QAM7D,+DAA+D;;QAK/D,0DAA0D;;;GA6BjE;AAsBM,wDAbI,IAAI,8DAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACI,GAAG,EAAf,GAAG;CACX,GAAU,CACZ,GAAO,IAAI,EAAE,UAAU,CACvB,UAAgB,CAAC,OAAO,oCAAoC,CAAC,CACxD,KACE,6BAA6B,CAAC,QAAQ,CAAC,CAc9C;;kBAloBa,YAAY;;oBAIb;IACZ,QAAY,EAAE,YAAY,qCAAqC,CAAC,CAAC;IACjE,OAAW,EAAE,UAAU,CAAC;IACxB,YAAgB,EAAE,YAAY,CAAC;IAC/B,aAAiB,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7C,SAAa,EAAE,MAAM,CAAC;IACtB,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;CAC7B;4CAwlBS,UAAU,CACtB,UAAc,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCA8BU,6BAA6B,CAAC,QAAQ,CAAC;0BA/oB9B,cAAc;8BARuK,aAAa;qCAC1K,6CAA6C;kCAK7D,cAAc;4BAFpB,kBAAkB;8BAGX,aAAa;kCAP+J,aAAa;gCAAb,aAAa;mCAAb,aAAa;+BAAb,aAAa;0BAElM,kDAAkD;mCAOzC,+CAA+C;8BACpD,sBAAsB;iCAV2J,aAAa;yBAOzL,aAAa;uCAP+J,aAAa;2CAAb,aAAa;4CAAb,aAAa;gCAG5L,wDAAwD;iCAFtC,6CAA6C"}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
|
|
17
17
|
import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
18
18
|
import { MsgSend } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/tx.js';
|
|
19
|
+
import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
19
20
|
import { makeTracer } from '@agoric/internal';
|
|
20
21
|
import { Shape as NetworkShape } from '@agoric/network';
|
|
21
22
|
import { M } from '@agoric/vat-data';
|
|
@@ -28,13 +29,15 @@ import {
|
|
|
28
29
|
ChainAddressShape,
|
|
29
30
|
DelegationShape,
|
|
30
31
|
DenomAmountShape,
|
|
32
|
+
IBCTransferOptionsShape,
|
|
31
33
|
} from '../typeGuards.js';
|
|
32
34
|
import { maxClockSkew, tryDecodeResponse } from '../utils/cosmos.js';
|
|
33
35
|
import { orchestrationAccountMethods } from '../utils/orchestrationAccount.js';
|
|
36
|
+
import { makeTimestampHelper } from '../utils/time.js';
|
|
34
37
|
|
|
35
38
|
/**
|
|
36
39
|
* @import {HostOf} from '@agoric/async-flow';
|
|
37
|
-
* @import {AmountArg, IcaAccount, ChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, DenomAmount, OrchestrationAccountI,
|
|
40
|
+
* @import {AmountArg, IcaAccount, ChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, DenomAmount, OrchestrationAccountI, IBCConnectionInfo, IBCMsgTransferOptions, ChainHub} from '../types.js';
|
|
38
41
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
39
42
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
40
43
|
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
@@ -94,16 +97,24 @@ const toDenomAmount = c => ({ denom: c.denom, value: BigInt(c.amount) });
|
|
|
94
97
|
|
|
95
98
|
/**
|
|
96
99
|
* @param {Zone} zone
|
|
97
|
-
* @param {
|
|
98
|
-
* @param {
|
|
99
|
-
* @param {
|
|
100
|
+
* @param {object} powers
|
|
101
|
+
* @param {ChainHub} powers.chainHub
|
|
102
|
+
* @param {MakeRecorderKit} powers.makeRecorderKit
|
|
103
|
+
* @param {Remote<TimerService>} powers.timerService
|
|
104
|
+
* @param {VowTools} powers.vowTools
|
|
105
|
+
* @param {ZCF} powers.zcf
|
|
100
106
|
*/
|
|
101
107
|
export const prepareCosmosOrchestrationAccountKit = (
|
|
102
108
|
zone,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
{
|
|
110
|
+
chainHub,
|
|
111
|
+
makeRecorderKit,
|
|
112
|
+
timerService,
|
|
113
|
+
vowTools: { watch, asVow, when, allVows },
|
|
114
|
+
zcf,
|
|
115
|
+
},
|
|
106
116
|
) => {
|
|
117
|
+
const timestampHelper = makeTimestampHelper(timerService);
|
|
107
118
|
const makeCosmosOrchestrationAccountKit = zone.exoClassKit(
|
|
108
119
|
'Cosmos Orchestration Account Holder',
|
|
109
120
|
{
|
|
@@ -132,6 +143,18 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
132
143
|
.optional(M.arrayOf(M.undefined())) // empty context
|
|
133
144
|
.returns(M.arrayOf(DenomAmountShape)),
|
|
134
145
|
}),
|
|
146
|
+
transferWatcher: M.interface('transferWatcher', {
|
|
147
|
+
onFulfilled: M.call([M.record(), M.nat()])
|
|
148
|
+
.optional({
|
|
149
|
+
destination: ChainAddressShape,
|
|
150
|
+
opts: M.or(M.undefined(), IBCTransferOptionsShape),
|
|
151
|
+
token: {
|
|
152
|
+
denom: M.string(),
|
|
153
|
+
amount: M.string(),
|
|
154
|
+
},
|
|
155
|
+
})
|
|
156
|
+
.returns(Vow$(M.record())),
|
|
157
|
+
}),
|
|
135
158
|
holder: IcaAccountHolderI,
|
|
136
159
|
invitationMakers: M.interface('invitationMakers', {
|
|
137
160
|
Delegate: M.call(ChainAddressShape, AmountArgShape).returns(
|
|
@@ -148,6 +171,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
148
171
|
TransferAccount: M.call().returns(M.promise()),
|
|
149
172
|
Send: M.call().returns(M.promise()),
|
|
150
173
|
SendAll: M.call().returns(M.promise()),
|
|
174
|
+
Transfer: M.call().returns(M.promise()),
|
|
151
175
|
}),
|
|
152
176
|
},
|
|
153
177
|
/**
|
|
@@ -252,6 +276,42 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
252
276
|
return harden(coins.map(toDenomAmount));
|
|
253
277
|
},
|
|
254
278
|
},
|
|
279
|
+
transferWatcher: {
|
|
280
|
+
/**
|
|
281
|
+
* @param {[
|
|
282
|
+
* { transferChannel: IBCConnectionInfo['transferChannel'] },
|
|
283
|
+
* bigint,
|
|
284
|
+
* ]} results
|
|
285
|
+
* @param {{
|
|
286
|
+
* destination: ChainAddress;
|
|
287
|
+
* opts?: IBCMsgTransferOptions;
|
|
288
|
+
* token: Coin;
|
|
289
|
+
* }} ctx
|
|
290
|
+
*/
|
|
291
|
+
onFulfilled(
|
|
292
|
+
[{ transferChannel }, timeoutTimestamp],
|
|
293
|
+
{ opts, token, destination },
|
|
294
|
+
) {
|
|
295
|
+
const results = E(this.facets.helper.owned()).executeEncodedTx([
|
|
296
|
+
Any.toJSON(
|
|
297
|
+
MsgTransfer.toProtoMsg({
|
|
298
|
+
sourcePort: transferChannel.portId,
|
|
299
|
+
sourceChannel: transferChannel.channelId,
|
|
300
|
+
token,
|
|
301
|
+
sender: this.state.chainAddress.value,
|
|
302
|
+
receiver: destination.value,
|
|
303
|
+
timeoutHeight: opts?.timeoutHeight ?? {
|
|
304
|
+
revisionHeight: 0n,
|
|
305
|
+
revisionNumber: 0n,
|
|
306
|
+
},
|
|
307
|
+
timeoutTimestamp,
|
|
308
|
+
memo: opts?.memo ?? '',
|
|
309
|
+
}),
|
|
310
|
+
),
|
|
311
|
+
]);
|
|
312
|
+
return watch(results, this.facets.returnVoidWatcher);
|
|
313
|
+
},
|
|
314
|
+
},
|
|
255
315
|
invitationMakers: {
|
|
256
316
|
/**
|
|
257
317
|
* @param {CosmosValidatorAddress} validator
|
|
@@ -335,6 +395,25 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
335
395
|
TransferAccount() {
|
|
336
396
|
throw Error('not yet implemented');
|
|
337
397
|
},
|
|
398
|
+
Transfer() {
|
|
399
|
+
/**
|
|
400
|
+
* @type {OfferHandler<
|
|
401
|
+
* Vow<void>,
|
|
402
|
+
* {
|
|
403
|
+
* amount: AmountArg;
|
|
404
|
+
* destination: ChainAddress;
|
|
405
|
+
* opts: IBCMsgTransferOptions;
|
|
406
|
+
* }
|
|
407
|
+
* >}
|
|
408
|
+
*/
|
|
409
|
+
const offerHandler = (seat, { amount, destination, opts }) => {
|
|
410
|
+
seat.exit();
|
|
411
|
+
return watch(
|
|
412
|
+
this.facets.holder.transfer(amount, destination, opts),
|
|
413
|
+
);
|
|
414
|
+
};
|
|
415
|
+
return zcf.makeInvitation(offerHandler, 'Transfer');
|
|
416
|
+
},
|
|
338
417
|
},
|
|
339
418
|
holder: {
|
|
340
419
|
/** @type {HostOf<OrchestrationAccountI['asContinuingOffer']>} */
|
|
@@ -513,9 +592,37 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
513
592
|
},
|
|
514
593
|
|
|
515
594
|
/** @type {HostOf<OrchestrationAccountI['transfer']>} */
|
|
516
|
-
transfer(amount,
|
|
517
|
-
|
|
518
|
-
return asVow(() =>
|
|
595
|
+
transfer(amount, destination, opts) {
|
|
596
|
+
trace('transfer', amount, destination, opts);
|
|
597
|
+
return asVow(() => {
|
|
598
|
+
const { helper } = this.facets;
|
|
599
|
+
const token = helper.amountToCoin(amount);
|
|
600
|
+
|
|
601
|
+
const connectionInfoV = watch(
|
|
602
|
+
chainHub.getConnectionInfo(
|
|
603
|
+
this.state.chainAddress.chainId,
|
|
604
|
+
destination.chainId,
|
|
605
|
+
),
|
|
606
|
+
);
|
|
607
|
+
|
|
608
|
+
// set a `timeoutTimestamp` if caller does not supply either `timeoutHeight` or `timeoutTimestamp`
|
|
609
|
+
// TODO #9324 what's a reasonable default? currently 5 minutes
|
|
610
|
+
const timeoutTimestampVowOrValue =
|
|
611
|
+
opts?.timeoutTimestamp ??
|
|
612
|
+
(opts?.timeoutHeight
|
|
613
|
+
? 0n
|
|
614
|
+
: E(timestampHelper).getTimeoutTimestampNS());
|
|
615
|
+
|
|
616
|
+
// Resolves when host chain successfully submits, but not when
|
|
617
|
+
// the receiving chain acknowledges.
|
|
618
|
+
// See https://github.com/Agoric/agoric-sdk/issues/9784 for a
|
|
619
|
+
// solution that tracks the acknowledgement on the receiving chain.
|
|
620
|
+
return watch(
|
|
621
|
+
allVows([connectionInfoV, timeoutTimestampVowOrValue]),
|
|
622
|
+
this.facets.transferWatcher,
|
|
623
|
+
{ opts, token, destination },
|
|
624
|
+
);
|
|
625
|
+
});
|
|
519
626
|
},
|
|
520
627
|
|
|
521
628
|
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
@@ -568,9 +675,12 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
568
675
|
|
|
569
676
|
/**
|
|
570
677
|
* @param {Zone} zone
|
|
571
|
-
* @param {
|
|
572
|
-
* @param {
|
|
573
|
-
* @param {
|
|
678
|
+
* @param {object} powers
|
|
679
|
+
* @param {ChainHub} powers.chainHub
|
|
680
|
+
* @param {MakeRecorderKit} powers.makeRecorderKit
|
|
681
|
+
* @param {Remote<TimerService>} powers.timerService
|
|
682
|
+
* @param {VowTools} powers.vowTools
|
|
683
|
+
* @param {ZCF} powers.zcf
|
|
574
684
|
* @returns {(
|
|
575
685
|
* ...args: Parameters<
|
|
576
686
|
* ReturnType<typeof prepareCosmosOrchestrationAccountKit>
|
|
@@ -579,16 +689,15 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
579
689
|
*/
|
|
580
690
|
export const prepareCosmosOrchestrationAccount = (
|
|
581
691
|
zone,
|
|
582
|
-
makeRecorderKit,
|
|
583
|
-
vowTools,
|
|
584
|
-
zcf,
|
|
692
|
+
{ chainHub, makeRecorderKit, timerService, vowTools, zcf },
|
|
585
693
|
) => {
|
|
586
|
-
const makeKit = prepareCosmosOrchestrationAccountKit(
|
|
587
|
-
|
|
694
|
+
const makeKit = prepareCosmosOrchestrationAccountKit(zone, {
|
|
695
|
+
chainHub,
|
|
588
696
|
makeRecorderKit,
|
|
697
|
+
timerService,
|
|
589
698
|
vowTools,
|
|
590
699
|
zcf,
|
|
591
|
-
);
|
|
700
|
+
});
|
|
592
701
|
return (...args) => makeKit(...args).holder;
|
|
593
702
|
};
|
|
594
703
|
/** @typedef {CosmosOrchestrationAccountKit['holder']} CosmosOrchestrationAccount */
|
|
@@ -30,6 +30,11 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
30
30
|
toAccount: ChainAddress;
|
|
31
31
|
amounts: AmountArg[];
|
|
32
32
|
}>>;
|
|
33
|
+
Transfer(): Promise<Invitation<Vow<void>, {
|
|
34
|
+
amount: AmountArg;
|
|
35
|
+
destination: ChainAddress;
|
|
36
|
+
opts: IBCMsgTransferOptions;
|
|
37
|
+
}>>;
|
|
33
38
|
};
|
|
34
39
|
undelegateWatcher: {
|
|
35
40
|
/**
|
|
@@ -41,13 +46,6 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
41
46
|
*/
|
|
42
47
|
onFulfilled(response: [JsonSafe<TypedJson<"/cosmos.staking.v1beta1.MsgUndelegateResponse">>]): Vow<undefined>;
|
|
43
48
|
};
|
|
44
|
-
getChainInfoWatcher: {
|
|
45
|
-
/**
|
|
46
|
-
* @param {ChainInfo} agoricChainInfo
|
|
47
|
-
* @param {ChainAddress} destination
|
|
48
|
-
*/
|
|
49
|
-
onFulfilled(agoricChainInfo: ChainInfo, destination: ChainAddress): Vow<IBCConnectionInfo>;
|
|
50
|
-
};
|
|
51
49
|
transferWatcher: {
|
|
52
50
|
/**
|
|
53
51
|
* @param {[
|
|
@@ -56,7 +54,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
56
54
|
* ]} results
|
|
57
55
|
* @param {{
|
|
58
56
|
* destination: ChainAddress;
|
|
59
|
-
* opts
|
|
57
|
+
* opts?: IBCMsgTransferOptions;
|
|
60
58
|
* amount: DenomAmount;
|
|
61
59
|
* }} ctx
|
|
62
60
|
*/
|
|
@@ -64,7 +62,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
64
62
|
transferChannel: IBCConnectionInfo["transferChannel"];
|
|
65
63
|
}, bigint], { opts, amount, destination }: {
|
|
66
64
|
destination: ChainAddress;
|
|
67
|
-
opts
|
|
65
|
+
opts?: IBCMsgTransferOptions;
|
|
68
66
|
amount: DenomAmount;
|
|
69
67
|
}): import("@agoric/async-flow").HostInterface<Vow<any>>;
|
|
70
68
|
};
|
|
@@ -218,11 +216,10 @@ import type { AmountArg } from '@agoric/orchestration';
|
|
|
218
216
|
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
219
217
|
import type { Vow } from '@agoric/vow';
|
|
220
218
|
import type { TimestampRecord } from '@agoric/time';
|
|
219
|
+
import type { IBCMsgTransferOptions } from '@agoric/orchestration';
|
|
221
220
|
import type { TypedJson } from '@agoric/cosmic-proto';
|
|
222
221
|
import type { JsonSafe } from '@agoric/cosmic-proto';
|
|
223
|
-
import type { ChainInfo } from '@agoric/orchestration';
|
|
224
222
|
import type { IBCConnectionInfo } from '@agoric/orchestration';
|
|
225
|
-
import type { IBCMsgTransferOptions } from '@agoric/orchestration';
|
|
226
223
|
import type { DenomAmount } from '@agoric/orchestration';
|
|
227
224
|
import type { Pattern } from '@endo/patterns';
|
|
228
225
|
import type { EVow } from '@agoric/vow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AAyFO,0DAPI,IAAI,mBACJ,eAAe,OACf,GAAG,gBACH,OAAO,YAAY,CAAC,YACpB,QAAQ,YACR,QAAQ;
|
|
1
|
+
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AAyFO,0DAPI,IAAI,mBACJ,eAAe,OACf,GAAG,gBACH,OAAO,YAAY,CAAC,YACpB,QAAQ,YACR,QAAQ;aAqEJ,iBAAiB;aACjB,YAAY;iBACZ,OAAO,WAAW,CAAC;;;QAc1B;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAejB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;QAYxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;uBAmBJ,YAAY;oBAAU,SAAS;;;uBAa/B,YAAY;qBAAW,SAAS,EAAE;;;oBAcrC,SAAS;yBACJ,YAAY;kBACnB,qBAAqB;;;;QAcpC;;;;;;WAMG;8BALQ,CACV,SACA,UAAgB,+CAA+C,CAAC,CAC3D,CACF;;;QAcJ;;;;;;;;;;WAUG;6DATQ,CACV;YAAM,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;SAAE,EAC7D,MAAU,CACP,iCACO;YACV,WAAe,EAAE,YAAY,CAAC;YAC9B,IAAQ,CAAC,EAAE,qBAAqB,CAAC;YACjC,MAAU,EAAE,WAAW,CAAC;SACrB;;IAqCN;;;OAGG;;QAED;;WAEG;6BADQ,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;;;;;IAavC;;;OAGG;;QAED;;;;WAIG;+BAHQ,MAAM,CAAC,KAAK,CAAC,SACb,WAAW,CAAC,OAAO,CAAC,GAClB,WAAW;;;QAOxB,iEAAiE;;QAsBjE;;;;WAIG;;QAeH,2DAA2D;;QAM3D;;WAEG;;QAiBH;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;QAsBxB;;;;WAIG;qCAHQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC,GACX,IAAI,IAAI,GAAG,eAAe,CAAC;QAoBxC;;;;WAIG;QACH,mDAAmD;;QAOnD,oDAAoD;;QAIpD,qDAAqD;;;;;;;;;;QAIrD,kDAAkD;;QAIlD;;;;WAIG;;QAiBH;;;;WAIG;;QAiBH;;;;;;;;WAQG;yBAPQ,SAAS,eAET,YAAY,6CAIV,IAAI,GAAG,CAAC;QAiCrB,6DAA6D;;QAO7D,wDAAwD;;QAMxD,sDAAsD;;;;;QAItD,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;GAQnE;;aAhjBa,MAAM;;oBAIP;IACZ,QAAY,EAAE,YAAY,6BAA6B,CAAC,CAAC;IACzD,WAAe,EAAE,WAAW,CAAC;IAC7B,OAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAW,EAAE,YAAY,CAAC;CACvB;+CAyiBU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BAzkBnC,cAAc;qCADU,6CAA6C;kCAK5C,cAAc;4BAHrC,kBAAkB;8BAIO,aAAa;8BAIpC,gBAAgB;uCAZP,gCAAgC;kCAC+D,uBAAuB;+BAAvB,uBAAuB;0BASnI,kDAAkD;yBAFvB,aAAa;qCADf,cAAc;2CANqE,uBAAuB;+BAQxG,sBAAsB;8BAAtB,sBAAsB;uCAR2D,uBAAuB;iCAAvB,uBAAuB;6BAUvH,gBAAgB;0BAHD,aAAa;iCANhB,6CAA6C;iCAW9D,mBAAmB"}
|
|
@@ -121,11 +121,6 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
121
121
|
.optional(M.arrayOf(M.undefined())) // empty context
|
|
122
122
|
.returns(VowShape),
|
|
123
123
|
}),
|
|
124
|
-
getChainInfoWatcher: M.interface('getChainInfoWatcher', {
|
|
125
|
-
onFulfilled: M.call(M.record()) // agoric chain info
|
|
126
|
-
.optional(ChainAddressShape)
|
|
127
|
-
.returns(Vow$(M.record())), // connection info
|
|
128
|
-
}),
|
|
129
124
|
transferWatcher: M.interface('transferWatcher', {
|
|
130
125
|
onFulfilled: M.call([M.record(), M.nat()])
|
|
131
126
|
.optional({
|
|
@@ -154,6 +149,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
154
149
|
CloseAccount: M.call().returns(M.promise()),
|
|
155
150
|
Send: M.call().returns(M.promise()),
|
|
156
151
|
SendAll: M.call().returns(M.promise()),
|
|
152
|
+
Transfer: M.call().returns(M.promise()),
|
|
157
153
|
}),
|
|
158
154
|
},
|
|
159
155
|
/**
|
|
@@ -248,6 +244,25 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
248
244
|
};
|
|
249
245
|
return zcf.makeInvitation(offerHandler, 'SendAll');
|
|
250
246
|
},
|
|
247
|
+
Transfer() {
|
|
248
|
+
/**
|
|
249
|
+
* @type {OfferHandler<
|
|
250
|
+
* Vow<void>,
|
|
251
|
+
* {
|
|
252
|
+
* amount: AmountArg;
|
|
253
|
+
* destination: ChainAddress;
|
|
254
|
+
* opts: IBCMsgTransferOptions;
|
|
255
|
+
* }
|
|
256
|
+
* >}
|
|
257
|
+
*/
|
|
258
|
+
const offerHandler = (seat, { amount, destination, opts }) => {
|
|
259
|
+
seat.exit();
|
|
260
|
+
return watch(
|
|
261
|
+
this.facets.holder.transfer(amount, destination, opts),
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
return zcf.makeInvitation(offerHandler, 'Transfer');
|
|
265
|
+
},
|
|
251
266
|
},
|
|
252
267
|
undelegateWatcher: {
|
|
253
268
|
/**
|
|
@@ -268,18 +283,6 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
268
283
|
);
|
|
269
284
|
},
|
|
270
285
|
},
|
|
271
|
-
getChainInfoWatcher: {
|
|
272
|
-
/**
|
|
273
|
-
* @param {ChainInfo} agoricChainInfo
|
|
274
|
-
* @param {ChainAddress} destination
|
|
275
|
-
*/
|
|
276
|
-
onFulfilled(agoricChainInfo, destination) {
|
|
277
|
-
return chainHub.getConnectionInfo(
|
|
278
|
-
agoricChainInfo.chainId,
|
|
279
|
-
destination.chainId,
|
|
280
|
-
);
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
286
|
transferWatcher: {
|
|
284
287
|
/**
|
|
285
288
|
* @param {[
|
|
@@ -288,7 +291,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
288
291
|
* ]} results
|
|
289
292
|
* @param {{
|
|
290
293
|
* destination: ChainAddress;
|
|
291
|
-
* opts
|
|
294
|
+
* opts?: IBCMsgTransferOptions;
|
|
292
295
|
* amount: DenomAmount;
|
|
293
296
|
* }} ctx
|
|
294
297
|
*/
|
|
@@ -556,9 +559,10 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
556
559
|
if ('brand' in amount) throw Fail`ERTP Amounts not yet supported`;
|
|
557
560
|
|
|
558
561
|
const connectionInfoV = watch(
|
|
559
|
-
chainHub.
|
|
560
|
-
|
|
561
|
-
|
|
562
|
+
chainHub.getConnectionInfo(
|
|
563
|
+
this.state.address.chainId,
|
|
564
|
+
destination.chainId,
|
|
565
|
+
),
|
|
562
566
|
);
|
|
563
567
|
|
|
564
568
|
// set a `timeoutTimestamp` if caller does not supply either `timeoutHeight` or `timeoutTimestamp`
|
package/src/exos/packet-tools.js
CHANGED
|
@@ -109,7 +109,7 @@ export const preparePacketTools = (zone, vowTools) => {
|
|
|
109
109
|
}),
|
|
110
110
|
utils: M.interface('utils', {
|
|
111
111
|
subscribeToTransfers: M.call().returns(M.promise()),
|
|
112
|
-
unsubscribeFromTransfers: M.call().returns(M.
|
|
112
|
+
unsubscribeFromTransfers: M.call().returns(M.undefined()),
|
|
113
113
|
incrPendingPatterns: M.call().returns(Vow$(M.undefined())),
|
|
114
114
|
decrPendingPatterns: M.call().returns(Vow$(M.undefined())),
|
|
115
115
|
}),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function startStakeAtom({ consume: { agoricNames, board, chainStorage, chainTimerService, cosmosInterchainService, startUpgradable, }, installation: { consume: { stakeIca }, }, instance: { produce: { stakeAtom: produceInstance }, }, }: BootstrapPowers & {
|
|
1
|
+
export function startStakeAtom({ consume: { agoricNames, board, chainStorage, chainTimerService: timer, cosmosInterchainService, startUpgradable, }, installation: { consume: { stakeIca }, }, instance: { produce: { stakeAtom: produceInstance }, }, }: BootstrapPowers & {
|
|
2
2
|
installation: {
|
|
3
3
|
consume: {
|
|
4
4
|
stakeIca: Installation<(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
5
|
+
agoricNames: import("@agoric/internal").Remote<import("@agoric/vats").NameHub>;
|
|
5
6
|
cosmosInterchainService: import("../types.js").CosmosInterchainService;
|
|
6
7
|
storageNode: StorageNode;
|
|
7
8
|
marshaller: Marshaller;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAyBO,
|
|
1
|
+
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAyBO,0PAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;cAA0D,CACjD,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAwDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;mCArG4C,+BAA+B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeTracer } from '@agoric/internal';
|
|
1
|
+
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
2
2
|
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
3
|
import { prepareVowTools } from '@agoric/vow';
|
|
4
4
|
import { makeHeapZone } from '@agoric/zone';
|
|
@@ -28,7 +28,7 @@ export const startStakeAtom = async ({
|
|
|
28
28
|
agoricNames,
|
|
29
29
|
board,
|
|
30
30
|
chainStorage,
|
|
31
|
-
chainTimerService,
|
|
31
|
+
chainTimerService: timer,
|
|
32
32
|
cosmosInterchainService,
|
|
33
33
|
startUpgradable,
|
|
34
34
|
},
|
|
@@ -64,12 +64,15 @@ export const startStakeAtom = async ({
|
|
|
64
64
|
bondDenom: cosmoshub.stakingTokens[0].denom,
|
|
65
65
|
icqEnabled: cosmoshub.icqEnabled,
|
|
66
66
|
},
|
|
67
|
-
privateArgs:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
privateArgs: await deeplyFulfilledObject(
|
|
68
|
+
harden({
|
|
69
|
+
agoricNames,
|
|
70
|
+
cosmosInterchainService,
|
|
71
|
+
storageNode,
|
|
72
|
+
marshaller,
|
|
73
|
+
timer,
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
73
76
|
};
|
|
74
77
|
|
|
75
78
|
const { instance } = await E(startUpgradable)(startOpts);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function startStakeOsmo({ consume: { agoricNames, board, chainStorage, chainTimerService, cosmosInterchainService, startUpgradable, }, installation: { consume: { stakeIca }, }, instance: { produce: { stakeOsmo: produceInstance }, }, }: BootstrapPowers & {
|
|
1
|
+
export function startStakeOsmo({ consume: { agoricNames, board, chainStorage, chainTimerService: timer, cosmosInterchainService, startUpgradable, }, installation: { consume: { stakeIca }, }, instance: { produce: { stakeOsmo: produceInstance }, }, }: BootstrapPowers & {
|
|
2
2
|
installation: {
|
|
3
3
|
consume: {
|
|
4
4
|
stakeIca: Installation<(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
5
|
+
agoricNames: import("@agoric/internal").Remote<import("@agoric/vats").NameHub>;
|
|
5
6
|
cosmosInterchainService: import("../types.js").CosmosInterchainService;
|
|
6
7
|
storageNode: StorageNode;
|
|
7
8
|
marshaller: Marshaller;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AA8BO,
|
|
1
|
+
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AA8BO,0PAfI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;cAA0D,CACjD,CAAC;SACH,CAAC;KACH,CAAC;IACN,QAAY,EAAE;QACd,OAAa,EAAE;YACf,SAAiB,EAAE,GAAG,CAAC;SAChB,CAAC;KACH,CAAC;CACH,iBAwDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeTracer } from '@agoric/internal';
|
|
1
|
+
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
2
2
|
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
3
|
import { prepareVowTools } from '@agoric/vow';
|
|
4
4
|
import { makeHeapZone } from '@agoric/zone';
|
|
@@ -33,7 +33,7 @@ export const startStakeOsmo = async ({
|
|
|
33
33
|
agoricNames,
|
|
34
34
|
board,
|
|
35
35
|
chainStorage,
|
|
36
|
-
chainTimerService,
|
|
36
|
+
chainTimerService: timer,
|
|
37
37
|
cosmosInterchainService,
|
|
38
38
|
startUpgradable,
|
|
39
39
|
},
|
|
@@ -69,12 +69,15 @@ export const startStakeOsmo = async ({
|
|
|
69
69
|
bondDenom: osmosis.stakingTokens[0].denom,
|
|
70
70
|
icqEnabled: osmosis.icqEnabled,
|
|
71
71
|
},
|
|
72
|
-
privateArgs:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
privateArgs: await deeplyFulfilledObject(
|
|
73
|
+
harden({
|
|
74
|
+
agoricNames,
|
|
75
|
+
cosmosInterchainService,
|
|
76
|
+
storageNode,
|
|
77
|
+
marshaller,
|
|
78
|
+
timer,
|
|
79
|
+
}),
|
|
80
|
+
),
|
|
78
81
|
};
|
|
79
82
|
|
|
80
83
|
const { instance } = await E(startUpgradable)(startOpts);
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
AmountArgShape,
|
|
7
7
|
ChainAddressShape,
|
|
8
8
|
DenomAmountShape,
|
|
9
|
+
IBCTransferOptionsShape,
|
|
9
10
|
} from '../typeGuards.js';
|
|
10
11
|
|
|
11
12
|
/** @import {OrchestrationAccountI} from '../orchestration-api.js'; */
|
|
@@ -22,7 +23,7 @@ export const orchestrationAccountMethods = {
|
|
|
22
23
|
VowShape,
|
|
23
24
|
),
|
|
24
25
|
transfer: M.call(AmountArgShape, ChainAddressShape)
|
|
25
|
-
.optional(
|
|
26
|
+
.optional(IBCTransferOptionsShape)
|
|
26
27
|
.returns(VowShape),
|
|
27
28
|
transferSteps: M.call(AmountArgShape, M.any()).returns(VowShape),
|
|
28
29
|
asContinuingOffer: M.call().returns(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BAwGR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;wCAzEW,GAAG;;+BA/C1B,GAAC,+EAGuB,GAAG,yCAK7B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0IL;AAuBM,kCAdgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IACnC,UAAc,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACV,GAAO,EAAE,GAAG,CAAC,EAAE,CAAC,EAChB,WAAe,EAAE,EAAE,EACnB,IAAQ,EAAE,IAAI,EACd,KAAS,EAAE,kBAAkB,KACtB,OAAO,CAAC,CAAC,CAAC,GACL,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAYzE;kCApLU;IACZ,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC1D,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;iCAiJU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BA/JzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,sCAAsC;kCALrC,cAAc;6BAE/B,cAAc"}
|
|
@@ -94,9 +94,13 @@ export const provideOrchestration = (
|
|
|
94
94
|
|
|
95
95
|
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
|
|
96
96
|
zones.orchestration,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
{
|
|
98
|
+
chainHub,
|
|
99
|
+
makeRecorderKit,
|
|
100
|
+
timerService,
|
|
101
|
+
vowTools,
|
|
102
|
+
zcf,
|
|
103
|
+
},
|
|
100
104
|
);
|
|
101
105
|
|
|
102
106
|
const makeRemoteChainFacade = prepareRemoteChainFacade(zones.orchestration, {
|
package/src/utils/time.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["time.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,2CAFW,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["time.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,2CAFW,OAAO,YAAY,CAAC;IAI3B;;;;;;;;;;OAUG;0EAFU,OAAO,CAAC,MAAM,CAAC;EAiB/B;AA1CD;;;GAGG;AAEH,qCAAsC;AACtC,4CAA6C;AAC7C,mDAAsD;AACtD,iDAAqD;8BAoCvC,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;kCA3CE,cAAc;4BACpD,kBAAkB;wCADoB,cAAc"}
|
package/src/utils/time.js
CHANGED
|
@@ -17,14 +17,6 @@ export const NANOSECONDS_PER_SECOND = 1_000_000_000n;
|
|
|
17
17
|
* @param {Remote<TimerService>} timer
|
|
18
18
|
*/
|
|
19
19
|
export function makeTimestampHelper(timer) {
|
|
20
|
-
/** @type {TimerBrand | undefined} */
|
|
21
|
-
let brandCache;
|
|
22
|
-
const getBrand = async () => {
|
|
23
|
-
if (brandCache) return brandCache;
|
|
24
|
-
brandCache = await E(timer).getTimerBrand();
|
|
25
|
-
return brandCache;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
20
|
return harden({
|
|
29
21
|
/**
|
|
30
22
|
* XXX do this need to be resumable / use Vows?
|
|
@@ -43,7 +35,7 @@ export function makeTimestampHelper(timer) {
|
|
|
43
35
|
relativeTime ||
|
|
44
36
|
TimeMath.coerceRelativeTimeRecord(
|
|
45
37
|
SECONDS_PER_MINUTE * 5n,
|
|
46
|
-
|
|
38
|
+
currentTime.timerBrand,
|
|
47
39
|
);
|
|
48
40
|
return (
|
|
49
41
|
TimeMath.addAbsRel(currentTime, timeout).absValue *
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoe-tools.d.ts","sourceRoot":"","sources":["zoe-tools.js"],"names":[],"mappings":"AAkCO,mCAHI,IAAI,qBACJ;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE;;
|
|
1
|
+
{"version":3,"file":"zoe-tools.d.ts","sourceRoot":"","sources":["zoe-tools.js"],"names":[],"mappings":"AAkCO,mCAHI,IAAI,qBACJ;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE;;EAiD1C;4CAnEY;IACZ,gBAAoB,EAAE,gBAAgB,CAAC;IACvC,iBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;CAC7D;4BAMS,CACZ,OAAW,EAAE,OAAO,EACpB,YAAgB,EAAE,mBAAmB,EACrC,IAAQ,EAAE,mBAAmB,KACtB,OAAO,CAAC,IAAI,CAAC;uBAuDP,UAAU,CAAC,OAAO,YAAY,CAAC;0BA1EtB,cAAc;8BADL,aAAa;yCAGP,aAAa;yBAHnB,aAAa;sCAFV,mCAAmC;yCAChC,2CAA2C"}
|
package/src/utils/zoe-tools.js
CHANGED
|
@@ -64,13 +64,15 @@ export const makeZoeTools = (zone, { zcf, vowTools }) => {
|
|
|
64
64
|
|
|
65
65
|
// Now all the `give` are accessible, so we can move them to the localAccount`
|
|
66
66
|
|
|
67
|
-
const
|
|
67
|
+
const depositVs = Object.entries(give).map(async ([kw, _amount]) => {
|
|
68
68
|
const pmt = await E(userSeat).getPayout(kw);
|
|
69
69
|
// TODO arrange recovery on upgrade of pmt?
|
|
70
70
|
return localAccount.deposit(pmt);
|
|
71
71
|
});
|
|
72
|
-
await
|
|
72
|
+
await vowTools.when(vowTools.allVows(depositVs));
|
|
73
73
|
// TODO remove userSeat from baggage
|
|
74
|
+
// TODO reject non-vbank issuers
|
|
75
|
+
// TODO recover failed deposits
|
|
74
76
|
},
|
|
75
77
|
);
|
|
76
78
|
|