@agoric/orchestration 0.1.1-dev-d3223ae.0 → 0.1.1-dev-644c210.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/stakeBld.contract.d.ts +2 -1
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeIca.contract.d.ts +2 -1
- package/src/examples/stakeIca.contract.d.ts.map +1 -1
- package/src/exos/README.md +3 -0
- package/src/exos/cosmos-orchestration-account.d.ts +12 -1
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +77 -11
- package/src/exos/local-chain-facade.d.ts +4 -2
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.d.ts +29 -2
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +88 -3
- package/src/exos/remote-chain-facade.d.ts +6 -3
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/orchestration-api.d.ts +8 -1
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +9 -1
- package/src/proposals/start-stakeAtom.d.ts +2 -1
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.d.ts +2 -1
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.d.ts +2 -1
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/utils/orchestrationAccount.d.ts +1 -0
- package/src/utils/orchestrationAccount.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-644c210.0+644c210",
|
|
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-644c210.0+644c210",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-644c210.0+644c210",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-644c210.0+644c210",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-644c210.0+644c210",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-644c210.0+644c210",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-644c210.0+644c210",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-644c210.0+644c210",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-644c210.0+644c210",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-644c210.0+644c210",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-644c210.0+644c210",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-644c210.0+644c210",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-644c210.0+644c210",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-644c210.0+644c210",
|
|
49
49
|
"@endo/base64": "^1.0.6",
|
|
50
50
|
"@endo/errors": "^1.2.4",
|
|
51
51
|
"@endo/far": "^1.1.4",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "github:paulmillr/noble-hashes#ae060da"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-644c210.0+644c210",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typeCoverage": {
|
|
95
95
|
"atLeast": 98.1
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "644c210038bc4beefe87691373f162ffa33a272b"
|
|
98
98
|
}
|
|
@@ -29,7 +29,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
29
29
|
'@type': string;
|
|
30
30
|
}>[]>>;
|
|
31
31
|
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
32
|
-
send(toAccount:
|
|
32
|
+
send(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/marshal").Passable ? 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 ? import("@endo/marshal").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
33
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>;
|
|
34
35
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/marshal").Passable ? import("@endo/marshal").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
35
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>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAkCO,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;;QAiDvC;;WAEG
|
|
1
|
+
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAkCO,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;;QAiDvC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0BH;;WAEG;;;GAaR;6BA7GyB,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc"}
|
|
@@ -29,7 +29,8 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
29
29
|
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 ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
30
30
|
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[]>>;
|
|
31
31
|
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>>;
|
|
32
|
-
send(toAccount: 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/pass-style").Passable ? import("@endo/pass-style").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/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
33
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<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
34
35
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
35
36
|
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[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO
|
|
1
|
+
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;GA4FjB;4BA7GY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,SAAa,EAAE,MAAM,CAAC;IACtB,UAAc,EAAE,OAAO,CAAC;CACrB;yBAyGU,OAAO,KAAK;6CArI+B,aAAa;kCAFvC,cAAc;6BAFnB,kBAAkB;mDAGI,uBAAuB;qCAFrC,cAAc"}
|
package/src/exos/README.md
CHANGED
|
@@ -98,6 +98,7 @@ classDiagram
|
|
|
98
98
|
getPublicTopics()
|
|
99
99
|
monitorTransfers()
|
|
100
100
|
send()
|
|
101
|
+
sendAll()
|
|
101
102
|
transfer()
|
|
102
103
|
undelegate()
|
|
103
104
|
withdraw()
|
|
@@ -117,6 +118,8 @@ classDiagram
|
|
|
117
118
|
getBalance()
|
|
118
119
|
getPublicTopics()
|
|
119
120
|
redelegate()
|
|
121
|
+
send()
|
|
122
|
+
sendAll()
|
|
120
123
|
undelegate()
|
|
121
124
|
withdrawReward()
|
|
122
125
|
}
|
|
@@ -23,6 +23,7 @@ export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
|
|
|
23
23
|
getBalance: import("@endo/patterns").MethodGuard;
|
|
24
24
|
getBalances: import("@endo/patterns").MethodGuard;
|
|
25
25
|
send: import("@endo/patterns").MethodGuard;
|
|
26
|
+
sendAll: import("@endo/patterns").MethodGuard;
|
|
26
27
|
transfer: import("@endo/patterns").MethodGuard;
|
|
27
28
|
transferSteps: import("@endo/patterns").MethodGuard;
|
|
28
29
|
asContinuingOffer: import("@endo/patterns").MethodGuard;
|
|
@@ -85,6 +86,14 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
85
86
|
/** @param {Omit<Delegation, 'delegatorAddress'>[]} delegations */
|
|
86
87
|
Undelegate(delegations: Omit<Delegation, "delegatorAddress">[]): Promise<Invitation<Vow<void>, undefined>>;
|
|
87
88
|
CloseAccount(): never;
|
|
89
|
+
Send(): Promise<Invitation<Vow<void>, {
|
|
90
|
+
toAccount: ChainAddress;
|
|
91
|
+
amount: AmountArg;
|
|
92
|
+
}>>;
|
|
93
|
+
SendAll(): Promise<Invitation<Vow<void>, {
|
|
94
|
+
toAccount: ChainAddress;
|
|
95
|
+
amounts: AmountArg[];
|
|
96
|
+
}>>;
|
|
88
97
|
/**
|
|
89
98
|
* Starting a transfer revokes the account holder. The associated
|
|
90
99
|
* updater will get a special notification that the account is being
|
|
@@ -110,7 +119,9 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
110
119
|
/** @type {HostOf<OrchestrationAccountI['getBalance']>} */
|
|
111
120
|
getBalance(denom: DenomArg): Vow<DenomAmount extends import("@endo/pass-style").Passable ? DenomAmount : import("@agoric/async-flow").HostInterface<DenomAmount>>;
|
|
112
121
|
/** @type {HostOf<OrchestrationAccountI['send']>} */
|
|
113
|
-
send(toAccount: ChainAddress,
|
|
122
|
+
send(toAccount: ChainAddress, amounts: AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
123
|
+
/** @type {HostOf<OrchestrationAccountI['sendAll']>} */
|
|
124
|
+
sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
114
125
|
/** @type {HostOf<OrchestrationAccountI['transfer']>} */
|
|
115
126
|
transfer(amount: AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
116
127
|
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAsDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,mCAAmC;AACnC;;;;;;;;;;;;;;;GAaG;AAgBI,2DALI,IAAI,mBACJ,eAAe,0BACf,QAAQ,OACR,GAAG;aA0DC,UAAU;iBACV,OAAO,WAAW,CAAC;mBACnB,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C;IACtB,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;CAC7B;4CAgfS,UAAU,CACtB,UAAc,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCA4BU,6BAA6B,CAAC,QAAQ,CAAC;0BAriB9B,cAAc;qCAPU,6CAA6C;8BAM5D,aAAa;kCAPqH,aAAa;gCAAb,aAAa;4BAItJ,kBAAkB;mCAJuH,aAAa;kCAMhJ,cAAc;+BANqH,aAAa;0BAExJ,kDAAkD;mCAOzC,+CAA+C;8BACpD,sBAAsB;iCAViH,aAAa;yBAO/I,aAAa;4CAPqH,aAAa;gCAGlJ,wDAAwD;8BAH6E,aAAa;iCAChI,6CAA6C"}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
MsgUndelegateResponse,
|
|
16
16
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
|
|
17
17
|
import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
18
|
+
import { MsgSend } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/tx.js';
|
|
18
19
|
import { makeTracer } from '@agoric/internal';
|
|
19
20
|
import { Shape as NetworkShape } from '@agoric/network';
|
|
20
21
|
import { M } from '@agoric/vat-data';
|
|
@@ -145,6 +146,8 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
145
146
|
Undelegate: M.call(M.arrayOf(DelegationShape)).returns(M.promise()),
|
|
146
147
|
CloseAccount: M.call().returns(M.promise()),
|
|
147
148
|
TransferAccount: M.call().returns(M.promise()),
|
|
149
|
+
Send: M.call().returns(M.promise()),
|
|
150
|
+
SendAll: M.call().returns(M.promise()),
|
|
148
151
|
}),
|
|
149
152
|
},
|
|
150
153
|
/**
|
|
@@ -184,15 +187,13 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
184
187
|
* @returns {Coin}
|
|
185
188
|
*/
|
|
186
189
|
amountToCoin(amount) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
trace('TODO: handle brand', amount);
|
|
192
|
-
// FIXME(#9211) brand handling
|
|
190
|
+
if (!('denom' in amount)) {
|
|
191
|
+
// FIXME(#9211) look up values from brands
|
|
192
|
+
trace('TODO #9211: handle brand', amount);
|
|
193
|
+
throw Fail`Brands not currently supported.`;
|
|
193
194
|
}
|
|
194
195
|
return harden({
|
|
195
|
-
denom:
|
|
196
|
+
denom: amount.denom,
|
|
196
197
|
amount: String(amount.value),
|
|
197
198
|
});
|
|
198
199
|
},
|
|
@@ -300,6 +301,32 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
300
301
|
CloseAccount() {
|
|
301
302
|
throw Error('not yet implemented');
|
|
302
303
|
},
|
|
304
|
+
Send() {
|
|
305
|
+
/**
|
|
306
|
+
* @type {OfferHandler<
|
|
307
|
+
* Vow<void>,
|
|
308
|
+
* { toAccount: ChainAddress; amount: AmountArg }
|
|
309
|
+
* >}
|
|
310
|
+
*/
|
|
311
|
+
const offerHandler = (seat, { toAccount, amount }) => {
|
|
312
|
+
seat.exit();
|
|
313
|
+
return watch(this.facets.holder.send(toAccount, amount));
|
|
314
|
+
};
|
|
315
|
+
return zcf.makeInvitation(offerHandler, 'Send');
|
|
316
|
+
},
|
|
317
|
+
SendAll() {
|
|
318
|
+
/**
|
|
319
|
+
* @type {OfferHandler<
|
|
320
|
+
* Vow<void>,
|
|
321
|
+
* { toAccount: ChainAddress; amounts: AmountArg[] }
|
|
322
|
+
* >}
|
|
323
|
+
*/
|
|
324
|
+
const offerHandler = (seat, { toAccount, amounts }) => {
|
|
325
|
+
seat.exit();
|
|
326
|
+
return watch(this.facets.holder.sendAll(toAccount, amounts));
|
|
327
|
+
};
|
|
328
|
+
return zcf.makeInvitation(offerHandler, 'SendAll');
|
|
329
|
+
},
|
|
303
330
|
/**
|
|
304
331
|
* Starting a transfer revokes the account holder. The associated
|
|
305
332
|
* updater will get a special notification that the account is being
|
|
@@ -358,14 +385,17 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
358
385
|
return asVow(() => {
|
|
359
386
|
trace('delegate', validator, amount);
|
|
360
387
|
const { helper } = this.facets;
|
|
361
|
-
const { chainAddress } = this.state;
|
|
388
|
+
const { chainAddress, bondDenom } = this.state;
|
|
389
|
+
|
|
390
|
+
const amountAsCoin = helper.amountToCoin(amount);
|
|
391
|
+
assert.equal(amountAsCoin.denom, bondDenom);
|
|
362
392
|
|
|
363
393
|
const results = E(helper.owned()).executeEncodedTx([
|
|
364
394
|
Any.toJSON(
|
|
365
395
|
MsgDelegate.toProtoMsg({
|
|
366
396
|
delegatorAddress: chainAddress.value,
|
|
367
397
|
validatorAddress: validator.value,
|
|
368
|
-
amount:
|
|
398
|
+
amount: amountAsCoin,
|
|
369
399
|
}),
|
|
370
400
|
),
|
|
371
401
|
]);
|
|
@@ -442,8 +472,44 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
442
472
|
|
|
443
473
|
/** @type {HostOf<OrchestrationAccountI['send']>} */
|
|
444
474
|
send(toAccount, amount) {
|
|
445
|
-
|
|
446
|
-
|
|
475
|
+
return asVow(() => {
|
|
476
|
+
trace('send', toAccount, amount);
|
|
477
|
+
const { helper } = this.facets;
|
|
478
|
+
const { chainAddress } = this.state;
|
|
479
|
+
return watch(
|
|
480
|
+
E(helper.owned()).executeEncodedTx([
|
|
481
|
+
Any.toJSON(
|
|
482
|
+
MsgSend.toProtoMsg({
|
|
483
|
+
fromAddress: chainAddress.value,
|
|
484
|
+
toAddress: toAccount.value,
|
|
485
|
+
amount: [helper.amountToCoin(amount)],
|
|
486
|
+
}),
|
|
487
|
+
),
|
|
488
|
+
]),
|
|
489
|
+
this.facets.returnVoidWatcher,
|
|
490
|
+
);
|
|
491
|
+
});
|
|
492
|
+
},
|
|
493
|
+
|
|
494
|
+
/** @type {HostOf<OrchestrationAccountI['sendAll']>} */
|
|
495
|
+
sendAll(toAccount, amounts) {
|
|
496
|
+
return asVow(() => {
|
|
497
|
+
trace('sendAll', toAccount, amounts);
|
|
498
|
+
const { helper } = this.facets;
|
|
499
|
+
const { chainAddress } = this.state;
|
|
500
|
+
return watch(
|
|
501
|
+
E(helper.owned()).executeEncodedTx([
|
|
502
|
+
Any.toJSON(
|
|
503
|
+
MsgSend.toProtoMsg({
|
|
504
|
+
fromAddress: chainAddress.value,
|
|
505
|
+
toAddress: toAccount.value,
|
|
506
|
+
amount: amounts.map(x => helper.amountToCoin(x)),
|
|
507
|
+
}),
|
|
508
|
+
),
|
|
509
|
+
]),
|
|
510
|
+
this.facets.returnVoidWatcher,
|
|
511
|
+
);
|
|
512
|
+
});
|
|
447
513
|
},
|
|
448
514
|
|
|
449
515
|
/** @type {HostOf<OrchestrationAccountI['transfer']>} */
|
|
@@ -56,7 +56,8 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
56
56
|
'@type': string;
|
|
57
57
|
}>[]>>;
|
|
58
58
|
getAddress(): ChainAddress;
|
|
59
|
-
send(toAccount:
|
|
59
|
+
send(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
60
|
+
sendAll(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
60
61
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<any>;
|
|
61
62
|
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>>;
|
|
62
63
|
sendThenWaitForAck(packetSender: Remote<import("./packet-tools.js").PacketSender>, opts?: import("./packet-tools.js").PacketOptions | undefined): import("@agoric/async-flow").HostInterface<Vow<any>>;
|
|
@@ -117,7 +118,8 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
117
118
|
'@type': string;
|
|
118
119
|
}>[]>>;
|
|
119
120
|
getAddress(): ChainAddress;
|
|
120
|
-
send(toAccount:
|
|
121
|
+
send(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
122
|
+
sendAll(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
121
123
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<any>;
|
|
122
124
|
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>>;
|
|
123
125
|
sendThenWaitForAck(packetSender: Remote<import("./packet-tools.js").PacketSender>, opts?: import("./packet-tools.js").PacketOptions | undefined): import("@agoric/async-flow").HostInterface<Vow<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AAkLO,8CAHI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;QA9EzB,6DAA6D;uBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;QAWzD,8DAA8D;;;;QAe9D;;WAEG;4BADQ,SAAS,EAAE;;;QAWtB;;WAEG;wCADQ,CAAC,iBAAiB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.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zone: Zone, makeRecorderKit:
|
|
|
3
3
|
address: ChainAddress;
|
|
4
4
|
storageNode: Remote<StorageNode>;
|
|
5
5
|
}) => import("@endo/exo").GuardedKit<{
|
|
6
|
+
helper: {
|
|
7
|
+
/**
|
|
8
|
+
* @param {AmountArg} amount
|
|
9
|
+
* @returns {Coin}
|
|
10
|
+
*/
|
|
11
|
+
amountToCoin(amount: AmountArg): Coin;
|
|
12
|
+
};
|
|
6
13
|
invitationMakers: {
|
|
7
14
|
/**
|
|
8
15
|
* @param {string} validatorAddress
|
|
@@ -15,6 +22,14 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
15
22
|
*/
|
|
16
23
|
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<TimestampRecord>, undefined>>;
|
|
17
24
|
CloseAccount(): never;
|
|
25
|
+
Send(): Promise<Invitation<Vow<void>, {
|
|
26
|
+
toAccount: ChainAddress;
|
|
27
|
+
amount: AmountArg;
|
|
28
|
+
}>>;
|
|
29
|
+
SendAll(): Promise<Invitation<Vow<void>, {
|
|
30
|
+
toAccount: ChainAddress;
|
|
31
|
+
amounts: AmountArg[];
|
|
32
|
+
}>>;
|
|
18
33
|
};
|
|
19
34
|
undelegateWatcher: {
|
|
20
35
|
/**
|
|
@@ -125,7 +140,18 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
125
140
|
}>[]>>;
|
|
126
141
|
/** @type {OrchestrationAccountI['getAddress']} */
|
|
127
142
|
getAddress(): ChainAddress;
|
|
128
|
-
|
|
143
|
+
/**
|
|
144
|
+
* XXX consider using ERTP to send if it's vbank asset
|
|
145
|
+
*
|
|
146
|
+
* @type {HostOf<OrchestrationAccountI['send']>}
|
|
147
|
+
*/
|
|
148
|
+
send(toAccount: ChainAddress, amounts: AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
149
|
+
/**
|
|
150
|
+
* XXX consider using ERTP to send if it's vbank asset
|
|
151
|
+
*
|
|
152
|
+
* @type {HostOf<OrchestrationAccountI['sendAll']>}
|
|
153
|
+
*/
|
|
154
|
+
sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
129
155
|
/**
|
|
130
156
|
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
131
157
|
* {@link DenomAmount}
|
|
@@ -188,6 +214,8 @@ import type { VowTools } from '@agoric/vow';
|
|
|
188
214
|
import type { ChainHub } from './chain-hub.js';
|
|
189
215
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
190
216
|
import type { ChainAddress } from '@agoric/orchestration';
|
|
217
|
+
import type { AmountArg } from '@agoric/orchestration';
|
|
218
|
+
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
191
219
|
import type { Vow } from '@agoric/vow';
|
|
192
220
|
import type { TimestampRecord } from '@agoric/time';
|
|
193
221
|
import type { TypedJson } from '@agoric/cosmic-proto';
|
|
@@ -197,7 +225,6 @@ import type { IBCConnectionInfo } from '@agoric/orchestration';
|
|
|
197
225
|
import type { IBCMsgTransferOptions } from '@agoric/orchestration';
|
|
198
226
|
import type { DenomAmount } from '@agoric/orchestration';
|
|
199
227
|
import type { Pattern } from '@endo/patterns';
|
|
200
|
-
import type { AmountArg } from '@agoric/orchestration';
|
|
201
228
|
import type { EVow } from '@agoric/vow';
|
|
202
229
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
203
230
|
import type { PacketTools } from './packet-tools.js';
|
|
@@ -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-or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;QAIlD;;;;WAIG;;QAiBH;;;;WAIG;;QAiBH;;;;;;;;WAQG;yBAPQ,SAAS,eAET,YAAY,6CAIV,IAAI,GAAG,CAAC;QAgCrB,6DAA6D;;QAO7D,wDAAwD;;QAMxD,sDAAsD;;;;;QAItD,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;GAQnE;;aA5iBa,MAAM;;oBAIP;IACZ,QAAY,EAAE,YAAY,6BAA6B,CAAC,CAAC;IACzD,WAAe,EAAE,WAAW,CAAC;IAC7B,OAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAW,EAAE,YAAY,CAAC;CACvB;+CAqiBU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BArkBnC,cAAc;qCADU,6CAA6C;kCAK5C,cAAc;4BAHrC,kBAAkB;8BAIO,aAAa;8BAIpC,gBAAgB;uCAZP,gCAAgC;kCAC+D,uBAAuB;+BAAvB,uBAAuB;0BASnI,kDAAkD;yBAFvB,aAAa;qCADf,cAAc;+BAEZ,sBAAsB;8BAAtB,sBAAsB;+BAR2D,uBAAuB;uCAAvB,uBAAuB;2CAAvB,uBAAuB;iCAAvB,uBAAuB;6BAUvH,gBAAgB;0BAHD,aAAa;iCANhB,6CAA6C;iCAW9D,mBAAmB"}
|
|
@@ -8,6 +8,7 @@ import { VowShape } from '@agoric/vow';
|
|
|
8
8
|
import { E } from '@endo/far';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
+
AmountArgShape,
|
|
11
12
|
ChainAddressShape,
|
|
12
13
|
DenomAmountShape,
|
|
13
14
|
DenomShape,
|
|
@@ -32,6 +33,7 @@ import { prepareIBCTools } from './ibc-packet.js';
|
|
|
32
33
|
* @import {TimerService, TimestampRecord} from '@agoric/time';
|
|
33
34
|
* @import {PromiseVow, EVow, Vow, VowTools} from '@agoric/vow';
|
|
34
35
|
* @import {TypedJson, JsonSafe, ResponseTo} from '@agoric/cosmic-proto';
|
|
36
|
+
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
35
37
|
* @import {Matcher, Pattern} from '@endo/patterns';
|
|
36
38
|
* @import {ChainHub} from './chain-hub.js';
|
|
37
39
|
* @import {PacketTools} from './packet-tools.js';
|
|
@@ -108,6 +110,9 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
108
110
|
const makeLocalOrchestrationAccountKit = zone.exoClassKit(
|
|
109
111
|
'Local Orchestration Account Kit',
|
|
110
112
|
{
|
|
113
|
+
helper: M.interface('helper', {
|
|
114
|
+
amountToCoin: M.call(AmountArgShape).returns(M.record()),
|
|
115
|
+
}),
|
|
111
116
|
holder: HolderI,
|
|
112
117
|
undelegateWatcher: M.interface('undelegateWatcher', {
|
|
113
118
|
onFulfilled: M.call([
|
|
@@ -147,6 +152,8 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
147
152
|
Delegate: M.call(M.string(), AmountShape).returns(M.promise()),
|
|
148
153
|
Undelegate: M.call(M.string(), AmountShape).returns(M.promise()),
|
|
149
154
|
CloseAccount: M.call().returns(M.promise()),
|
|
155
|
+
Send: M.call().returns(M.promise()),
|
|
156
|
+
SendAll: M.call().returns(M.promise()),
|
|
150
157
|
}),
|
|
151
158
|
},
|
|
152
159
|
/**
|
|
@@ -166,6 +173,23 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
166
173
|
return { account, address, topicKit, packetTools };
|
|
167
174
|
},
|
|
168
175
|
{
|
|
176
|
+
helper: {
|
|
177
|
+
/**
|
|
178
|
+
* @param {AmountArg} amount
|
|
179
|
+
* @returns {Coin}
|
|
180
|
+
*/
|
|
181
|
+
amountToCoin(amount) {
|
|
182
|
+
if (!('denom' in amount)) {
|
|
183
|
+
// FIXME(#9211) look up values from brands
|
|
184
|
+
trace('TODO #9211: handle brand', amount);
|
|
185
|
+
throw Fail`Brands not currently supported.`;
|
|
186
|
+
}
|
|
187
|
+
return harden({
|
|
188
|
+
denom: amount.denom,
|
|
189
|
+
amount: String(amount.value),
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
},
|
|
169
193
|
invitationMakers: {
|
|
170
194
|
/**
|
|
171
195
|
* @param {string} validatorAddress
|
|
@@ -198,6 +222,32 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
198
222
|
CloseAccount() {
|
|
199
223
|
throw Error('not yet implemented');
|
|
200
224
|
},
|
|
225
|
+
Send() {
|
|
226
|
+
/**
|
|
227
|
+
* @type {OfferHandler<
|
|
228
|
+
* Vow<void>,
|
|
229
|
+
* { toAccount: ChainAddress; amount: AmountArg }
|
|
230
|
+
* >}
|
|
231
|
+
*/
|
|
232
|
+
const offerHandler = (seat, { toAccount, amount }) => {
|
|
233
|
+
seat.exit();
|
|
234
|
+
return watch(this.facets.holder.send(toAccount, amount));
|
|
235
|
+
};
|
|
236
|
+
return zcf.makeInvitation(offerHandler, 'Send');
|
|
237
|
+
},
|
|
238
|
+
SendAll() {
|
|
239
|
+
/**
|
|
240
|
+
* @type {OfferHandler<
|
|
241
|
+
* Vow<void>,
|
|
242
|
+
* { toAccount: ChainAddress; amounts: AmountArg[] }
|
|
243
|
+
* >}
|
|
244
|
+
*/
|
|
245
|
+
const offerHandler = (seat, { toAccount, amounts }) => {
|
|
246
|
+
seat.exit();
|
|
247
|
+
return watch(this.facets.holder.sendAll(toAccount, amounts));
|
|
248
|
+
};
|
|
249
|
+
return zcf.makeInvitation(offerHandler, 'SendAll');
|
|
250
|
+
},
|
|
201
251
|
},
|
|
202
252
|
undelegateWatcher: {
|
|
203
253
|
/**
|
|
@@ -448,11 +498,46 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
448
498
|
getAddress() {
|
|
449
499
|
return this.state.address;
|
|
450
500
|
},
|
|
501
|
+
/**
|
|
502
|
+
* XXX consider using ERTP to send if it's vbank asset
|
|
503
|
+
*
|
|
504
|
+
* @type {HostOf<OrchestrationAccountI['send']>}
|
|
505
|
+
*/
|
|
451
506
|
send(toAccount, amount) {
|
|
452
507
|
return asVow(() => {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
508
|
+
trace('send', toAccount, amount);
|
|
509
|
+
const { helper } = this.facets;
|
|
510
|
+
return watch(
|
|
511
|
+
E(this.state.account).executeTx([
|
|
512
|
+
typedJson('/cosmos.bank.v1beta1.MsgSend', {
|
|
513
|
+
amount: [helper.amountToCoin(amount)],
|
|
514
|
+
toAddress: toAccount.value,
|
|
515
|
+
fromAddress: this.state.address.value,
|
|
516
|
+
}),
|
|
517
|
+
]),
|
|
518
|
+
this.facets.returnVoidWatcher,
|
|
519
|
+
);
|
|
520
|
+
});
|
|
521
|
+
},
|
|
522
|
+
/**
|
|
523
|
+
* XXX consider using ERTP to send if it's vbank asset
|
|
524
|
+
*
|
|
525
|
+
* @type {HostOf<OrchestrationAccountI['sendAll']>}
|
|
526
|
+
*/
|
|
527
|
+
sendAll(toAccount, amounts) {
|
|
528
|
+
return asVow(() => {
|
|
529
|
+
trace('sendAll', toAccount, amounts);
|
|
530
|
+
const { helper } = this.facets;
|
|
531
|
+
return watch(
|
|
532
|
+
E(this.state.account).executeTx([
|
|
533
|
+
typedJson('/cosmos.bank.v1beta1.MsgSend', {
|
|
534
|
+
amount: amounts.map(a => helper.amountToCoin(a)),
|
|
535
|
+
toAddress: toAccount.value,
|
|
536
|
+
fromAddress: this.state.address.value,
|
|
537
|
+
}),
|
|
538
|
+
]),
|
|
539
|
+
this.facets.returnVoidWatcher,
|
|
540
|
+
);
|
|
456
541
|
});
|
|
457
542
|
},
|
|
458
543
|
/**
|
|
@@ -34,7 +34,8 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
34
34
|
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
35
35
|
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
36
36
|
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount : HostInterface<import("../orchestration-api.js").DenomAmount>>;
|
|
37
|
-
send(toAccount: ChainAddress,
|
|
37
|
+
send(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
38
|
+
sendAll(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
38
39
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
39
40
|
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 : HostInterface<void>>;
|
|
40
41
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
@@ -55,7 +56,8 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
55
56
|
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
56
57
|
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
57
58
|
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount : HostInterface<import("../orchestration-api.js").DenomAmount>>;
|
|
58
|
-
send(toAccount: ChainAddress,
|
|
59
|
+
send(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
60
|
+
sendAll(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
59
61
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
60
62
|
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 : HostInterface<void>>;
|
|
61
63
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
@@ -82,7 +84,8 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
82
84
|
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
83
85
|
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
84
86
|
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount : HostInterface<import("../orchestration-api.js").DenomAmount>>;
|
|
85
|
-
send(toAccount: ChainAddress,
|
|
87
|
+
send(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
88
|
+
sendAll(toAccount: ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
86
89
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : HostInterface<void>>;
|
|
87
90
|
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 : HostInterface<void>>;
|
|
88
91
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"AA2KO,+CAHI,IAAI,UACJ,uBAAuB;;;;;;;;;;;;;;;;QAnF1B,4CAA4C;;QAK5C,2CAA2C;;;;QAqB3C;;;;WAIG;6BADQ,UAAU
|
|
1
|
+
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"AA2KO,+CAHI,IAAI,UACJ,uBAAuB;;;;;;;;;;;;;;;;QAnF1B,4CAA4C;;QAK5C,2CAA2C;;;;QAqB3C;;;;WAIG;6BADQ,UAAU;;;;;;;;;;;;;;;;;;QAWrB;;;WAGG;kCAFQ,YAAY,WACZ,UAAU;;;;;;;;;;;;;;;;;;QAWrB;;;;;;WAMG;+BALQ,OAAO,WAAW,CAAC,6BACnB;YACV,OAAW,EAAE,UAAU,CAAC;YACxB,YAAgB,EAAE,YAAY,CAAC;SAC5B;;;;;;;;;;;;;;;;;cA8BX;sCApJY;IACZ,8BAAkC,EAAE,UAAU,CAC9C,wCAA8C,CACzC,CAAC;IACN,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,QAAY,EAAE,QAAQ,CAAC;CACpB;oCA+IU,UAAU,CAAC,OAAO,wBAAwB,CAAC;gCAC3C,UAAU,CAAC,qBAAqB,CAAC;0BAxKxB,mBAAmB;uCAMoF,aAAa;mCAPnG,oBAAoB;yBAI5B,aAAa;0CAGiF,aAAa;gCAAb,aAAa;kCAAb,aAAa;4BAJlH,kBAAkB;uDAGS,mCAAmC;6CAD7C,gCAAgC;kCAH3C,cAAc;8BAEb,aAAa"}
|
|
@@ -108,7 +108,14 @@ export interface OrchestrationAccountI {
|
|
|
108
108
|
* @param amount - the amount to send
|
|
109
109
|
* @returns void
|
|
110
110
|
*/
|
|
111
|
-
send: (toAccount: ChainAddress,
|
|
111
|
+
send: (toAccount: ChainAddress, amounts: AmountArg) => Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Transfer multiple amounts to another account on the same chain. The promise settles when the transfer is complete.
|
|
114
|
+
* @param toAccount - the account to send the amount to. MUST be on the same chain
|
|
115
|
+
* @param amounts - the amounts to send
|
|
116
|
+
* @returns void
|
|
117
|
+
*/
|
|
118
|
+
sendAll: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise<void>;
|
|
112
119
|
/**
|
|
113
120
|
* Transfer an amount to another account, typically on another chain.
|
|
114
121
|
* The promise settles when the transfer is complete.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAI3B;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AAE7C,6DAA6D;AAC7D,MAAM,MAAM,YAAY,GAAG;IACzB,uEAAuE;IACvE,OAAO,EAAE,MAAM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,6BAA6B,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9E;AAED,MAAM,WAAW,iBAAiB,CAAC,EAAE,GAAG,OAAO;IAC7C,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrE;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC;AAC3E,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/src/orchestration-api.ts
CHANGED
|
@@ -154,7 +154,15 @@ export interface OrchestrationAccountI {
|
|
|
154
154
|
* @param amount - the amount to send
|
|
155
155
|
* @returns void
|
|
156
156
|
*/
|
|
157
|
-
send: (toAccount: ChainAddress,
|
|
157
|
+
send: (toAccount: ChainAddress, amounts: AmountArg) => Promise<void>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Transfer multiple amounts to another account on the same chain. The promise settles when the transfer is complete.
|
|
161
|
+
* @param toAccount - the account to send the amount to. MUST be on the same chain
|
|
162
|
+
* @param amounts - the amounts to send
|
|
163
|
+
* @returns void
|
|
164
|
+
*/
|
|
165
|
+
sendAll: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise<void>;
|
|
158
166
|
|
|
159
167
|
/**
|
|
160
168
|
* Transfer an amount to another account, typically on another chain.
|
|
@@ -17,7 +17,8 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
|
|
|
17
17
|
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 ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
18
18
|
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[]>>;
|
|
19
19
|
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>>;
|
|
20
|
-
send(toAccount: import("../orchestration-api.js").ChainAddress,
|
|
20
|
+
send(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
21
|
+
sendAll(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
21
22
|
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 ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
22
23
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
23
24
|
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[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAyBO,mPAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B
|
|
1
|
+
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAyBO,mPAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;cAA0D,CACjD,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAqDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;mCAlG4C,+BAA+B"}
|
|
@@ -29,7 +29,8 @@ export function startStakeBld({ consume: { agoricNames: agoricNamesP, board, cha
|
|
|
29
29
|
'@type': string;
|
|
30
30
|
}>[]>>;
|
|
31
31
|
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
32
|
-
send(toAccount:
|
|
32
|
+
send(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").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/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
33
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>;
|
|
34
35
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
35
36
|
sendThenWaitForAck(packetSender: import("@agoric/internal").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>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAkBO,6TAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;+BAiCqB,kBAAiB
|
|
1
|
+
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAkBO,6TAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;+BAiCqB,kBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAjC2B,CACxD,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAwDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BN;sBApGqB,gCAAgC"}
|
|
@@ -17,7 +17,8 @@ export function startStakeOsmo({ consume: { agoricNames, board, chainStorage, ch
|
|
|
17
17
|
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 ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
18
18
|
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[]>>;
|
|
19
19
|
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>>;
|
|
20
|
-
send(toAccount: import("../orchestration-api.js").ChainAddress,
|
|
20
|
+
send(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
21
|
+
sendAll(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
21
22
|
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 ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
22
23
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
23
24
|
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[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AA8BO,mPAfI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B
|
|
1
|
+
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AA8BO,mPAfI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;cAA0D,CACjD,CAAC;SACH,CAAC;KACH,CAAC;IACN,QAAY,EAAE;QACd,OAAa,EAAE;YACf,SAAiB,EAAE,GAAG,CAAC;SAChB,CAAC;KACH,CAAC;CACH,iBAqDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN"}
|
|
@@ -3,6 +3,7 @@ export namespace orchestrationAccountMethods {
|
|
|
3
3
|
let getBalance: import("@endo/patterns").MethodGuard;
|
|
4
4
|
let getBalances: import("@endo/patterns").MethodGuard;
|
|
5
5
|
let send: import("@endo/patterns").MethodGuard;
|
|
6
|
+
let sendAll: import("@endo/patterns").MethodGuard;
|
|
6
7
|
let transfer: import("@endo/patterns").MethodGuard;
|
|
7
8
|
let transferSteps: import("@endo/patterns").MethodGuard;
|
|
8
9
|
let asContinuingOffer: import("@endo/patterns").MethodGuard;
|
|
@@ -18,6 +18,9 @@ export const orchestrationAccountMethods = {
|
|
|
18
18
|
getBalance: M.call(M.any()).returns(Vow$(DenomAmountShape)),
|
|
19
19
|
getBalances: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))),
|
|
20
20
|
send: M.call(ChainAddressShape, AmountArgShape).returns(VowShape),
|
|
21
|
+
sendAll: M.call(ChainAddressShape, M.arrayOf(AmountArgShape)).returns(
|
|
22
|
+
VowShape,
|
|
23
|
+
),
|
|
21
24
|
transfer: M.call(AmountArgShape, ChainAddressShape)
|
|
22
25
|
.optional(M.record())
|
|
23
26
|
.returns(VowShape),
|