@agoric/orchestration 0.1.1-dev-252b405.0 → 0.1.1-dev-4e588de.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/cosmos-api.d.ts +15 -9
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +21 -9
- package/src/examples/auto-stake-it-tap-kit.d.ts +3 -3
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +7 -7
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +0 -1
- package/src/examples/stake-bld.contract.d.ts +4 -4
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +0 -1
- package/src/examples/stake-ica.contract.d.ts +5 -7
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +4 -4
- package/src/examples/staking-combinations.flows.d.ts +2 -2
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +4 -4
- package/src/exos/chain-hub.d.ts +16 -8
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +60 -17
- package/src/exos/cosmos-orchestration-account.d.ts +14 -16
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +32 -21
- package/src/exos/ica-account-kit.d.ts +4 -4
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +5 -6
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +3 -4
- package/src/exos/local-orchestration-account.d.ts +12 -11
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +8 -7
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/portfolio-holder-kit.js +0 -1
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +6 -6
- package/src/orchestration-api.d.ts +36 -10
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +42 -10
- package/src/typeGuards.d.ts +11 -4
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +27 -12
- package/src/utils/address.d.ts +9 -2
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +45 -5
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +0 -2
- package/src/utils/orc.d.ts.map +1 -1
- package/src/utils/orc.js +0 -2
- package/src/utils/orchestrationAccount.js +6 -5
- package/src/utils/start-helper.d.ts +3 -2
- package/src/utils/start-helper.d.ts.map +1 -1
- package/tools/ibc-mocks.d.ts +4 -4
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +4 -4
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-4e588de.0+4e588de",
|
|
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-4e588de.0+4e588de",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-4e588de.0+4e588de",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-4e588de.0+4e588de",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-4e588de.0+4e588de",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-4e588de.0+4e588de",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-4e588de.0+4e588de",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-4e588de.0+4e588de",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-4e588de.0+4e588de",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-4e588de.0+4e588de",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-4e588de.0+4e588de",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-4e588de.0+4e588de",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-4e588de.0+4e588de",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-4e588de.0+4e588de",
|
|
49
49
|
"@endo/base64": "^1.0.9",
|
|
50
50
|
"@endo/errors": "^1.2.9",
|
|
51
51
|
"@endo/far": "^1.1.10",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "^1.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-4e588de.0+4e588de",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"typeCoverage": {
|
|
98
98
|
"atLeast": 97.77
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "4e588deeeee83704a5de69f3914ded0605dc1dc0"
|
|
101
101
|
}
|
package/src/cosmos-api.d.ts
CHANGED
|
@@ -12,11 +12,17 @@ import type { IBCChannelID, IBCConnectionID, IBCPortID } from '@agoric/vats';
|
|
|
12
12
|
import type { TargetApp, TargetRegistration } from '@agoric/vats/src/bridge-target.js';
|
|
13
13
|
import type { LocalIbcAddress, RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
14
14
|
import { PFM_RECEIVER } from './exos/chain-hub.js';
|
|
15
|
-
import type { AmountArg,
|
|
15
|
+
import type { AmountArg, CosmosChainAddress, Denom, DenomAmount } from './types.js';
|
|
16
|
+
/**
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346
|
|
20
|
+
* cosmosvaloper1npm9gvss52mlmk
|
|
21
|
+
*/
|
|
22
|
+
export type Bech32Address = `${string}1${string}`;
|
|
16
23
|
/** An address for a validator on some blockchain, e.g., cosmos, eth, etc. */
|
|
17
|
-
export type CosmosValidatorAddress =
|
|
24
|
+
export type CosmosValidatorAddress = CosmosChainAddress & {
|
|
18
25
|
value: `${string}valoper${string}`;
|
|
19
|
-
encoding: 'bech32';
|
|
20
26
|
};
|
|
21
27
|
/** Represents an IBC Connection between two chains, which can contain multiple Channels. */
|
|
22
28
|
export interface IBCConnectionInfo {
|
|
@@ -94,7 +100,7 @@ export interface CosmosRewardsResponse {
|
|
|
94
100
|
}
|
|
95
101
|
/** @see {DelegationResponse} */
|
|
96
102
|
export interface CosmosDelegationResponse {
|
|
97
|
-
delegator:
|
|
103
|
+
delegator: CosmosChainAddress;
|
|
98
104
|
validator: CosmosValidatorAddress;
|
|
99
105
|
amount: DenomAmount;
|
|
100
106
|
}
|
|
@@ -166,7 +172,7 @@ export interface StakingAccountActions {
|
|
|
166
172
|
*/
|
|
167
173
|
undelegate: (delegations: {
|
|
168
174
|
amount: AmountArg;
|
|
169
|
-
delegator?:
|
|
175
|
+
delegator?: CosmosChainAddress;
|
|
170
176
|
validator: CosmosValidatorAddress;
|
|
171
177
|
}[]) => Promise<void>;
|
|
172
178
|
/**
|
|
@@ -217,7 +223,7 @@ export interface IcaAccount extends IcaAccountMethods {
|
|
|
217
223
|
/**
|
|
218
224
|
* @returns the address of the account on the remote chain
|
|
219
225
|
*/
|
|
220
|
-
getAddress: () =>
|
|
226
|
+
getAddress: () => CosmosChainAddress;
|
|
221
227
|
/**
|
|
222
228
|
* Submit a transaction on behalf of the remote account for execution on the remote chain.
|
|
223
229
|
* @param msgs - records for the transaction
|
|
@@ -269,7 +275,7 @@ export interface IBCMsgTransferOptions {
|
|
|
269
275
|
memo?: string;
|
|
270
276
|
forwardOpts?: {
|
|
271
277
|
/** The recipient address for the intermediate transfer. Defaults to 'pfm' unless specified */
|
|
272
|
-
intermediateRecipient?:
|
|
278
|
+
intermediateRecipient?: CosmosChainAddress;
|
|
273
279
|
timeout?: ForwardInfo['forward']['timeout'];
|
|
274
280
|
retries?: ForwardInfo['forward']['retries'];
|
|
275
281
|
};
|
|
@@ -294,7 +300,7 @@ export type ICQQueryFunction = (msgs: JsonSafe<RequestQuery>[]) => Promise<JsonS
|
|
|
294
300
|
*/
|
|
295
301
|
export interface ForwardInfo {
|
|
296
302
|
forward: {
|
|
297
|
-
receiver:
|
|
303
|
+
receiver: CosmosChainAddress['value'];
|
|
298
304
|
port: IBCPortID;
|
|
299
305
|
channel: IBCChannelID;
|
|
300
306
|
/** e.g. '10m' */
|
|
@@ -320,7 +326,7 @@ export type TransferRoute = {
|
|
|
320
326
|
sourceChannel: IBCChannelID;
|
|
321
327
|
token: Coin;
|
|
322
328
|
} & ({
|
|
323
|
-
receiver: typeof PFM_RECEIVER |
|
|
329
|
+
receiver: typeof PFM_RECEIVER | CosmosChainAddress['value'];
|
|
324
330
|
/** contains PFM forwarding info */
|
|
325
331
|
forwardInfo: ForwardInfo;
|
|
326
332
|
} | {
|
package/src/cosmos-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-api.d.ts","sourceRoot":"","sources":["cosmos-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kDAAkD,CAAC;AAC7E,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AAE3F,OAAO,KAAK,EACV,KAAK,IAAI,eAAe,EACxB,KAAK,EACN,MAAM,qDAAqD,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC7G,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACd,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,SAAS,EAEV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cosmos-api.d.ts","sourceRoot":"","sources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AM,UAAU,GAAG,GAAG,MAAM,GAAG,cAAc,EAAE,CAAC"}
|
package/src/cosmos-api.ts
CHANGED
|
@@ -33,13 +33,25 @@ import type {
|
|
|
33
33
|
RemoteIbcAddress,
|
|
34
34
|
} from '@agoric/vats/tools/ibc-utils.js';
|
|
35
35
|
import { PFM_RECEIVER } from './exos/chain-hub.js';
|
|
36
|
-
import type {
|
|
36
|
+
import type {
|
|
37
|
+
AmountArg,
|
|
38
|
+
CosmosChainAddress,
|
|
39
|
+
Denom,
|
|
40
|
+
DenomAmount,
|
|
41
|
+
} from './types.js';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @example
|
|
45
|
+
*
|
|
46
|
+
* agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346
|
|
47
|
+
* cosmosvaloper1npm9gvss52mlmk
|
|
48
|
+
*/
|
|
49
|
+
export type Bech32Address = `${string}1${string}`;
|
|
37
50
|
|
|
38
51
|
/** An address for a validator on some blockchain, e.g., cosmos, eth, etc. */
|
|
39
|
-
export type CosmosValidatorAddress =
|
|
52
|
+
export type CosmosValidatorAddress = CosmosChainAddress & {
|
|
40
53
|
// infix for Validator Operator https://docs.cosmos.network/main/learn/beginner/accounts#addresses
|
|
41
54
|
value: `${string}valoper${string}`;
|
|
42
|
-
encoding: 'bech32';
|
|
43
55
|
};
|
|
44
56
|
|
|
45
57
|
/** Represents an IBC Connection between two chains, which can contain multiple Channels. */
|
|
@@ -120,7 +132,7 @@ export interface CosmosRewardsResponse {
|
|
|
120
132
|
|
|
121
133
|
/** @see {DelegationResponse} */
|
|
122
134
|
export interface CosmosDelegationResponse {
|
|
123
|
-
delegator:
|
|
135
|
+
delegator: CosmosChainAddress;
|
|
124
136
|
validator: CosmosValidatorAddress;
|
|
125
137
|
amount: DenomAmount;
|
|
126
138
|
}
|
|
@@ -215,7 +227,7 @@ export interface StakingAccountActions {
|
|
|
215
227
|
undelegate: (
|
|
216
228
|
delegations: {
|
|
217
229
|
amount: AmountArg;
|
|
218
|
-
delegator?:
|
|
230
|
+
delegator?: CosmosChainAddress;
|
|
219
231
|
validator: CosmosValidatorAddress;
|
|
220
232
|
}[],
|
|
221
233
|
) => Promise<void>;
|
|
@@ -275,7 +287,7 @@ export interface IcaAccount extends IcaAccountMethods {
|
|
|
275
287
|
/**
|
|
276
288
|
* @returns the address of the account on the remote chain
|
|
277
289
|
*/
|
|
278
|
-
getAddress: () =>
|
|
290
|
+
getAddress: () => CosmosChainAddress;
|
|
279
291
|
|
|
280
292
|
/**
|
|
281
293
|
* Submit a transaction on behalf of the remote account for execution on the remote chain.
|
|
@@ -332,7 +344,7 @@ export interface IBCMsgTransferOptions {
|
|
|
332
344
|
memo?: string;
|
|
333
345
|
forwardOpts?: {
|
|
334
346
|
/** The recipient address for the intermediate transfer. Defaults to 'pfm' unless specified */
|
|
335
|
-
intermediateRecipient?:
|
|
347
|
+
intermediateRecipient?: CosmosChainAddress;
|
|
336
348
|
timeout?: ForwardInfo['forward']['timeout'];
|
|
337
349
|
retries?: ForwardInfo['forward']['retries'];
|
|
338
350
|
};
|
|
@@ -366,7 +378,7 @@ export type ICQQueryFunction = (
|
|
|
366
378
|
*/
|
|
367
379
|
export interface ForwardInfo {
|
|
368
380
|
forward: {
|
|
369
|
-
receiver:
|
|
381
|
+
receiver: CosmosChainAddress['value'];
|
|
370
382
|
port: IBCPortID;
|
|
371
383
|
channel: IBCChannelID;
|
|
372
384
|
/** e.g. '10m' */
|
|
@@ -394,7 +406,7 @@ export type TransferRoute = {
|
|
|
394
406
|
token: Coin;
|
|
395
407
|
} & (
|
|
396
408
|
| {
|
|
397
|
-
receiver: typeof PFM_RECEIVER |
|
|
409
|
+
receiver: typeof PFM_RECEIVER | CosmosChainAddress['value'];
|
|
398
410
|
/** contains PFM forwarding info */
|
|
399
411
|
forwardInfo: ForwardInfo;
|
|
400
412
|
}
|
|
@@ -5,8 +5,8 @@ export type StakingTapState = {
|
|
|
5
5
|
chainId: "agoric";
|
|
6
6
|
}>>;
|
|
7
7
|
validator: CosmosValidatorAddress;
|
|
8
|
-
localChainAddress:
|
|
9
|
-
remoteChainAddress:
|
|
8
|
+
localChainAddress: CosmosChainAddress;
|
|
9
|
+
remoteChainAddress: CosmosChainAddress;
|
|
10
10
|
sourceChannel: IBCChannelID;
|
|
11
11
|
remoteDenom: Denom;
|
|
12
12
|
localDenom: Denom;
|
|
@@ -41,7 +41,7 @@ declare function prepareStakingTapKit(zone: Zone, { watch }: VowTools): (initial
|
|
|
41
41
|
import type { OrchestrationAccount } from '@agoric/orchestration';
|
|
42
42
|
import type { StakingAccountActions } from '@agoric/orchestration';
|
|
43
43
|
import type { CosmosValidatorAddress } from '@agoric/orchestration';
|
|
44
|
-
import type {
|
|
44
|
+
import type { CosmosChainAddress } from '@agoric/orchestration';
|
|
45
45
|
import type { IBCChannelID } from '@agoric/vats';
|
|
46
46
|
import type { Denom } from '@agoric/orchestration';
|
|
47
47
|
import type { VTransferIBCEvent } from '@agoric/vats';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-stake-it-tap-kit.d.ts","sourceRoot":"","sources":["auto-stake-it-tap-kit.js"],"names":[],"mappings":"AAmJO,wCANI,IAAI,YACJ,QAAQ,GACN,CACZ,GAAO,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,KACzD,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAKjE;8BAlIY;IACR,cAAc,EAAE,IAAI,CAAC,qBAAqB,GAAG,CAAC,GAAG,qBAAqB,CAAC,CAAC;IACxE,YAAY,EAAE,IAAI,CAAC,qBAAqB;QAAE,OAAO,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC,CAAC;IAChE,SAAS,EAAE,sBAAsB,CAAC;IAClC,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"auto-stake-it-tap-kit.d.ts","sourceRoot":"","sources":["auto-stake-it-tap-kit.js"],"names":[],"mappings":"AAmJO,wCANI,IAAI,YACJ,QAAQ,GACN,CACZ,GAAO,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,KACzD,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAKjE;8BAlIY;IACR,cAAc,EAAE,IAAI,CAAC,qBAAqB,GAAG,CAAC,GAAG,qBAAqB,CAAC,CAAC;IACxE,YAAY,EAAE,IAAI,CAAC,qBAAqB;QAAE,OAAO,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC,CAAC;IAChE,SAAS,EAAE,sBAAsB,CAAC;IAClC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,aAAa,EAAE,YAAY,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC;CACnB;6BA2HU,UAAU,CAAC,OAAO,iBAAiB,CAAC;yBACpC,UAAU,CAAC,cAAc,CAAC;0BA7IjB,cAAc;8BADV,aAAa;AAkCxC;;;GAGG;AACH,4CAHW,IAAI,aACJ,QAAQ;;QAwBX;;;;;;WAMG;6BADQ,iBAAiB;;;QAqC5B;;;WAGG;6BAFQ,IAAI,SACJ,MAAM;;GAcxB;0CAnHgH,uBAAuB;2CAAvB,uBAAuB;4CAAvB,uBAAuB;wCAAvB,uBAAuB;kCAJtF,cAAc;2BAIiD,uBAAuB;uCAJtF,cAAc"}
|
|
@@ -3,7 +3,7 @@ import { E } from '@endo/far';
|
|
|
3
3
|
import { VowShape } from '@agoric/vow';
|
|
4
4
|
import { makeTracer } from '@agoric/internal';
|
|
5
5
|
import { atob } from '@endo/base64';
|
|
6
|
-
import {
|
|
6
|
+
import { CosmosChainAddressShape } from '../typeGuards.js';
|
|
7
7
|
|
|
8
8
|
const trace = makeTracer('AutoStakeItTap');
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ const trace = makeTracer('AutoStakeItTap');
|
|
|
12
12
|
* @import {VowTools} from '@agoric/vow';
|
|
13
13
|
* @import {Zone} from '@agoric/zone';
|
|
14
14
|
* @import {TargetApp} from '@agoric/vats/src/bridge-target.js';
|
|
15
|
-
* @import {
|
|
15
|
+
* @import {CosmosChainAddress, CosmosValidatorAddress, Denom, OrchestrationAccount, StakingAccountActions} from '@agoric/orchestration';
|
|
16
16
|
* @import {FungibleTokenPacketData} from '@agoric/cosmic-proto/ibc/applications/transfer/v2/packet.js';
|
|
17
17
|
* @import {TypedPattern} from '@agoric/internal';
|
|
18
18
|
*/
|
|
@@ -22,8 +22,8 @@ const trace = makeTracer('AutoStakeItTap');
|
|
|
22
22
|
* stakingAccount: ERef<OrchestrationAccount<any> & StakingAccountActions>;
|
|
23
23
|
* localAccount: ERef<OrchestrationAccount<{ chainId: 'agoric' }>>;
|
|
24
24
|
* validator: CosmosValidatorAddress;
|
|
25
|
-
* localChainAddress:
|
|
26
|
-
* remoteChainAddress:
|
|
25
|
+
* localChainAddress: CosmosChainAddress;
|
|
26
|
+
* remoteChainAddress: CosmosChainAddress;
|
|
27
27
|
* sourceChannel: IBCChannelID;
|
|
28
28
|
* remoteDenom: Denom;
|
|
29
29
|
* localDenom: Denom;
|
|
@@ -34,9 +34,9 @@ const trace = makeTracer('AutoStakeItTap');
|
|
|
34
34
|
const StakingTapStateShape = {
|
|
35
35
|
stakingAccount: M.remotable('CosmosOrchestrationAccount'),
|
|
36
36
|
localAccount: M.remotable('LocalOrchestrationAccount'),
|
|
37
|
-
validator:
|
|
38
|
-
localChainAddress:
|
|
39
|
-
remoteChainAddress:
|
|
37
|
+
validator: CosmosChainAddressShape,
|
|
38
|
+
localChainAddress: CosmosChainAddressShape,
|
|
39
|
+
remoteChainAddress: CosmosChainAddressShape,
|
|
40
40
|
sourceChannel: M.string(),
|
|
41
41
|
remoteDenom: M.string(),
|
|
42
42
|
localDenom: M.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-anywhere.flows.d.ts","sourceRoot":"","sources":["send-anywhere.flows.js"],"names":[],"mappings":"AA2BO,6BARI,YAAY,6EAEpB;IAA6E,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IACiB,GAAG,EAA5C,QAAQ,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC;CAC3C,QAAQ,OAAO,aACP;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"send-anywhere.flows.d.ts","sourceRoot":"","sources":["send-anywhere.flows.js"],"names":[],"mappings":"AA2BO,6BARI,YAAY,6EAEpB;IAA6E,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IACiB,GAAG,EAA5C,QAAQ,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC;CAC3C,QAAQ,OAAO,aACP;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,iBAwDjD;kCAxEsE,aAAa;kDAFrC,wCAAwC;oCAF7C,oBAAoB;8BAGnC,uBAAuB;yBAF5B,aAAa;6BADO,oBAAoB"}
|
|
@@ -24,10 +24,10 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
24
24
|
}[]): import("@agoric/vow").Vow<{
|
|
25
25
|
'@type': string;
|
|
26
26
|
}[]>;
|
|
27
|
-
getAddress(): import("../orchestration-api.js").
|
|
28
|
-
send(toAccount: import("../orchestration-api.js").
|
|
29
|
-
sendAll(toAccount: import("../orchestration-api.js").
|
|
30
|
-
transfer(destination: import("../orchestration-api.js").
|
|
27
|
+
getAddress(): import("../orchestration-api.js").CosmosChainAddress;
|
|
28
|
+
send(toAccount: import("../orchestration-api.js").CosmosChainAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
29
|
+
sendAll(toAccount: import("../orchestration-api.js").CosmosChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void>;
|
|
30
|
+
transfer(destination: import("../orchestration-api.js").AccountIdArg, amount: import("../orchestration-api.js").AmountArg, opts?: import("../cosmos-api.js").IBCMsgTransferOptions): import("@agoric/vow").Vow<any>;
|
|
31
31
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void>;
|
|
32
32
|
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>>;
|
|
33
33
|
matchFirstPacket(args_0?: import("@agoric/vow").EVow<globalThis.Pattern>): import("@agoric/async-flow").HostInterface<import("@agoric/vow").Vow<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-bld.contract.d.ts","sourceRoot":"","sources":["stake-bld.contract.js"],"names":[],"mappings":"AAoCO,2BAVI,GAAG,eACH;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;
|
|
1
|
+
{"version":3,"file":"stake-bld.contract.d.ts","sourceRoot":"","sources":["stake-bld.contract.js"],"names":[],"mappings":"AAoCO,2BAVI,GAAG,eACH;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAqEvC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4BH;;WAEG;;;GAaR;6BAnIyB,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc"}
|
|
@@ -26,20 +26,20 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
26
26
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
27
27
|
asContinuingOffer(): import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<ResolvedContinuingOfferResult>>;
|
|
28
28
|
getPublicTopics(): import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
|
|
29
|
-
getAddress(): import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").
|
|
29
|
+
getAddress(): import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").CosmosChainAddress>;
|
|
30
30
|
delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
31
31
|
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
32
32
|
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
33
33
|
getBalance(denom: import("../orchestration-api.js").DenomArg): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount>;
|
|
34
34
|
getBalances(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
35
|
-
send(toAccount: import("../orchestration-api.js").
|
|
36
|
-
sendAll(toAccount: import("../orchestration-api.js").
|
|
37
|
-
transfer(destination: import("../orchestration-api.js").
|
|
35
|
+
send(toAccount: import("../orchestration-api.js").CosmosChainAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
36
|
+
sendAll(toAccount: import("../orchestration-api.js").CosmosChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void>;
|
|
37
|
+
transfer(destination: import("../orchestration-api.js").AccountIdArg, amount: import("../orchestration-api.js").AmountArg, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void>;
|
|
38
38
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void>;
|
|
39
39
|
withdrawRewards(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
40
40
|
undelegate(delegations: {
|
|
41
41
|
amount: import("../orchestration-api.js").AmountArg;
|
|
42
|
-
delegator?: import("../orchestration-api.js").
|
|
42
|
+
delegator?: import("../orchestration-api.js").CosmosChainAddress;
|
|
43
43
|
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
44
44
|
}[]): import("@agoric/vow").Vow<void>;
|
|
45
45
|
deactivate(): import("@agoric/vow").Vow<void>;
|
|
@@ -49,12 +49,10 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
49
49
|
delegator: {
|
|
50
50
|
chainId: string;
|
|
51
51
|
value: string;
|
|
52
|
-
encoding: "bech32" | "ethereum";
|
|
53
52
|
};
|
|
54
53
|
validator: {
|
|
55
54
|
chainId: string;
|
|
56
55
|
value: `${string}valoper${string}`;
|
|
57
|
-
encoding: "bech32";
|
|
58
56
|
};
|
|
59
57
|
amount: {
|
|
60
58
|
denom: import("../orchestration-api.js").Denom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,GAAG,CAAC,aAAa,CAAC,eAClB;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;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,GAAG,CAAC,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;6BAxJiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
|
|
@@ -9,7 +9,7 @@ import { AmountShape } from '@agoric/ertp';
|
|
|
9
9
|
import { M } from '@endo/patterns';
|
|
10
10
|
import { prepareCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
11
11
|
import { CosmosOrchestrationInvitationMakersI } from '../exos/cosmos-orchestration-account.js';
|
|
12
|
-
import {
|
|
12
|
+
import { CosmosChainAddressShape, DelegationShape } from '../typeGuards.js';
|
|
13
13
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
14
14
|
import * as flows from './staking-combinations.flows.js';
|
|
15
15
|
import * as sharedFlows from './shared.flows.js';
|
|
@@ -20,7 +20,7 @@ import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
|
20
20
|
* @import {Zone} from '@agoric/zone';
|
|
21
21
|
* @import {OrchestrationTools, OrchestrationPowers} from '../utils/start-helper.js';
|
|
22
22
|
* @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js';
|
|
23
|
-
* @import {AmountArg,
|
|
23
|
+
* @import {AmountArg, CosmosChainAddress, CosmosValidatorAddress} from '../types.js';
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
const emptyOfferShape = harden({
|
|
@@ -52,7 +52,7 @@ const contract = async (
|
|
|
52
52
|
DepositAndDelegate: M.call().returns(M.promise()),
|
|
53
53
|
UndelegateAndTransfer: M.call(
|
|
54
54
|
M.arrayOf(DelegationShape),
|
|
55
|
-
|
|
55
|
+
CosmosChainAddressShape,
|
|
56
56
|
).returns(M.promise()),
|
|
57
57
|
},
|
|
58
58
|
);
|
|
@@ -90,7 +90,7 @@ const contract = async (
|
|
|
90
90
|
},
|
|
91
91
|
/**
|
|
92
92
|
* @param {{ amount: AmountArg; validator: CosmosValidatorAddress }[]} delegations
|
|
93
|
-
* @param {
|
|
93
|
+
* @param {CosmosChainAddress} destination
|
|
94
94
|
*/
|
|
95
95
|
UndelegateAndTransfer(delegations, destination) {
|
|
96
96
|
const { account } = this.state;
|
|
@@ -14,7 +14,7 @@ export function undelegateAndTransfer(orch: Orchestrator, ctx: object, account:
|
|
|
14
14
|
amount: AmountArg;
|
|
15
15
|
validator: CosmosValidatorAddress;
|
|
16
16
|
}[];
|
|
17
|
-
destination:
|
|
17
|
+
destination: CosmosChainAddress;
|
|
18
18
|
}): Promise<void>;
|
|
19
19
|
import type { Orchestrator } from '../types.js';
|
|
20
20
|
import type { MakeCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
@@ -27,5 +27,5 @@ import type { ZoeTools } from '../utils/zoe-tools.js';
|
|
|
27
27
|
import type { CosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
28
28
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
29
29
|
import type { AmountArg } from '../types.js';
|
|
30
|
-
import type {
|
|
30
|
+
import type { CosmosChainAddress } from '../types.js';
|
|
31
31
|
//# sourceMappingURL=staking-combinations.flows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"AA4BO,kCATI,YAAY,OACZ;IACN,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,wBAAwB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,gBAAgB,CAAC;CAC9D,SACO,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAiBlD;AAeM,yCAVI,YAAY,+CAEpB;IAAsC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IAC6C,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;CAChC,WAAQ,eAAe,0BAA0B,CAAC,QAC1C,OAAO,aACP,sBAAsB,GACpB,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAcM,4CATI,YAAY,OACZ,MAAM,WACN,eAAe,0BAA0B,CAAC,gCAC1C;IACN,WAAW,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IACxE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"AA4BO,kCATI,YAAY,OACZ;IACN,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,wBAAwB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,gBAAgB,CAAC;CAC9D,SACO,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAiBlD;AAeM,yCAVI,YAAY,+CAEpB;IAAsC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IAC6C,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;CAChC,WAAQ,eAAe,0BAA0B,CAAC,QAC1C,OAAO,aACP,sBAAsB,GACpB,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAcM,4CATI,YAAY,OACZ,MAAM,WACN,eAAe,0BAA0B,CAAC,gCAC1C;IACN,WAAW,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IACxE,WAAW,EAAE,kBAAkB,CAAC;CACjC,GACS,OAAO,CAAC,IAAI,CAAC,CAYzB;kCAlHmK,aAAa;iDAGnI,sCAAsC;sCAF1B,mCAAmC;mDAInC,uBAAuB;8BALmF,aAAa;oCADhJ,oBAAoB;kDAGN,wCAAwC;8BAG7B,uBAAuB;gDADpC,yCAAyC;4CAJ8E,aAAa;+BAAb,aAAa;wCAAb,aAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {GuestInterface} from '@agoric/async-flow';
|
|
3
|
-
* @import {Orchestrator, OrchestrationFlow, AmountArg, CosmosValidatorAddress,
|
|
3
|
+
* @import {Orchestrator, OrchestrationFlow, AmountArg, CosmosValidatorAddress, CosmosChainAddress, LocalAccountMethods, OrchestrationAccountCommon, ChainHub} from '../types.js'
|
|
4
4
|
* @import {ContinuingOfferResult, InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
5
5
|
* @import {LocalOrchestrationAccountKit} from '../exos/local-orchestration-account.js';
|
|
6
6
|
* @import {MakeCombineInvitationMakers} from '../exos/combine-invitation-makers.js';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { mustMatch } from '@endo/patterns';
|
|
12
12
|
import { Fail, makeError, q } from '@endo/errors';
|
|
13
13
|
import { makeTracer } from '@agoric/internal';
|
|
14
|
-
import {
|
|
14
|
+
import { CosmosChainAddressShape } from '../typeGuards.js';
|
|
15
15
|
|
|
16
16
|
const trace = makeTracer('StakingCombinationsFlows');
|
|
17
17
|
|
|
@@ -65,7 +65,7 @@ export const depositAndDelegate = async (
|
|
|
65
65
|
) => {
|
|
66
66
|
await null;
|
|
67
67
|
trace('depositAndDelegate', account, seat, validator);
|
|
68
|
-
mustMatch(validator,
|
|
68
|
+
mustMatch(validator, CosmosChainAddressShape);
|
|
69
69
|
|
|
70
70
|
const { give } = seat.getProposal();
|
|
71
71
|
/**
|
|
@@ -100,7 +100,7 @@ harden(depositAndDelegate);
|
|
|
100
100
|
* @param {GuestInterface<CosmosOrchestrationAccount>} account
|
|
101
101
|
* @param {{
|
|
102
102
|
* delegations: { amount: AmountArg; validator: CosmosValidatorAddress }[];
|
|
103
|
-
* destination:
|
|
103
|
+
* destination: CosmosChainAddress;
|
|
104
104
|
* }} offerArgs
|
|
105
105
|
* @returns {Promise<void>}
|
|
106
106
|
*/
|
package/src/exos/chain-hub.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @import {NameHub} from '@agoric/vats';
|
|
3
3
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
4
4
|
* @import {Zone} from '@agoric/zone';
|
|
5
|
-
* @import {CosmosAssetInfo, CosmosChainInfo, ForwardInfo, IBCConnectionInfo, IBCMsgTransferOptions, TransferRoute, GoDuration} from '../cosmos-api.js';
|
|
5
|
+
* @import {CosmosAssetInfo, CosmosChainInfo, ForwardInfo, IBCConnectionInfo, IBCMsgTransferOptions, TransferRoute, GoDuration, Bech32Address} from '../cosmos-api.js';
|
|
6
6
|
* @import {ChainInfo, KnownChains} from '../chain-info.js';
|
|
7
|
-
* @import {
|
|
7
|
+
* @import {AccountId, CosmosChainAddress, ScopedChainId, Denom, DenomAmount, AccountIdArg} from '../orchestration-api.js';
|
|
8
8
|
* @import {Remote, TypedPattern} from '@agoric/internal';
|
|
9
9
|
*/
|
|
10
10
|
/** receiver address value for ibc transfers that involve PFM */
|
|
@@ -97,11 +97,17 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
|
|
|
97
97
|
*/
|
|
98
98
|
getDenom(brand: Brand): Denom | undefined;
|
|
99
99
|
/**
|
|
100
|
-
* @param {string}
|
|
101
|
-
* @returns {
|
|
100
|
+
* @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
|
|
101
|
+
* @returns {AccountId}
|
|
102
102
|
* @throws {Error} if chain info not found for bech32Prefix
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
resolveAccountId(partialId: string): AccountId;
|
|
105
|
+
/**
|
|
106
|
+
* @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
|
|
107
|
+
* @returns {CosmosChainAddress}
|
|
108
|
+
* @throws {Error} if chain info not found for bech32Prefix
|
|
109
|
+
*/
|
|
110
|
+
makeChainAddress(partialId: string): CosmosChainAddress;
|
|
105
111
|
/**
|
|
106
112
|
* Determine the transfer route for a destination and amount given the
|
|
107
113
|
* current holding chain.
|
|
@@ -111,14 +117,14 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
|
|
|
111
117
|
*
|
|
112
118
|
* XXX consider accepting AmountArg #10449
|
|
113
119
|
*
|
|
114
|
-
* @param {
|
|
120
|
+
* @param {AccountIdArg} destination
|
|
115
121
|
* @param {DenomAmount} denomAmount
|
|
116
122
|
* @param {string} srcChainName
|
|
117
123
|
* @param {IBCMsgTransferOptions['forwardOpts']} [forwardOpts]
|
|
118
124
|
* @returns {TransferRoute} single hop, multi hop
|
|
119
125
|
* @throws {Error} if unable to determine route
|
|
120
126
|
*/
|
|
121
|
-
makeTransferRoute(destination:
|
|
127
|
+
makeTransferRoute(destination: AccountIdArg, denomAmount: DenomAmount, srcChainName: string, forwardOpts?: IBCMsgTransferOptions["forwardOpts"]): TransferRoute;
|
|
122
128
|
}>;
|
|
123
129
|
export function registerAssets(chainHub: ChainHub, name: string, assets: CosmosAssetInfo[]): void;
|
|
124
130
|
/**
|
|
@@ -154,7 +160,9 @@ import type { VowTools } from '@agoric/vow';
|
|
|
154
160
|
import type { CosmosChainInfo } from '../cosmos-api.js';
|
|
155
161
|
import type { Vow } from '@agoric/vow';
|
|
156
162
|
import type { Denom } from '../orchestration-api.js';
|
|
157
|
-
import type {
|
|
163
|
+
import type { AccountId } from '../orchestration-api.js';
|
|
164
|
+
import type { CosmosChainAddress } from '../orchestration-api.js';
|
|
165
|
+
import type { AccountIdArg } from '../orchestration-api.js';
|
|
158
166
|
import type { DenomAmount } from '../orchestration-api.js';
|
|
159
167
|
import type { IBCMsgTransferOptions } from '../cosmos-api.js';
|
|
160
168
|
import type { CosmosAssetInfo } from '../cosmos-api.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAoBA;;;;;;;;GAQG;AAEH,gEAAgE;AAChE,2BAAkD,KAAK,CAAE;sBAsB/C,CAAC,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,CAAC;;;;;;AAYhD,oCAAoC;AACpC,gCAAuC;AACvC,8CAA8C;AAC9C,gDAAuD;AAC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