@agoric/orchestration 0.2.0-upgrade-20-dev-ef71cfd.0 → 0.2.0-upgrade-19-devnet-dev-5428c4d.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 +27 -29
- package/src/chain-capabilities.d.ts +12 -7
- package/src/chain-capabilities.d.ts.map +1 -1
- package/src/chain-capabilities.js +21 -46
- package/src/chain-info.d.ts +97 -839
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +12 -38
- package/src/cosmos-api.d.ts +13 -41
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +16 -52
- package/src/ethereum-api.d.ts +5 -6
- package/src/ethereum-api.d.ts.map +1 -1
- package/src/ethereum-api.ts +5 -7
- package/src/examples/auto-stake-it-tap-kit.d.ts +4 -4
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +8 -8
- package/src/examples/auto-stake-it.contract.d.ts +23 -5
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +0 -1
- package/src/examples/basic-flows.contract.d.ts +13 -5
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +0 -1
- package/src/examples/send-anywhere.contract.d.ts +27 -7
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +12 -40
- package/src/examples/send-anywhere.flows.d.ts +3 -563
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +31 -112
- package/src/examples/stake-bld.contract.d.ts +7 -8
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +1 -3
- package/src/examples/stake-ica.contract.d.ts +13 -82
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/stake-ica.contract.js +0 -1
- package/src/examples/staking-combinations.contract.d.ts +11 -3
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +4 -5
- 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/examples/swap.contract.d.ts +13 -4
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +2 -2
- package/src/examples/unbond.contract.d.ts +2 -2
- package/src/exos/README.md +0 -1
- package/src/exos/chain-hub-admin.d.ts +9 -9
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +17 -17
- package/src/exos/chain-hub.d.ts +17 -69
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +55 -289
- package/src/exos/cosmos-orchestration-account.d.ts +17 -86
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +26 -111
- package/src/exos/ibc-packet.d.ts +0 -1
- package/src/exos/ibc-packet.d.ts.map +1 -1
- package/src/exos/ibc-packet.js +1 -8
- package/src/exos/ica-account-kit.d.ts +4 -8
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +5 -8
- package/src/exos/local-chain-facade.d.ts +23 -3
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +3 -3
- package/src/exos/local-orchestration-account.d.ts +12 -16
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +8 -13
- package/src/exos/orchestrator.d.ts +15 -5
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +10 -9
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/packet-tools.js +12 -17
- package/src/exos/portfolio-holder-kit.d.ts +0 -1
- 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 +15 -5
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +13 -23
- package/src/facade.js +1 -1
- package/src/fetched-chain-info.d.ts +86 -676
- package/src/fetched-chain-info.js +41 -553
- package/src/fixtures/query-flows.contract.d.ts +4 -5
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +0 -1
- package/src/orchestration-api.d.ts +16 -73
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +19 -89
- package/src/proposals/start-send-anywhere.js +0 -4
- package/src/typeGuards.d.ts +4 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +13 -52
- package/src/types.d.ts +1 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +1 -2
- package/src/utils/address.d.ts +3 -13
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +5 -97
- package/src/utils/chain-hub-helper.d.ts +2 -2
- package/src/utils/chain-hub-helper.d.ts.map +1 -1
- package/src/utils/chain-hub-helper.js +5 -9
- 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/orchestrationAccount.js +5 -6
- package/src/utils/registry.d.ts +12 -2
- package/src/utils/registry.d.ts.map +1 -1
- package/src/utils/registry.js +2 -4
- package/src/utils/start-helper.d.ts +6 -20
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +2 -13
- package/src/utils/zoe-tools.d.ts +2 -2
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +2 -5
- package/tools/ibc-mocks.d.ts +5 -6
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +4 -10
- package/tools/make-test-address.d.ts +1 -2
- package/tools/make-test-address.d.ts.map +1 -1
- package/tools/make-test-address.js +2 -6
- package/src/cctp-chain-info.d.ts +0 -65
- package/src/cctp-chain-info.d.ts.map +0 -1
- package/src/cctp-chain-info.js +0 -52
- package/src/utils/chain-info.d.ts +0 -5
- package/src/utils/chain-info.d.ts.map +0 -1
- package/src/utils/chain-info.js +0 -11
|
@@ -24,7 +24,6 @@ export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
|
|
|
24
24
|
transferSteps: import("@endo/patterns").MethodGuard;
|
|
25
25
|
asContinuingOffer: import("@endo/patterns").MethodGuard;
|
|
26
26
|
getPublicTopics: import("@endo/patterns").MethodGuard;
|
|
27
|
-
depositForBurn: import("@endo/patterns").MethodGuard;
|
|
28
27
|
}>;
|
|
29
28
|
export const CosmosOrchestrationInvitationMakersI: import("@endo/patterns").InterfaceGuard<{
|
|
30
29
|
Delegate: import("@endo/patterns").MethodGuard;
|
|
@@ -45,7 +44,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
45
44
|
vowTools: VowTools;
|
|
46
45
|
zcf: ZCF;
|
|
47
46
|
}): (args_0: {
|
|
48
|
-
chainAddress:
|
|
47
|
+
chainAddress: ChainAddress;
|
|
49
48
|
localAddress: LocalIbcAddress;
|
|
50
49
|
remoteAddress: RemoteIbcAddress;
|
|
51
50
|
}, io: {
|
|
@@ -156,7 +155,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
156
155
|
* bigint,
|
|
157
156
|
* ]} results
|
|
158
157
|
* @param {{
|
|
159
|
-
* destination:
|
|
158
|
+
* destination: ChainAddress;
|
|
160
159
|
* opts?: IBCMsgTransferOptions;
|
|
161
160
|
* token: Coin;
|
|
162
161
|
* }} ctx
|
|
@@ -164,7 +163,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
164
163
|
onFulfilled([{ transferChannel }, timeoutTimestamp]: [{
|
|
165
164
|
transferChannel: IBCConnectionInfo["transferChannel"];
|
|
166
165
|
}, bigint], { opts, token, destination }: {
|
|
167
|
-
destination:
|
|
166
|
+
destination: ChainAddress;
|
|
168
167
|
opts?: IBCMsgTransferOptions;
|
|
169
168
|
token: Coin;
|
|
170
169
|
}): Vow<undefined>;
|
|
@@ -196,11 +195,11 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
196
195
|
DeactivateAccount(): Promise<Invitation<Vow<void>, undefined>>;
|
|
197
196
|
ReactivateAccount(): Promise<Invitation<Vow<void>, undefined>>;
|
|
198
197
|
Send(): Promise<Invitation<Vow<void>, {
|
|
199
|
-
toAccount:
|
|
198
|
+
toAccount: ChainAddress;
|
|
200
199
|
amount: AmountArg;
|
|
201
200
|
}>>;
|
|
202
201
|
SendAll(): Promise<Invitation<Vow<void>, {
|
|
203
|
-
toAccount:
|
|
202
|
+
toAccount: ChainAddress;
|
|
204
203
|
amounts: AmountArg[];
|
|
205
204
|
}>>;
|
|
206
205
|
/**
|
|
@@ -211,27 +210,27 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
211
210
|
TransferAccount(): never;
|
|
212
211
|
Transfer(): Promise<Invitation<Vow<void>, {
|
|
213
212
|
amount: AmountArg;
|
|
214
|
-
destination:
|
|
213
|
+
destination: ChainAddress;
|
|
215
214
|
opts?: IBCMsgTransferOptions;
|
|
216
215
|
}>>;
|
|
217
216
|
};
|
|
218
217
|
holder: {
|
|
219
218
|
asContinuingOffer(): Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
|
|
220
219
|
getPublicTopics(): Vow<import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
|
|
221
|
-
getAddress(): import("@agoric/async-flow").HostInterface<
|
|
220
|
+
getAddress(): import("@agoric/async-flow").HostInterface<ChainAddress>;
|
|
222
221
|
delegate(validator: CosmosValidatorAddress, amount: AmountArg): Vow<void>;
|
|
223
222
|
redelegate(srcValidator: CosmosValidatorAddress, dstValidator: CosmosValidatorAddress, amount: AmountArg): Vow<void>;
|
|
224
223
|
withdrawReward(validator: CosmosValidatorAddress): Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
225
224
|
getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount>;
|
|
226
225
|
getBalances(): Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
227
|
-
send(toAccount:
|
|
228
|
-
sendAll(toAccount:
|
|
229
|
-
transfer(destination:
|
|
226
|
+
send(toAccount: ChainAddress, amount: AmountArg): Vow<void>;
|
|
227
|
+
sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void>;
|
|
228
|
+
transfer(destination: ChainAddress, amount: AmountArg, opts?: IBCMsgTransferOptions | undefined): Vow<void>;
|
|
230
229
|
transferSteps(amount: AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void>;
|
|
231
230
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
232
231
|
undelegate(delegations: {
|
|
233
232
|
amount: AmountArg;
|
|
234
|
-
delegator?:
|
|
233
|
+
delegator?: ChainAddress;
|
|
235
234
|
validator: CosmosValidatorAddress;
|
|
236
235
|
}[]): Vow<void>;
|
|
237
236
|
deactivate(): Vow<void>;
|
|
@@ -240,76 +239,12 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
240
239
|
getDelegations(): Vow<{
|
|
241
240
|
delegator: {
|
|
242
241
|
chainId: string;
|
|
243
|
-
value:
|
|
244
|
-
encoding: "bech32";
|
|
242
|
+
value: string;
|
|
243
|
+
encoding: "bech32" | "ethereum";
|
|
245
244
|
};
|
|
246
245
|
validator: {
|
|
247
246
|
chainId: string;
|
|
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
|
-
};
|
|
247
|
+
value: `${string}valoper${string}`;
|
|
313
248
|
encoding: "bech32";
|
|
314
249
|
};
|
|
315
250
|
amount: {
|
|
@@ -366,7 +301,6 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
366
301
|
typeUrl: string;
|
|
367
302
|
value: string;
|
|
368
303
|
}[], opts?: Partial<Omit<import("@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js").TxBody, "messages">> | undefined): Vow<string>;
|
|
369
|
-
depositForBurn(mintRecipient: `${string}:${string}:${string}`, amount: AmountArg, caller?: `${string}:${string}:${string}` | undefined): Vow<void>;
|
|
370
304
|
};
|
|
371
305
|
}>;
|
|
372
306
|
export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRecorderKit, timerService, vowTools, zcf }: {
|
|
@@ -377,14 +311,14 @@ export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRe
|
|
|
377
311
|
zcf: ZCF;
|
|
378
312
|
}): (...args: Parameters<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>) => CosmosOrchestrationAccountKit["holder"];
|
|
379
313
|
export type CosmosOrchestrationAccountNotification = {
|
|
380
|
-
chainAddress:
|
|
314
|
+
chainAddress: ChainAddress;
|
|
381
315
|
};
|
|
382
316
|
/**
|
|
383
317
|
* Internal to the IcaAccountHolder exo
|
|
384
318
|
*/
|
|
385
319
|
export type State = {
|
|
386
320
|
account: IcaAccount;
|
|
387
|
-
chainAddress:
|
|
321
|
+
chainAddress: ChainAddress;
|
|
388
322
|
icqConnection: ICQConnection | undefined;
|
|
389
323
|
localAddress: LocalIbcAddress;
|
|
390
324
|
remoteAddress: RemoteIbcAddress;
|
|
@@ -403,8 +337,7 @@ import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.j
|
|
|
403
337
|
import type { TimerService } from '@agoric/time';
|
|
404
338
|
import type { Remote } from '@agoric/internal';
|
|
405
339
|
import type { VowTools } from '@agoric/vow';
|
|
406
|
-
import type {
|
|
407
|
-
import type { CosmosChainAddress } from '../types.js';
|
|
340
|
+
import type { ChainAddress } from '../types.js';
|
|
408
341
|
import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
409
342
|
import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
410
343
|
import type { IcaAccount } from '../types.js';
|
|
@@ -418,8 +351,6 @@ import type { CosmosRewardsResponse } from '../types.js';
|
|
|
418
351
|
import type { IBCConnectionInfo } from '../types.js';
|
|
419
352
|
import type { IBCMsgTransferOptions } from '../types.js';
|
|
420
353
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
421
|
-
import type { Invitation } from '@agoric/zoe';
|
|
422
|
-
import type { AccountIdArg } from '../types.js';
|
|
423
354
|
import type { ICQConnection } from '../types.js';
|
|
424
355
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
425
356
|
//# sourceMappingURL=cosmos-orchestration-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/** @file Use-object for the owner of a staking account */
|
|
2
2
|
import { toRequestQueryJson } from '@agoric/cosmic-proto';
|
|
3
|
-
import {
|
|
4
|
-
MsgDepositForBurn,
|
|
5
|
-
MsgDepositForBurnWithCaller,
|
|
6
|
-
} from '@agoric/cosmic-proto/circle/cctp/v1/tx.js';
|
|
7
3
|
import {
|
|
8
4
|
QueryAllBalancesRequest,
|
|
9
5
|
QueryAllBalancesResponse,
|
|
@@ -50,7 +46,7 @@ import { Fail, makeError, q } from '@endo/errors';
|
|
|
50
46
|
import { E } from '@endo/far';
|
|
51
47
|
import {
|
|
52
48
|
AmountArgShape,
|
|
53
|
-
|
|
49
|
+
ChainAddressShape,
|
|
54
50
|
DelegationShape,
|
|
55
51
|
DenomAmountShape,
|
|
56
52
|
IBCTransferOptionsShape,
|
|
@@ -68,12 +64,10 @@ import {
|
|
|
68
64
|
} from '../utils/cosmos.js';
|
|
69
65
|
import { orchestrationAccountMethods } from '../utils/orchestrationAccount.js';
|
|
70
66
|
import { makeTimestampHelper } from '../utils/time.js';
|
|
71
|
-
import { accountIdTo32Bytes, parseAccountId } from '../utils/address.js';
|
|
72
67
|
|
|
73
68
|
/**
|
|
74
69
|
* @import {HostOf} from '@agoric/async-flow';
|
|
75
|
-
* @import {AmountArg, IcaAccount,
|
|
76
|
-
* @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
70
|
+
* @import {AmountArg, IcaAccount, ChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, StakingAccountQueries, OrchestrationAccountCommon, CosmosRewardsResponse, IBCConnectionInfo, IBCMsgTransferOptions, ChainHub, CosmosDelegationResponse} from '../types.js';
|
|
77
71
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
78
72
|
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
79
73
|
* @import {Remote} from '@agoric/internal';
|
|
@@ -94,14 +88,14 @@ const { Vow$ } = NetworkShape; // TODO #9611
|
|
|
94
88
|
|
|
95
89
|
/**
|
|
96
90
|
* @typedef {object} CosmosOrchestrationAccountNotification
|
|
97
|
-
* @property {
|
|
91
|
+
* @property {ChainAddress} chainAddress
|
|
98
92
|
*/
|
|
99
93
|
|
|
100
94
|
/**
|
|
101
95
|
* @private
|
|
102
96
|
* @typedef {{
|
|
103
97
|
* account: IcaAccount;
|
|
104
|
-
* chainAddress:
|
|
98
|
+
* chainAddress: ChainAddress;
|
|
105
99
|
* icqConnection: ICQConnection | undefined;
|
|
106
100
|
* localAddress: LocalIbcAddress;
|
|
107
101
|
* remoteAddress: RemoteIbcAddress;
|
|
@@ -120,14 +114,14 @@ const { Vow$ } = NetworkShape; // TODO #9611
|
|
|
120
114
|
|
|
121
115
|
/** @see {StakingAccountActions} */
|
|
122
116
|
const stakingAccountActionsMethods = {
|
|
123
|
-
delegate: M.call(
|
|
117
|
+
delegate: M.call(ChainAddressShape, AmountArgShape).returns(VowShape),
|
|
124
118
|
redelegate: M.call(
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
ChainAddressShape,
|
|
120
|
+
ChainAddressShape,
|
|
127
121
|
AmountArgShape,
|
|
128
122
|
).returns(VowShape),
|
|
129
123
|
undelegate: M.call(M.arrayOf(DelegationShape)).returns(VowShape),
|
|
130
|
-
withdrawReward: M.call(
|
|
124
|
+
withdrawReward: M.call(ChainAddressShape).returns(
|
|
131
125
|
Vow$(M.arrayOf(DenomAmountShape)),
|
|
132
126
|
),
|
|
133
127
|
withdrawRewards: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))),
|
|
@@ -135,25 +129,17 @@ const stakingAccountActionsMethods = {
|
|
|
135
129
|
|
|
136
130
|
/** @see {StakingAccountQueries} */
|
|
137
131
|
const stakingAccountQueriesMethods = {
|
|
138
|
-
getDelegation: M.call(
|
|
132
|
+
getDelegation: M.call(ChainAddressShape).returns(VowShape),
|
|
139
133
|
getDelegations: M.call().returns(VowShape),
|
|
140
|
-
getUnbondingDelegation: M.call(
|
|
134
|
+
getUnbondingDelegation: M.call(ChainAddressShape).returns(VowShape),
|
|
141
135
|
getUnbondingDelegations: M.call().returns(VowShape),
|
|
142
136
|
getRedelegations: M.call().returns(VowShape),
|
|
143
|
-
getReward: M.call(
|
|
137
|
+
getReward: M.call(ChainAddressShape).returns(VowShape),
|
|
144
138
|
getRewards: M.call().returns(VowShape),
|
|
145
139
|
};
|
|
146
140
|
|
|
147
|
-
/** @see {NobleMethods} */
|
|
148
|
-
const nobleMethods = {
|
|
149
|
-
depositForBurn: M.call(M.string(), AmountArgShape)
|
|
150
|
-
.optional(M.string())
|
|
151
|
-
.returns(VowShape),
|
|
152
|
-
};
|
|
153
|
-
|
|
154
141
|
/** @see {OrchestrationAccountCommon} */
|
|
155
142
|
export const IcaAccountHolderI = M.interface('IcaAccountHolder', {
|
|
156
|
-
...nobleMethods,
|
|
157
143
|
...orchestrationAccountMethods,
|
|
158
144
|
...stakingAccountActionsMethods,
|
|
159
145
|
...stakingAccountQueriesMethods,
|
|
@@ -172,15 +158,13 @@ const PUBLIC_TOPICS = {
|
|
|
172
158
|
export const CosmosOrchestrationInvitationMakersI = M.interface(
|
|
173
159
|
'invitationMakers',
|
|
174
160
|
{
|
|
175
|
-
Delegate: M.call(
|
|
176
|
-
M.promise(),
|
|
177
|
-
),
|
|
161
|
+
Delegate: M.call(ChainAddressShape, AmountArgShape).returns(M.promise()),
|
|
178
162
|
Redelegate: M.call(
|
|
179
|
-
|
|
180
|
-
|
|
163
|
+
ChainAddressShape,
|
|
164
|
+
ChainAddressShape,
|
|
181
165
|
AmountArgShape,
|
|
182
166
|
).returns(M.promise()),
|
|
183
|
-
WithdrawReward: M.call(
|
|
167
|
+
WithdrawReward: M.call(ChainAddressShape).returns(M.promise()),
|
|
184
168
|
Undelegate: M.call(M.arrayOf(DelegationShape)).returns(M.promise()),
|
|
185
169
|
DeactivateAccount: M.call().returns(M.promise()),
|
|
186
170
|
ReactivateAccount: M.call().returns(M.promise()),
|
|
@@ -221,7 +205,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
221
205
|
amountToCoin: M.call(AmountArgShape).returns(M.record()),
|
|
222
206
|
}),
|
|
223
207
|
returnVoidWatcher: M.interface('returnVoidWatcher', {
|
|
224
|
-
onFulfilled: M.call(M.
|
|
208
|
+
onFulfilled: M.call(M.or(M.string(), M.record()))
|
|
225
209
|
.optional(M.arrayOf(M.undefined()))
|
|
226
210
|
.returns(M.undefined()),
|
|
227
211
|
}),
|
|
@@ -248,7 +232,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
248
232
|
transferWatcher: M.interface('transferWatcher', {
|
|
249
233
|
onFulfilled: M.call([M.record(), M.nat()])
|
|
250
234
|
.optional({
|
|
251
|
-
destination:
|
|
235
|
+
destination: ChainAddressShape,
|
|
252
236
|
opts: M.or(M.undefined(), IBCTransferOptionsShape),
|
|
253
237
|
token: {
|
|
254
238
|
denom: M.string(),
|
|
@@ -302,7 +286,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
302
286
|
},
|
|
303
287
|
/**
|
|
304
288
|
* @param {object} info
|
|
305
|
-
* @param {
|
|
289
|
+
* @param {ChainAddress} info.chainAddress
|
|
306
290
|
* @param {LocalIbcAddress} info.localAddress
|
|
307
291
|
* @param {RemoteIbcAddress} info.remoteAddress
|
|
308
292
|
* @param {object} io
|
|
@@ -313,11 +297,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
313
297
|
* @returns {State}
|
|
314
298
|
*/
|
|
315
299
|
({ chainAddress, localAddress, remoteAddress }, io) => {
|
|
316
|
-
trace('cosmos orch acct init', {
|
|
317
|
-
chainAddress,
|
|
318
|
-
localAddress,
|
|
319
|
-
remoteAddress,
|
|
320
|
-
});
|
|
321
300
|
const { storageNode } = io;
|
|
322
301
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
323
302
|
const topicKit = storageNode
|
|
@@ -582,7 +561,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
582
561
|
* bigint,
|
|
583
562
|
* ]} results
|
|
584
563
|
* @param {{
|
|
585
|
-
* destination:
|
|
564
|
+
* destination: ChainAddress;
|
|
586
565
|
* opts?: IBCMsgTransferOptions;
|
|
587
566
|
* token: Coin;
|
|
588
567
|
* }} ctx
|
|
@@ -676,7 +655,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
676
655
|
/**
|
|
677
656
|
* @type {OfferHandler<
|
|
678
657
|
* Vow<void>,
|
|
679
|
-
* { toAccount:
|
|
658
|
+
* { toAccount: ChainAddress; amount: AmountArg }
|
|
680
659
|
* >}
|
|
681
660
|
*/
|
|
682
661
|
const offerHandler = (seat, { toAccount, amount }) => {
|
|
@@ -689,7 +668,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
689
668
|
/**
|
|
690
669
|
* @type {OfferHandler<
|
|
691
670
|
* Vow<void>,
|
|
692
|
-
* { toAccount:
|
|
671
|
+
* { toAccount: ChainAddress; amounts: AmountArg[] }
|
|
693
672
|
* >}
|
|
694
673
|
*/
|
|
695
674
|
const offerHandler = (seat, { toAccount, amounts }) => {
|
|
@@ -712,7 +691,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
712
691
|
* Vow<void>,
|
|
713
692
|
* {
|
|
714
693
|
* amount: AmountArg;
|
|
715
|
-
* destination:
|
|
694
|
+
* destination: ChainAddress;
|
|
716
695
|
* opts?: IBCMsgTransferOptions;
|
|
717
696
|
* }
|
|
718
697
|
* >}
|
|
@@ -875,17 +854,14 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
875
854
|
send(toAccount, amount) {
|
|
876
855
|
return asVow(() => {
|
|
877
856
|
trace('send', toAccount, amount);
|
|
878
|
-
const cosmosDest = chainHub.coerceCosmosAddress(toAccount);
|
|
879
|
-
const { chainAddress } = this.state;
|
|
880
|
-
cosmosDest.chainId === chainAddress.chainId ||
|
|
881
|
-
Fail`bank/send cannot send to a different chain ${q(cosmosDest.chainId)}`;
|
|
882
857
|
const { helper } = this.facets;
|
|
858
|
+
const { chainAddress } = this.state;
|
|
883
859
|
return watch(
|
|
884
860
|
E(helper.owned()).executeEncodedTx([
|
|
885
861
|
Any.toJSON(
|
|
886
862
|
MsgSend.toProtoMsg({
|
|
887
863
|
fromAddress: chainAddress.value,
|
|
888
|
-
toAddress:
|
|
864
|
+
toAddress: toAccount.value,
|
|
889
865
|
amount: [helper.amountToCoin(amount)],
|
|
890
866
|
}),
|
|
891
867
|
),
|
|
@@ -920,19 +896,13 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
920
896
|
transfer(destination, amount, opts) {
|
|
921
897
|
trace('transfer', destination, amount, opts);
|
|
922
898
|
return asVow(() => {
|
|
923
|
-
// `destination` arg can be non-Cosmos per the common `.transfer` method signature
|
|
924
|
-
// but this implementation only supports transferring to another Cosmos chain.
|
|
925
|
-
// It relies on `coerceCosmosChainAddress` to throw if `destination` has another namespace.
|
|
926
|
-
|
|
927
|
-
const cosmosDest = chainHub.coerceCosmosAddress(destination);
|
|
928
|
-
|
|
929
899
|
const { helper } = this.facets;
|
|
930
900
|
const token = helper.amountToCoin(amount);
|
|
931
901
|
|
|
932
902
|
const connectionInfoV = watch(
|
|
933
903
|
chainHub.getConnectionInfo(
|
|
934
904
|
this.state.chainAddress.chainId,
|
|
935
|
-
|
|
905
|
+
destination.chainId,
|
|
936
906
|
),
|
|
937
907
|
);
|
|
938
908
|
|
|
@@ -951,7 +921,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
951
921
|
return watch(
|
|
952
922
|
allVows([connectionInfoV, timeoutTimestampVowOrValue]),
|
|
953
923
|
this.facets.transferWatcher,
|
|
954
|
-
{ opts, token, destination
|
|
924
|
+
{ opts, token, destination },
|
|
955
925
|
);
|
|
956
926
|
});
|
|
957
927
|
},
|
|
@@ -1005,7 +975,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1005
975
|
},
|
|
1006
976
|
/** @type {HostOf<StakingAccountQueries['getDelegation']>} */
|
|
1007
977
|
getDelegation(validator) {
|
|
1008
|
-
// @ts-expect-error XXX string template with generics
|
|
1009
978
|
return asVow(() => {
|
|
1010
979
|
trace('getDelegation', validator);
|
|
1011
980
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -1025,7 +994,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1025
994
|
},
|
|
1026
995
|
/** @type {HostOf<StakingAccountQueries['getDelegations']>} */
|
|
1027
996
|
getDelegations() {
|
|
1028
|
-
// @ts-expect-error XXX string template with generics
|
|
1029
997
|
return asVow(() => {
|
|
1030
998
|
trace('getDelegations');
|
|
1031
999
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -1121,7 +1089,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1121
1089
|
},
|
|
1122
1090
|
/** @type {HostOf<StakingAccountQueries['getRewards']>} */
|
|
1123
1091
|
getRewards() {
|
|
1124
|
-
// @ts-expect-error XXX string template with generics
|
|
1125
1092
|
return asVow(() => {
|
|
1126
1093
|
trace('getRewards');
|
|
1127
1094
|
const { chainAddress, icqConnection } = this.state;
|
|
@@ -1144,58 +1111,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1144
1111
|
watch(E(this.facets.helper.owned()).executeEncodedTx(msgs, opts)),
|
|
1145
1112
|
);
|
|
1146
1113
|
},
|
|
1147
|
-
/**
|
|
1148
|
-
* @type {HostOf<NobleMethods['depositForBurn']>}
|
|
1149
|
-
*/
|
|
1150
|
-
depositForBurn(destination, amount, caller) {
|
|
1151
|
-
return asVow(() => {
|
|
1152
|
-
trace('depositForBurn', { destination, amount });
|
|
1153
|
-
const { helper } = this.facets;
|
|
1154
|
-
const { chainAddress } = this.state;
|
|
1155
|
-
|
|
1156
|
-
const destParts = parseAccountId(destination);
|
|
1157
|
-
/** @type {CaipChainId} */
|
|
1158
|
-
const chainId = `${destParts.namespace}:${destParts.reference}`;
|
|
1159
|
-
|
|
1160
|
-
const { cctpDestinationDomain } =
|
|
1161
|
-
chainHub.getChainInfoByChainId(chainId);
|
|
1162
|
-
if (typeof cctpDestinationDomain !== 'number') {
|
|
1163
|
-
throw Fail`${q(chainId)} does not have "cctpDestinationDomain" set in ChainInfo`;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
/** @satisfies {MsgDepositForBurn} */
|
|
1167
|
-
const depositForBurn = {
|
|
1168
|
-
amount: helper.amountToCoin(amount)?.amount,
|
|
1169
|
-
from: chainAddress.value,
|
|
1170
|
-
destinationDomain: cctpDestinationDomain,
|
|
1171
|
-
mintRecipient: accountIdTo32Bytes(destination),
|
|
1172
|
-
// safe to hardcode since `uusdc` is the only asset supported by CCTP
|
|
1173
|
-
burnToken: 'uusdc',
|
|
1174
|
-
};
|
|
1175
|
-
|
|
1176
|
-
const destinationCaller = (() => {
|
|
1177
|
-
if (!caller) return undefined;
|
|
1178
|
-
const callerParts = parseAccountId(caller);
|
|
1179
|
-
callerParts.namespace === destParts.namespace ||
|
|
1180
|
-
Fail`caller ${q(caller)} must be in same namespace as destination ${q(destination)}`;
|
|
1181
|
-
return accountIdTo32Bytes(caller);
|
|
1182
|
-
})();
|
|
1183
|
-
|
|
1184
|
-
return watch(
|
|
1185
|
-
E(helper.owned()).executeEncodedTx([
|
|
1186
|
-
Any.toJSON(
|
|
1187
|
-
destinationCaller
|
|
1188
|
-
? MsgDepositForBurnWithCaller.toProtoMsg({
|
|
1189
|
-
...depositForBurn,
|
|
1190
|
-
destinationCaller,
|
|
1191
|
-
})
|
|
1192
|
-
: MsgDepositForBurn.toProtoMsg(depositForBurn),
|
|
1193
|
-
),
|
|
1194
|
-
]),
|
|
1195
|
-
this.facets.returnVoidWatcher,
|
|
1196
|
-
);
|
|
1197
|
-
});
|
|
1198
|
-
},
|
|
1199
1114
|
},
|
|
1200
1115
|
},
|
|
1201
1116
|
);
|
package/src/exos/ibc-packet.d.ts
CHANGED
|
@@ -61,7 +61,6 @@ export function prepareIBCTools(zone: import("@agoric/base-zone").Zone, vowTools
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
export type MakeIBCReplyKit = ReturnType<typeof prepareIBCReplyKit>;
|
|
64
|
-
import type { Pattern } from '@endo/patterns';
|
|
65
64
|
import type { VowTools } from '@agoric/vow';
|
|
66
65
|
import type { Vow } from '@agoric/vow';
|
|
67
66
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibc-packet.d.ts","sourceRoot":"","sources":["ibc-packet.js"],"names":[],"mappings":"AAMA,4CAA6C,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ibc-packet.d.ts","sourceRoot":"","sources":["ibc-packet.js"],"names":[],"mappings":"AAMA,4CAA6C,MAAM,CAAC;AAkB7C,gDAHI,GAAG,GACD,OAAO,CAgCnB;AAOM,+CAHI,OAAO,mBAAmB,EAAE,IAAI,8BAChC,QAAQ,GAAG;IAAE,eAAe,EAAE,eAAe,CAAA;CAAE,IA2FhD,GAAG,MAFA,UAAU;eAvEH,iBAAiB,CAAC,WAAW,CAAC;;;;;;;;;;;QAoB1C;;;;;;;;;;;WAWG;oCARQ,CACV,SACA,WACA,UAAkB,2CAA2C,CAAC,CACvD,CACF,CACF,OACO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;;;GA2CrB;;;;;GAChB;AAOM,yCAHI,OAAO,mBAAmB,EAAE,IAAI,YAChC,QAAQ,wBAyBN,OAAO,UACP,IAAI,GAAG,CAAC,QACR,aAAa;;;EAmBzB;AAQM,sCAHI,OAAO,mBAAmB,EAAE,IAAI,YAChC,QAAQ;;mBAnIC,iBAAiB,CAAC,WAAW,CAAC;;;;;;;;;0CAwGrC,OAAO,UACP,IAAI,GAAG,CAAC,QACR,aAAa;;;;EAkCzB;8BAba,UAAU,CAAC,OAAO,kBAAkB,CAAC;8BAlMnB,aAAa;yBAAb,aAAa;uCACT,gCAAgC;+BAFlB,sBAAsB;gCAAtB,sBAAsB;8BAAtB,sBAAsB;mCAGxC,mBAAmB"}
|
package/src/exos/ibc-packet.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertAllDefined
|
|
1
|
+
import { assertAllDefined } from '@agoric/internal';
|
|
2
2
|
import { base64ToBytes, Shape as NetworkShape } from '@agoric/network';
|
|
3
3
|
import { M } from '@endo/patterns';
|
|
4
4
|
import { E } from '@endo/far';
|
|
@@ -6,10 +6,7 @@ import { E } from '@endo/far';
|
|
|
6
6
|
// As specified in ICS20, the success result is a base64-encoded '\0x1' byte.
|
|
7
7
|
export const ICS20_TRANSFER_SUCCESS_RESULT = 'AQ==';
|
|
8
8
|
|
|
9
|
-
const trace = makeTracer('IBCP');
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
|
-
* @import {Key, Pattern} from '@endo/patterns';
|
|
13
10
|
* @import {JsonSafe, TypedJson, ResponseTo} from '@agoric/cosmic-proto';
|
|
14
11
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
15
12
|
* @import {LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
@@ -114,10 +111,6 @@ export const prepareIBCTransferSender = (zone, { watch, makeIBCReplyKit }) => {
|
|
|
114
111
|
const { match } = ctx;
|
|
115
112
|
const { transferMsg } = this.state;
|
|
116
113
|
|
|
117
|
-
// sequence + sourceChannel uniquely identifies a transfer.
|
|
118
|
-
// trace with receiver etc. for forensics
|
|
119
|
-
trace('sequence', sequence, transferMsg);
|
|
120
|
-
|
|
121
114
|
// Match the port/channel and sequence number.
|
|
122
115
|
const replyPacketPattern = M.splitRecord({
|
|
123
116
|
source_port: transferMsg.sourcePort,
|
|
@@ -14,8 +14,8 @@ export function prepareIcaAccountKit(zone: Zone, { watch, asVow }: VowTools): (c
|
|
|
14
14
|
onFulfilled(ack: string): string;
|
|
15
15
|
};
|
|
16
16
|
account: {
|
|
17
|
-
/** @returns {
|
|
18
|
-
getAddress():
|
|
17
|
+
/** @returns {ChainAddress} */
|
|
18
|
+
getAddress(): ChainAddress;
|
|
19
19
|
getLocalAddress(): `/ibc-port/${string}`;
|
|
20
20
|
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
21
21
|
getPort(): Port;
|
|
@@ -71,16 +71,14 @@ export type State = {
|
|
|
71
71
|
localAddress: LocalIbcAddress | undefined;
|
|
72
72
|
requestedRemoteAddress: string;
|
|
73
73
|
remoteAddress: RemoteIbcAddress | undefined;
|
|
74
|
-
chainAddress:
|
|
75
|
-
value: typeof UNPARSABLE_CHAIN_ADDRESS;
|
|
76
|
-
}) | undefined;
|
|
74
|
+
chainAddress: ChainAddress | undefined;
|
|
77
75
|
isInitiatingClose: boolean;
|
|
78
76
|
};
|
|
79
77
|
export type IcaAccountKit = ReturnType<ReturnType<typeof prepareIcaAccountKit>>;
|
|
80
78
|
import type { Zone } from '@agoric/base-zone';
|
|
81
79
|
import type { VowTools } from '@agoric/vow';
|
|
82
80
|
import type { Port } from '@agoric/network';
|
|
83
|
-
import type {
|
|
81
|
+
import type { ChainAddress } from '../types.js';
|
|
84
82
|
import type { Vow } from '@agoric/vow';
|
|
85
83
|
import type { AnyJson } from '@agoric/cosmic-proto';
|
|
86
84
|
import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
@@ -88,6 +86,4 @@ import type { Connection } from '@agoric/network';
|
|
|
88
86
|
import type { Remote } from '@agoric/vow';
|
|
89
87
|
import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
90
88
|
import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
91
|
-
declare const UNPARSABLE_CHAIN_ADDRESS: "UNPARSABLE_CHAIN_ADDRESS";
|
|
92
|
-
export {};
|
|
93
89
|
//# 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;AA0BI,2CAJI,IAAI,oBACJ,QAAQ;;QAiCX,0BAA0B;yBAAd,MAAM;;;QAMlB,8BAA8B;sBAAhB,YAAY;;;;;QAyB1B;;;;;;;;;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;;;;oBAtLU;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,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;4BA+KU,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;0BArN1C,mBAAmB;8BAEF,aAAa;0BADlB,iBAAiB;kCAKT,aAAa;yBAJhB,aAAa;6BAC3B,sBAAsB;4BACvB,8CAA8C;gCAHpC,iBAAiB;4BACZ,aAAa;qCAGD,iCAAiC;sCAAjC,iCAAiC"}
|