@agoric/orchestration 0.1.1-dev-47a51f2.0 → 0.1.1-dev-ebe7d88.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/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +12 -10
- package/src/typeGuards.d.ts +6 -3
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +11 -2
- package/src/utils/chain-info.d.ts +2 -1
- package/src/utils/chain-info.d.ts.map +1 -1
- package/src/utils/chain-info.js +3 -3
- package/src/utils/orchestrationAccount.js +3 -3
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-ebe7d88.0+ebe7d88",
|
|
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-ebe7d88.0+ebe7d88",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-ebe7d88.0+ebe7d88",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-ebe7d88.0+ebe7d88",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-ebe7d88.0+ebe7d88",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-ebe7d88.0+ebe7d88",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-ebe7d88.0+ebe7d88",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-ebe7d88.0+ebe7d88",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-ebe7d88.0+ebe7d88",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-ebe7d88.0+ebe7d88",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-ebe7d88.0+ebe7d88",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-ebe7d88.0+ebe7d88",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-ebe7d88.0+ebe7d88",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-ebe7d88.0+ebe7d88",
|
|
49
49
|
"@cosmjs/encoding": "^0.32.4",
|
|
50
50
|
"@endo/base64": "^1.0.9",
|
|
51
51
|
"@endo/errors": "^1.2.10",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@noble/hashes": "^1.5.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
58
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-ebe7d88.0+ebe7d88",
|
|
59
59
|
"@chain-registry/client": "^1.47.4",
|
|
60
60
|
"@cosmjs/amino": "^0.33.0",
|
|
61
61
|
"@cosmjs/proto-signing": "^0.33.0",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"typeCoverage": {
|
|
99
99
|
"atLeast": 97.84
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "ebe7d889e7a95c78e9844ad5a9ffb20316772cde"
|
|
102
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAqBA;;;;;;;;;GASG;AAEH,gEAAgE;AAChE,2BAAkD,KAAK,CAAE;sBAsB/C,CAAC,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,CAAC;;;;;;AAYhD,oCAAoC;AACpC,gCAAuC;AACvC,8CAA8C;AAC9C,gDAAuD;AACvD,0CAA0C;AAC1C,uCAA8C;AAkBvC,uCAHI,MAAM,UAOd;AAWI,wCAJI,MAAM,YACN,MAAM,GACJ,gBAAgB,CAS5B;AAoCM,wDALI,MAAM,kBACN,MAAM,YACN,iBAAiB,GACf,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAajD;AAwCD,0CAA0C;AAC1C,iCADW,aAAa,aAAa,CAAC,CAUpC;AAgDK,mCARI,IAAI,eACJ,OAAO,OAAO,CAAC,YACf,QAAQ,4BAEhB;IAAuB,mBAAmB,GAAlC,OAAO;CAGjB;IAqLG;;;;;;;;;;;OAWG;wBAFQ,MAAM,aACN,SAAS;IASpB;;;;;;OAMG;2BAHQ,MAAM,aACN,SAAS;IA0BpB;;;;OAIG;iBAHmB,CAAC,SAAV,MAAQ,aACV,CAAC,GACC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"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"}
|
package/src/exos/chain-hub.js
CHANGED
|
@@ -5,7 +5,7 @@ import { M } from '@endo/patterns';
|
|
|
5
5
|
|
|
6
6
|
import { VowShape } from '@agoric/vow';
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
AccountIdArgShape,
|
|
9
9
|
ChainInfoShape,
|
|
10
10
|
CoinShape,
|
|
11
11
|
CosmosChainAddressShape,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
IBCConnectionInfoShape,
|
|
18
18
|
} from '../typeGuards.js';
|
|
19
19
|
import { getBech32Prefix } from '../utils/address.js';
|
|
20
|
-
import {
|
|
20
|
+
import { caipIdFromInfo } from '../utils/chain-info.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @import {NameHub} from '@agoric/vats';
|
|
@@ -232,9 +232,9 @@ const ChainHubI = M.interface('ChainHub', {
|
|
|
232
232
|
M.or(DenomDetailShape, M.undefined()),
|
|
233
233
|
),
|
|
234
234
|
getDenom: M.call(BrandShape).returns(M.or(M.string(), M.undefined())),
|
|
235
|
-
makeChainAddress: M.call(
|
|
236
|
-
resolveAccountId: M.call(
|
|
237
|
-
makeTransferRoute: M.call(
|
|
235
|
+
makeChainAddress: M.call(AccountIdArgShape).returns(CosmosChainAddressShape),
|
|
236
|
+
resolveAccountId: M.call(AccountIdArgShape).returns(M.string()),
|
|
237
|
+
makeTransferRoute: M.call(AccountIdArgShape, DenomAmountShape, M.string())
|
|
238
238
|
.optional(ForwardOptsShape)
|
|
239
239
|
.returns(M.or(M.undefined(), TransferRouteShape)),
|
|
240
240
|
});
|
|
@@ -348,7 +348,7 @@ export const makeChainHub = (
|
|
|
348
348
|
// TODO consider makeAtomicProvider for vows
|
|
349
349
|
if (!chainInfos.has(chainName)) {
|
|
350
350
|
chainInfos.init(chainName, chainInfo);
|
|
351
|
-
chainIdToChainName.init(
|
|
351
|
+
chainIdToChainName.init(caipIdFromInfo(chainInfo), chainName);
|
|
352
352
|
if (chainInfo.bech32Prefix) {
|
|
353
353
|
bech32PrefixToChainName.init(chainInfo.bech32Prefix, chainName);
|
|
354
354
|
}
|
|
@@ -449,7 +449,7 @@ export const makeChainHub = (
|
|
|
449
449
|
*/
|
|
450
450
|
registerChain(name, chainInfo) {
|
|
451
451
|
chainInfos.init(name, chainInfo);
|
|
452
|
-
chainIdToChainName.init(
|
|
452
|
+
chainIdToChainName.init(caipIdFromInfo(chainInfo), name);
|
|
453
453
|
if (chainInfo.namespace === 'cosmos' && chainInfo.bech32Prefix) {
|
|
454
454
|
bech32PrefixToChainName.init(chainInfo.bech32Prefix, name);
|
|
455
455
|
}
|
|
@@ -467,8 +467,8 @@ export const makeChainHub = (
|
|
|
467
467
|
}
|
|
468
468
|
const oldInfo = chainInfos.get(chainName);
|
|
469
469
|
// defensively check, for older versions which may not have `chainIdToChainName`
|
|
470
|
-
if (chainIdToChainName.has(
|
|
471
|
-
chainIdToChainName.delete(
|
|
470
|
+
if (chainIdToChainName.has(caipIdFromInfo(oldInfo))) {
|
|
471
|
+
chainIdToChainName.delete(caipIdFromInfo(oldInfo));
|
|
472
472
|
}
|
|
473
473
|
if (/** @type {CosmosChainInfo} */ (oldInfo).bech32Prefix) {
|
|
474
474
|
bech32PrefixToChainName.delete(
|
|
@@ -476,7 +476,7 @@ export const makeChainHub = (
|
|
|
476
476
|
);
|
|
477
477
|
}
|
|
478
478
|
chainInfos.set(chainName, chainInfo);
|
|
479
|
-
chainIdToChainName.init(
|
|
479
|
+
chainIdToChainName.init(caipIdFromInfo(chainInfo), chainName);
|
|
480
480
|
if (/** @type {CosmosChainInfo} */ (chainInfo).bech32Prefix) {
|
|
481
481
|
bech32PrefixToChainName.init(
|
|
482
482
|
/** @type {CosmosChainInfo} */ (chainInfo).bech32Prefix,
|
|
@@ -490,6 +490,8 @@ export const makeChainHub = (
|
|
|
490
490
|
* @returns {Vow<ActualChainInfo<K>>}
|
|
491
491
|
*/
|
|
492
492
|
getChainInfo(chainName) {
|
|
493
|
+
chainName.includes(':') &&
|
|
494
|
+
Fail`${chainName} must be a bare chain name. Maybe try getChainInfoByChainId()`;
|
|
493
495
|
// Either from registerChain or memoized remote lookup()
|
|
494
496
|
if (chainInfos.has(chainName)) {
|
|
495
497
|
return /** @type {Vow<ActualChainInfo<K>>} */ (
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {TypedPattern} from '@agoric/internal';
|
|
3
|
-
* @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount, DenomInfo, AmountArg, CosmosValidatorAddress, OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions, AccountIdArg, BaseChainInfo, ChainInfo} from './types.js';
|
|
3
|
+
* @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount, DenomInfo, AmountArg, CosmosValidatorAddress, OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions, AccountIdArg, BaseChainInfo, ChainInfo,Caip10Record} from './types.js';
|
|
4
4
|
* @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
5
5
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
6
6
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
@@ -21,13 +21,15 @@ export namespace CosmosChainAddressShape {
|
|
|
21
21
|
let encoding: import("@endo/patterns").Matcher;
|
|
22
22
|
let value: import("@endo/patterns").Matcher;
|
|
23
23
|
}
|
|
24
|
+
/** @type {TypedPattern<Caip10Record>} */
|
|
25
|
+
export const Caip10RecordShape: TypedPattern<Caip10Record>;
|
|
24
26
|
export namespace ChainAddressShape { }
|
|
25
27
|
/**
|
|
26
28
|
* NB: For the AccountId case does not fully verify it is CAIP-10 (only string)
|
|
27
29
|
*
|
|
28
30
|
* @type {TypedPattern<AccountIdArg>}
|
|
29
31
|
*/
|
|
30
|
-
export const
|
|
32
|
+
export const AccountIdArgShape: TypedPattern<AccountIdArg>;
|
|
31
33
|
/** @type {TypedPattern<Proto3Msg>} */
|
|
32
34
|
export const Proto3Shape: TypedPattern<Proto3Msg>;
|
|
33
35
|
/** @internal */
|
|
@@ -107,8 +109,9 @@ export const ForwardOptsShape: TypedPattern<IBCMsgTransferOptions["forwardOpts"]
|
|
|
107
109
|
* @internal
|
|
108
110
|
*/
|
|
109
111
|
export const IBCTransferOptionsShape: TypedPattern<IBCMsgTransferOptions>;
|
|
110
|
-
import type {
|
|
112
|
+
import type { Caip10Record } from './types.js';
|
|
111
113
|
import type { TypedPattern } from '@agoric/internal';
|
|
114
|
+
import type { AccountIdArg } from './types.js';
|
|
112
115
|
import type { Any as Proto3Msg } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
113
116
|
import type { CosmosAssetInfo } from './types.js';
|
|
114
117
|
import type { BaseChainInfo } from './types.js';
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH;;;GAQE
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH;;;GAQE;;;;;;AAYF,yCAAyC;AACzC,gCADW,aAAa,YAAY,CAAC,CAKnC;;AAMF;;;;GAIG;AACH,gCAFU,aAAa,YAAY,CAAC,CAEuC;AAE3E,sCAAsC;AACtC,0BADW,aAAa,SAAS,CAAC,CACoC;AAGtE,gBAAgB;AAChB,iEAA4C;AAE5C,gBAAgB;AAChB,mEAQG;AAEH,gBAAgB;AAChB,oEAA+C;AAE/C,gBAAgB;AAChB,sEASG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CASrC;AAWH,0CAA0C;AAC1C,iCADW,aAAa,aAAa,CAAC,CAIpC;AAGF,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CAetC;AAGF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAC2C;AAG7E,0DAAqC;AAErC,iCAAiC;AACjC,wBADW,aAAa,IAAI,CAAC,CAK3B;AAGF,gDAAgD;AAChD,6BADW,aAAa,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC,CAM1C;AAGF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAIlC;AAGF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CACkC;AAGtE,0CAA0C;AAC1C,gCADW,aAAa,MAAM,CAAC,KAAK,CAAC,CAAC,CAIpC;AAGF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CACsC;AAExE;;;;;GAKG;AACH,8BALU,aAAa;IAClB,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC,CAQH;AAEF,sCAAsC;AACtC,2DAGE;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CACmC;;;;;;;;;AAmBrE;;;;GAIG;AACH,+DAQE;AAEF;;;GAGG;AACH,mEAGE;AAEF,gDAAgD;AAChD,uCADW,aAAa,mBAAmB,CAAC,CAO1C;AAYF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAWlC;AAGF;;;;GAIG;AACH,+BAFU,aAAa,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAU1D;AAEF;;;GAGG;AACH,sCAHU,aAAa,qBAAqB,CAAC,CAc3C;kCA5S0N,YAAY;kCADzM,kBAAkB;kCAC2K,YAAY;sCACrM,6CAA6C;qCAD4I,YAAY;mCAAZ,YAAY;qCAAZ,YAAY;+BAAZ,YAAY;0BAGjN,kDAAkD;+BAHmJ,YAAY;iCAK1M,qBAAqB;iCALyK,YAAY;+BAAZ,YAAY;4CAAZ,YAAY;+BAI5M,sBAAsB;yCAJ0K,YAAY;iCAAZ,YAAY;2CAAZ,YAAY"}
|
package/src/typeGuards.js
CHANGED
|
@@ -4,7 +4,7 @@ import { M } from '@endo/patterns';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @import {TypedPattern} from '@agoric/internal';
|
|
7
|
-
* @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount, DenomInfo, AmountArg, CosmosValidatorAddress, OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions, AccountIdArg, BaseChainInfo, ChainInfo} from './types.js';
|
|
7
|
+
* @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount, DenomInfo, AmountArg, CosmosValidatorAddress, OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions, AccountIdArg, BaseChainInfo, ChainInfo,Caip10Record} from './types.js';
|
|
8
8
|
* @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
9
9
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
10
10
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
@@ -36,6 +36,15 @@ export const CosmosChainAddressShape = {
|
|
|
36
36
|
value: M.string(),
|
|
37
37
|
};
|
|
38
38
|
harden(CosmosChainAddressShape);
|
|
39
|
+
|
|
40
|
+
/** @type {TypedPattern<Caip10Record>} */
|
|
41
|
+
export const Caip10RecordShape = {
|
|
42
|
+
namespace: M.string(),
|
|
43
|
+
reference: M.string(),
|
|
44
|
+
accountAddress: M.string(),
|
|
45
|
+
};
|
|
46
|
+
harden(Caip10RecordShape);
|
|
47
|
+
|
|
39
48
|
/** @deprecated use CosmosChainAddressShape */
|
|
40
49
|
export const ChainAddressShape = CosmosChainAddressShape;
|
|
41
50
|
|
|
@@ -44,7 +53,7 @@ export const ChainAddressShape = CosmosChainAddressShape;
|
|
|
44
53
|
*
|
|
45
54
|
* @type {TypedPattern<AccountIdArg>}
|
|
46
55
|
*/
|
|
47
|
-
export const
|
|
56
|
+
export const AccountIdArgShape = M.or(M.string(), CosmosChainAddressShape);
|
|
48
57
|
|
|
49
58
|
/** @type {TypedPattern<Proto3Msg>} */
|
|
50
59
|
export const Proto3Shape = { typeUrl: M.string(), value: M.string() };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function caipIdFromInfo(info: ChainInfo | Caip10Record): CaipChainId;
|
|
2
2
|
import type { ChainInfo } from '../types.js';
|
|
3
|
+
import type { Caip10Record } from '../types.js';
|
|
3
4
|
import type { CaipChainId } from '../types.js';
|
|
4
5
|
//# sourceMappingURL=chain-info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.js"],"names":[],"mappings":"AAQO,
|
|
1
|
+
{"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.js"],"names":[],"mappings":"AAQO,qCAHI,SAAS,GAAG,YAAY,GACtB,WAAW,CAIvB;+BATqG,aAAa;kCAAb,aAAa;iCAAb,aAAa"}
|
package/src/utils/chain-info.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {CaipChainId, ChainHub, ChainInfo, CosmosChainInfo, Denom, DenomDetail} from '../types.js';
|
|
2
|
+
* @import {CaipChainId, ChainHub, ChainInfo, CosmosChainInfo, Denom, DenomDetail, Caip10Record} from '../types.js';
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @param {ChainInfo} info
|
|
6
|
+
* @param {ChainInfo | Caip10Record} info
|
|
7
7
|
* @returns {CaipChainId}
|
|
8
8
|
*/
|
|
9
|
-
export const
|
|
9
|
+
export const caipIdFromInfo = info => {
|
|
10
10
|
return `${info.namespace}:${info.reference}`;
|
|
11
11
|
};
|
|
@@ -4,7 +4,7 @@ import { VowShape } from '@agoric/vow';
|
|
|
4
4
|
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/topics.js';
|
|
5
5
|
import { M } from '@endo/patterns';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
AccountIdArgShape,
|
|
8
8
|
AmountArgShape,
|
|
9
9
|
CosmosChainAddressShape,
|
|
10
10
|
DenomAmountShape,
|
|
@@ -22,11 +22,11 @@ export const orchestrationAccountMethods = {
|
|
|
22
22
|
Vow$(DenomAmountShape),
|
|
23
23
|
),
|
|
24
24
|
getBalances: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))),
|
|
25
|
-
send: M.call(
|
|
25
|
+
send: M.call(AccountIdArgShape, AmountArgShape).returns(VowShape),
|
|
26
26
|
sendAll: M.call(CosmosChainAddressShape, M.arrayOf(AmountArgShape)).returns(
|
|
27
27
|
VowShape,
|
|
28
28
|
),
|
|
29
|
-
transfer: M.call(
|
|
29
|
+
transfer: M.call(AccountIdArgShape, AmountArgShape)
|
|
30
30
|
.optional(IBCTransferOptionsShape)
|
|
31
31
|
.returns(VowShape),
|
|
32
32
|
transferSteps: M.call(AmountArgShape, M.any()).returns(VowShape),
|