@agoric/orchestration 0.1.1-dev-afbbd9a.0 → 0.1.1-dev-129bb20.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/stake-ica.contract.d.ts +67 -3
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/exos/chain-hub.d.ts +9 -6
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +30 -24
- package/src/exos/cosmos-orchestration-account.d.ts +67 -3
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +12 -15
- package/src/exos/ica-account-kit.d.ts +5 -1
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +4 -1
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +4 -7
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/orchestration-api.d.ts +3 -3
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +3 -2
- package/src/utils/cosmos.d.ts +1 -1
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +2 -2
- package/src/utils/start-helper.d.ts +2 -2
- package/tools/ibc-mocks.d.ts +2 -2
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +5 -2
- package/tools/make-test-address.d.ts +2 -1
- package/tools/make-test-address.d.ts.map +1 -1
- package/tools/make-test-address.js +6 -2
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-129bb20.0+129bb20",
|
|
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-129bb20.0+129bb20",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-129bb20.0+129bb20",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-129bb20.0+129bb20",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-129bb20.0+129bb20",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-129bb20.0+129bb20",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-129bb20.0+129bb20",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-129bb20.0+129bb20",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-129bb20.0+129bb20",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-129bb20.0+129bb20",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-129bb20.0+129bb20",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-129bb20.0+129bb20",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-129bb20.0+129bb20",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-129bb20.0+129bb20",
|
|
49
49
|
"@cosmjs/encoding": "^0.32.4",
|
|
50
50
|
"@endo/base64": "^1.0.9",
|
|
51
51
|
"@endo/errors": "^1.2.10",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"bs58": "^6.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
59
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-129bb20.0+129bb20",
|
|
60
60
|
"@chain-registry/client": "^1.47.4",
|
|
61
61
|
"@cosmjs/amino": "^0.33.0",
|
|
62
62
|
"@cosmjs/proto-signing": "^0.33.0",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"typeCoverage": {
|
|
100
100
|
"atLeast": 97.84
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "129bb208d14fe7b03fed190c8a507ed1c7269721"
|
|
103
103
|
}
|
|
@@ -49,12 +49,76 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
49
49
|
getDelegations(): import("@agoric/vow").Vow<{
|
|
50
50
|
delegator: {
|
|
51
51
|
chainId: string;
|
|
52
|
-
value:
|
|
53
|
-
encoding: "bech32"
|
|
52
|
+
value: import("../cosmos-api.js").Bech32Address;
|
|
53
|
+
encoding: "bech32";
|
|
54
54
|
};
|
|
55
55
|
validator: {
|
|
56
56
|
chainId: string;
|
|
57
|
-
value:
|
|
57
|
+
value: {
|
|
58
|
+
readonly [x: number]: string;
|
|
59
|
+
toString: () => string;
|
|
60
|
+
charAt: (pos: number) => string;
|
|
61
|
+
charCodeAt: (index: number) => number;
|
|
62
|
+
concat: (...args: string[]) => string;
|
|
63
|
+
indexOf: (searchString: string, position?: number | undefined) => number;
|
|
64
|
+
lastIndexOf: (searchString: string, position?: number | undefined) => number;
|
|
65
|
+
localeCompare: (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions | undefined) => number;
|
|
66
|
+
match: ((matcher: {
|
|
67
|
+
[Symbol.match](string: string): RegExpMatchArray | null;
|
|
68
|
+
}) => null) | ((matcher: {
|
|
69
|
+
[Symbol.match](string: string): RegExpMatchArray | null;
|
|
70
|
+
}) => import("@agoric/async-flow").HostInterface<RegExpMatchArray>);
|
|
71
|
+
replace: (searchValue: {
|
|
72
|
+
[Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
|
|
73
|
+
}, replacer: (substring: string, ...args: any[]) => string) => string;
|
|
74
|
+
search: (searcher: {
|
|
75
|
+
[Symbol.search](string: string): number;
|
|
76
|
+
}) => number;
|
|
77
|
+
slice: (start?: number | undefined, end?: number | undefined) => string;
|
|
78
|
+
split: (splitter: {
|
|
79
|
+
[Symbol.split](string: string, limit?: number): string[];
|
|
80
|
+
}, limit?: number | undefined) => string[];
|
|
81
|
+
substring: (start: number, end?: number | undefined) => string;
|
|
82
|
+
toLowerCase: () => string;
|
|
83
|
+
toLocaleLowerCase: (locales?: Intl.LocalesArgument) => string;
|
|
84
|
+
toUpperCase: () => string;
|
|
85
|
+
toLocaleUpperCase: (locales?: Intl.LocalesArgument) => string;
|
|
86
|
+
trim: () => string;
|
|
87
|
+
readonly length: number;
|
|
88
|
+
substr: (from: number, length?: number | undefined) => string;
|
|
89
|
+
valueOf: () => string;
|
|
90
|
+
codePointAt: ((pos: number) => undefined) | ((pos: number) => number);
|
|
91
|
+
includes: ((searchString: string, position?: number | undefined) => false) | ((searchString: string, position?: number | undefined) => true);
|
|
92
|
+
endsWith: ((searchString: string, endPosition?: number | undefined) => false) | ((searchString: string, endPosition?: number | undefined) => true);
|
|
93
|
+
normalize: (form?: string | undefined) => string;
|
|
94
|
+
repeat: (count: number) => string;
|
|
95
|
+
startsWith: ((searchString: string, position?: number | undefined) => false) | ((searchString: string, position?: number | undefined) => true);
|
|
96
|
+
anchor: (name: string) => string;
|
|
97
|
+
big: () => string;
|
|
98
|
+
blink: () => string;
|
|
99
|
+
bold: () => string;
|
|
100
|
+
fixed: () => string;
|
|
101
|
+
fontcolor: (color: string) => string;
|
|
102
|
+
fontsize: (size: string) => string;
|
|
103
|
+
italics: () => string;
|
|
104
|
+
link: (url: string) => string;
|
|
105
|
+
small: () => string;
|
|
106
|
+
strike: () => string;
|
|
107
|
+
sub: () => string;
|
|
108
|
+
sup: () => string;
|
|
109
|
+
padStart: (maxLength: number, fillString?: string | undefined) => string;
|
|
110
|
+
padEnd: (maxLength: number, fillString?: string | undefined) => string;
|
|
111
|
+
trimEnd: () => string;
|
|
112
|
+
trimStart: () => string;
|
|
113
|
+
trimLeft: () => string;
|
|
114
|
+
trimRight: () => string;
|
|
115
|
+
matchAll: (regexp: RegExp) => import("@agoric/async-flow").HostInterface<RegExpStringIterator<RegExpExecArray>>;
|
|
116
|
+
replaceAll: (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string;
|
|
117
|
+
at: ((index: number) => undefined) | ((index: number) => string);
|
|
118
|
+
isWellFormed: (() => false) | (() => true);
|
|
119
|
+
toWellFormed: () => string;
|
|
120
|
+
[Symbol.iterator]: () => import("@agoric/async-flow").HostInterface<StringIterator<string>>;
|
|
121
|
+
};
|
|
58
122
|
encoding: "bech32";
|
|
59
123
|
};
|
|
60
124
|
amount: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,IAAI,aAAa,CAAC,eAClB;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;CACrB,WACO,OAAO
|
|
1
|
+
{"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,IAAI,aAAa,CAAC,eAClB;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGjB;4BA1HY;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,eAAe,CAAC;IAClC,sBAAsB,EAAE,eAAe,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;CACrB;yBAwHU,OAAO,KAAK;kCAzJ+B,aAAa;yBAAb,aAAa;6BAC3B,cAAc;4BAFhC,kBAAkB;6CAKwB,aAAa;kCAFjD,cAAc;6BAJnB,kBAAkB;mDAKI,uBAAuB;gCAHd,aAAa;qCAC3B,cAAc"}
|
package/src/exos/chain-hub.d.ts
CHANGED
|
@@ -134,18 +134,21 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
|
|
|
134
134
|
*/
|
|
135
135
|
getDenom(brand: Brand): Denom | undefined;
|
|
136
136
|
/**
|
|
137
|
-
* @param {AccountId | Bech32Address
|
|
138
|
-
*
|
|
137
|
+
* @param {AccountId | Bech32Address} partialId CAIP-10 account ID or a
|
|
138
|
+
* Cosmos bech32 address
|
|
139
139
|
* @returns {AccountId}
|
|
140
140
|
* @throws {Error} if chain info not found for bech32Prefix
|
|
141
141
|
*/
|
|
142
|
-
resolveAccountId(partialId: AccountId | Bech32Address
|
|
142
|
+
resolveAccountId(partialId: AccountId | Bech32Address): AccountId;
|
|
143
143
|
/**
|
|
144
|
-
* @
|
|
144
|
+
* Like {@see resolveAccountId} but always returns a CosmosChainAddress.
|
|
145
|
+
*
|
|
146
|
+
* @param {AccountIdArg | Bech32Address} partialId CAIP-10 account ID or a
|
|
147
|
+
* Cosmos bech32 address
|
|
145
148
|
* @returns {CosmosChainAddress}
|
|
146
149
|
* @throws {Error} if chain info not found for bech32Prefix
|
|
147
150
|
*/
|
|
148
|
-
|
|
151
|
+
coerceCosmosAddress(partialId: AccountIdArg | Bech32Address): CosmosChainAddress;
|
|
149
152
|
/**
|
|
150
153
|
* Determine the IBC transfer route for a destination and amount given the
|
|
151
154
|
* current holding chain.
|
|
@@ -203,8 +206,8 @@ import type { CaipChainId } from '../orchestration-api.js';
|
|
|
203
206
|
import type { Denom } from '../orchestration-api.js';
|
|
204
207
|
import type { AccountId } from '../orchestration-api.js';
|
|
205
208
|
import type { Bech32Address } from '../cosmos-api.js';
|
|
206
|
-
import type { CosmosChainAddress } from '../orchestration-api.js';
|
|
207
209
|
import type { AccountIdArg } from '../orchestration-api.js';
|
|
210
|
+
import type { CosmosChainAddress } from '../orchestration-api.js';
|
|
208
211
|
import type { DenomAmount } from '../orchestration-api.js';
|
|
209
212
|
import type { IBCMsgTransferOptions } from '../cosmos-api.js';
|
|
210
213
|
import type { CosmosAssetInfo } from '../cosmos-api.js';
|
|
@@ -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;AAC1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AMD,kBAAkB;8BALzB,aAAa;6BAMnB,gBAAgB;+BAFgE,yBAAyB;yBAJnG,aAAa;iCAI6D,yBAAyB;2BAAzB,yBAAyB;+BAAzB,yBAAyB;mCAFiB,kBAAkB;kCAE5D,yBAAyB;wCAAzB,yBAAyB;iCAAzB,yBAAyB;2CAFiB,kBAAkB;qCAAlB,kBAAkB;iCACxI,kBAAkB"}
|
package/src/exos/chain-hub.js
CHANGED
|
@@ -232,8 +232,10 @@ 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
|
-
|
|
236
|
-
|
|
235
|
+
coerceCosmosAddress: M.call(AccountIdArgShape).returns(
|
|
236
|
+
CosmosChainAddressShape,
|
|
237
|
+
),
|
|
238
|
+
resolveAccountId: M.call(M.string()).returns(M.string()),
|
|
237
239
|
makeTransferRoute: M.call(AccountIdArgShape, DenomAmountShape, M.string())
|
|
238
240
|
.optional(ForwardOptsShape)
|
|
239
241
|
.returns(M.or(M.undefined(), TransferRouteShape)),
|
|
@@ -679,8 +681,8 @@ export const makeChainHub = (
|
|
|
679
681
|
},
|
|
680
682
|
|
|
681
683
|
/**
|
|
682
|
-
* @param {AccountId | Bech32Address
|
|
683
|
-
*
|
|
684
|
+
* @param {AccountId | Bech32Address} partialId CAIP-10 account ID or a
|
|
685
|
+
* Cosmos bech32 address
|
|
684
686
|
* @returns {AccountId}
|
|
685
687
|
* @throws {Error} if chain info not found for bech32Prefix
|
|
686
688
|
*/
|
|
@@ -697,27 +699,34 @@ export const makeChainHub = (
|
|
|
697
699
|
},
|
|
698
700
|
|
|
699
701
|
/**
|
|
700
|
-
* @
|
|
702
|
+
* Like {@see resolveAccountId} but always returns a CosmosChainAddress.
|
|
703
|
+
*
|
|
704
|
+
* @param {AccountIdArg | Bech32Address} partialId CAIP-10 account ID or a
|
|
705
|
+
* Cosmos bech32 address
|
|
701
706
|
* @returns {CosmosChainAddress}
|
|
702
707
|
* @throws {Error} if chain info not found for bech32Prefix
|
|
703
708
|
*/
|
|
704
|
-
|
|
709
|
+
coerceCosmosAddress(partialId) {
|
|
710
|
+
if (typeof partialId !== 'string') {
|
|
711
|
+
// already a CosmosChainAddress
|
|
712
|
+
return partialId;
|
|
713
|
+
}
|
|
705
714
|
const parts = partialId.split(':');
|
|
706
715
|
if (parts.length === 3) {
|
|
707
716
|
assert.equal(parts[0], 'cosmos');
|
|
708
717
|
return harden({
|
|
709
718
|
chainId: parts[1],
|
|
710
719
|
encoding: 'bech32',
|
|
711
|
-
value: parts[2],
|
|
720
|
+
value: /** @type {Bech32Address} */ (parts[2]),
|
|
712
721
|
});
|
|
713
722
|
}
|
|
714
723
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
);
|
|
724
|
+
assert.equal(parts.length, 1); // no colons
|
|
725
|
+
const value = /** @type {Bech32Address} */ (partialId);
|
|
726
|
+
const cosmosChainId = resolveCosmosChainId(value);
|
|
718
727
|
return harden({
|
|
719
728
|
chainId: cosmosChainId,
|
|
720
|
-
value
|
|
729
|
+
value,
|
|
721
730
|
encoding: /** @type {const} */ ('bech32'),
|
|
722
731
|
});
|
|
723
732
|
},
|
|
@@ -767,21 +776,18 @@ export const makeChainHub = (
|
|
|
767
776
|
}
|
|
768
777
|
const { chainId: holdingChainId } = holdingChainInfo;
|
|
769
778
|
|
|
770
|
-
|
|
771
|
-
typeof destination === 'string'
|
|
772
|
-
? chainHub.makeChainAddress(destination)
|
|
773
|
-
: destination;
|
|
779
|
+
const cosmosDest = chainHub.coerceCosmosAddress(destination);
|
|
774
780
|
|
|
775
781
|
// asset is transferring to or from the issuing chain, return direct route
|
|
776
|
-
if (baseChainId ===
|
|
782
|
+
if (baseChainId === cosmosDest.chainId || baseName === srcChainName) {
|
|
777
783
|
// TODO use getConnectionInfo once its sync
|
|
778
|
-
const connKey = connectionKey(holdingChainId,
|
|
784
|
+
const connKey = connectionKey(holdingChainId, cosmosDest.chainId);
|
|
779
785
|
connectionInfos.has(connKey) ||
|
|
780
|
-
Fail`no connection info found for ${holdingChainId}<->${
|
|
786
|
+
Fail`no connection info found for ${holdingChainId}<->${cosmosDest.chainId}`;
|
|
781
787
|
|
|
782
788
|
const { transferChannel } = denormalizeConnectionInfo(
|
|
783
789
|
holdingChainId, // from chain (primary)
|
|
784
|
-
|
|
790
|
+
cosmosDest.chainId, // to chain (counterparty)
|
|
785
791
|
connectionInfos.get(connKey),
|
|
786
792
|
);
|
|
787
793
|
return harden({
|
|
@@ -791,7 +797,7 @@ export const makeChainHub = (
|
|
|
791
797
|
amount: String(denomAmount.value),
|
|
792
798
|
denom: denomAmount.denom,
|
|
793
799
|
},
|
|
794
|
-
receiver:
|
|
800
|
+
receiver: cosmosDest.value,
|
|
795
801
|
});
|
|
796
802
|
}
|
|
797
803
|
|
|
@@ -803,9 +809,9 @@ export const makeChainHub = (
|
|
|
803
809
|
connectionInfos.has(currToIssuerKey) ||
|
|
804
810
|
Fail`no connection info found for ${holdingChainId}<->${baseChainId}`;
|
|
805
811
|
|
|
806
|
-
const issuerToDestKey = connectionKey(baseChainId,
|
|
812
|
+
const issuerToDestKey = connectionKey(baseChainId, cosmosDest.chainId);
|
|
807
813
|
connectionInfos.has(issuerToDestKey) ||
|
|
808
|
-
Fail`no connection info found for ${baseChainId}<->${
|
|
814
|
+
Fail`no connection info found for ${baseChainId}<->${cosmosDest.chainId}`;
|
|
809
815
|
|
|
810
816
|
const currToIssuer = denormalizeConnectionInfo(
|
|
811
817
|
holdingChainId,
|
|
@@ -814,7 +820,7 @@ export const makeChainHub = (
|
|
|
814
820
|
);
|
|
815
821
|
const issuerToDest = denormalizeConnectionInfo(
|
|
816
822
|
baseChainId,
|
|
817
|
-
|
|
823
|
+
cosmosDest.chainId,
|
|
818
824
|
connectionInfos.get(issuerToDestKey),
|
|
819
825
|
);
|
|
820
826
|
|
|
@@ -822,7 +828,7 @@ export const makeChainHub = (
|
|
|
822
828
|
/** @type {ForwardInfo} */
|
|
823
829
|
const forwardInfo = harden({
|
|
824
830
|
forward: {
|
|
825
|
-
receiver:
|
|
831
|
+
receiver: cosmosDest.value,
|
|
826
832
|
port: issuerToDest.transferChannel.portId,
|
|
827
833
|
channel: issuerToDest.transferChannel.channelId,
|
|
828
834
|
...DefaultPfmTimeoutOpts,
|
|
@@ -240,12 +240,76 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
240
240
|
getDelegations(): Vow<{
|
|
241
241
|
delegator: {
|
|
242
242
|
chainId: string;
|
|
243
|
-
value:
|
|
244
|
-
encoding: "bech32"
|
|
243
|
+
value: import("../cosmos-api.js").Bech32Address;
|
|
244
|
+
encoding: "bech32";
|
|
245
245
|
};
|
|
246
246
|
validator: {
|
|
247
247
|
chainId: string;
|
|
248
|
-
value:
|
|
248
|
+
value: {
|
|
249
|
+
readonly [x: number]: string;
|
|
250
|
+
toString: () => string;
|
|
251
|
+
charAt: (pos: number) => string;
|
|
252
|
+
charCodeAt: (index: number) => number;
|
|
253
|
+
concat: (...args: string[]) => string;
|
|
254
|
+
indexOf: (searchString: string, position?: number | undefined) => number;
|
|
255
|
+
lastIndexOf: (searchString: string, position?: number | undefined) => number;
|
|
256
|
+
localeCompare: (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions | undefined) => number;
|
|
257
|
+
match: ((matcher: {
|
|
258
|
+
[Symbol.match](string: string): RegExpMatchArray | null;
|
|
259
|
+
}) => null) | ((matcher: {
|
|
260
|
+
[Symbol.match](string: string): RegExpMatchArray | null;
|
|
261
|
+
}) => import("@agoric/async-flow").HostInterface<RegExpMatchArray>);
|
|
262
|
+
replace: (searchValue: {
|
|
263
|
+
[Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
|
|
264
|
+
}, replacer: (substring: string, ...args: any[]) => string) => string;
|
|
265
|
+
search: (searcher: {
|
|
266
|
+
[Symbol.search](string: string): number;
|
|
267
|
+
}) => number;
|
|
268
|
+
slice: (start?: number | undefined, end?: number | undefined) => string;
|
|
269
|
+
split: (splitter: {
|
|
270
|
+
[Symbol.split](string: string, limit?: number): string[];
|
|
271
|
+
}, limit?: number | undefined) => string[];
|
|
272
|
+
substring: (start: number, end?: number | undefined) => string;
|
|
273
|
+
toLowerCase: () => string;
|
|
274
|
+
toLocaleLowerCase: (locales?: Intl.LocalesArgument) => string;
|
|
275
|
+
toUpperCase: () => string;
|
|
276
|
+
toLocaleUpperCase: (locales?: Intl.LocalesArgument) => string;
|
|
277
|
+
trim: () => string;
|
|
278
|
+
readonly length: number;
|
|
279
|
+
substr: (from: number, length?: number | undefined) => string;
|
|
280
|
+
valueOf: () => string;
|
|
281
|
+
codePointAt: ((pos: number) => undefined) | ((pos: number) => number);
|
|
282
|
+
includes: ((searchString: string, position?: number | undefined) => false) | ((searchString: string, position?: number | undefined) => true);
|
|
283
|
+
endsWith: ((searchString: string, endPosition?: number | undefined) => false) | ((searchString: string, endPosition?: number | undefined) => true);
|
|
284
|
+
normalize: (form?: string | undefined) => string;
|
|
285
|
+
repeat: (count: number) => string;
|
|
286
|
+
startsWith: ((searchString: string, position?: number | undefined) => false) | ((searchString: string, position?: number | undefined) => true);
|
|
287
|
+
anchor: (name: string) => string;
|
|
288
|
+
big: () => string;
|
|
289
|
+
blink: () => string;
|
|
290
|
+
bold: () => string;
|
|
291
|
+
fixed: () => string;
|
|
292
|
+
fontcolor: (color: string) => string;
|
|
293
|
+
fontsize: (size: string) => string;
|
|
294
|
+
italics: () => string;
|
|
295
|
+
link: (url: string) => string;
|
|
296
|
+
small: () => string;
|
|
297
|
+
strike: () => string;
|
|
298
|
+
sub: () => string;
|
|
299
|
+
sup: () => string;
|
|
300
|
+
padStart: (maxLength: number, fillString?: string | undefined) => string;
|
|
301
|
+
padEnd: (maxLength: number, fillString?: string | undefined) => string;
|
|
302
|
+
trimEnd: () => string;
|
|
303
|
+
trimStart: () => string;
|
|
304
|
+
trimLeft: () => string;
|
|
305
|
+
trimRight: () => string;
|
|
306
|
+
matchAll: (regexp: RegExp) => import("@agoric/async-flow").HostInterface<RegExpStringIterator<RegExpExecArray>>;
|
|
307
|
+
replaceAll: (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string;
|
|
308
|
+
at: ((index: number) => undefined) | ((index: number) => string);
|
|
309
|
+
isWellFormed: (() => false) | (() => true);
|
|
310
|
+
toWellFormed: () => string;
|
|
311
|
+
[Symbol.iterator]: () => import("@agoric/async-flow").HostInterface<StringIterator<string>>;
|
|
312
|
+
};
|
|
249
313
|
encoding: "bech32";
|
|
250
314
|
};
|
|
251
315
|
amount: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAyJA,wCAAwC;AACxC;;;;;;;;;;;;;;;;;;;;;;;;;;GAUG;AAOH;;;;;;;;;;;GAoBE;AAYK,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACI,GAAG,EAAf,GAAG;CACb;kBAsGc,kBAAkB;kBAClB,eAAe;mBACf,gBAAgB;;aAEhB,UAAU;;;;;;;WAGV,OAAO,YAAY,CAAC;;;QAuC3B,wDAAwD;;;QAYxD;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QASjB;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;;WAGG;8BAFQ,SAAS,aAAa,CAAC,EAAE,GACvB,wBAAwB;;;QAgBrC;;;WAGG;8BAFQ,SAAS,aAAa,CAAC,EAAE,GACvB,wBAAwB,EAAE;;;QAiBvC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAcpC;;WAEG;8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CAAC,CACxD;yCA8BU,6BAA6B,CAAC,QAAQ,CAAC;0BAnoC9B,cAAc;8BATsR,aAAa;qCAEzR,6CAA6C;kCAK7D,cAAc;4BAHpB,kBAAkB;8BAIX,aAAa;yBAP0B,aAAa;wCADuO,aAAa;qCAapR,iCAAiC;sCAAjC,iCAAiC;gCAbsO,aAAa;8BAW7S,sBAAsB;mCADjB,+CAA+C;yBAF/C,aAAa;+BAR8Q,aAAa;0BAGjT,kDAAkD;8CAHkP,aAAa;2CAAb,aAAa;uCAAb,aAAa;2CAAb,aAAa;4CAAb,aAAa;gCACjQ,aAAa;kCADuO,aAAa;mCAAb,aAAa;iCAEzR,6CAA6C"}
|
|
@@ -875,20 +875,17 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
875
875
|
send(toAccount, amount) {
|
|
876
876
|
return asVow(() => {
|
|
877
877
|
trace('send', toAccount, amount);
|
|
878
|
-
|
|
879
|
-
typeof toAccount === 'string'
|
|
880
|
-
? chainHub.makeChainAddress(toAccount)
|
|
881
|
-
: toAccount;
|
|
878
|
+
const cosmosDest = chainHub.coerceCosmosAddress(toAccount);
|
|
882
879
|
const { chainAddress } = this.state;
|
|
883
|
-
|
|
884
|
-
Fail`bank/send cannot send to a different chain ${q(
|
|
880
|
+
cosmosDest.chainId === chainAddress.chainId ||
|
|
881
|
+
Fail`bank/send cannot send to a different chain ${q(cosmosDest.chainId)}`;
|
|
885
882
|
const { helper } = this.facets;
|
|
886
883
|
return watch(
|
|
887
884
|
E(helper.owned()).executeEncodedTx([
|
|
888
885
|
Any.toJSON(
|
|
889
886
|
MsgSend.toProtoMsg({
|
|
890
887
|
fromAddress: chainAddress.value,
|
|
891
|
-
toAddress:
|
|
888
|
+
toAddress: cosmosDest.value,
|
|
892
889
|
amount: [helper.amountToCoin(amount)],
|
|
893
890
|
}),
|
|
894
891
|
),
|
|
@@ -925,12 +922,9 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
925
922
|
return asVow(() => {
|
|
926
923
|
// `destination` arg can be non-Cosmos per the common `.transfer` method signature
|
|
927
924
|
// but this implementation only supports transferring to another Cosmos chain.
|
|
928
|
-
// It relies on `
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
? // If `destination` is not actually CAIP-10 then this will throw
|
|
932
|
-
chainHub.makeChainAddress(destination)
|
|
933
|
-
: destination;
|
|
925
|
+
// It relies on `coerceCosmosChainAddress` to throw if `destination` has another namespace.
|
|
926
|
+
|
|
927
|
+
const cosmosDest = chainHub.coerceCosmosAddress(destination);
|
|
934
928
|
|
|
935
929
|
const { helper } = this.facets;
|
|
936
930
|
const token = helper.amountToCoin(amount);
|
|
@@ -938,7 +932,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
938
932
|
const connectionInfoV = watch(
|
|
939
933
|
chainHub.getConnectionInfo(
|
|
940
934
|
this.state.chainAddress.chainId,
|
|
941
|
-
|
|
935
|
+
cosmosDest.chainId,
|
|
942
936
|
),
|
|
943
937
|
);
|
|
944
938
|
|
|
@@ -957,7 +951,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
957
951
|
return watch(
|
|
958
952
|
allVows([connectionInfoV, timeoutTimestampVowOrValue]),
|
|
959
953
|
this.facets.transferWatcher,
|
|
960
|
-
{ opts, token, destination },
|
|
954
|
+
{ opts, token, destination: cosmosDest },
|
|
961
955
|
);
|
|
962
956
|
});
|
|
963
957
|
},
|
|
@@ -1011,6 +1005,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1011
1005
|
},
|
|
1012
1006
|
/** @type {HostOf<StakingAccountQueries['getDelegation']>} */
|
|
1013
1007
|
getDelegation(validator) {
|
|
1008
|
+
// @ts-expect-error XXX string template with generics
|
|
1014
1009
|
return asVow(() => {
|
|
1015
1010
|
trace('getDelegation', validator);
|
|
1016
1011
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -1030,6 +1025,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1030
1025
|
},
|
|
1031
1026
|
/** @type {HostOf<StakingAccountQueries['getDelegations']>} */
|
|
1032
1027
|
getDelegations() {
|
|
1028
|
+
// @ts-expect-error XXX string template with generics
|
|
1033
1029
|
return asVow(() => {
|
|
1034
1030
|
trace('getDelegations');
|
|
1035
1031
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -1125,6 +1121,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1125
1121
|
},
|
|
1126
1122
|
/** @type {HostOf<StakingAccountQueries['getRewards']>} */
|
|
1127
1123
|
getRewards() {
|
|
1124
|
+
// @ts-expect-error XXX string template with generics
|
|
1128
1125
|
return asVow(() => {
|
|
1129
1126
|
trace('getRewards');
|
|
1130
1127
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -71,7 +71,9 @@ export type State = {
|
|
|
71
71
|
localAddress: LocalIbcAddress | undefined;
|
|
72
72
|
requestedRemoteAddress: string;
|
|
73
73
|
remoteAddress: RemoteIbcAddress | undefined;
|
|
74
|
-
chainAddress: CosmosChainAddress |
|
|
74
|
+
chainAddress: (CosmosChainAddress | {
|
|
75
|
+
value: typeof UNPARSABLE_CHAIN_ADDRESS;
|
|
76
|
+
}) | undefined;
|
|
75
77
|
isInitiatingClose: boolean;
|
|
76
78
|
};
|
|
77
79
|
export type IcaAccountKit = ReturnType<ReturnType<typeof prepareIcaAccountKit>>;
|
|
@@ -86,4 +88,6 @@ import type { Connection } from '@agoric/network';
|
|
|
86
88
|
import type { Remote } from '@agoric/vow';
|
|
87
89
|
import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
88
90
|
import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
91
|
+
declare const UNPARSABLE_CHAIN_ADDRESS: "UNPARSABLE_CHAIN_ADDRESS";
|
|
92
|
+
export {};
|
|
89
93
|
//# sourceMappingURL=ica-account-kit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ica-account-kit.d.ts","sourceRoot":"","sources":["ica-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"ica-account-kit.d.ts","sourceRoot":"","sources":["ica-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;GAWG;AA4BI,2CAJI,IAAI,oBACJ,QAAQ;;QAiCX,0BAA0B;yBAAd,MAAM;;;QAMlB,oCAAoC;sBAAtB,kBAAkB;;;;;QA0BhC;;;;;;;;;WASG;+BALQ,OAAO,EAAE,SACT,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GACtB,IAAI,MAAM,CAAC;;;;;QA0CxB;;;;WAIG;2BAHQ,OAAO,UAAU,CAAC,aAClB,eAAe,cACf,gBAAgB;QAiB3B;;;;;;;;;;;;;;;;WAgBG;6BAHQ,OAAO,UAAU,CAAC,UAClB,OAAO;;GAkBvB;;;;oBAzLU;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;IAC3C,YAAY,EAAE,eAAe,GAAG,SAAS,CAAC;IAC1C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC5C,YAAY,EACR,CAAC,kBAAkB,GAAG;QAAE,KAAK,EAAE,OAAO,wBAAwB,CAAA;KAAE,CAAC,GACjE,SAAS,CAAC;IACd,iBAAiB,EAAE,OAAO,CAAC;CAC5B;4BAgLU,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;0BAxN1C,mBAAmB;8BAEF,aAAa;0BADlB,iBAAiB;wCAKH,aAAa;yBAJtB,aAAa;6BAC3B,sBAAsB;4BACvB,8CAA8C;gCAHpC,iBAAiB;4BACZ,aAAa;qCAGD,iCAAiC;sCAAjC,iCAAiC;AAMrF,wCAAiC,0BAA0B,CAAC"}
|
|
@@ -51,7 +51,9 @@ export const IcaAccountI = M.interface('IcaAccount', {
|
|
|
51
51
|
* localAddress: LocalIbcAddress | undefined;
|
|
52
52
|
* requestedRemoteAddress: string;
|
|
53
53
|
* remoteAddress: RemoteIbcAddress | undefined;
|
|
54
|
-
* chainAddress:
|
|
54
|
+
* chainAddress:
|
|
55
|
+
* | (CosmosChainAddress | { value: typeof UNPARSABLE_CHAIN_ADDRESS })
|
|
56
|
+
* | undefined;
|
|
55
57
|
* isInitiatingClose: boolean;
|
|
56
58
|
* }} State
|
|
57
59
|
* Internal to the IcaAccountKit exo
|
|
@@ -103,6 +105,7 @@ export const prepareIcaAccountKit = (zone, { watch, asVow }) =>
|
|
|
103
105
|
account: {
|
|
104
106
|
/** @returns {CosmosChainAddress} */
|
|
105
107
|
getAddress() {
|
|
108
|
+
// @ts-expect-error value may be UNPARSABLE_CHAIN_ADDRESS
|
|
106
109
|
return NonNullish(
|
|
107
110
|
this.state.chainAddress,
|
|
108
111
|
'ICA channel creation acknowledgement not yet received.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AAkGO,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;aAqFc,iBAAiB;aACjB,kBAAkB;;;;QAoBzB;;;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,kBAAkB;qBAAW,SAAS,EAAE;;;oBAc3C,SAAS;yBACJ,YAA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BAAqB,GAGnB,IAAI,GAAG,CAAC;;;;;;;;;GAoE5B;;aAzrBa,MAAM;;;;;oBAKP;IACR,QAAQ,EAAE,YAAY,6BAA6B,CAAC,GAAG,SAAS,CAAC;IACjE,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,kBAAkB,CAAC;CAC7B;+CAirBU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BAjtBnC,cAAc;qCADU,6CAA6C;yBADrB,aAAa;kCAKpC,cAAc;4BAFrC,kBAAkB;8BAGX,aAAa;8BAIlB,gBAAgB;gCAZK,gCAAgC;8BAcrD,uBAAuB;uCAdF,gCAAgC;wCACgH,uBAAuB;+BAAvB,uBAAuB;0BAShM,kDAAkD;yBAFzC,aAAa;gCAN0B,aAAa;qCAKpC,cAAc;kCANkI,uBAAuB;2CAAvB,uBAAuB;+BAQrK,sBAAsB;8BAAtB,sBAAsB;mCARwH,uBAAuB;iCAAvB,uBAAuB;6BAChJ,aAAa;gCAOlC,sBAAsB;iCANzB,6CAA6C;iCAU9D,mBAAmB"}
|
|
@@ -637,18 +637,15 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
637
637
|
send(toAccount, amount) {
|
|
638
638
|
return asVow(() => {
|
|
639
639
|
trace('send', toAccount, amount);
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
: toAccount;
|
|
644
|
-
toAccount.chainId === this.state.address.chainId ||
|
|
645
|
-
Fail`bank/send cannot send to a different chain ${q(toAccount.chainId)}`;
|
|
640
|
+
const cosmosDest = chainHub.coerceCosmosAddress(toAccount);
|
|
641
|
+
cosmosDest.chainId === this.state.address.chainId ||
|
|
642
|
+
Fail`bank/send cannot send to a different chain ${q(cosmosDest.chainId)}`;
|
|
646
643
|
const { helper } = this.facets;
|
|
647
644
|
return watch(
|
|
648
645
|
E(this.state.account).executeTx([
|
|
649
646
|
typedJson('/cosmos.bank.v1beta1.MsgSend', {
|
|
650
647
|
amount: [helper.amountToCoin(amount)],
|
|
651
|
-
toAddress:
|
|
648
|
+
toAddress: cosmosDest.value,
|
|
652
649
|
fromAddress: this.state.address.value,
|
|
653
650
|
}),
|
|
654
651
|
]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function preparePacketTools(zone: import("@agoric/base-zone").Zone, vowTools: VowTools): (lca: import("@endo/exo").Guarded<{
|
|
2
|
-
getAddress(): string
|
|
2
|
+
getAddress(): `${string}1${string}`;
|
|
3
3
|
getBalance(brand: Brand<"nat">): import("@agoric/vow").PromiseVow<Amount<"nat">>;
|
|
4
4
|
deposit(payment: ERef<Payment<"nat">>, optAmountShape?: Pattern): import("@agoric/vow").PromiseVow<Amount<"nat">>;
|
|
5
5
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<Payment<"nat">>;
|
|
@@ -8,7 +8,7 @@ import type { Timestamp } from '@agoric/time';
|
|
|
8
8
|
import type { QueryManyFn } from '@agoric/vats/src/localchain.js';
|
|
9
9
|
import type { ResolvedPublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
|
|
10
10
|
import type { Passable } from '@endo/marshal';
|
|
11
|
-
import type { AgoricChainMethods, CosmosChainAccountMethods, CosmosChainInfo, IBCMsgTransferOptions, KnownChains, LocalAccountMethods, ICQQueryFunction, KnownNamespace, NobleMethods } from './types.js';
|
|
11
|
+
import type { AgoricChainMethods, CosmosChainAccountMethods, CosmosChainInfo, IBCMsgTransferOptions, KnownChains, LocalAccountMethods, ICQQueryFunction, KnownNamespace, NobleMethods, Bech32Address } from './types.js';
|
|
12
12
|
import type { ResolvedContinuingOfferResult } from './utils/zoe-tools.js';
|
|
13
13
|
/**
|
|
14
14
|
* A denom that designates a path to a token type on some blockchain.
|
|
@@ -65,8 +65,8 @@ export type CosmosChainAddress = {
|
|
|
65
65
|
/** Within the Cosmos ecosystem. e.g. `agoric-3' or 'cosmoshub-4' */
|
|
66
66
|
chainId: string;
|
|
67
67
|
/** The address value used on-chain */
|
|
68
|
-
value:
|
|
69
|
-
encoding: 'bech32'
|
|
68
|
+
value: Bech32Address;
|
|
69
|
+
encoding: 'bech32';
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* Info used to identify blockchains across ecosystems
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AAAA;;;;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,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,YAAY,
|
|
1
|
+
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AAAA;;;;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,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,qBAAqB,E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aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/src/orchestration-api.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
ICQQueryFunction,
|
|
20
20
|
KnownNamespace,
|
|
21
21
|
NobleMethods,
|
|
22
|
+
Bech32Address,
|
|
22
23
|
} from './types.js';
|
|
23
24
|
import type { ResolvedContinuingOfferResult } from './utils/zoe-tools.js';
|
|
24
25
|
|
|
@@ -85,8 +86,8 @@ export type CosmosChainAddress = {
|
|
|
85
86
|
/** Within the Cosmos ecosystem. e.g. `agoric-3' or 'cosmoshub-4' */
|
|
86
87
|
chainId: string;
|
|
87
88
|
/** The address value used on-chain */
|
|
88
|
-
value:
|
|
89
|
-
encoding: 'bech32'
|
|
89
|
+
value: Bech32Address;
|
|
90
|
+
encoding: 'bech32';
|
|
90
91
|
};
|
|
91
92
|
|
|
92
93
|
/**
|
package/src/utils/cosmos.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {CosmosDelegationResponse, CosmosValidatorAddress, DenomAmount} from '../types.js';
|
|
2
|
+
* @import {Bech32Address, CosmosDelegationResponse, CosmosValidatorAddress, DenomAmount} from '../types.js';
|
|
3
3
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js'
|
|
4
4
|
* @import {DelegationResponse} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["cosmos.js"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,mFAAmF;AACnF,kCAAsC;AAO/B,kCAJM,CAAC,UACH,MAAM,gBACN,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC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B,CAM3B;AAEH;;;;;;;;GAQG;AACH,yCALU,CACL,SAAS,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9B,CAAC,EAAE,kBAAkB,KAClB,wBAAwB,CAU7B;iCA5E4F,aAAa;4CAAb,aAAa;wCAEvE,wDAAwD;8CAFE,aAAa"}
|
package/src/utils/cosmos.js
CHANGED
|
@@ -3,7 +3,7 @@ import { decodeBase64 } from '@endo/base64';
|
|
|
3
3
|
import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @import {CosmosDelegationResponse, CosmosValidatorAddress, DenomAmount} from '../types.js';
|
|
6
|
+
* @import {Bech32Address, CosmosDelegationResponse, CosmosValidatorAddress, DenomAmount} from '../types.js';
|
|
7
7
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js'
|
|
8
8
|
* @import {DelegationResponse} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
9
9
|
*/
|
|
@@ -75,7 +75,7 @@ export const toCosmosDelegationResponse = ({ chainId }, r) => ({
|
|
|
75
75
|
delegator: {
|
|
76
76
|
chainId,
|
|
77
77
|
encoding: 'bech32',
|
|
78
|
-
value: r.delegation.delegatorAddress,
|
|
78
|
+
value: /** @type {Bech32Address} */ (r.delegation.delegatorAddress),
|
|
79
79
|
},
|
|
80
80
|
validator: toCosmosValidatorAddress(r.delegation, chainId),
|
|
81
81
|
amount: toDenomAmount(r.balance),
|
|
@@ -25,8 +25,8 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
|
|
|
25
25
|
updateAsset(denom: import("../orchestration-api.js").Denom, detail: DenomDetail): void;
|
|
26
26
|
getAsset(denom: import("../orchestration-api.js").Denom, srcChainName: string): DenomDetail | undefined;
|
|
27
27
|
getDenom(brand: Brand): import("../orchestration-api.js").Denom | undefined;
|
|
28
|
-
resolveAccountId(partialId: import("../orchestration-api.js").AccountId | import("../cosmos-api.js").Bech32Address
|
|
29
|
-
|
|
28
|
+
resolveAccountId(partialId: import("../orchestration-api.js").AccountId | import("../cosmos-api.js").Bech32Address): import("../orchestration-api.js").AccountId;
|
|
29
|
+
coerceCosmosAddress(partialId: import("../orchestration-api.js").AccountIdArg | import("../cosmos-api.js").Bech32Address): import("../orchestration-api.js").CosmosChainAddress;
|
|
30
30
|
makeTransferRoute(destination: import("../orchestration-api.js").AccountIdArg | import("../cosmos-api.js").Bech32Address, denomAmount: import("../orchestration-api.js").DenomAmount, srcChainName: string, forwardOpts?: import("../cosmos-api.js").IBCMsgTransferOptions["forwardOpts"]): import("../cosmos-api.js").TransferRoute;
|
|
31
31
|
}>;
|
|
32
32
|
vowTools: import("@agoric/vow").VowTools;
|
package/tools/ibc-mocks.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
|
5
5
|
import type { PacketSDKType } from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
|
|
6
6
|
import { RequestQuery, ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.js';
|
|
7
7
|
import type { IBCChannelID, IBCEvent, VTransferIBCEvent } from '@agoric/vats';
|
|
8
|
-
import type { CosmosChainAddress } from '../src/orchestration-api.js';
|
|
8
|
+
import type { AccountId, CosmosChainAddress } from '../src/orchestration-api.js';
|
|
9
9
|
interface EncoderCommon<T> {
|
|
10
10
|
encode: (message: T) => {
|
|
11
11
|
finish: () => Uint8Array;
|
|
@@ -65,7 +65,7 @@ export declare function buildQueryPacketString(msgs: Any[], opts?: Partial<Omit<
|
|
|
65
65
|
type BuildVTransferEventParams = {
|
|
66
66
|
event?: VTransferIBCEvent['event'];
|
|
67
67
|
sender?: CosmosChainAddress['value'];
|
|
68
|
-
receiver?: CosmosChainAddress['value'];
|
|
68
|
+
receiver?: AccountId | CosmosChainAddress['value'];
|
|
69
69
|
target?: CosmosChainAddress['value'];
|
|
70
70
|
amount?: bigint;
|
|
71
71
|
denom?: string;
|
package/tools/ibc-mocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibc-mocks.d.ts","sourceRoot":"","sources":["ibc-mocks.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,KAAK,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,6CAA6C,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAEzF,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,+CAA+C,CAAC;AAKvD,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EAER,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ibc-mocks.d.ts","sourceRoot":"","sources":["ibc-mocks.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,KAAK,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,6CAA6C,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAEzF,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,+CAA+C,CAAC;AAKvD,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EAER,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAGrC,UAAU,aAAa,CAAC,CAAC;IACvB,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK;QACtB,MAAM,EAAE,MAAM,UAAU,CAAC;KAC1B,CAAC;IACF,WAAW,EAAE,CAAC,OA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C,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,YAAY,CAAC;IAClC,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,mBAAmB,GAAI,yGAWjC,yBAA8B,KAAG,iBA0BlC,CAAC;AAEH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,MAOtD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GAAI,yBAG3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAM,KAAG,OAAO,CACxD,QAAQ,CAAC,qBAAqB,CAAC,CAQ/B,CAAC"}
|
package/tools/ibc-mocks.ts
CHANGED
|
@@ -21,7 +21,10 @@ import type {
|
|
|
21
21
|
} from '@agoric/vats';
|
|
22
22
|
import { LOCALCHAIN_DEFAULT_ADDRESS } from '@agoric/vats/tools/fake-bridge.js';
|
|
23
23
|
import { atob, btoa, decodeBase64, encodeBase64 } from '@endo/base64';
|
|
24
|
-
import type {
|
|
24
|
+
import type {
|
|
25
|
+
AccountId,
|
|
26
|
+
CosmosChainAddress,
|
|
27
|
+
} from '../src/orchestration-api.js';
|
|
25
28
|
import { makeQueryPacket, makeTxPacket } from '../src/utils/packet.js';
|
|
26
29
|
|
|
27
30
|
interface EncoderCommon<T> {
|
|
@@ -157,7 +160,7 @@ type BuildVTransferEventParams = {
|
|
|
157
160
|
/* defaults to cosmos1AccAddress. set to `agoric1fakeLCAAddress` to simulate an outgoing transfer event */
|
|
158
161
|
sender?: CosmosChainAddress['value'];
|
|
159
162
|
/* defaults to agoric1fakeLCAAddress. set to a different value to simulate an outgoing transfer event */
|
|
160
|
-
receiver?: CosmosChainAddress['value'];
|
|
163
|
+
receiver?: AccountId | CosmosChainAddress['value'];
|
|
161
164
|
target?: CosmosChainAddress['value'];
|
|
162
165
|
amount?: bigint;
|
|
163
166
|
denom?: string;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export function makeTestAddress(index?: number, prefix?: string, byteLength?: number):
|
|
1
|
+
export function makeTestAddress(index?: number, prefix?: string, byteLength?: number): Bech32Address;
|
|
2
|
+
import type { Bech32Address } from '../src/cosmos-api.ts';
|
|
2
3
|
//# sourceMappingURL=make-test-address.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-test-address.d.ts","sourceRoot":"","sources":["make-test-address.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"make-test-address.d.ts","sourceRoot":"","sources":["make-test-address.js"],"names":[],"mappings":"AAaO,wCALI,MAAM,WACN,MAAM,eACN,MAAM,GACJ,aAAa,CAazB;mCApB+B,sBAAsB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
import { bech32 } from 'bech32';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @import {Bech32Address} from '../src/cosmos-api.ts';
|
|
6
|
+
*/
|
|
7
|
+
|
|
4
8
|
/**
|
|
5
9
|
* @param {number} index
|
|
6
10
|
* @param {string} prefix
|
|
7
11
|
* @param {number} byteLength
|
|
8
|
-
* @returns {
|
|
12
|
+
* @returns {Bech32Address} a mock bech32 address for tests
|
|
9
13
|
*/
|
|
10
14
|
export const makeTestAddress = (
|
|
11
15
|
index = 0,
|
|
@@ -17,5 +21,5 @@ export const makeTestAddress = (
|
|
|
17
21
|
// if index provided, put it in the first byte
|
|
18
22
|
if (index !== 0) bytes[0] = Number(index);
|
|
19
23
|
const words = bech32.toWords(bytes);
|
|
20
|
-
return bech32.encode(prefix, words);
|
|
24
|
+
return /** @type {Bech32Address} */ (bech32.encode(prefix, words));
|
|
21
25
|
};
|