@agoric/orchestration 0.1.1-dev-3e9ff43.0 → 0.1.1-dev-c04c91c.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/send-anywhere.contract.d.ts +1 -1
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +5 -5
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.js +3 -0
- package/src/exos/local-orchestration-account.d.ts +18 -1
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +82 -3
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/typeGuards.d.ts +5 -0
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +10 -0
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +9 -1
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-c04c91c.0+c04c91c",
|
|
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-c04c91c.0+c04c91c",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-c04c91c.0+c04c91c",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-c04c91c.0+c04c91c",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-c04c91c.0+c04c91c",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-c04c91c.0+c04c91c",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-c04c91c.0+c04c91c",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-c04c91c.0+c04c91c",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-c04c91c.0+c04c91c",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-c04c91c.0+c04c91c",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-c04c91c.0+c04c91c",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-c04c91c.0+c04c91c",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-c04c91c.0+c04c91c",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-c04c91c.0+c04c91c",
|
|
49
49
|
"@endo/base64": "^1.0.7",
|
|
50
50
|
"@endo/errors": "^1.2.5",
|
|
51
51
|
"@endo/far": "^1.1.5",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "^1.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-c04c91c.0+c04c91c",
|
|
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": 97.6
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "c04c91c35e863e39728454326b95f00fc4f09d3e"
|
|
98
98
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @import {Zone} from '@agoric/zone';
|
|
3
3
|
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
4
4
|
*/
|
|
5
|
-
export const
|
|
5
|
+
export const SingleNatAmountRecord: import("@endo/patterns").Matcher;
|
|
6
6
|
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
|
|
7
7
|
marshaller: Marshaller;
|
|
8
8
|
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-anywhere.contract.d.ts","sourceRoot":"","sources":["send-anywhere.contract.js"],"names":[],"mappings":"AAQA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"send-anywhere.contract.d.ts","sourceRoot":"","sources":["send-anywhere.contract.js"],"names":[],"mappings":"AAQA;;;GAGG;AAEH,qEAKE;AAsDF;gBA9CiB,UAAU;;;;;;;;;;;;;;;;;;;GA8CsB;yCA9DS,0BAA0B"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { makeSharedStateRecord } from '@agoric/async-flow';
|
|
2
|
-
import { AmountShape } from '@agoric/ertp';
|
|
3
2
|
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
4
3
|
import { M } from '@endo/patterns';
|
|
5
4
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
6
5
|
import * as flows from './send-anywhere.flows.js';
|
|
7
6
|
import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
7
|
+
import { AnyNatAmountShape } from '../typeGuards.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @import {Zone} from '@agoric/zone';
|
|
11
11
|
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
export const
|
|
15
|
-
M.recordOf(M.string(),
|
|
14
|
+
export const SingleNatAmountRecord = M.and(
|
|
15
|
+
M.recordOf(M.string(), AnyNatAmountShape, {
|
|
16
16
|
numPropertiesLimit: 1,
|
|
17
17
|
}),
|
|
18
18
|
M.not(harden({})),
|
|
19
19
|
);
|
|
20
|
-
harden(
|
|
20
|
+
harden(SingleNatAmountRecord);
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Orchestration contract to be wrapped by withOrchestration for Zoe
|
|
@@ -61,7 +61,7 @@ const contract = async (
|
|
|
61
61
|
orchFns.sendIt,
|
|
62
62
|
'send',
|
|
63
63
|
undefined,
|
|
64
|
-
M.splitRecord({ give:
|
|
64
|
+
M.splitRecord({ give: SingleNatAmountRecord }),
|
|
65
65
|
);
|
|
66
66
|
},
|
|
67
67
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAoCO,2BAVI,GAAG,eACH;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAkEvC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0BH;;WAEG;;;GAaR;6BA9HyB,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc"}
|
|
@@ -12,6 +12,7 @@ import { M } from '@endo/patterns';
|
|
|
12
12
|
import { makeChainHub } from '../exos/chain-hub.js';
|
|
13
13
|
import { prepareLocalOrchestrationAccountKit } from '../exos/local-orchestration-account.js';
|
|
14
14
|
import fetchedChainInfo from '../fetched-chain-info.js';
|
|
15
|
+
import { makeZoeTools } from '../utils/zoe-tools.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* @import {NameHub} from '@agoric/vats';
|
|
@@ -43,6 +44,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
43
44
|
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
44
45
|
|
|
45
46
|
const chainHub = makeChainHub(privateArgs.agoricNames, vowTools);
|
|
47
|
+
const zoeTools = makeZoeTools(zcf, vowTools);
|
|
46
48
|
|
|
47
49
|
const { localchain, timerService } = privateArgs;
|
|
48
50
|
const makeLocalOrchestrationAccountKit = prepareLocalOrchestrationAccountKit(
|
|
@@ -54,6 +56,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
54
56
|
vowTools,
|
|
55
57
|
chainHub,
|
|
56
58
|
localchain,
|
|
59
|
+
zoeTools,
|
|
57
60
|
},
|
|
58
61
|
);
|
|
59
62
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKit, zcf, timerService, vowTools, chainHub, localchain }: {
|
|
1
|
+
export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKit, zcf, timerService, vowTools, chainHub, localchain, zoeTools, }: {
|
|
2
2
|
makeRecorderKit: MakeRecorderKit;
|
|
3
3
|
zcf: ZCF;
|
|
4
4
|
timerService: Remote<TimerService>;
|
|
5
5
|
vowTools: VowTools;
|
|
6
6
|
chainHub: ChainHub;
|
|
7
7
|
localchain: Remote<LocalChain>;
|
|
8
|
+
zoeTools: ZoeTools;
|
|
8
9
|
}): (args_0: {
|
|
9
10
|
account: LocalChainAccount;
|
|
10
11
|
address: ChainAddress;
|
|
@@ -23,6 +24,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
23
24
|
* @param {Amount<'nat'>} ertpAmount
|
|
24
25
|
*/
|
|
25
26
|
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<Record<unknown, unknown>>, undefined>>;
|
|
27
|
+
Deposit(): Promise<Invitation<Vow<void>, undefined>>;
|
|
26
28
|
/**
|
|
27
29
|
* @param {string} validatorAddress
|
|
28
30
|
* @param {Amount<'nat'>} ertpAmount
|
|
@@ -42,6 +44,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
42
44
|
destination: ChainAddress;
|
|
43
45
|
opts: IBCMsgTransferOptions;
|
|
44
46
|
}>>;
|
|
47
|
+
Withdraw(): Promise<Invitation<Vow<void>, undefined>>;
|
|
45
48
|
};
|
|
46
49
|
undelegateWatcher: {
|
|
47
50
|
/**
|
|
@@ -98,6 +101,19 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
98
101
|
*/
|
|
99
102
|
onFulfilled(natAmount: Amount<"nat">, denom: DenomAmount["denom"]): DenomAmount;
|
|
100
103
|
};
|
|
104
|
+
/** exits or fails a seat depending the outcome */
|
|
105
|
+
seatExiterHandler: {
|
|
106
|
+
/**
|
|
107
|
+
* @param {undefined} _
|
|
108
|
+
* @param {ZCFSeat} seat
|
|
109
|
+
*/
|
|
110
|
+
onFulfilled(_: undefined, seat: ZCFSeat): void;
|
|
111
|
+
/**
|
|
112
|
+
* @param {Error} reason
|
|
113
|
+
* @param {ZCFSeat} seat
|
|
114
|
+
*/
|
|
115
|
+
onRejected(reason: Error, seat: ZCFSeat): never;
|
|
116
|
+
};
|
|
101
117
|
/**
|
|
102
118
|
* handles a QueryBalanceRequest from localchain.query and returns the
|
|
103
119
|
* balance as a DenomAmount
|
|
@@ -223,6 +239,7 @@ import type { Remote } from '@agoric/internal';
|
|
|
223
239
|
import type { VowTools } from '@agoric/vow';
|
|
224
240
|
import type { ChainHub } from './chain-hub.js';
|
|
225
241
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
242
|
+
import type { ZoeTools } from '../utils/zoe-tools.js';
|
|
226
243
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
227
244
|
import type { ChainAddress } from '@agoric/orchestration';
|
|
228
245
|
import type { AmountArg } from '@agoric/orchestration';
|
|
@@ -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":"AAiGO,0DAVI,IAAI,qFAEZ;IAAgC,eAAe,EAAvC,eAAe;IACH,GAAG,EAAf,GAAG;IAC0B,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACS,QAAQ,EAAzB,QAAQ;IACmB,UAAU,EAArC,OAAO,UAAU,CAAC;IACD,QAAQ,EAAzB,QAAQ;CAClB;aAsFc,iBAAiB;aACjB,YAAY;iBACZ,OAAO,WAAW,CAAC;;;QAc1B;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAOjB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;QAiCxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;uBAmBJ,YAAY;oBAAU,SAAS;;;uBAa/B,YAAY;qBAAW,SAAS,EAAE;;;oBAcrC,SAAS;yBACJ,YAAY;kBACnB,qBAAqB;;;;;QAmCpC;;;;;;WAMG;8BALQ,CACV,SACA,UAAgB,+CAA+C,CAAC,CAC3D,CACF;;;QAcJ;;;;;;;;;;WAUG;6DATQ,CACV;YAAM,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC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EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,YAAY,CAAC;CACvB;+CA0qBU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BA1sBnC,cAAc;qCADU,6CAA6C;kCAI5C,cAAc;4BAFrC,kBAAkB;8BAGX,aAAa;8BAIlB,gBAAgB;gCAXK,gCAAgC;8BAarD,uBAAuB;uCAbF,gCAAgC;kCACwC,uBAAuB;+BAAvB,uBAAuB;0BAQxH,kDAAkD;yBAFzC,aAAa;qCADG,cAAc;2CAL0D,uBAAuB;+BAO7F,sBAAsB;8BAAtB,sBAAsB;uCAPgD,uBAAuB;iCAAvB,uBAAuB;gCAO7F,sBAAsB;iCANzB,6CAA6C;iCAU9D,mBAAmB"}
|
|
@@ -10,6 +10,7 @@ import { Fail, q } from '@endo/errors';
|
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
AmountArgShape,
|
|
13
|
+
AnyNatAmountsRecord,
|
|
13
14
|
ChainAddressShape,
|
|
14
15
|
DenomAmountShape,
|
|
15
16
|
DenomShape,
|
|
@@ -39,6 +40,7 @@ import { coerceCoin, coerceDenomAmount } from '../utils/amounts.js';
|
|
|
39
40
|
* @import {Matcher} from '@endo/patterns';
|
|
40
41
|
* @import {ChainHub} from './chain-hub.js';
|
|
41
42
|
* @import {PacketTools} from './packet-tools.js';
|
|
43
|
+
* @import {ZoeTools} from '../utils/zoe-tools.js';
|
|
42
44
|
*/
|
|
43
45
|
|
|
44
46
|
const trace = makeTracer('LOA');
|
|
@@ -91,10 +93,19 @@ const PUBLIC_TOPICS = {
|
|
|
91
93
|
* @param {VowTools} powers.vowTools
|
|
92
94
|
* @param {ChainHub} powers.chainHub
|
|
93
95
|
* @param {Remote<LocalChain>} powers.localchain
|
|
96
|
+
* @param {ZoeTools} powers.zoeTools
|
|
94
97
|
*/
|
|
95
98
|
export const prepareLocalOrchestrationAccountKit = (
|
|
96
99
|
zone,
|
|
97
|
-
{
|
|
100
|
+
{
|
|
101
|
+
makeRecorderKit,
|
|
102
|
+
zcf,
|
|
103
|
+
timerService,
|
|
104
|
+
vowTools,
|
|
105
|
+
chainHub,
|
|
106
|
+
localchain,
|
|
107
|
+
zoeTools,
|
|
108
|
+
},
|
|
98
109
|
) => {
|
|
99
110
|
const { watch, allVows, asVow, when } = vowTools;
|
|
100
111
|
const { makeIBCTransferSender } = prepareIBCTools(
|
|
@@ -139,6 +150,12 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
139
150
|
returnVoidWatcher: M.interface('returnVoidWatcher', {
|
|
140
151
|
onFulfilled: M.call(M.any()).optional(M.any()).returns(M.undefined()),
|
|
141
152
|
}),
|
|
153
|
+
seatExiterHandler: M.interface('seatExiterHandler', {
|
|
154
|
+
onFulfilled: M.call(M.undefined(), M.remotable()).returns(
|
|
155
|
+
M.undefined(),
|
|
156
|
+
),
|
|
157
|
+
onRejected: M.call(M.error(), M.remotable()).returns(M.undefined()),
|
|
158
|
+
}),
|
|
142
159
|
getBalanceWatcher: M.interface('getBalanceWatcher', {
|
|
143
160
|
onFulfilled: M.call(AmountShape, DenomShape).returns(DenomAmountShape),
|
|
144
161
|
}),
|
|
@@ -151,12 +168,14 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
151
168
|
),
|
|
152
169
|
}),
|
|
153
170
|
invitationMakers: M.interface('invitationMakers', {
|
|
154
|
-
Delegate: M.call(M.string(), AmountShape).returns(M.promise()),
|
|
155
|
-
Undelegate: M.call(M.string(), AmountShape).returns(M.promise()),
|
|
156
171
|
CloseAccount: M.call().returns(M.promise()),
|
|
172
|
+
Delegate: M.call(M.string(), AmountShape).returns(M.promise()),
|
|
173
|
+
Deposit: M.call().returns(M.promise()),
|
|
157
174
|
Send: M.call().returns(M.promise()),
|
|
158
175
|
SendAll: M.call().returns(M.promise()),
|
|
159
176
|
Transfer: M.call().returns(M.promise()),
|
|
177
|
+
Undelegate: M.call(M.string(), AmountShape).returns(M.promise()),
|
|
178
|
+
Withdraw: M.call().returns(M.promise()),
|
|
160
179
|
}),
|
|
161
180
|
},
|
|
162
181
|
/**
|
|
@@ -200,6 +219,27 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
200
219
|
);
|
|
201
220
|
}, 'Delegate');
|
|
202
221
|
},
|
|
222
|
+
Deposit() {
|
|
223
|
+
trace('Deposit');
|
|
224
|
+
return zcf.makeInvitation(
|
|
225
|
+
seat => {
|
|
226
|
+
const { give } = seat.getProposal();
|
|
227
|
+
return watch(
|
|
228
|
+
zoeTools.localTransfer(
|
|
229
|
+
seat,
|
|
230
|
+
// @ts-expect-error LocalAccount vs LocalAccountMethods
|
|
231
|
+
this.state.account,
|
|
232
|
+
give,
|
|
233
|
+
),
|
|
234
|
+
this.facets.seatExiterHandler,
|
|
235
|
+
seat,
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
'Deposit',
|
|
239
|
+
undefined,
|
|
240
|
+
M.splitRecord({ give: AnyNatAmountsRecord, want: {} }),
|
|
241
|
+
);
|
|
242
|
+
},
|
|
203
243
|
/**
|
|
204
244
|
* @param {string} validatorAddress
|
|
205
245
|
* @param {Amount<'nat'>} ertpAmount
|
|
@@ -262,6 +302,27 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
262
302
|
};
|
|
263
303
|
return zcf.makeInvitation(offerHandler, 'Transfer');
|
|
264
304
|
},
|
|
305
|
+
Withdraw() {
|
|
306
|
+
trace('Withdraw');
|
|
307
|
+
return zcf.makeInvitation(
|
|
308
|
+
seat => {
|
|
309
|
+
const { want } = seat.getProposal();
|
|
310
|
+
return watch(
|
|
311
|
+
zoeTools.withdrawToSeat(
|
|
312
|
+
// @ts-expect-error LocalAccount vs LocalAccountMethods
|
|
313
|
+
this.state.account,
|
|
314
|
+
seat,
|
|
315
|
+
want,
|
|
316
|
+
),
|
|
317
|
+
this.facets.seatExiterHandler,
|
|
318
|
+
seat,
|
|
319
|
+
);
|
|
320
|
+
},
|
|
321
|
+
'Withdraw',
|
|
322
|
+
undefined,
|
|
323
|
+
M.splitRecord({ give: {}, want: AnyNatAmountsRecord }),
|
|
324
|
+
);
|
|
325
|
+
},
|
|
265
326
|
},
|
|
266
327
|
undelegateWatcher: {
|
|
267
328
|
/**
|
|
@@ -362,6 +423,24 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
362
423
|
return harden({ denom, value: natAmount.value });
|
|
363
424
|
},
|
|
364
425
|
},
|
|
426
|
+
/** exits or fails a seat depending the outcome */
|
|
427
|
+
seatExiterHandler: {
|
|
428
|
+
/**
|
|
429
|
+
* @param {undefined} _
|
|
430
|
+
* @param {ZCFSeat} seat
|
|
431
|
+
*/
|
|
432
|
+
onFulfilled(_, seat) {
|
|
433
|
+
seat.exit();
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* @param {Error} reason
|
|
437
|
+
* @param {ZCFSeat} seat
|
|
438
|
+
*/
|
|
439
|
+
onRejected(reason, seat) {
|
|
440
|
+
seat.exit(reason);
|
|
441
|
+
throw reason;
|
|
442
|
+
},
|
|
443
|
+
},
|
|
365
444
|
/**
|
|
366
445
|
* handles a QueryBalanceRequest from localchain.query and returns the
|
|
367
446
|
* balance as a DenomAmount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAkBO,6TAVI,eAAe,GAAG;IACxB,YAAY,EAAE;QACZ,OAAO,EAAE;YACP,QAAQ,EAAE,YAAY,CAC9B;;;;;;+
|
|
1
|
+
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAkBO,6TAVI,eAAe,GAAG;IACxB,YAAY,EAAE;QACZ,OAAO,EAAE;YACP,QAAQ,EAAE,YAAY,CAC9B;;;;;;+BAuCkB,kBACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAxC8D,CACxD,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAwDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BN;sBApGqB,gCAAgC"}
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -73,6 +73,11 @@ export namespace TimestampProtoShape {
|
|
|
73
73
|
* @internal
|
|
74
74
|
*/
|
|
75
75
|
export const TxBodyOptsShape: import("@endo/patterns").Matcher;
|
|
76
|
+
/**
|
|
77
|
+
* Ensures at least one {@link AmountKeywordRecord} entry is present and only
|
|
78
|
+
* permits Nat (fungible) amounts.
|
|
79
|
+
*/
|
|
80
|
+
export const AnyNatAmountsRecord: import("@endo/patterns").Matcher;
|
|
76
81
|
import type { ChainAddress } from './types.js';
|
|
77
82
|
import type { TypedPattern } from '@agoric/internal';
|
|
78
83
|
import type { Any as Proto3Msg } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH;;;;GAIG;AACH;;;GAQE;AAEF,yCAAyC;AACzC,gCADW,aAAa,YAAY,CAAC,CAKnC;AAEF,sCAAsC;AACtC,0BADW,aAAa,SAAS,CAAC,CAIhC;AAEF,gBAAgB;AAChB,uEAUE;AAEF,gBAAgB;AAChB,iEAA4C;AAC5C,gBAAgB;AAChB,mEAQG;AACH,gBAAgB;AAChB,oEAA+C;AAC/C,gBAAgB;AAChB,sEASG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CASrC;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CAWtC;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAG/B;AACH,sEAAuE;AACvE,0DAAqC;AAErC,gDAAgD;AAChD,6BADW,aAAa,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC,CAM1C;AAEF,wCAAwC;AACxC,+BADW,aAAa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sB,CAAC;IAClC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC,CAQH;AAEF,sCAAsC;AACtC,2DAGE;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CACmC;;;;;;;;;AAiBrE;;;;GAIG;AACH,+DAQE;AAEF;;;GAGG;AACH,mEAGE;kCAzLyJ,YAAY;kCADxI,kBAAkB;sCAEd,6CAA6C;qCAD2E,YAAY;qCAAZ,YAAY;+BAAZ,YAAY;+BAAZ,YAAY;iCAAZ,YAAY;+BAAZ,YAAY;4CAAZ,YAAY;+BAI3I,sBAAsB"}
|
package/src/typeGuards.js
CHANGED
|
@@ -180,3 +180,13 @@ export const TxBodyOptsShape = M.splitRecord(
|
|
|
180
180
|
nonCriticalExtensionOptions: M.arrayOf(M.any()),
|
|
181
181
|
},
|
|
182
182
|
);
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Ensures at least one {@link AmountKeywordRecord} entry is present and only
|
|
186
|
+
* permits Nat (fungible) amounts.
|
|
187
|
+
*/
|
|
188
|
+
export const AnyNatAmountsRecord = M.and(
|
|
189
|
+
M.recordOf(M.string(), AnyNatAmountShape),
|
|
190
|
+
M.not(harden({})),
|
|
191
|
+
);
|
|
192
|
+
harden(AnyNatAmountsRecord);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BA2GR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAzEM,GAAG;;+BAhDV,GAAG,+EAMoD,GAAG,yCAG9D,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0Id;AA8BM,kCAdgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACN,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EACZ,WAAW,EAAE,EAAE,EACf,IAAI,EAAE,IAAI,EACV,KAAK,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;kCA9LU;IACR,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;iCAoJU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BAlKzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,2BAA2B;kCAL1B,cAAc;6BAE/B,cAAc"}
|
|
@@ -79,7 +79,15 @@ export const provideOrchestration = (
|
|
|
79
79
|
const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);
|
|
80
80
|
const makeLocalOrchestrationAccountKit = prepareLocalOrchestrationAccountKit(
|
|
81
81
|
zones.orchestration,
|
|
82
|
-
{
|
|
82
|
+
{
|
|
83
|
+
makeRecorderKit,
|
|
84
|
+
zcf,
|
|
85
|
+
timerService,
|
|
86
|
+
vowTools,
|
|
87
|
+
chainHub,
|
|
88
|
+
localchain,
|
|
89
|
+
zoeTools,
|
|
90
|
+
},
|
|
83
91
|
);
|
|
84
92
|
|
|
85
93
|
const asyncFlowTools = prepareAsyncFlowTools(zones.asyncFlow, {
|