@agoric/orchestration 0.1.1-dev-d756c83.0.d756c83 → 0.1.1-dev-e9efaa1.0.e9efaa1

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/src/cosmos-api.ts DELETED
@@ -1,585 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars -- fails to notice the @see uses */
2
- import type {
3
- AnyJson,
4
- JsonSafe,
5
- MessageBody,
6
- ResponseTypeUrl,
7
- TypedJson,
8
- TypeFromUrl,
9
- } from '@agoric/cosmic-proto';
10
- import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
11
- import type {
12
- RedelegationResponse,
13
- UnbondingDelegation,
14
- } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
15
- import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
16
- import type { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
17
- import type { FungibleTokenPacketData } from '@agoric/cosmic-proto/ibc/applications/transfer/v2/packet.js';
18
- import type {
19
- State as IBCChannelState,
20
- Order,
21
- } from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
22
- import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
23
- import type {
24
- RequestQuery,
25
- ResponseQuery,
26
- } from '@agoric/cosmic-proto/tendermint/abci/types.js';
27
- import type { Amount, Payment } from '@agoric/ertp/src/types.js';
28
- import type { Port } from '@agoric/network';
29
- import type { TimerService } from '@agoric/time';
30
- import type {
31
- IBCChannelID,
32
- IBCConnectionID,
33
- IBCPortID,
34
- NetworkBinding,
35
- NetworkEndpoint,
36
- VTransferIBCEvent,
37
- } from '@agoric/vats';
38
- import type {
39
- TargetApp,
40
- TargetRegistration,
41
- } from '@agoric/vats/src/bridge-target.js';
42
- import type {
43
- LocalIbcAddress,
44
- RemoteIbcAddress,
45
- } from '@agoric/vats/tools/ibc-utils.js';
46
- import type { PFM_RECEIVER } from './exos/chain-hub.js';
47
- import type {
48
- AccountId,
49
- AmountArg,
50
- BaseChainInfo,
51
- CosmosChainAddress,
52
- Denom,
53
- DenomAmount,
54
- PacketOptions,
55
- } from './types.js';
56
-
57
- /**
58
- * Record of Network API traffic for a specific data packet sent between two
59
- * chains.
60
- */
61
- export type TrafficEntry<
62
- /** Source Protocol (like 'ibc') */
63
- SP extends keyof NetworkBinding = keyof NetworkBinding,
64
- /** Destination Protocol */
65
- DP extends keyof NetworkBinding = SP,
66
- > = {
67
- /** Semantic operation name for debugging, e.g. 'IBC transfer' */
68
- op: string;
69
- /** Indicates whether the traffic entry is not yet finalized. */
70
- incomplete?: boolean;
71
- /** Network API endpoint info for source chain */
72
- src: NetworkEndpoint<SP>;
73
- /** Network API endpoint info for destination chain */
74
- dst: NetworkEndpoint<DP>;
75
- /** Sequence number to match sent packet to received acknowledgement */
76
- seq: { status: 'pending' | 'unknown' } | number | bigint | string;
77
- };
78
-
79
- export type CosmosActionOptions = PacketOptions & {
80
- txOpts?: Partial<Omit<TxBody, 'messages'>>;
81
- };
82
-
83
- /**
84
- * The type of the `executeEncodedTx` options parameter on the underlying ICA.
85
- */
86
- export type LegacyExecuteEncodedTxOptions = CosmosActionOptions['txOpts'] &
87
- Omit<CosmosActionOptions, 'txOpts'>;
88
-
89
- export type CosmosQuerierOptions = PacketOptions & {
90
- queryOpts?: Partial<Omit<RequestQuery, 'path' | 'data'>>;
91
- };
92
-
93
- /**
94
- * @example
95
- *
96
- * agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346
97
- * cosmosvaloper1npm9gvss52mlmk
98
- */
99
- export type Bech32Address = `${string}1${string}`;
100
-
101
- /** An address for a validator on some blockchain, e.g., cosmos, eth, etc. */
102
- export type CosmosValidatorAddress = CosmosChainAddress & {
103
- // infix for Validator Operator https://docs.cosmos.network/main/learn/beginner/accounts#addresses
104
- value: `${string}valoper${string}`;
105
- encoding: 'bech32';
106
- };
107
-
108
- /** Represents an IBC Connection between two chains, which can contain multiple Channels. */
109
- export interface IBCConnectionInfo {
110
- id: IBCConnectionID; // e.g. connection-0
111
- client_id: string; // '07-tendermint-0'
112
- state: IBCConnectionState;
113
- counterparty: {
114
- client_id: string;
115
- connection_id: IBCConnectionID;
116
- };
117
- transferChannel: {
118
- portId: string;
119
- channelId: IBCChannelID;
120
- counterPartyPortId: string;
121
- counterPartyChannelId: IBCChannelID;
122
- ordering: Order;
123
- state: IBCChannelState;
124
- version: string; // e.eg. 'ics20-1'
125
- };
126
- }
127
-
128
- /**
129
- * https://github.com/cosmos/chain-registry/blob/master/assetlist.schema.json
130
- */
131
- export interface CosmosAssetInfo extends Record<string, unknown> {
132
- base: Denom;
133
- name: string;
134
- display: string;
135
- symbol: string;
136
- denom_units: Array<{ denom: Denom; exponent: number }>;
137
- traces?: Array<{
138
- type: 'ibc';
139
- counterparty: {
140
- chain_name: string;
141
- base_denom: Denom;
142
- channel_id: IBCChannelID;
143
- };
144
- chain: {
145
- channel_id: IBCChannelID;
146
- path: string;
147
- };
148
- }>;
149
- }
150
-
151
- /**
152
- * Info for a Cosmos-based chain.
153
- */
154
- export interface CosmosChainInfo extends BaseChainInfo {
155
- /** can be used to lookup chainInfo (chainId) from an address value */
156
- bech32Prefix: string;
157
- /** Cosmos chain ID. The CAIP-2 fields (namespace, reference) are on {@link BaseChainInfo}. */
158
- chainId: string;
159
- /** IBC connections between this chain and others, keyed by chainId */
160
- connections?: Record<string, IBCConnectionInfo>;
161
- /** indicates the host chain supports Interchain Accounts (ICS-27). Not currently used at runtime - only for types */
162
- icaEnabled?: boolean;
163
- /**
164
- * indicates the host chain support the async-icq IBC Application protocol. Used at runtime to permit `Chain.query()` operations.
165
- *
166
- * in the future (@see https://github.com/Agoric/agoric-sdk/issues/9326), querying will be supported by the ICA protocol natively and this will likely deprecate
167
- */
168
- icqEnabled?: boolean;
169
- namespace: 'cosmos';
170
- /**
171
- * Note: developers must provide this value themselves for `.transfer` to work
172
- * as expected. Please see examples for details.
173
- */
174
- pfmEnabled?: boolean;
175
- /**
176
- * cf https://github.com/cosmos/chain-registry/blob/master/chain.schema.json#L117
177
- */
178
- stakingTokens?: Readonly<Array<{ denom: string }>>;
179
- }
180
-
181
- // #region Orchestration views on Cosmos response types
182
- // Naming scheme: Cosmos for the chain system, Rewards b/c getRewards function,
183
- // and Response because it's the return value.
184
-
185
- /** @see {QueryDelegationTotalRewardsResponse} */
186
- export interface CosmosRewardsResponse {
187
- rewards: { validator: CosmosValidatorAddress; reward: DenomAmount[] }[];
188
- total: DenomAmount[];
189
- }
190
-
191
- /** @see {DelegationResponse} */
192
- export interface CosmosDelegationResponse {
193
- delegator: CosmosChainAddress;
194
- validator: CosmosValidatorAddress;
195
- amount: DenomAmount;
196
- }
197
- // #endregion
198
-
199
- /**
200
- * Queries for the staking properties of an account.
201
- *
202
- * @see {@link https://docs.cosmos.network/main/build/modules/staking#messages x/staking messages}
203
- * {@link https://cosmos.github.io/cosmjs/latest/stargate/interfaces/StakingExtension.html StakingExtension} in cosmjs
204
- */
205
- export interface StakingAccountQueries {
206
- /**
207
- * @returns all active delegations from the account to any validator (or [] if none)
208
- */
209
- getDelegations: (
210
- opts?: CosmosQuerierOptions,
211
- ) => Promise<CosmosDelegationResponse[]>;
212
- /**
213
- * @returns the active delegation from the account to a specific validator. Return an
214
- * empty Delegation if there is no delegation.
215
- */
216
- getDelegation: (
217
- validator: CosmosValidatorAddress,
218
- opts?: CosmosQuerierOptions,
219
- ) => Promise<CosmosDelegationResponse>;
220
-
221
- /**
222
- * @returns the unbonding delegations from the account to any validator (or [] if none)
223
- */
224
- getUnbondingDelegations: (
225
- opts?: CosmosQuerierOptions,
226
- ) => Promise<UnbondingDelegation[]>;
227
-
228
- /**
229
- * @returns the unbonding delegations from the account to a specific validator (or [] if none)
230
- */
231
- getUnbondingDelegation: (
232
- validator: CosmosValidatorAddress,
233
- opts?: CosmosQuerierOptions,
234
- ) => Promise<UnbondingDelegation>;
235
-
236
- getRedelegations: (
237
- opts?: CosmosQuerierOptions,
238
- ) => Promise<RedelegationResponse[]>;
239
-
240
- /**
241
- * Get the pending rewards for the account.
242
- * @returns the amounts of the account's rewards pending from all validators
243
- */
244
- getRewards: (opts?: CosmosQuerierOptions) => Promise<CosmosRewardsResponse>;
245
-
246
- /**
247
- * Get the rewards pending with a specific validator.
248
- * @param validator - the validator address to query for
249
- * @returns the amount of the account's rewards pending from a specific validator
250
- */
251
- getReward: (
252
- validator: CosmosValidatorAddress,
253
- opts?: CosmosQuerierOptions,
254
- ) => Promise<DenomAmount[]>;
255
- }
256
-
257
- /**
258
- * Transactions for doing staking operations on an individual account.
259
- *
260
- * @see {@link https://docs.cosmos.network/main/build/modules/staking#messages x/staking messages} and
261
- * {@link https://cosmos.github.io/cosmjs/latest/stargate/interfaces/StakingExtension.html StakingExtension} in cosmjs
262
- */
263
- export interface StakingAccountActions {
264
- /**
265
- * Delegate an amount to a validator. The promise settles when the delegation is complete.
266
- * @param validator - the validator to delegate to
267
- * @param amount - the amount to delegate
268
- * @param [opts] - transaction submission options
269
- * @returns unknown
270
- */
271
- delegate: (
272
- validator: CosmosValidatorAddress,
273
- amount: AmountArg,
274
- opts?: CosmosActionOptions,
275
- ) => Promise<unknown>;
276
-
277
- /**
278
- * Redelegate from one delegator to another.
279
- * Settles when the redelegation is established, not 21 days later.
280
- * @param srcValidator - the current validator for the delegation.
281
- * @param dstValidator - the validator that will receive the delegation.
282
- * @param amount - how much to redelegate.
283
- * @param [opts] - transaction submission options
284
- * @returns
285
- */
286
- redelegate: (
287
- srcValidator: CosmosValidatorAddress,
288
- dstValidator: CosmosValidatorAddress,
289
- amount: AmountArg,
290
- opts?: CosmosActionOptions,
291
- ) => Promise<unknown>;
292
-
293
- /**
294
- * Undelegate multiple delegations (concurrently). To delegate independently, pass an array with one item.
295
- * Resolves when the undelegation is complete and the tokens are no longer bonded. Note it may take weeks.
296
- * The unbonding time is padded by 10 minutes to account for clock skew.
297
- * @param delegations - the delegation to undelegate
298
- * @param [opts] - transaction submission options
299
- */
300
- undelegate: (
301
- delegations: {
302
- amount: AmountArg;
303
- delegator?: CosmosChainAddress;
304
- validator: CosmosValidatorAddress;
305
- }[],
306
- opts?: CosmosActionOptions,
307
- ) => Promise<unknown>;
308
-
309
- /**
310
- * Withdraw rewards from all validators. The promise settles when the rewards are withdrawn.
311
- * @param [opts] - transaction submission options
312
- * @returns The total amounts of rewards withdrawn
313
- */
314
- withdrawRewards: (opts?: CosmosActionOptions) => Promise<DenomAmount[]>;
315
-
316
- /**
317
- * Withdraw rewards from a specific validator. The promise settles when the rewards are withdrawn.
318
- * @param validator - the validator to withdraw rewards from
319
- * @param [opts] - transaction submission options
320
- * @returns
321
- */
322
- withdrawReward: (
323
- validator: CosmosValidatorAddress,
324
- opts?: CosmosActionOptions,
325
- ) => Promise<DenomAmount[]>;
326
- }
327
-
328
- /**
329
- * Low level methods from IcaAccount that we pass through to CosmosOrchestrationAccount
330
- */
331
-
332
- export interface IcaAccountBaseMethods {
333
- /**
334
- * Submit a transaction on behalf of the remote account for execution on the remote chain.
335
- * @param msgs - records for the transaction
336
- * @param [opts] - optional parameters for the Tx. use `opts.sendOpts.relativeTimeoutNs` to specify a timeout for the ICA tx packet
337
- * @returns base64 protobuf responses for tryDecodeMessages
338
- */
339
- executeEncodedTx: (
340
- msgs: readonly AnyJson[],
341
- // XXX just use CosmosActionOptions directly after all ICAs are upgraded to
342
- // support 'opts.txOpts'
343
- opts?: LegacyExecuteEncodedTxOptions,
344
- ) => Promise<string>;
345
- /**
346
- * Deactivates the ICA account by closing the ICA channel. The `Port` is
347
- * persisted so holders can always call `.reactivate()` to re-establish a new
348
- * channel with the same chain address.
349
- * CAVEAT: Does not retrieve assets so they may be lost if left.
350
- * @throws {Error} if connection is not available or already deactivated
351
- */
352
- deactivate: () => Promise<void>;
353
- /**
354
- * Reactivates the ICA account by re-establishing a new channel with the
355
- * original Port and requested address.
356
- * If a channel is closed for an unexpected reason, such as a packet timeout,
357
- * an automatic attempt to reopen will be made and the holder should not need
358
- * to call `.reactivate()`.
359
- * @throws {Error} if connection is currently active
360
- */
361
- reactivate: () => Promise<void>;
362
- }
363
-
364
- /**
365
- * Low level object that supports queries and operations for an account on a remote chain.
366
- */
367
- export interface IcaAccount extends IcaAccountBaseMethods {
368
- /**
369
- * @returns the address of the account on the remote chain
370
- */
371
- getAddress: () => CosmosChainAddress;
372
-
373
- /**
374
- * Submit a transaction on behalf of the remote account for execution on the remote chain.
375
- * @param msgs - records for the transaction
376
- * @returns acknowledgement
377
- */
378
- executeTx: (msgs: TypedJson[]) => Promise<string>;
379
- /** @returns the address of the remote channel */
380
- getRemoteAddress: () => RemoteIbcAddress;
381
- /** @returns the address of the local channel */
382
- getLocalAddress: () => LocalIbcAddress;
383
- /** @returns the port the ICA channel is bound to */
384
- getPort: () => Port;
385
- }
386
-
387
- /**
388
- * ICA-related account methods exposed on the Cosmos Orchestration Account
389
- * holder facet.
390
- */
391
- export interface IcaAccountMethods extends IcaAccountBaseMethods {
392
- /**
393
- * Submit a transaction on behalf of the remote account for execution on
394
- * the remote chain, and decode the response.
395
- *
396
- * Set `relativeTimeoutNs` to provide a timeout for the IBC packet.
397
- *
398
- * `TxBody` fields like `timeoutHeight` and `memo` can be set, but these
399
- * typically do not affect IBC app protocols like PFM, ICA.
400
- *
401
- * @param msgs - records for the transaction
402
- * @param [opts] - optional parameters for the Tx. use `opts.sendOpts.relativeTimeoutNs` to specify a timeout for the ICA tx packet
403
- * @returns decoded responses or Any if unknown
404
- */
405
- executeTxProto3: <TUS extends readonly (keyof TypeFromUrl | unknown)[]>(
406
- msgs: Readonly<{
407
- [K in keyof TUS]: AnyJson<TUS[K]>;
408
- }>,
409
- opts?: CosmosActionOptions,
410
- ) => Promise<{ [K in keyof TUS]: MessageBody<ResponseTypeUrl<TUS[K]>> }>;
411
- /**
412
- * Submit a transaction on behalf of the remote account for execution on
413
- * the remote chain, but do not decode the response.
414
- *
415
- * Set `relativeTimeoutNs` to provide a timeout for the IBC packet.
416
- *
417
- * `TxBody` fields like `timeoutHeight` and `memo` can be set, but these
418
- * typically do not affect IBC app protocols like PFM, ICA.
419
- *
420
- * @param msgs - records for the transaction
421
- * @param [opts] - optional parameters for the Tx. use `opts.sendOpts.relativeTimeoutNs` to specify a timeout for the ICA tx packet
422
- * @returns base64 protobuf responses for tryDecodeMessages
423
- */
424
- executeTxProto3Undecoded: (
425
- msgs: readonly AnyJson[],
426
- opts?: CosmosActionOptions,
427
- ) => Promise<string>;
428
- }
429
-
430
- /** Methods on chains that support Liquid Staking */
431
- export interface LiquidStakingMethods {
432
- liquidStake: (
433
- amount: AmountArg,
434
- opts?: CosmosActionOptions,
435
- ) => Promise<unknown>;
436
- }
437
-
438
- /**
439
- * Noble is the gateway to transferring USDC among Cosmos chains. We can
440
- * transfer funds from any cosmos account using depositForBurn().
441
- */
442
- export interface NobleMethods {
443
- /** burn USDC on Noble and mint on a destination chain via CCTP */
444
- depositForBurn: (
445
- mintRecipient: AccountId,
446
- amount: AmountArg,
447
- /** if specified, only this account can call MsgReceive on the destination chain */
448
- caller?: AccountId,
449
- opts?: CosmosActionOptions,
450
- ) => Promise<unknown>;
451
- }
452
-
453
- // TODO support StakingAccountQueries
454
- /** Methods supported only on Agoric chain accounts */
455
- export interface LocalAccountMethods extends StakingAccountActions {
456
- /** deposit payment (from zoe, for example) to the account */
457
- deposit: (payment: Payment<'nat'>) => Promise<Amount<'nat'>>;
458
- /** withdraw a Payment from the account */
459
- withdraw: (amount: Amount<'nat'>) => Promise<Payment<'nat'>>;
460
- /**
461
- * Register a handler that receives an event each time ICS-20 transfers are
462
- * sent or received by the underlying account.
463
- *
464
- * Handler includes {@link VTransferIBCEvent} and
465
- * {@link FungibleTokenPacketData} that can be used for application logic.
466
- *
467
- * Each account may be associated with at most one handler at a given time.
468
- *
469
- * Does not grant the handler the ability to intercept a transfer. For a
470
- * blocking handler, aka 'IBC Hooks', leverage `registerActiveTap` from
471
- * `transferMiddleware` directly.
472
- *
473
- * @param tap
474
- */
475
- monitorTransfers: (tap: TargetApp) => Promise<TargetRegistration>;
476
- /**
477
- * Parse an incoming transfer message and return its details.
478
- */
479
- parseInboundTransfer: (packet: Record<string, any>) => Promise<{
480
- amount: DenomAmount;
481
- fromAccount: string;
482
- toAccount: string;
483
- extra: Record<string, any>;
484
- }>;
485
- }
486
-
487
- /**
488
- * Options for {@link OrchestrationAccountI} `transfer` method.
489
- *
490
- * If specifying a custom timeout, use one of `timeoutHeight`, `timeoutTimestamp`, or `timeoutRelativeSeconds`.
491
- *
492
- * @see {@link https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures ICS 20 Data Structures}
493
- */
494
- export type IBCMsgTransferOptions = {
495
- timeoutHeight?: MsgTransfer['timeoutHeight'];
496
- timeoutTimestamp?: MsgTransfer['timeoutTimestamp'];
497
- /** converted using {@link TimerService} to a `timeoutTimestamp` value `timeoutRelativeSeconds` in the future */
498
- timeoutRelativeSeconds?: bigint;
499
- memo?: string;
500
- forwardOpts?: {
501
- /** The recipient address for the intermediate transfer. Defaults to 'pfm' unless specified */
502
- intermediateRecipient?: CosmosChainAddress;
503
- timeout?: ForwardInfo['forward']['timeout'];
504
- retries?: ForwardInfo['forward']['retries'];
505
- };
506
- } & CosmosActionOptions;
507
-
508
- /**
509
- * Cosmos-specific methods to extend `OrchestrationAccountI`, parameterized
510
- * by `CosmosChainInfo`.
511
- *
512
- * In particular, if the chain info includes a staking token, {@link StakingAccountActions}
513
- * are available.
514
- *
515
- * @see {OrchestrationAccountI}
516
- */
517
- export type CosmosChainAccountMethods<CCI extends { chainId: string }> =
518
- IcaAccountMethods &
519
- (CCI extends {
520
- stakingTokens: object;
521
- }
522
- ? StakingAccountActions & StakingAccountQueries
523
- : object);
524
-
525
- export type ICQQueryFunction = (
526
- msgs: JsonSafe<RequestQuery>[],
527
- ) => Promise<JsonSafe<ResponseQuery>[]>;
528
-
529
- /**
530
- * Message structure for PFM memo
531
- *
532
- * @see {@link https://github.com/cosmos/chain-registry/blob/58b603bbe01f70e911e3ad2bdb6b90c4ca665735/_memo_keys/ICS20_memo_keys.json#L38-L60}
533
- */
534
- export interface ForwardInfo {
535
- forward: {
536
- receiver: CosmosChainAddress['value'];
537
- port: IBCPortID;
538
- channel: IBCChannelID;
539
- /** e.g. '10m' */
540
- timeout: GoDuration;
541
- /** default is 3? */
542
- retries: number;
543
- next?: {
544
- forward: ForwardInfo;
545
- };
546
- };
547
- }
548
-
549
- /**
550
- * Object used to help build MsgTransfer parameters for IBC transfers.
551
- *
552
- * If `forwardInfo` is present:
553
- * - it must be stringified and provided as the `memo` field value for
554
- * use with `MsgTransfer`.
555
- * - `receiver` will be set to `"pfm"` - purposely invalid bech32. see {@link https://github.com/cosmos/ibc-apps/blob/26f3ad8f58e4ffc7769c6766cb42b954181dc100/middleware/packet-forward-middleware/README.md#minimal-example---chain-forward-a-b-c}
556
- */
557
- export type TransferRoute = {
558
- /** typically, `transfer` */
559
- sourcePort: string;
560
- sourceChannel: IBCChannelID;
561
- token: Coin;
562
- } & (
563
- | {
564
- receiver: typeof PFM_RECEIVER | CosmosChainAddress['value'];
565
- /** contains PFM forwarding info */
566
- forwardInfo: ForwardInfo;
567
- }
568
- | {
569
- receiver: string;
570
- forwardInfo?: never;
571
- }
572
- );
573
-
574
- /** Single units allowed in Go time duration strings */
575
- type GoDurationUnit = 'h' | 'm' | 's' | 'ms' | 'us' | 'ns';
576
-
577
- /**
578
- * Type for a time duration string in Go (cosmos-sdk). For example, "1h", "3m".
579
- *
580
- * Note: this does not support composite values like "1h30m", "1m30s",
581
- * which are allowed in Go.
582
- *
583
- * @see https://pkg.go.dev/time#ParseDuration
584
- */
585
- export type GoDuration = `${number}${GoDurationUnit}`;
@@ -1,35 +0,0 @@
1
- import type { IBCConnectionID } from '@agoric/vats';
2
- import type { Vow } from '@agoric/vow';
3
- import type { IcaAccount } from '../cosmos-api.js';
4
- import type { ICAChannelAddressOpts } from '../utils/address.js';
5
- import type { ICQConnection } from './icq-connection-kit.js';
6
-
7
- /**
8
- * Authority to make a Cosmos interchain account or an interchain query connection.
9
- */
10
- export interface CosmosInterchainService {
11
- /**
12
- * @param {string} chainId
13
- * @param {IBCConnectionID} hostConnectionId the counterparty
14
- * connection_id
15
- * @param {IBCConnectionID} controllerConnectionId self connection_id
16
- * @param {ICAChannelAddressOpts} [opts] optional to configure the
17
- * channel address, such as version and ordering
18
- * @returns {Vow<IcaAccount>}
19
- */
20
- makeAccount(
21
- chainId: string,
22
- hostConnectionId: IBCConnectionID,
23
- controllerConnectionId: IBCConnectionID,
24
- opts?: ICAChannelAddressOpts | undefined,
25
- ): Vow<IcaAccount>;
26
- /**
27
- * @param {IBCConnectionID} controllerConnectionId
28
- * @param {string} [version]
29
- * @returns {Vow<ICQConnection> | ICQConnection}
30
- */
31
- provideICQConnection(
32
- controllerConnectionId: IBCConnectionID,
33
- version?: string | undefined,
34
- ): Vow<ICQConnection> | ICQConnection;
35
- }