@agoric/orchestration 0.1.1-dev-12ce494.0 → 0.1.1-dev-5d18974.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 +17 -17
- package/src/examples/stakeBld.contract.d.ts +14 -92
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeIca.contract.d.ts +13 -53
- package/src/examples/stakeIca.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +3 -3
- package/src/exos/cosmos-orchestration-account.d.ts +28 -77
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +23 -28
- package/src/exos/local-chain-facade.d.ts +27 -61
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +9 -10
- package/src/exos/local-orchestration-account.d.ts +23 -42
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +24 -10
- package/src/exos/orchestrator.d.ts +5 -14
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +3 -7
- package/src/exos/remote-chain-facade.d.ts +41 -117
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +17 -19
- package/src/facade.js +14 -14
- package/src/orchestration-api.d.ts +7 -7
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +13 -7
- package/src/proposals/start-stakeAtom.d.ts +13 -53
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.d.ts +14 -92
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.d.ts +18 -53
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.js +5 -1
- package/src/types.d.ts +0 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +0 -1
- package/src/utils/start-helper.d.ts +2 -40
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/zoe-tools.d.ts +9 -39
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +21 -6
- package/src/internal.d.ts +0 -13
- package/src/internal.d.ts.map +0 -1
- package/src/internal.ts +0 -20
|
@@ -33,16 +33,19 @@ import { maxClockSkew, tryDecodeResponse } from '../utils/cosmos.js';
|
|
|
33
33
|
import { orchestrationAccountMethods } from '../utils/orchestrationAccount.js';
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
+
* @import {HostOf} from '@agoric/async-flow';
|
|
36
37
|
* @import {AmountArg, IcaAccount, ChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, DenomAmount, OrchestrationAccountI, DenomArg} from '../types.js';
|
|
37
38
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
38
39
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
39
40
|
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
40
41
|
* @import {Remote} from '@agoric/internal';
|
|
42
|
+
* @import {InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
41
43
|
* @import {TimerService} from '@agoric/time';
|
|
42
44
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
43
45
|
* @import {Zone} from '@agoric/zone';
|
|
44
46
|
* @import {ResponseQuery} from '@agoric/cosmic-proto/tendermint/abci/types.js';
|
|
45
47
|
* @import {JsonSafe} from '@agoric/cosmic-proto';
|
|
48
|
+
* @import {Matcher} from '@endo/patterns';
|
|
46
49
|
*/
|
|
47
50
|
|
|
48
51
|
const trace = makeTracer('ComosOrchestrationAccountHolder');
|
|
@@ -81,7 +84,7 @@ export const IcaAccountHolderI = M.interface('IcaAccountHolder', {
|
|
|
81
84
|
undelegate: M.call(M.arrayOf(DelegationShape)).returns(VowShape),
|
|
82
85
|
});
|
|
83
86
|
|
|
84
|
-
/** @type {{ [name: string]: [description: string, valueShape:
|
|
87
|
+
/** @type {{ [name: string]: [description: string, valueShape: Matcher] }} */
|
|
85
88
|
const PUBLIC_TOPICS = {
|
|
86
89
|
account: ['Staking Account holder status', M.any()],
|
|
87
90
|
};
|
|
@@ -158,7 +161,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
158
161
|
(chainAddress, bondDenom, io) => {
|
|
159
162
|
const { storageNode, ...rest } = io;
|
|
160
163
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
161
|
-
// @ts-expect-error XXX Patterns
|
|
162
164
|
const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]);
|
|
163
165
|
// TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066
|
|
164
166
|
void E(topicKit.recorder).write('');
|
|
@@ -309,12 +311,18 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
309
311
|
},
|
|
310
312
|
},
|
|
311
313
|
holder: {
|
|
314
|
+
/** @type {HostOf<OrchestrationAccountI['asContinuingOffer']>} */
|
|
312
315
|
asContinuingOffer() {
|
|
313
316
|
// getPublicTopics resolves promptly (same run), so we don't need a watcher
|
|
314
317
|
// eslint-disable-next-line no-restricted-syntax
|
|
315
318
|
return asVow(async () => {
|
|
316
319
|
await null;
|
|
317
|
-
const { holder, invitationMakers } = this.facets;
|
|
320
|
+
const { holder, invitationMakers: im } = this.facets;
|
|
321
|
+
// XXX cast to a type that has string index signature
|
|
322
|
+
const invitationMakers = /** @type {InvitationMakers} */ (
|
|
323
|
+
/** @type {unknown} */ (im)
|
|
324
|
+
);
|
|
325
|
+
|
|
318
326
|
return harden({
|
|
319
327
|
// getPublicTopics returns a vow, for membrane compatibility.
|
|
320
328
|
// it's safe to unwrap to a promise and get the result as we
|
|
@@ -325,6 +333,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
325
333
|
});
|
|
326
334
|
});
|
|
327
335
|
},
|
|
336
|
+
/** @type {HostOf<OrchestrationAccountI['getPublicTopics']>} */
|
|
328
337
|
getPublicTopics() {
|
|
329
338
|
// getStoragePath resolves promptly (same run), so we don't need a watcher
|
|
330
339
|
// eslint-disable-next-line no-restricted-syntax
|
|
@@ -341,18 +350,11 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
341
350
|
});
|
|
342
351
|
},
|
|
343
352
|
|
|
344
|
-
|
|
345
|
-
// to the OrchestrationAccount provided by makeAccount()
|
|
346
|
-
/** @returns {ChainAddress} */
|
|
353
|
+
/** @type {HostOf<OrchestrationAccountI['getAddress']>} */
|
|
347
354
|
getAddress() {
|
|
348
355
|
return this.state.chainAddress;
|
|
349
356
|
},
|
|
350
|
-
/**
|
|
351
|
-
* _Assumes users has already sent funds to their ICA, until #9193
|
|
352
|
-
*
|
|
353
|
-
* @param {CosmosValidatorAddress} validator
|
|
354
|
-
* @param {AmountArg} amount
|
|
355
|
-
*/
|
|
357
|
+
/** @type {HostOf<StakingAccountActions['delegate']>} */
|
|
356
358
|
delegate(validator, amount) {
|
|
357
359
|
return asVow(() => {
|
|
358
360
|
trace('delegate', validator, amount);
|
|
@@ -371,17 +373,12 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
371
373
|
return watch(results, this.facets.returnVoidWatcher);
|
|
372
374
|
});
|
|
373
375
|
},
|
|
376
|
+
/** @type {HostOf<OrchestrationAccountI['getBalances']>} */
|
|
374
377
|
getBalances() {
|
|
375
378
|
// TODO https://github.com/Agoric/agoric-sdk/issues/9610
|
|
376
379
|
return asVow(() => Fail`not yet implemented`);
|
|
377
380
|
},
|
|
378
|
-
/**
|
|
379
|
-
* _Assumes users has already sent funds to their ICA, until #9193
|
|
380
|
-
*
|
|
381
|
-
* @param {CosmosValidatorAddress} srcValidator
|
|
382
|
-
* @param {CosmosValidatorAddress} dstValidator
|
|
383
|
-
* @param {AmountArg} amount
|
|
384
|
-
*/
|
|
381
|
+
/** @type {HostOf<StakingAccountActions['redelegate']>} */
|
|
385
382
|
redelegate(srcValidator, dstValidator, amount) {
|
|
386
383
|
return asVow(() => {
|
|
387
384
|
trace('redelegate', srcValidator, dstValidator, amount);
|
|
@@ -406,10 +403,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
406
403
|
);
|
|
407
404
|
});
|
|
408
405
|
},
|
|
409
|
-
/**
|
|
410
|
-
* @param {CosmosValidatorAddress} validator
|
|
411
|
-
* @returns {Vow<DenomAmount[]>}
|
|
412
|
-
*/
|
|
406
|
+
/** @type {HostOf<StakingAccountActions['withdrawReward']>} */
|
|
413
407
|
withdrawReward(validator) {
|
|
414
408
|
return asVow(() => {
|
|
415
409
|
trace('withdrawReward', validator);
|
|
@@ -425,10 +419,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
425
419
|
return watch(results, this.facets.withdrawRewardWatcher);
|
|
426
420
|
});
|
|
427
421
|
},
|
|
428
|
-
/**
|
|
429
|
-
* @param {DenomArg} denom
|
|
430
|
-
* @returns {Vow<DenomAmount>}
|
|
431
|
-
*/
|
|
422
|
+
/** @type {HostOf<OrchestrationAccountI['getBalance']>} */
|
|
432
423
|
getBalance(denom) {
|
|
433
424
|
return asVow(() => {
|
|
434
425
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -450,26 +441,30 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
450
441
|
});
|
|
451
442
|
},
|
|
452
443
|
|
|
444
|
+
/** @type {HostOf<OrchestrationAccountI['send']>} */
|
|
453
445
|
send(toAccount, amount) {
|
|
454
446
|
console.log('send got', toAccount, amount);
|
|
455
447
|
return asVow(() => Fail`not yet implemented`);
|
|
456
448
|
},
|
|
457
449
|
|
|
450
|
+
/** @type {HostOf<OrchestrationAccountI['transfer']>} */
|
|
458
451
|
transfer(amount, msg) {
|
|
459
452
|
console.log('transferSteps got', amount, msg);
|
|
460
453
|
return asVow(() => Fail`not yet implemented`);
|
|
461
454
|
},
|
|
462
455
|
|
|
456
|
+
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
463
457
|
transferSteps(amount, msg) {
|
|
464
458
|
console.log('transferSteps got', amount, msg);
|
|
465
459
|
return asVow(() => Fail`not yet implemented`);
|
|
466
460
|
},
|
|
467
461
|
|
|
462
|
+
/** @type {HostOf<StakingAccountActions['withdrawRewards']>} */
|
|
468
463
|
withdrawRewards() {
|
|
469
464
|
return asVow(() => Fail`Not Implemented. Try using withdrawReward.`);
|
|
470
465
|
},
|
|
471
466
|
|
|
472
|
-
/** @
|
|
467
|
+
/** @type {HostOf<StakingAccountActions['undelegate']>} */
|
|
473
468
|
undelegate(delegations) {
|
|
474
469
|
return asVow(() => {
|
|
475
470
|
trace('undelegate', delegations);
|
|
@@ -22,51 +22,35 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
22
22
|
denom: string;
|
|
23
23
|
}>>;
|
|
24
24
|
}>>;
|
|
25
|
-
/** @returns {Vow<
|
|
26
|
-
makeAccount(): Vow<
|
|
25
|
+
/** @returns {Vow<LocalOrchestrationAccountKit['holder']>} */
|
|
26
|
+
makeAccount(): Vow<LocalOrchestrationAccountKit["holder"]>;
|
|
27
27
|
};
|
|
28
28
|
makeAccountWatcher: {
|
|
29
29
|
/**
|
|
30
30
|
* @param {[LocalChainAccount, ChainAddress['value']]} results
|
|
31
31
|
*/
|
|
32
32
|
onFulfilled([account, address]: [LocalChainAccount, ChainAddress["value"]]): Vow<import("@endo/exo").Guarded<{
|
|
33
|
-
asContinuingOffer(): Vow<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
subscriber: globalThis.Subscriber<import("./local-orchestration-account.js").LocalChainAccountNotification>;
|
|
38
|
-
storagePath: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
invitationMakers: import("@endo/exo").Guarded<{
|
|
42
|
-
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<Record<unknown, unknown>>, undefined>>;
|
|
43
|
-
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<import("@agoric/time").TimestampRecord>, undefined>>;
|
|
44
|
-
CloseAccount(): never;
|
|
45
|
-
}>;
|
|
46
|
-
holder: import("@endo/exo").Guarded<any>;
|
|
47
|
-
}>;
|
|
48
|
-
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount>;
|
|
49
|
-
getBalances(): Vow<never>;
|
|
50
|
-
getPublicTopics(): Vow<{
|
|
51
|
-
account: {
|
|
52
|
-
description: string;
|
|
53
|
-
subscriber: globalThis.Subscriber<import("./local-orchestration-account.js").LocalChainAccountNotification>;
|
|
54
|
-
storagePath: string;
|
|
55
|
-
};
|
|
56
|
-
}>;
|
|
33
|
+
asContinuingOffer(): Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & import("../utils/zoe-tools.js").ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
|
|
34
|
+
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount>>;
|
|
35
|
+
getBalances(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
36
|
+
getPublicTopics(): Vow<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> : import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
|
|
57
37
|
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Vow<Record<unknown, unknown>>;
|
|
58
38
|
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Vow<void | import("@agoric/time").TimestampRecord>;
|
|
59
|
-
deposit(payment: globalThis.Payment<"nat">, optAmountShape?: globalThis.Pattern): Vow<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount
|
|
60
|
-
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): Vow<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat"
|
|
39
|
+
deposit(payment: globalThis.Payment<"nat">, optAmountShape?: globalThis.Pattern): Vow<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount> extends import("@endo/pass-style").Passable ? import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount> : import("@agoric/async-flow").HostInterface<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount>>>;
|
|
40
|
+
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): Vow<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">> extends import("@endo/pass-style").Passable ? globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">> : import("@agoric/async-flow").HostInterface<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">>>>;
|
|
61
41
|
executeTx(messages: {
|
|
62
42
|
'@type': string;
|
|
63
43
|
}[]): Vow<import("@agoric/cosmic-proto").JsonSafe<{
|
|
64
44
|
'@type': string;
|
|
65
|
-
}>[]
|
|
45
|
+
}>[] extends import("@endo/pass-style").Passable ? import("@agoric/cosmic-proto").JsonSafe<{
|
|
46
|
+
'@type': string;
|
|
47
|
+
}>[] : import("@agoric/async-flow").HostInterface<import("@agoric/cosmic-proto").JsonSafe<{
|
|
48
|
+
'@type': string;
|
|
49
|
+
}>[]>>;
|
|
66
50
|
getAddress(): ChainAddress;
|
|
67
51
|
send(toAccount: any, amount: any): Vow<never>;
|
|
68
52
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void>;
|
|
69
|
-
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void
|
|
53
|
+
transferSteps(amount: import("../orchestration-api.js").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>>;
|
|
70
54
|
}>>;
|
|
71
55
|
};
|
|
72
56
|
makeChildNodeWatcher: {
|
|
@@ -81,43 +65,27 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
81
65
|
account: LocalChainAccount;
|
|
82
66
|
address: ChainAddress["value"];
|
|
83
67
|
}): import("@endo/exo").Guarded<{
|
|
84
|
-
asContinuingOffer(): Vow<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
subscriber: globalThis.Subscriber<import("./local-orchestration-account.js").LocalChainAccountNotification>;
|
|
89
|
-
storagePath: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
invitationMakers: import("@endo/exo").Guarded<{
|
|
93
|
-
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<Record<unknown, unknown>>, undefined>>;
|
|
94
|
-
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<import("@agoric/time").TimestampRecord>, undefined>>;
|
|
95
|
-
CloseAccount(): never;
|
|
96
|
-
}>;
|
|
97
|
-
holder: import("@endo/exo").Guarded<any>;
|
|
98
|
-
}>;
|
|
99
|
-
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount>;
|
|
100
|
-
getBalances(): Vow<never>;
|
|
101
|
-
getPublicTopics(): Vow<{
|
|
102
|
-
account: {
|
|
103
|
-
description: string;
|
|
104
|
-
subscriber: globalThis.Subscriber<import("./local-orchestration-account.js").LocalChainAccountNotification>;
|
|
105
|
-
storagePath: string;
|
|
106
|
-
};
|
|
107
|
-
}>;
|
|
68
|
+
asContinuingOffer(): Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & import("../utils/zoe-tools.js").ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
|
|
69
|
+
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount>>;
|
|
70
|
+
getBalances(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
71
|
+
getPublicTopics(): Vow<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> : import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
|
|
108
72
|
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Vow<Record<unknown, unknown>>;
|
|
109
73
|
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Vow<void | import("@agoric/time").TimestampRecord>;
|
|
110
|
-
deposit(payment: globalThis.Payment<"nat">, optAmountShape?: globalThis.Pattern): Vow<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount
|
|
111
|
-
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): Vow<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat"
|
|
74
|
+
deposit(payment: globalThis.Payment<"nat">, optAmountShape?: globalThis.Pattern): Vow<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount> extends import("@endo/pass-style").Passable ? import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount> : import("@agoric/async-flow").HostInterface<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount>>>;
|
|
75
|
+
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): Vow<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">> extends import("@endo/pass-style").Passable ? globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">> : import("@agoric/async-flow").HostInterface<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">>>>;
|
|
112
76
|
executeTx(messages: {
|
|
113
77
|
'@type': string;
|
|
114
78
|
}[]): Vow<import("@agoric/cosmic-proto").JsonSafe<{
|
|
115
79
|
'@type': string;
|
|
116
|
-
}>[]
|
|
80
|
+
}>[] extends import("@endo/pass-style").Passable ? import("@agoric/cosmic-proto").JsonSafe<{
|
|
81
|
+
'@type': string;
|
|
82
|
+
}>[] : import("@agoric/async-flow").HostInterface<import("@agoric/cosmic-proto").JsonSafe<{
|
|
83
|
+
'@type': string;
|
|
84
|
+
}>[]>>;
|
|
117
85
|
getAddress(): ChainAddress;
|
|
118
86
|
send(toAccount: any, amount: any): Vow<never>;
|
|
119
87
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void>;
|
|
120
|
-
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void
|
|
88
|
+
transferSteps(amount: import("../orchestration-api.js").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>>;
|
|
121
89
|
}>;
|
|
122
90
|
};
|
|
123
91
|
}>>["public"];
|
|
@@ -133,9 +101,7 @@ export type MakeLocalChainFacade = ReturnType<typeof prepareLocalChainFacade>;
|
|
|
133
101
|
import type { Zone } from '@agoric/base-zone';
|
|
134
102
|
import type { IBCConnectionInfo } from '../types.js';
|
|
135
103
|
import type { Vow } from '@agoric/vow';
|
|
136
|
-
import type {
|
|
137
|
-
import type { OrchestrationAccount } from '../types.js';
|
|
138
|
-
import type { PromiseToVow } from '../types.js';
|
|
104
|
+
import type { LocalOrchestrationAccountKit } from './local-orchestration-account.js';
|
|
139
105
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
140
106
|
import type { ChainAddress } from '../types.js';
|
|
141
107
|
import type { Remote } from '@agoric/internal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AAiIO,8CAHI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;QArDzB,6DAA6D;uBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;QAazD;;WAEG;wCADQ,CAAC,iBAAiB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;QAWrD;;;;;;WAMG;+BALQ,OAAO,WAAW,CAAC,wBACnB;YACV,OAAW,EAAE,iBAAiB,CAAC;YAC/B,OAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;SAChC;;;;;;;;;;;;;;;;;;;;;;;;cA4BX;qCA9GY;IACZ,gCAAoC,EAAE,gCAAgC,CAAC;IACvE,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAC;CACpB;mCA0GU,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BA5HjC,mBAAmB;uCAO0D,aAAa;yBAHjF,aAAa;kDAEoC,kCAAkC;uCAHnE,gCAAgC;kCAIoB,aAAa;4BALxF,kBAAkB;sDAIsC,kCAAkC;6CADzE,gCAAgC;kCAJ3C,cAAc;gCAEG,gCAAgC;8BAChD,aAAa"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @file ChainAccount exo */
|
|
2
2
|
import { E } from '@endo/far';
|
|
3
|
+
// eslint-disable-next-line no-restricted-syntax -- just the import
|
|
4
|
+
import { heapVowE } from '@agoric/vow/vat.js';
|
|
3
5
|
import { M } from '@endo/patterns';
|
|
4
6
|
import { pickFacet } from '@agoric/vat-data';
|
|
5
7
|
import { VowShape } from '@agoric/vow';
|
|
@@ -13,8 +15,8 @@ import { ChainFacadeI } from '../typeGuards.js';
|
|
|
13
15
|
* @import {LocalChain, LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
14
16
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
15
17
|
* @import {CosmosInterchainService} from './cosmos-interchain-service.js';
|
|
16
|
-
* @import {MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
17
|
-
* @import {ChainAddress, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount
|
|
18
|
+
* @import {LocalOrchestrationAccountKit, MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
19
|
+
* @import {ChainAddress, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
|
|
18
20
|
*/
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -70,17 +72,14 @@ const prepareLocalChainFacadeKit = (
|
|
|
70
72
|
return watch(this.state.localChainInfo);
|
|
71
73
|
},
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
// That used to work but got lost in the migration to Exo
|
|
75
|
-
/** @returns {Vow<PromiseToVow<OrchestrationAccount<ChainInfo>>>} */
|
|
75
|
+
/** @returns {Vow<LocalOrchestrationAccountKit['holder']>} */
|
|
76
76
|
makeAccount() {
|
|
77
77
|
const lcaP = E(localchain).makeAccount();
|
|
78
|
-
// TODO #9449 fix types
|
|
79
|
-
// @ts-expect-error Type 'Vow<Voidless>' is not assignable to type 'Vow<OrchestrationAccountI>'.
|
|
80
78
|
return watch(
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
|
|
79
|
+
// XXX makeAccount returns a Promise for an exo but reserves being able to return a vow
|
|
80
|
+
// so we use heapVowE to shorten the promise path
|
|
81
|
+
// eslint-disable-next-line no-restricted-syntax -- will run in one turn
|
|
82
|
+
allVows([lcaP, heapVowE(lcaP).getAddress()]),
|
|
84
83
|
this.facets.makeAccountWatcher,
|
|
85
84
|
);
|
|
86
85
|
},
|
|
@@ -88,43 +88,20 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
88
88
|
onFulfilled(natAmount: Amount<"nat">, denom: DenomAmount["denom"]): DenomAmount;
|
|
89
89
|
};
|
|
90
90
|
holder: {
|
|
91
|
-
asContinuingOffer
|
|
92
|
-
|
|
93
|
-
account: {
|
|
94
|
-
description: string;
|
|
95
|
-
subscriber: globalThis.Subscriber<LocalChainAccountNotification>;
|
|
96
|
-
storagePath: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
invitationMakers: import("@endo/exo").Guarded<{
|
|
100
|
-
/**
|
|
101
|
-
* @param {string} validatorAddress
|
|
102
|
-
* @param {Amount<'nat'>} ertpAmount
|
|
103
|
-
*/
|
|
104
|
-
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<Record<unknown, unknown>>, undefined>>;
|
|
105
|
-
/**
|
|
106
|
-
* @param {string} validatorAddress
|
|
107
|
-
* @param {Amount<'nat'>} ertpAmount
|
|
108
|
-
*/
|
|
109
|
-
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<TimestampRecord>, undefined>>;
|
|
110
|
-
CloseAccount(): never;
|
|
111
|
-
}>;
|
|
112
|
-
holder: import("@endo/exo").Guarded<any>;
|
|
113
|
-
}>;
|
|
91
|
+
/** @type {HostOf<OrchestrationAccountI['asContinuingOffer']>} */
|
|
92
|
+
asContinuingOffer(): Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & import("../utils/zoe-tools.js").ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
|
|
114
93
|
/**
|
|
115
94
|
* TODO: balance lookups for non-vbank assets
|
|
116
95
|
*
|
|
117
|
-
* @type {
|
|
96
|
+
* @type {HostOf<OrchestrationAccountI['getBalance']>}
|
|
118
97
|
*/
|
|
119
|
-
getBalance(denom: import("@agoric/orchestration").DenomArg): Vow<DenomAmount
|
|
120
|
-
getBalances
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
};
|
|
127
|
-
}>;
|
|
98
|
+
getBalance(denom: import("@agoric/orchestration").DenomArg): Vow<DenomAmount extends import("@endo/pass-style").Passable ? DenomAmount : import("@agoric/async-flow").HostInterface<DenomAmount>>;
|
|
99
|
+
/** @type {HostOf<OrchestrationAccountI['getBalances']>} */
|
|
100
|
+
getBalances(): Vow<DenomAmount[] extends import("@endo/pass-style").Passable ? DenomAmount[] : import("@agoric/async-flow").HostInterface<DenomAmount[]>>;
|
|
101
|
+
/**
|
|
102
|
+
* @type {HostOf<OrchestrationAccountI['getPublicTopics']>}
|
|
103
|
+
*/
|
|
104
|
+
getPublicTopics(): Vow<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> : import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
|
|
128
105
|
/**
|
|
129
106
|
* @param {string} validatorAddress
|
|
130
107
|
* @param {Amount<'nat'>} ertpAmount
|
|
@@ -141,17 +118,21 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
141
118
|
* updater will get a special notification that the account is being
|
|
142
119
|
* transferred.
|
|
143
120
|
*/
|
|
144
|
-
/** @type {
|
|
145
|
-
deposit(payment: globalThis.Payment<"nat">, optAmountShape?: globalThis.Pattern): Vow<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount
|
|
146
|
-
/** @type {
|
|
147
|
-
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): Vow<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat"
|
|
148
|
-
/** @type {
|
|
121
|
+
/** @type {HostOf<LocalChainAccount['deposit']>} */
|
|
122
|
+
deposit(payment: globalThis.Payment<"nat">, optAmountShape?: globalThis.Pattern): Vow<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount> extends import("@endo/pass-style").Passable ? import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount> : import("@agoric/async-flow").HostInterface<import("@agoric/ertp/src/types.js").NatAmount | Vow<import("@agoric/ertp/src/types.js").NatAmount>>>;
|
|
123
|
+
/** @type {HostOf<LocalChainAccount['withdraw']>} */
|
|
124
|
+
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): Vow<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">> extends import("@endo/pass-style").Passable ? globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">> : import("@agoric/async-flow").HostInterface<globalThis.Payment<"nat"> | Vow<globalThis.Payment<"nat">>>>;
|
|
125
|
+
/** @type {HostOf<LocalChainAccount['executeTx']>} */
|
|
149
126
|
executeTx(messages: {
|
|
150
127
|
'@type': string;
|
|
151
128
|
}[]): Vow<JsonSafe<{
|
|
152
129
|
'@type': string;
|
|
153
|
-
}>[]
|
|
154
|
-
|
|
130
|
+
}>[] extends import("@endo/pass-style").Passable ? JsonSafe<{
|
|
131
|
+
'@type': string;
|
|
132
|
+
}>[] : import("@agoric/async-flow").HostInterface<JsonSafe<{
|
|
133
|
+
'@type': string;
|
|
134
|
+
}>[]>>;
|
|
135
|
+
/** @type {OrchestrationAccountI['getAddress']} */
|
|
155
136
|
getAddress(): ChainAddress;
|
|
156
137
|
send(toAccount: any, amount: any): Vow<never>;
|
|
157
138
|
/**
|
|
@@ -164,8 +145,8 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
164
145
|
* @returns {Vow<void>}
|
|
165
146
|
*/
|
|
166
147
|
transfer(amount: AmountArg, destination: ChainAddress, opts?: IBCMsgTransferOptions | undefined): Vow<void>;
|
|
167
|
-
/** @type {
|
|
168
|
-
transferSteps(amount: AmountArg, msg: import("@agoric/orchestration").TransferMsg): Vow<void
|
|
148
|
+
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
149
|
+
transferSteps(amount: AmountArg, msg: import("@agoric/orchestration").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
169
150
|
};
|
|
170
151
|
}>;
|
|
171
152
|
export type LocalChainAccountNotification = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AA2EO,0DAPI,IAAI,mBACJ,eAAe,OACf,GAAG,gBACH,OAAO,YAAY,CAAC,mCACpB,QAAQ,YACR,QAAQ;aA6DJ,iBAAiB;aACjB,YAAY;iBACZ,OAAO,WAAW,CAAC;;;QAa1B;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;QAYxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;;QAiBxB;;;;;;WAMG;8BALQ,CACV,SACA,UAAgB,+CAA+C,CAAC,CAC3D,CACF;;;QAcJ;;;WAGG;6DADQ,YAAY;;;QAUvB;;;;;;;;;;WAUG;6DATQ,CACV;YAAM,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;SAAE,EAC7D,MAAU,CACP,iCACO;YACV,WAAe,EAAE,YAAY,CAAC;YAC9B,IAAQ,EAAE,qBAAqB,CAAC;YAChC,MAAU,EAAE,WAAW,CAAC;SACrB;;;;IA4BN;;;OAGG;;QAED;;WAEG;6BADQ,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;;IAQvC;;;OAGG;;QAED;;WAEG;6BADQ,OAAO;;IAMpB;;;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;;;QAWlD;;;;;;;;WAQG;yBAPQ,SAAS,eAET,YAAY,6CAIV,IAAI,IAAI,CAAC;QA8BtB,6DAA6D;;;GAWpE;;aAzba,MAAM;;oBAIP;IACZ,QAAY,EAAE,YAAY,6BAA6B,CAAC,CAAC;IACzD,OAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAW,EAAE,YAAY,CAAC;CACvB;+CAkbU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BA5cnC,cAAc;qCADU,6CAA6C;kCAIhC,cAAc;4BAFjD,kBAAkB;8BAGC,aAAa;8BAG9B,gBAAgB;uCAVP,gCAAgC;kCACqF,uBAAuB;yBAMpI,aAAa;qCADG,cAAc;+BAEpC,sBAAsB;8BAAtB,sBAAsB;+BAP6F,uBAAuB;uCAAvB,uBAAuB;2CAAvB,uBAAuB;iCAAvB,uBAAuB;+BAAvB,uBAAuB;iCACjI,6CAA6C"}
|
|
@@ -19,14 +19,17 @@ import { orchestrationAccountMethods } from '../utils/orchestrationAccount.js';
|
|
|
19
19
|
import { makeTimestampHelper } from '../utils/time.js';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
+
* @import {HostOf} from '@agoric/async-flow';
|
|
22
23
|
* @import {LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
23
|
-
* @import {AmountArg, ChainAddress, DenomAmount, IBCMsgTransferOptions, OrchestrationAccount, ChainInfo, IBCConnectionInfo,
|
|
24
|
+
* @import {AmountArg, ChainAddress, DenomAmount, IBCMsgTransferOptions, OrchestrationAccount, ChainInfo, IBCConnectionInfo, OrchestrationAccountI} from '@agoric/orchestration';
|
|
24
25
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'.
|
|
25
26
|
* @import {Zone} from '@agoric/zone';
|
|
26
27
|
* @import {Remote} from '@agoric/internal';
|
|
28
|
+
* @import {InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
27
29
|
* @import {TimerService, TimerBrand, TimestampRecord} from '@agoric/time';
|
|
28
30
|
* @import {PromiseVow, Vow, VowTools} from '@agoric/vow';
|
|
29
31
|
* @import {TypedJson, JsonSafe} from '@agoric/cosmic-proto';
|
|
32
|
+
* @import {Matcher} from '@endo/patterns';
|
|
30
33
|
* @import {ChainHub} from './chain-hub.js';
|
|
31
34
|
*/
|
|
32
35
|
|
|
@@ -57,7 +60,7 @@ const HolderI = M.interface('holder', {
|
|
|
57
60
|
executeTx: M.call(M.arrayOf(M.record())).returns(Vow$(M.record())),
|
|
58
61
|
});
|
|
59
62
|
|
|
60
|
-
/** @type {{ [name: string]: [description: string, valueShape:
|
|
63
|
+
/** @type {{ [name: string]: [description: string, valueShape: Matcher] }} */
|
|
61
64
|
const PUBLIC_TOPICS = {
|
|
62
65
|
account: ['Account holder status', M.any()],
|
|
63
66
|
};
|
|
@@ -136,7 +139,6 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
136
139
|
*/
|
|
137
140
|
({ account, address, storageNode }) => {
|
|
138
141
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
139
|
-
// @ts-expect-error XXX Patterns
|
|
140
142
|
const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]);
|
|
141
143
|
// TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066
|
|
142
144
|
void E(topicKit.recorder).write('');
|
|
@@ -287,12 +289,18 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
287
289
|
},
|
|
288
290
|
},
|
|
289
291
|
holder: {
|
|
292
|
+
/** @type {HostOf<OrchestrationAccountI['asContinuingOffer']>} */
|
|
290
293
|
asContinuingOffer() {
|
|
291
294
|
// getPublicTopics resolves promptly (same run), so we don't need a watcher
|
|
292
295
|
// eslint-disable-next-line no-restricted-syntax
|
|
293
296
|
return asVow(async () => {
|
|
294
297
|
await null;
|
|
295
|
-
const { holder, invitationMakers } = this.facets;
|
|
298
|
+
const { holder, invitationMakers: im } = this.facets;
|
|
299
|
+
// XXX cast to a type that has string index signature
|
|
300
|
+
const invitationMakers = /** @type {InvitationMakers} */ (
|
|
301
|
+
/** @type {unknown} */ (im)
|
|
302
|
+
);
|
|
303
|
+
|
|
296
304
|
return harden({
|
|
297
305
|
// getPublicTopics returns a vow, for membrane compatibility.
|
|
298
306
|
// it's safe to unwrap to a promise and get the result as we
|
|
@@ -306,7 +314,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
306
314
|
/**
|
|
307
315
|
* TODO: balance lookups for non-vbank assets
|
|
308
316
|
*
|
|
309
|
-
* @type {
|
|
317
|
+
* @type {HostOf<OrchestrationAccountI['getBalance']>}
|
|
310
318
|
*/
|
|
311
319
|
getBalance(denomArg) {
|
|
312
320
|
// FIXME look up real values
|
|
@@ -322,11 +330,15 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
322
330
|
denom,
|
|
323
331
|
);
|
|
324
332
|
},
|
|
333
|
+
/** @type {HostOf<OrchestrationAccountI['getBalances']>} */
|
|
325
334
|
getBalances() {
|
|
326
335
|
// TODO https://github.com/Agoric/agoric-sdk/issues/9610
|
|
327
336
|
return asVow(() => Fail`not yet implemented`);
|
|
328
337
|
},
|
|
329
338
|
|
|
339
|
+
/**
|
|
340
|
+
* @type {HostOf<OrchestrationAccountI['getPublicTopics']>}
|
|
341
|
+
*/
|
|
330
342
|
getPublicTopics() {
|
|
331
343
|
// getStoragePath resolves promptly (same run), so we don't need a watcher
|
|
332
344
|
// eslint-disable-next-line no-restricted-syntax
|
|
@@ -342,6 +354,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
342
354
|
});
|
|
343
355
|
});
|
|
344
356
|
},
|
|
357
|
+
// FIXME take ChainAddress to match OrchestrationAccountI
|
|
345
358
|
/**
|
|
346
359
|
* @param {string} validatorAddress
|
|
347
360
|
* @param {Amount<'nat'>} ertpAmount
|
|
@@ -365,6 +378,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
365
378
|
this.facets.extractFirstResultWatcher,
|
|
366
379
|
);
|
|
367
380
|
},
|
|
381
|
+
// FIXME take ChainAddress to match OrchestrationAccountI
|
|
368
382
|
/**
|
|
369
383
|
* @param {string} validatorAddress
|
|
370
384
|
* @param {Amount<'nat'>} ertpAmount
|
|
@@ -393,22 +407,22 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
393
407
|
* updater will get a special notification that the account is being
|
|
394
408
|
* transferred.
|
|
395
409
|
*/
|
|
396
|
-
/** @type {
|
|
410
|
+
/** @type {HostOf<LocalChainAccount['deposit']>} */
|
|
397
411
|
deposit(payment) {
|
|
398
412
|
return watch(
|
|
399
413
|
E(this.state.account).deposit(payment),
|
|
400
414
|
this.facets.returnVoidWatcher,
|
|
401
415
|
);
|
|
402
416
|
},
|
|
403
|
-
/** @type {
|
|
417
|
+
/** @type {HostOf<LocalChainAccount['withdraw']>} */
|
|
404
418
|
withdraw(amount) {
|
|
405
419
|
return watch(E(this.state.account).withdraw(amount));
|
|
406
420
|
},
|
|
407
|
-
/** @type {
|
|
421
|
+
/** @type {HostOf<LocalChainAccount['executeTx']>} */
|
|
408
422
|
executeTx(messages) {
|
|
409
423
|
return watch(E(this.state.account).executeTx(messages));
|
|
410
424
|
},
|
|
411
|
-
/** @type {
|
|
425
|
+
/** @type {OrchestrationAccountI['getAddress']} */
|
|
412
426
|
getAddress() {
|
|
413
427
|
return this.state.address;
|
|
414
428
|
},
|
|
@@ -456,7 +470,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
456
470
|
return watch(transferV, this.facets.returnVoidWatcher);
|
|
457
471
|
});
|
|
458
472
|
},
|
|
459
|
-
/** @type {
|
|
473
|
+
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
460
474
|
transferSteps(amount, msg) {
|
|
461
475
|
return asVow(() => {
|
|
462
476
|
console.log('transferSteps got', amount, msg);
|