@agoric/orchestration 0.2.0-upgrade-17-dev-a1453b2.0 → 0.2.0-upgrade-18-dev-bf39b10.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/index.d.ts +1 -1
- package/index.js +2 -1
- package/package.json +29 -28
- package/src/chain-info.d.ts +31 -387
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +10 -64
- package/src/cosmos-api.d.ts +21 -10
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +33 -14
- package/src/examples/README.md +3 -4
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +4 -7
- package/src/examples/auto-stake-it.contract.d.ts +1 -1
- package/src/examples/auto-stake-it.flows.d.ts +1 -1
- package/src/examples/auto-stake-it.flows.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.d.ts +1 -1
- package/src/examples/basic-flows.flows.d.ts +1 -1
- package/src/examples/send-anywhere.contract.d.ts +20 -2
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +34 -18
- package/src/examples/send-anywhere.flows.d.ts +7 -7
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +40 -20
- package/src/examples/shared.flows.d.ts +4 -0
- package/src/examples/shared.flows.d.ts.map +1 -0
- package/src/examples/shared.flows.js +21 -0
- package/src/examples/stake-bld.contract.d.ts +49 -0
- package/src/examples/stake-bld.contract.d.ts.map +1 -0
- package/src/examples/{stakeBld.contract.js → stake-bld.contract.js} +10 -1
- package/src/examples/stake-ica.contract.d.ts +126 -0
- package/src/examples/stake-ica.contract.d.ts.map +1 -0
- package/src/examples/{stakeIca.contract.js → stake-ica.contract.js} +6 -2
- package/src/examples/staking-combinations.contract.d.ts +1 -1
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +16 -13
- package/src/examples/staking-combinations.flows.d.ts +6 -9
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +19 -16
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +0 -1
- package/src/examples/unbond.contract.d.ts +1 -1
- package/src/examples/unbond.contract.d.ts.map +1 -1
- package/src/examples/unbond.contract.js +10 -5
- package/src/examples/unbond.flows.d.ts +4 -3
- package/src/examples/unbond.flows.d.ts.map +1 -1
- package/src/examples/unbond.flows.js +23 -31
- package/src/exos/chain-hub.d.ts +12 -4
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +28 -19
- package/src/exos/combine-invitation-makers.d.ts +1 -0
- package/src/exos/combine-invitation-makers.d.ts.map +1 -1
- package/src/exos/combine-invitation-makers.js +6 -0
- package/src/exos/cosmos-interchain-service.d.ts +20 -70
- package/src/exos/cosmos-interchain-service.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.d.ts +152 -47
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +355 -13
- package/src/exos/exo-interfaces.d.ts +3 -3
- package/src/exos/exo-interfaces.d.ts.map +1 -1
- package/src/exos/exo-interfaces.ts +3 -3
- package/src/exos/ica-account-kit.d.ts +2 -2
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/icq-connection-kit.d.ts +17 -1
- package/src/exos/icq-connection-kit.d.ts.map +1 -1
- package/src/exos/local-chain-facade.d.ts +22 -170
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.d.ts +41 -48
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +94 -13
- package/src/exos/orchestrator.d.ts +44 -136
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +42 -44
- package/src/exos/packet-tools.d.ts +21 -81
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/portfolio-holder-kit.d.ts +4 -4
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/portfolio-holder-kit.js +65 -10
- package/src/exos/remote-chain-facade.d.ts +35 -128
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +7 -0
- package/src/fetched-chain-info.d.ts +30 -340
- package/src/fetched-chain-info.js +18 -329
- package/src/fixtures/query-flows.flows.d.ts.map +1 -1
- package/src/orchestration-api.d.ts +4 -8
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +3 -8
- package/src/proposals/init-chain-info.js +3 -3
- package/src/proposals/orchestration-proposal.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.d.ts +78 -16
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +9 -4
- package/src/proposals/start-stakeBld.d.ts +13 -39
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.js +2 -2
- package/src/proposals/start-stakeOsmo.d.ts +77 -15
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.js +9 -4
- package/src/typeGuards.d.ts +5 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +21 -9
- package/src/types-index.d.ts +1 -0
- package/src/types-index.js +1 -0
- package/src/types.d.ts +14 -4
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +15 -4
- package/src/utils/cosmos.d.ts +40 -1
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +48 -1
- package/src/utils/orchestrationAccount.js +1 -1
- package/src/utils/registry.d.ts.map +1 -1
- package/src/utils/registry.js +0 -3
- package/src/utils/start-helper.d.ts +4 -10
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +18 -15
- package/src/utils/zcf-tools.d.ts +5 -0
- package/src/utils/zcf-tools.d.ts.map +1 -0
- package/src/utils/zcf-tools.js +35 -0
- package/src/utils/zoe-tools.d.ts +5 -8
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +136 -33
- package/src/vat-orchestration.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.d.ts +0 -75
- package/src/examples/stakeBld.contract.d.ts.map +0 -1
- package/src/examples/stakeIca.contract.d.ts +0 -64
- package/src/examples/stakeIca.contract.d.ts.map +0 -1
package/src/utils/zoe-tools.js
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file Helper functions for transferring payments between a LocalChainAccount
|
|
3
|
+
* and a ZCFSeat.
|
|
4
|
+
*
|
|
5
|
+
* Maintainers: This exists as an endowment for orchestrated async-flows so we
|
|
6
|
+
* can make use of E and promises. The logic for recovering partial failures
|
|
7
|
+
* is also an added convenience for developers.
|
|
8
|
+
*
|
|
9
|
+
* Functions are written using `asVow` and non-resumable promises as we expect
|
|
10
|
+
* each invocation to resolve promptly - there are no timers or interchain
|
|
11
|
+
* network calls.
|
|
12
|
+
*
|
|
13
|
+
* A promise resolved promptly is currently safe from being severed by an
|
|
14
|
+
* upgrade because we only trigger vat upgrades as the result of network
|
|
15
|
+
* input.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { makeError, q, Fail } from '@endo/errors';
|
|
19
|
+
import { depositToSeat } from '@agoric/zoe/src/contractSupport/index.js';
|
|
3
20
|
import { E } from '@endo/far';
|
|
4
21
|
|
|
22
|
+
const { assign, keys, values } = Object;
|
|
23
|
+
|
|
5
24
|
/**
|
|
25
|
+
* @import {HostOf} from '@agoric/async-flow';
|
|
6
26
|
* @import {InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
7
27
|
* @import {ResolvedPublicTopic} from '@agoric/zoe/src/contractSupport/topics.js';
|
|
8
|
-
* @import {
|
|
9
|
-
* @import {Zone} from '@agoric/zone';
|
|
10
|
-
* @import {OrchestrationAccount} from '../orchestration-api.js'
|
|
28
|
+
* @import {VowTools} from '@agoric/vow';
|
|
11
29
|
* @import {LocalAccountMethods} from '../types.js';
|
|
12
30
|
*/
|
|
13
31
|
|
|
@@ -24,60 +42,145 @@ import { E } from '@endo/far';
|
|
|
24
42
|
* @typedef {(
|
|
25
43
|
* srcSeat: ZCFSeat,
|
|
26
44
|
* localAccount: LocalAccountMethods,
|
|
27
|
-
*
|
|
45
|
+
* amounts: AmountKeywordRecord,
|
|
28
46
|
* ) => Promise<void>} LocalTransfer
|
|
29
47
|
*/
|
|
30
48
|
|
|
31
49
|
/**
|
|
32
|
-
* @
|
|
33
|
-
*
|
|
50
|
+
* @typedef {(
|
|
51
|
+
* localAccount: LocalAccountMethods,
|
|
52
|
+
* destSeat: ZCFSeat,
|
|
53
|
+
* amounts: AmountKeywordRecord,
|
|
54
|
+
* ) => Promise<void>} WithdrawToSeat
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param {ZCF} zcf
|
|
59
|
+
* @param {VowTools} vowTools
|
|
34
60
|
*/
|
|
35
|
-
export const makeZoeTools = (
|
|
61
|
+
export const makeZoeTools = (zcf, { when, allVows, allSettled, asVow }) => {
|
|
36
62
|
/**
|
|
37
|
-
* Transfer the `
|
|
63
|
+
* Transfer the `amounts` from `srcSeat` to `localAccount`. If any of the
|
|
64
|
+
* deposits fail, everything will be rolled back to the `srcSeat`. Supports
|
|
65
|
+
* multiple items in the `amounts` {@link AmountKeywordRecord}.
|
|
66
|
+
*
|
|
67
|
+
* @type {HostOf<LocalTransfer>}
|
|
38
68
|
*/
|
|
39
|
-
const localTransfer =
|
|
40
|
-
|
|
41
|
-
'localTransfer',
|
|
42
|
-
/**
|
|
43
|
-
* @type {LocalTransfer}
|
|
44
|
-
*/
|
|
45
|
-
async (srcSeat, localAccount, give) => {
|
|
69
|
+
const localTransfer = (srcSeat, localAccount, amounts) =>
|
|
70
|
+
asVow(async () => {
|
|
46
71
|
!srcSeat.hasExited() || Fail`The seat cannot have exited.`;
|
|
47
72
|
const { zcfSeat: tempSeat, userSeat: userSeatP } = zcf.makeEmptySeatKit();
|
|
48
73
|
const userSeat = await userSeatP;
|
|
49
|
-
|
|
74
|
+
zcf.atomicRearrange(harden([[srcSeat, tempSeat, amounts]]));
|
|
50
75
|
tempSeat.exit();
|
|
51
|
-
// TODO get the userSeat into baggage so it's at least recoverable
|
|
76
|
+
// TODO (#9541) get the userSeat into baggage so it's at least recoverable
|
|
52
77
|
// const userSeat = await subzone.makeOnce(
|
|
53
78
|
// 'localTransferHelper',
|
|
54
79
|
// async () => {
|
|
55
80
|
// const { zcfSeat: tempSeat, userSeat: userSeatP } =
|
|
56
81
|
// zcf.makeEmptySeatKit();
|
|
57
82
|
// const uSeat = await userSeatP;
|
|
58
|
-
// // TODO how do I store in the place for this
|
|
59
|
-
// atomicTransfer(zcf, srcSeat, tempSeat,
|
|
83
|
+
// // TODO how do I store in the place for this retryable?
|
|
84
|
+
// atomicTransfer(zcf, srcSeat, tempSeat, amounts);
|
|
60
85
|
// tempSeat.exit();
|
|
61
86
|
// return uSeat;
|
|
62
87
|
// },
|
|
63
88
|
// );
|
|
64
89
|
|
|
65
|
-
// Now all the `
|
|
90
|
+
// Now all the `amounts` are accessible, so we can move them to the localAccount
|
|
91
|
+
const payments = await Promise.all(
|
|
92
|
+
keys(amounts).map(kw => E(userSeat).getPayout(kw)),
|
|
93
|
+
);
|
|
94
|
+
const settleDeposits = await when(
|
|
95
|
+
allSettled(payments.map(pmt => E(localAccount).deposit(pmt))),
|
|
96
|
+
);
|
|
97
|
+
// if any of the deposits to localAccount failed, unwind all of the allocations
|
|
98
|
+
if (settleDeposits.find(x => x.status === 'rejected')) {
|
|
99
|
+
const amts = values(amounts);
|
|
100
|
+
const errors = [];
|
|
101
|
+
// withdraw the successfully deposited payments
|
|
102
|
+
const paymentsOrWithdrawVs = settleDeposits.map((x, i) => {
|
|
103
|
+
if (x.status === 'rejected') {
|
|
104
|
+
errors.push(x.reason);
|
|
105
|
+
return payments[i];
|
|
106
|
+
}
|
|
107
|
+
return E(localAccount).withdraw(amts[i]);
|
|
108
|
+
});
|
|
66
109
|
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
110
|
+
// return all payments to the srcSeat
|
|
111
|
+
const paymentsToReturn = await when(allVows(paymentsOrWithdrawVs));
|
|
112
|
+
const paymentKwr = harden(
|
|
113
|
+
keys(amounts).reduce(
|
|
114
|
+
(kwr, kw, i) => assign(kwr, { [kw]: paymentsToReturn[i] }),
|
|
115
|
+
{},
|
|
116
|
+
),
|
|
117
|
+
);
|
|
118
|
+
const depositResponse = await depositToSeat(
|
|
119
|
+
zcf,
|
|
120
|
+
srcSeat,
|
|
121
|
+
amounts,
|
|
122
|
+
paymentKwr,
|
|
123
|
+
);
|
|
124
|
+
console.debug(depositResponse);
|
|
125
|
+
throw makeError(`One or more deposits failed ${q(errors)}`);
|
|
126
|
+
}
|
|
127
|
+
// TODO #9541 remove userSeat from baggage
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Transfer the `amounts` from a `localAccount` to the `recipientSeat`. If any
|
|
132
|
+
* of the withdrawals fail, everything will be rolled back to the
|
|
133
|
+
* `srcLocalAccount`. Supports multiple items in the `amounts`
|
|
134
|
+
* {@link PaymentKeywordRecord}
|
|
135
|
+
*
|
|
136
|
+
* @type {HostOf<WithdrawToSeat>}
|
|
137
|
+
*/
|
|
138
|
+
const withdrawToSeat = (localAccount, destSeat, amounts) =>
|
|
139
|
+
asVow(async () => {
|
|
140
|
+
!destSeat.hasExited() || Fail`The seat cannot have exited.`;
|
|
141
|
+
|
|
142
|
+
const settledWithdrawals = await when(
|
|
143
|
+
allSettled(values(amounts).map(amt => E(localAccount).withdraw(amt))),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
// if any of the withdrawals were rejected, unwind the successful ones
|
|
147
|
+
if (settledWithdrawals.find(x => x.status === 'rejected')) {
|
|
148
|
+
const returnPaymentVs = [];
|
|
149
|
+
const errors = [];
|
|
150
|
+
for (const result of settledWithdrawals) {
|
|
151
|
+
if (result.status === 'fulfilled') {
|
|
152
|
+
returnPaymentVs.push(E(localAccount).deposit(result.value));
|
|
153
|
+
} else {
|
|
154
|
+
errors.push(result.reason);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
await when(allVows(returnPaymentVs));
|
|
158
|
+
throw makeError(`One or more withdrawals failed ${q(errors)}`);
|
|
159
|
+
}
|
|
160
|
+
// successfully withdrew payments from srcLocalAccount, deposit to recipientSeat
|
|
161
|
+
const paymentKwr = harden(
|
|
162
|
+
keys(amounts).reduce(
|
|
163
|
+
(acc, kw, i) =>
|
|
164
|
+
assign(acc, {
|
|
165
|
+
[kw]: /** @type {{ value: Amount }[]} */ (settledWithdrawals)[i]
|
|
166
|
+
.value,
|
|
167
|
+
}),
|
|
168
|
+
{},
|
|
169
|
+
),
|
|
170
|
+
);
|
|
171
|
+
const depositResponse = await depositToSeat(
|
|
172
|
+
zcf,
|
|
173
|
+
destSeat,
|
|
174
|
+
amounts,
|
|
175
|
+
paymentKwr,
|
|
176
|
+
);
|
|
177
|
+
console.debug(depositResponse);
|
|
178
|
+
});
|
|
78
179
|
|
|
79
180
|
return harden({
|
|
80
181
|
localTransfer,
|
|
182
|
+
withdrawToSeat,
|
|
81
183
|
});
|
|
82
184
|
};
|
|
185
|
+
|
|
83
186
|
/** @typedef {ReturnType<typeof makeZoeTools>} ZoeTools */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-orchestration.d.ts","sourceRoot":"","sources":["vat-orchestration.js"],"names":[],"mappings":"AAmBO,2CANI,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"vat-orchestration.d.ts","sourceRoot":"","sources":["vat-orchestration.js"],"names":[],"mappings":"AAmBO,2CANI,SAAS,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;CACX,iBACO,KAAK,WACL,OAAO;IAWd,4DAA4D;;;;;;IAA5D,4DAA4D;;;;;GAK/D;+BAEa,UAAU,CAAC,OAAO,eAAe,CAAC;6BA7BtB,kBAAkB;yCACN,qCAAqC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export function start(zcf: ZCF, privateArgs: {
|
|
2
|
-
agoricNames: Remote<NameHub>;
|
|
3
|
-
localchain: Remote<LocalChain>;
|
|
4
|
-
marshaller: Marshaller;
|
|
5
|
-
storageNode: StorageNode;
|
|
6
|
-
timerService: TimerService;
|
|
7
|
-
}, baggage: import("@agoric/vat-data").Baggage): Promise<{
|
|
8
|
-
publicFacet: import("@endo/exo").Guarded<{
|
|
9
|
-
/**
|
|
10
|
-
* Invitation to make an account, initialized with the give's BLD
|
|
11
|
-
*/
|
|
12
|
-
makeStakeBldInvitation(): Promise<Invitation<import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>, undefined>>;
|
|
13
|
-
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
14
|
-
asContinuingOffer(): import("@agoric/vow").Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult extends import("@endo/marshal").Passable ? import("@endo/marshal").Passable & import("../utils/zoe-tools.js").ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
|
|
15
|
-
getBalance(denom: import("../orchestration-api.js").DenomArg): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount extends import("@endo/marshal").Passable ? import("../orchestration-api.js").DenomAmount : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount>>;
|
|
16
|
-
getBalances(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/marshal").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
17
|
-
getPublicTopics(): import("@agoric/vow").Vow<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> extends import("@endo/marshal").Passable ? import("@endo/marshal").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>>>>;
|
|
18
|
-
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): import("@agoric/vow").Vow<Record<unknown, unknown>>;
|
|
19
|
-
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): import("@agoric/vow").Vow<void | import("@agoric/time").TimestampRecord>;
|
|
20
|
-
deposit(payment: globalThis.ERef<globalThis.Payment<"nat">>, optAmountShape?: globalThis.Pattern): import("@agoric/vow").Vow<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/vow").Vow<import("@agoric/ertp/src/types.js").NatAmount> extends import("@endo/marshal").Passable ? import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/vow").Vow<import("@agoric/ertp/src/types.js").NatAmount> : import("@agoric/async-flow").HostInterface<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/vow").Vow<import("@agoric/ertp/src/types.js").NatAmount>>>;
|
|
21
|
-
withdraw(amount: import("@agoric/ertp/src/types.js").NatAmount): import("@agoric/vow").Vow<globalThis.Payment<"nat"> | import("@agoric/vow").Vow<globalThis.Payment<"nat">> extends import("@endo/marshal").Passable ? globalThis.Payment<"nat"> | import("@agoric/vow").Vow<globalThis.Payment<"nat">> : import("@agoric/async-flow").HostInterface<globalThis.Payment<"nat"> | import("@agoric/vow").Vow<globalThis.Payment<"nat">>>>;
|
|
22
|
-
executeTx(messages: {
|
|
23
|
-
'@type': string;
|
|
24
|
-
}[]): import("@agoric/vow").Vow<import("@agoric/cosmic-proto").JsonSafe<{
|
|
25
|
-
'@type': string;
|
|
26
|
-
}>[] extends import("@endo/marshal").Passable ? import("@agoric/cosmic-proto").JsonSafe<{
|
|
27
|
-
'@type': string;
|
|
28
|
-
}>[] : import("@agoric/async-flow").HostInterface<import("@agoric/cosmic-proto").JsonSafe<{
|
|
29
|
-
'@type': string;
|
|
30
|
-
}>[]>>;
|
|
31
|
-
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
32
|
-
send(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/marshal").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
33
|
-
sendAll(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void extends import("@endo/marshal").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
34
|
-
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<any>;
|
|
35
|
-
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/marshal").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
36
|
-
sendThenWaitForAck(packetSender: Remote<import("../exos/packet-tools.js").PacketSender>, opts?: import("../exos/packet-tools.js").PacketOptions | undefined): import("@agoric/async-flow").HostInterface<import("@agoric/vow").Vow<any>>;
|
|
37
|
-
matchFirstPacket(args_0?: import("@agoric/vow").EVow<globalThis.Pattern>): import("@agoric/async-flow").HostInterface<import("@agoric/vow").Vow<{
|
|
38
|
-
resolver: import("@agoric/vow").VowResolver<any>;
|
|
39
|
-
match: import("@agoric/vow").Vow<any>;
|
|
40
|
-
}>>;
|
|
41
|
-
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): import("@agoric/vow").Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration | import("@agoric/vow").Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration> extends import("@endo/marshal").Passable ? (string & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (string & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
42
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
43
|
-
}) | (number & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (number & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
44
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
45
|
-
}) | (bigint & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
46
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
47
|
-
}) | (true & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (true & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
48
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
49
|
-
}) | (symbol & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (symbol & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
50
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
51
|
-
}) | (void & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (void & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
52
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
53
|
-
}) | (Error & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Error & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
54
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
55
|
-
}) | (Promise<any> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
56
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
57
|
-
}) | (import("@endo/marshal").RemotableObject<string> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyArrayI<import("@endo/marshal").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyArrayI<import("@endo/marshal").PassableCap, Error> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
58
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
59
|
-
}) | (import("@endo/marshal").CopyRecordI<import("@endo/marshal").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyRecordI<import("@endo/marshal").PassableCap, Error> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
60
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
61
|
-
}) | (import("@endo/marshal").CopyTaggedI<import("@endo/marshal").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyTaggedI<import("@endo/marshal").PassableCap, Error> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
62
|
-
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
63
|
-
}) : import("@agoric/async-flow").HostInterface<import("@agoric/vats/src/bridge-target.js").TargetRegistration | import("@agoric/vow").Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>>>;
|
|
64
|
-
}>>;
|
|
65
|
-
/**
|
|
66
|
-
* Invitation to make an account, without any funds
|
|
67
|
-
*/
|
|
68
|
-
makeAccountInvitationMaker(): Promise<Invitation<import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>, undefined>>;
|
|
69
|
-
}>;
|
|
70
|
-
}>;
|
|
71
|
-
import type { NameHub } from '@agoric/vats';
|
|
72
|
-
import type { Remote } from '@agoric/internal';
|
|
73
|
-
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
74
|
-
import type { TimerService } from '@agoric/time';
|
|
75
|
-
//# sourceMappingURL=stakeBld.contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAmCO,2BAVI,GAAG,eACH;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,UAAc,EAAE,UAAU,CAAC;IAC3B,WAAe,EAAE,WAAW,CAAC;IAC7B,YAAgB,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAgEvC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0BH;;WAEG;;;GAaR;6BA5HyB,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import {Baggage} from '@agoric/vat-data';
|
|
3
|
-
* @import {Remote} from '@agoric/internal';
|
|
4
|
-
* @import {IBCConnectionID, NameHub} from '@agoric/vats';
|
|
5
|
-
* @import {TimerService} from '@agoric/time';
|
|
6
|
-
* @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js';
|
|
7
|
-
* @import {ICQConnection, CosmosInterchainService, ChainHub} from '../types.js';
|
|
8
|
-
*/
|
|
9
|
-
/** @type {ContractMeta<typeof start>} */
|
|
10
|
-
export const meta: ContractMeta<typeof start>;
|
|
11
|
-
export const privateArgsShape: {
|
|
12
|
-
agoricNames: globalThis.Pattern;
|
|
13
|
-
cosmosInterchainService: globalThis.Pattern;
|
|
14
|
-
storageNode: globalThis.Pattern;
|
|
15
|
-
marshaller: globalThis.Pattern;
|
|
16
|
-
timer: globalThis.Pattern;
|
|
17
|
-
} | undefined;
|
|
18
|
-
export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
19
|
-
agoricNames: Remote<NameHub>;
|
|
20
|
-
cosmosInterchainService: CosmosInterchainService;
|
|
21
|
-
storageNode: StorageNode;
|
|
22
|
-
marshaller: Marshaller;
|
|
23
|
-
timer: TimerService;
|
|
24
|
-
}, baggage: Baggage): Promise<{
|
|
25
|
-
publicFacet: import("@endo/exo").Guarded<{
|
|
26
|
-
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
27
|
-
asContinuingOffer(): import("@agoric/vow").Vow<ResolvedContinuingOfferResult extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<ResolvedContinuingOfferResult>>;
|
|
28
|
-
getPublicTopics(): import("@agoric/vow").Vow<Record<string, import("@agoric/zoe/src/contractSupport").ResolvedPublicTopic<unknown>> extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & Record<string, import("@agoric/zoe/src/contractSupport").ResolvedPublicTopic<unknown>> : import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport").ResolvedPublicTopic<unknown>>>>;
|
|
29
|
-
getAddress(): import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").ChainAddress>;
|
|
30
|
-
delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
31
|
-
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
32
|
-
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): import("@agoric/vow").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[]>>;
|
|
33
|
-
getBalance(denom: import("../orchestration-api.js").DenomArg): import("@agoric/vow").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>>;
|
|
34
|
-
getBalances(): import("@agoric/vow").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
|
-
send(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
36
|
-
sendAll(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
37
|
-
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
38
|
-
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
39
|
-
withdrawRewards(): import("@agoric/vow").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[]>>;
|
|
40
|
-
undelegate(delegations: {
|
|
41
|
-
amount: import("../orchestration-api.js").AmountArg;
|
|
42
|
-
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
43
|
-
}[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
44
|
-
deactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
45
|
-
reactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
46
|
-
}>>;
|
|
47
|
-
makeAccountInvitationMaker(): Promise<Invitation<ResolvedContinuingOfferResult, undefined>>;
|
|
48
|
-
}>;
|
|
49
|
-
}>;
|
|
50
|
-
export type StakeIcaTerms = {
|
|
51
|
-
chainId: string;
|
|
52
|
-
hostConnectionId: IBCConnectionID;
|
|
53
|
-
controllerConnectionId: IBCConnectionID;
|
|
54
|
-
icqEnabled: boolean;
|
|
55
|
-
};
|
|
56
|
-
export type StakeIcaSF = typeof start;
|
|
57
|
-
import type { NameHub } from '@agoric/vats';
|
|
58
|
-
import type { Remote } from '@agoric/internal';
|
|
59
|
-
import type { CosmosInterchainService } from '../types.js';
|
|
60
|
-
import type { TimerService } from '@agoric/time';
|
|
61
|
-
import type { Baggage } from '@agoric/vat-data';
|
|
62
|
-
import type { ResolvedContinuingOfferResult } from '../utils/zoe-tools.js';
|
|
63
|
-
import type { IBCConnectionID } from '@agoric/vats';
|
|
64
|
-
//# sourceMappingURL=stakeIca.contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAelC;AAEH;;;;;;cAAsD;AAuB/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;;;;;;;;;;;;;;;;;;;;;;;;;GAqGjB;4BAtHY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,UAAc,EAAE,OAAO,CAAC;CACrB;yBAoHU,OAAO,KAAK;6BApJiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
|