@agoric/orchestration 0.3.0-u23.0 → 0.3.0-u23.1

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.
Files changed (170) hide show
  1. package/index.d.ts +9 -0
  2. package/package.json +15 -15
  3. package/src/axelar-types.d.ts +53 -0
  4. package/src/axelar-types.d.ts.map +1 -0
  5. package/src/cctp-chain-info.d.ts +65 -0
  6. package/src/cctp-chain-info.d.ts.map +1 -0
  7. package/src/chain-capabilities.d.ts +12 -0
  8. package/src/chain-capabilities.d.ts.map +1 -0
  9. package/src/chain-info.d.ts +10267 -0
  10. package/src/chain-info.d.ts.map +1 -0
  11. package/src/cosmos-api.d.ts +437 -0
  12. package/src/cosmos-api.d.ts.map +1 -0
  13. package/src/ethereum-api.d.ts +9 -0
  14. package/src/ethereum-api.d.ts.map +1 -0
  15. package/src/examples/auto-stake-it-tap-kit.d.ts +50 -0
  16. package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -0
  17. package/src/examples/auto-stake-it.contract.d.ts +34 -0
  18. package/src/examples/auto-stake-it.contract.d.ts.map +1 -0
  19. package/src/examples/auto-stake-it.flows.d.ts +24 -0
  20. package/src/examples/auto-stake-it.flows.d.ts.map +1 -0
  21. package/src/examples/axelar-gmp-account-kit.d.ts +80 -0
  22. package/src/examples/axelar-gmp-account-kit.d.ts.map +1 -0
  23. package/src/examples/axelar-gmp.contract.d.ts +52 -0
  24. package/src/examples/axelar-gmp.contract.d.ts.map +1 -0
  25. package/src/examples/axelar-gmp.flows.d.ts +21 -0
  26. package/src/examples/axelar-gmp.flows.d.ts.map +1 -0
  27. package/src/examples/basic-flows.contract.d.ts +32 -0
  28. package/src/examples/basic-flows.contract.d.ts.map +1 -0
  29. package/src/examples/basic-flows.flows.d.ts +20 -0
  30. package/src/examples/basic-flows.flows.d.ts.map +1 -0
  31. package/src/examples/send-anywhere.contract.d.ts +60 -0
  32. package/src/examples/send-anywhere.contract.d.ts.map +1 -0
  33. package/src/examples/send-anywhere.flows.d.ts +576 -0
  34. package/src/examples/send-anywhere.flows.d.ts.map +1 -0
  35. package/src/examples/shared.flows.d.ts +4 -0
  36. package/src/examples/shared.flows.d.ts.map +1 -0
  37. package/src/examples/stake-bld.contract.d.ts +237 -0
  38. package/src/examples/stake-bld.contract.d.ts.map +1 -0
  39. package/src/examples/stake-ica.contract.d.ts +573 -0
  40. package/src/examples/stake-ica.contract.d.ts.map +1 -0
  41. package/src/examples/staking-combinations.contract.d.ts +19 -0
  42. package/src/examples/staking-combinations.contract.d.ts.map +1 -0
  43. package/src/examples/staking-combinations.flows.d.ts +32 -0
  44. package/src/examples/staking-combinations.flows.d.ts.map +1 -0
  45. package/src/examples/swap-anything.contract.d.ts +55 -0
  46. package/src/examples/swap-anything.contract.d.ts.map +1 -0
  47. package/src/examples/swap-anything.flows.d.ts +32 -0
  48. package/src/examples/swap-anything.flows.d.ts.map +1 -0
  49. package/src/examples/swap.contract.d.ts +56 -0
  50. package/src/examples/swap.contract.d.ts.map +1 -0
  51. package/src/examples/swap.flows.d.ts +12 -0
  52. package/src/examples/swap.flows.d.ts.map +1 -0
  53. package/src/examples/unbond.contract.d.ts +21 -0
  54. package/src/examples/unbond.contract.d.ts.map +1 -0
  55. package/src/examples/unbond.flows.d.ts +6 -0
  56. package/src/examples/unbond.flows.d.ts.map +1 -0
  57. package/src/exos/chain-hub-admin.d.ts +27 -0
  58. package/src/exos/chain-hub-admin.d.ts.map +1 -0
  59. package/src/exos/chain-hub.d.ts +225 -0
  60. package/src/exos/chain-hub.d.ts.map +1 -0
  61. package/src/exos/combine-invitation-makers.d.ts +7 -0
  62. package/src/exos/combine-invitation-makers.d.ts.map +1 -0
  63. package/src/exos/cosmos-interchain-service.d.ts +49 -0
  64. package/src/exos/cosmos-interchain-service.d.ts.map +1 -0
  65. package/src/exos/cosmos-orchestration-account.d.ts +950 -0
  66. package/src/exos/cosmos-orchestration-account.d.ts.map +1 -0
  67. package/src/exos/exo-interfaces.d.ts +27 -0
  68. package/src/exos/exo-interfaces.d.ts.map +1 -0
  69. package/src/exos/ibc-packet.d.ts +101 -0
  70. package/src/exos/ibc-packet.d.ts.map +1 -0
  71. package/src/exos/ica-account-kit.d.ts +98 -0
  72. package/src/exos/ica-account-kit.d.ts.map +1 -0
  73. package/src/exos/icq-connection-kit.d.ts +67 -0
  74. package/src/exos/icq-connection-kit.d.ts.map +1 -0
  75. package/src/exos/local-chain-facade.d.ts +1587 -0
  76. package/src/exos/local-chain-facade.d.ts.map +1 -0
  77. package/src/exos/local-orchestration-account.d.ts +405 -0
  78. package/src/exos/local-orchestration-account.d.ts.map +1 -0
  79. package/src/exos/orchestrator.d.ts +35857 -0
  80. package/src/exos/orchestrator.d.ts.map +1 -0
  81. package/src/exos/packet-tools.d.ts +63 -0
  82. package/src/exos/packet-tools.d.ts.map +1 -0
  83. package/src/exos/portfolio-holder-kit.d.ts +154 -0
  84. package/src/exos/portfolio-holder-kit.d.ts.map +1 -0
  85. package/src/exos/remote-chain-facade.d.ts +1549 -0
  86. package/src/exos/remote-chain-facade.d.ts.map +1 -0
  87. package/src/facade.d.ts +33 -0
  88. package/src/facade.d.ts.map +1 -0
  89. package/src/fetched-chain-info.d.ts +10275 -0
  90. package/src/fetched-chain-info.d.ts.map +1 -0
  91. package/src/fixtures/query-flows.contract.d.ts +33 -0
  92. package/src/fixtures/query-flows.contract.d.ts.map +1 -0
  93. package/src/fixtures/query-flows.flows.d.ts +20 -0
  94. package/src/fixtures/query-flows.flows.d.ts.map +1 -0
  95. package/src/orchestration-api.d.ts +315 -0
  96. package/src/orchestration-api.d.ts.map +1 -0
  97. package/src/typeGuards.d.ts +163 -0
  98. package/src/typeGuards.d.ts.map +1 -0
  99. package/src/types.d.ts +25 -0
  100. package/src/types.d.ts.map +1 -0
  101. package/src/utils/abitype.d.ts +6 -0
  102. package/src/utils/abitype.d.ts.map +1 -0
  103. package/src/utils/address.d.ts +44 -0
  104. package/src/utils/address.d.ts.map +1 -0
  105. package/src/utils/agd-lib.d.ts +58 -0
  106. package/src/utils/agd-lib.d.ts.map +1 -0
  107. package/src/utils/amounts.d.ts +11 -0
  108. package/src/utils/amounts.d.ts.map +1 -0
  109. package/src/utils/asset.d.ts +6 -0
  110. package/src/utils/asset.d.ts.map +1 -0
  111. package/src/utils/axelar-static-config.d.ts +34 -0
  112. package/src/utils/axelar-static-config.d.ts.map +1 -0
  113. package/src/utils/chain-hub-helper.d.ts +14 -0
  114. package/src/utils/chain-hub-helper.d.ts.map +1 -0
  115. package/src/utils/chain-info.d.ts +5 -0
  116. package/src/utils/chain-info.d.ts.map +1 -0
  117. package/src/utils/codecs.d.ts +145 -0
  118. package/src/utils/codecs.d.ts.map +1 -0
  119. package/src/utils/cosmos.d.ts +61 -0
  120. package/src/utils/cosmos.d.ts.map +1 -0
  121. package/src/utils/denomHash.d.ts +7 -0
  122. package/src/utils/denomHash.d.ts.map +1 -0
  123. package/src/utils/exo-helpers.d.ts +156 -0
  124. package/src/utils/exo-helpers.d.ts.map +1 -0
  125. package/src/utils/gmp.d.ts +30 -0
  126. package/src/utils/gmp.d.ts.map +1 -0
  127. package/src/utils/orc.d.ts +17 -0
  128. package/src/utils/orc.d.ts.map +1 -0
  129. package/src/utils/orchestrationAccount.d.ts +91 -0
  130. package/src/utils/orchestrationAccount.d.ts.map +1 -0
  131. package/src/utils/packet.d.ts +57 -0
  132. package/src/utils/packet.d.ts.map +1 -0
  133. package/src/utils/permit2/signatureTransfer.d.ts +221 -0
  134. package/src/utils/permit2/signatureTransfer.d.ts.map +1 -0
  135. package/src/utils/permit2/signatureTransferHelpers.d.ts +334 -0
  136. package/src/utils/permit2/signatureTransferHelpers.d.ts.map +1 -0
  137. package/src/utils/permit2.d.ts +11 -0
  138. package/src/utils/permit2.d.ts.map +1 -0
  139. package/src/utils/progress.d.ts +41 -0
  140. package/src/utils/progress.d.ts.map +1 -0
  141. package/src/utils/registry.d.ts +6 -0
  142. package/src/utils/registry.d.ts.map +1 -0
  143. package/src/utils/start-helper.d.ts +129 -0
  144. package/src/utils/start-helper.d.ts.map +1 -0
  145. package/src/utils/time.d.ts +38 -0
  146. package/src/utils/time.d.ts.map +1 -0
  147. package/src/utils/viem-utils/hashTypedData.d.ts +21 -0
  148. package/src/utils/viem-utils/hashTypedData.d.ts.map +1 -0
  149. package/src/utils/viem-utils/types.d.ts +6 -0
  150. package/src/utils/viem-utils/types.d.ts.map +1 -0
  151. package/src/utils/viem.d.ts +11 -0
  152. package/src/utils/viem.d.ts.map +1 -0
  153. package/src/utils/zcf-tools.d.ts +19 -0
  154. package/src/utils/zcf-tools.d.ts.map +1 -0
  155. package/src/utils/zoe-tools.d.ts +19 -0
  156. package/src/utils/zoe-tools.d.ts.map +1 -0
  157. package/src/vat-orchestration.d.ts +21 -0
  158. package/src/vat-orchestration.d.ts.map +1 -0
  159. package/tools/contract-tests.d.ts +1832 -0
  160. package/tools/contract-tests.d.ts.map +1 -0
  161. package/tools/ibc-mock-fixtures.d.ts +49 -0
  162. package/tools/ibc-mock-fixtures.d.ts.map +1 -0
  163. package/tools/ibc-mocks.d.ts +168 -0
  164. package/tools/ibc-mocks.d.ts.map +1 -0
  165. package/tools/make-test-address.d.ts +3 -0
  166. package/tools/make-test-address.d.ts.map +1 -0
  167. package/tools/network-fakes.d.ts +143 -0
  168. package/tools/network-fakes.d.ts.map +1 -0
  169. package/tools/protobuf-decoder.d.ts +19 -0
  170. package/tools/protobuf-decoder.d.ts.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetched-chain-info.d.ts","sourceRoot":"","sources":["fetched-chain-info.js"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
2
+ marshaller: Remote<Marshaller>;
3
+ chainInfo?: Record<string, CosmosChainInfo>;
4
+ assetInfo?: [Denom, DenomDetail & {
5
+ brandKey?: string;
6
+ }][];
7
+ }, baggage: import("@agoric/vat-data").Baggage) => Promise<{
8
+ publicFacet: import("@endo/exo").Guarded<{
9
+ makeSendICQQueryInvitation(): Promise<import("@agoric/zoe").Invitation<import("@agoric/vow").Vow<string>, {
10
+ chainName: string;
11
+ msgs: Parameters<import("@agoric/orchestration").ICQQueryFunction>[0];
12
+ }>>;
13
+ makeAccountAndGetBalanceQueryInvitation(): Promise<import("@agoric/zoe").Invitation<import("@agoric/vow").Vow<string>, {
14
+ chainName: string;
15
+ denom: import("@agoric/orchestration").DenomArg;
16
+ }>>;
17
+ makeAccountAndGetBalancesQueryInvitation(): Promise<import("@agoric/zoe").Invitation<import("@agoric/vow").Vow<string>, {
18
+ chainName: string;
19
+ }>>;
20
+ makeSendLocalQueryInvitation(): Promise<import("@agoric/zoe").Invitation<import("@agoric/vow").Vow<string>, {
21
+ msgs: Parameters<import("@agoric/vats/src/localchain.js").QueryManyFn>[0];
22
+ }>>;
23
+ }>;
24
+ }>;
25
+ export type QueryFlowsSF = typeof start;
26
+ import type { ZCF } from '@agoric/zoe';
27
+ import type { OrchestrationPowers } from '../utils/start-helper.js';
28
+ import type { Marshaller } from '@agoric/internal/src/lib-chainStorage.js';
29
+ import type { Remote } from '@agoric/internal';
30
+ import type { CosmosChainInfo } from '@agoric/orchestration';
31
+ import type { Denom } from '@agoric/orchestration';
32
+ import type { DenomDetail } from '@agoric/orchestration';
33
+ //# sourceMappingURL=query-flows.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-flows.contract.d.ts","sourceRoot":"","sources":["query-flows.contract.js"],"names":[],"mappings":"AAoFA;gBA/DiB,OAAO,UAAU,CAAC;gBAClB,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC;gBAC/B,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;;GA6DgB;2BAGjE,OAAO,KAAK;yBA7EJ,aAAa;yCAIuB,0BAA0B;gCACvD,0CAA0C;4BAH9C,kBAAkB;qCACW,uBAAuB;2BAAvB,uBAAuB;iCAAvB,uBAAuB"}
@@ -0,0 +1,20 @@
1
+ export function sendICQQuery(orch: Orchestrator, _ctx: any, seat: ZCFSeat, { chainName, msgs }: {
2
+ chainName: string;
3
+ msgs: Parameters<ICQQueryFunction>[0];
4
+ }): Promise<string>;
5
+ export function makeAccountAndGetBalanceQuery(orch: Orchestrator, _ctx: any, seat: ZCFSeat, { chainName, denom }: {
6
+ chainName: string;
7
+ denom: DenomArg;
8
+ }): Promise<string>;
9
+ export function makeAccountAndGetBalancesQuery(orch: Orchestrator, _ctx: any, seat: ZCFSeat, { chainName }: {
10
+ chainName: string;
11
+ }): Promise<string>;
12
+ export function sendLocalQuery(orch: Orchestrator, _ctx: any, seat: ZCFSeat, { msgs }: {
13
+ msgs: Parameters<QueryManyFn>[0];
14
+ }): Promise<string>;
15
+ import type { Orchestrator } from '@agoric/orchestration';
16
+ import type { ZCFSeat } from '@agoric/zoe';
17
+ import type { ICQQueryFunction } from '@agoric/orchestration';
18
+ import type { DenomArg } from '@agoric/orchestration';
19
+ import type { QueryManyFn } from '@agoric/vats/src/localchain.js';
20
+ //# sourceMappingURL=query-flows.flows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-flows.flows.d.ts","sourceRoot":"","sources":["query-flows.flows.js"],"names":[],"mappings":"AA2BO,mCALI,YAAY,QACZ,GAAG,QACH,OAAO,uBACP;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,mBActE;AAeM,oDALI,YAAY,QACZ,GAAG,QACH,OAAO,wBACP;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,mBAgBhD;AAeM,qDALI,YAAY,QACZ,GAAG,QACH,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,mBAgB/B;AAiBM,qCAPI,YAAY,QACZ,GAAG,QACH,OAAO,YACP;IACN,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,mBASH;kCA/GqG,uBAAuB;6BAEnG,aAAa;sCAF+D,uBAAuB;8BAAvB,uBAAuB;iCAC/F,gCAAgC"}
@@ -0,0 +1,315 @@
1
+ /**
2
+ * @file General API of orchestration
3
+ * - must not have chain-specific types without runtime narrowing by chain id
4
+ * - should remain relatively stable.
5
+ */
6
+ import type { Amount, Brand, NatAmount } from '@agoric/ertp/src/types.js';
7
+ import type { Timestamp } from '@agoric/time';
8
+ import type { QueryManyFn } from '@agoric/vats/src/localchain.js';
9
+ import type { ResolvedPublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
10
+ import type { Passable } from '@endo/marshal';
11
+ import type { SendOptions } from '@agoric/network';
12
+ import type { AgoricChainMethods, CosmosChainAccountMethods, CosmosChainInfo, IBCMsgTransferOptions, KnownChains, LocalAccountMethods, ICQQueryFunction, KnownNamespace, NobleMethods, Bech32Address, ProgressTracker } from './types.js';
13
+ import type { ResolvedContinuingOfferResult } from './utils/zoe-tools.js';
14
+ export type OrchestrationOptions = {
15
+ progressTracker?: ProgressTracker;
16
+ };
17
+ export type PacketOptions = OrchestrationOptions & {
18
+ sendOpts?: SendOptions;
19
+ };
20
+ /**
21
+ * Options relevant to all queries (non-mutating).
22
+ */
23
+ export type QuerierOptions = PacketOptions & {
24
+ queryOpts?: Record<string, any>;
25
+ };
26
+ /**
27
+ * Options relevant to all actions (mutating).
28
+ */
29
+ export type ActionOptions = PacketOptions & {
30
+ txOpts?: Record<string, any>;
31
+ };
32
+ /**
33
+ * A denom that designates a path to a token type on some blockchain.
34
+ *
35
+ * Multiple denoms may designate the same underlying base denom (e.g., `uist`,
36
+ * `uatom`) on different Chains or on the same Chain via different paths. On
37
+ * Cosmos chains, all but the base denom are IBC style denoms, but that may vary
38
+ * across other chains. All the denoms that designate the same underlying base
39
+ * denom form an equivalence class, along with the unique Brand on the local
40
+ * Chain. Some operations accept any member of the equivalence class to
41
+ * effectively designate the corresponding token type on the target chain.
42
+ */
43
+ export type Denom = string;
44
+ /**
45
+ * In many cases, either a denom string or a local Brand can be used to
46
+ * designate a remote token type.
47
+ */
48
+ export type DenomArg = Denom | Brand<'nat'>;
49
+ /**
50
+ * Count of some fungible token on some blockchain.
51
+ *
52
+ * @see {@link Orchestrator.asAmount} to convert to an Amount surjectively
53
+ */
54
+ export type DenomAmount = {
55
+ denom: Denom;
56
+ value: bigint;
57
+ };
58
+ /** Amounts can be provided as pure data using denoms or as ERTP Amounts */
59
+ export type AmountArg = DenomAmount | Amount<'nat'>;
60
+ /**
61
+ * Per `chain_id` in CAIP-2. In that spec all chain IDs are scoped
62
+ * (namespace:reference) but in the Cosmos ecosystem the namespace is implied
63
+ * and they use `chain_id`/`chainId` for what CAIP-2 calls the `reference`. We
64
+ * qualify the term here to avoid confusion.
65
+ *
66
+ * @see {@link https://standards.chainagnostic.org/CAIPs/caip-2}
67
+ */
68
+ export type CaipChainId = `${string}:${string}`;
69
+ /**
70
+ * à la CAIP-10
71
+ *
72
+ * account_id: chain_id + ":" + account_address
73
+ * chain_id: [-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32} (See [CAIP-2][])
74
+ * account_address: [-.%a-zA-Z0-9]{1,128}
75
+ *
76
+ * @see {@link https://standards.chainagnostic.org/CAIPs/caip-10}
77
+ */
78
+ export type AccountId = `${CaipChainId}:${string}`;
79
+ /**
80
+ * Rough approximation for `/0x([0-9a-fA-F]{2})+/`
81
+ */
82
+ export type HexAddress = `0x${string}`;
83
+ /**
84
+ * Specific to Cosmos chains
85
+ * @see {AccountId} for universal account identifier
86
+ */
87
+ export type CosmosChainAddress = {
88
+ /** Within the Cosmos ecosystem. e.g. `agoric-3' or 'cosmoshub-4' */
89
+ chainId: string;
90
+ /** The address value used on-chain */
91
+ value: Bech32Address;
92
+ encoding: 'bech32';
93
+ };
94
+ /**
95
+ * Info used to identify blockchains across ecosystems
96
+ * @see {@link https://standards.chainagnostic.org/CAIPs/caip-2}
97
+ */
98
+ export interface BaseChainInfo<N extends KnownNamespace = KnownNamespace> {
99
+ /** CAIP-2 namespace, e.g. 'cosmos', 'eip155' */
100
+ namespace: N;
101
+ /** CAIP-2 reference, `e.g. `1`, `agoric-3` */
102
+ reference: N extends 'eip155' ? `${number}` : string;
103
+ /**
104
+ * Circle CCTP Destination Domain
105
+ * @see {@link https://developers.circle.com/stablecoins/supported-domains}
106
+ */
107
+ cctpDestinationDomain?: number;
108
+ }
109
+ /**
110
+ * Shape that `ChainHub` is expecting
111
+ */
112
+ export type ChainInfo<N extends KnownNamespace = KnownNamespace> = N extends 'cosmos' ? CosmosChainInfo : BaseChainInfo<N>;
113
+ /**
114
+ * A value that can be converted mechanically to an AccountId.
115
+ * @see {@link ChainHub.resolveAccountId}
116
+ */
117
+ export type AccountIdArg = AccountId | CosmosChainAddress;
118
+ export type Caip10Record = {
119
+ namespace: string;
120
+ reference: string;
121
+ accountAddress: string;
122
+ };
123
+ /**
124
+ * Object that controls an account on a particular chain.
125
+ *
126
+ * The methods available depend on the chain and its capabilities.
127
+ */
128
+ export type OrchestrationAccount<CI extends Partial<ChainInfo>> = OrchestrationAccountCommon & (CI extends {
129
+ chainId: string;
130
+ } ? CI['chainId'] extends `agoric${string}` ? LocalAccountMethods : CI['chainId'] extends `noble${string}` ? CosmosChainAccountMethods<CI> & NobleMethods : CosmosChainAccountMethods<CI> : object);
131
+ /**
132
+ * An object for access the core functions of a remote chain.
133
+ *
134
+ * Note that "remote" can mean the local chain; it's just that
135
+ * accounts are treated as remote/arms length for consistency.
136
+ */
137
+ export interface Chain<CI extends Partial<ChainInfo>> {
138
+ getChainInfo: () => Promise<CI>;
139
+ /**
140
+ * Creates a new Orchestration Account on the current Chain.
141
+ * @returns an object that controls the account
142
+ */
143
+ makeAccount: (opts?: OrchestrationOptions) => CI extends {
144
+ chainId: string;
145
+ } ? Promise<OrchestrationAccount<CI>> : never;
146
+ query: CI extends {
147
+ icqEnabled: true;
148
+ } ? ICQQueryFunction : CI extends {
149
+ chainId: string;
150
+ } ? CI['chainId'] extends `agoric${string}` ? QueryManyFn : never : never;
151
+ }
152
+ /**
153
+ * Used with `orch.getDenomInfo('ibc/1234')`. See {@link Orchestrator.getDenomInfo}
154
+ */
155
+ export interface DenomInfo<HoldingChain extends keyof KnownChains, IssuingChain extends keyof KnownChains> {
156
+ /** The well-known Brand on Agoric for the direct asset */
157
+ brand?: Brand;
158
+ /** The Chain at which the argument `denom` exists (where the asset is currently held) */
159
+ chain: Chain<KnownChains[HoldingChain]>;
160
+ /** The Chain that is the issuer of the underlying asset */
161
+ base: Chain<KnownChains[IssuingChain]>;
162
+ /** the Denom for the underlying asset on its issuer chain */
163
+ baseDenom: Denom;
164
+ }
165
+ /**
166
+ * Provided in the callback to `orchestrate()`.
167
+ */
168
+ export interface Orchestrator {
169
+ /**
170
+ * Get a Chain object for working with the given chain.
171
+ *
172
+ * @param {C} chainName name of the chain in KnownChains or the ChainHub backing the Orchestrator
173
+ */
174
+ getChain: <C extends string>(chainName: C) => Promise<Chain<C extends keyof KnownChains ? KnownChains[C] : any> & (C extends 'agoric' ? AgoricChainMethods : object)>;
175
+ /**
176
+ * For a denom, return information about a denom including the equivalent
177
+ * local Brand, the Chain on which the denom is held, and the Chain that
178
+ * issues the corresponding asset.
179
+ * @param denom
180
+ */
181
+ getDenomInfo: <HoldingChain extends keyof KnownChains, IssuingChain extends keyof KnownChains>(denom: Denom, srcChainName: HoldingChain) => DenomInfo<HoldingChain, IssuingChain>;
182
+ /**
183
+ * Convert an amount described in native data to a local, structured Amount.
184
+ * @param amount - the described amount
185
+ * @returns the Amount in local structuerd format
186
+ */
187
+ asAmount: (amount: DenomAmount) => NatAmount;
188
+ }
189
+ /**
190
+ * An object that supports high-level operations for an account on a remote chain.
191
+ */
192
+ export interface OrchestrationAccountCommon {
193
+ /**
194
+ * @returns the address of the account on the remote chain
195
+ */
196
+ getAddress: () => CosmosChainAddress;
197
+ /**
198
+ * @returns an array of amounts for every balance in the account.
199
+ *
200
+ * @throws when prohibited (see `icqEnabled` in {@link CosmosChainInfo})
201
+ */
202
+ getBalances: (opts?: QuerierOptions) => Promise<DenomAmount[]>;
203
+ /**
204
+ * @returns the balance of a specific denom for the account.
205
+ *
206
+ * @throws when prohibited (see `icqEnabled` in {@link CosmosChainInfo})
207
+ */
208
+ getBalance: (denom: DenomArg, opts?: QuerierOptions) => Promise<DenomAmount>;
209
+ /**
210
+ * @returns a progressTracker that can be used to give incremental updates to an
211
+ * orchestration client.
212
+ */
213
+ makeProgressTracker: () => ProgressTracker;
214
+ /**
215
+ * Transfer amount to another account on the same chain. The promise settles when the transfer is complete.
216
+ * @param toAccount - the account to send the amount to. MUST be on the same chain
217
+ * @param amount - the amount to send
218
+ * @param [opts] - transaction submission options
219
+ * @returns unknown
220
+ */
221
+ send: (toAccount: AccountIdArg, amount: AmountArg, opts?: ActionOptions) => Promise<unknown>;
222
+ /**
223
+ * Transfer multiple amounts to another account on the same chain. The promise settles when the transfer is complete.
224
+ * @param toAccount - the account to send the amount to. MUST be on the same chain
225
+ * @param amounts - the amounts to send
226
+ * @param [opts] - transaction submission options
227
+ * @returns unknown
228
+ */
229
+ sendAll: (toAccount: CosmosChainAddress, amounts: AmountArg[], opts?: ActionOptions) => Promise<unknown>;
230
+ /**
231
+ * Transfer an amount to another account, typically on another chain.
232
+ * The promise settles when the transfer is complete.
233
+ * @param amount - the amount to transfer. Can be provided as pure data using denoms or as ERTP Amounts.
234
+ * @param destination - the account to transfer the amount to.
235
+ * @param [opts] - an optional memo to include with the transfer, which could drive custom PFM behavior, and timeout parameters
236
+ * @returns {Promise<unknown>} The promise fulfills with the successful acknowledgement of the transfer
237
+ * @throws {Error} if route is not determinable, asset is not recognized, or
238
+ * the transfer is rejected (insufficient funds, timeout, error ack)
239
+ */
240
+ transfer: (destination: AccountIdArg, amount: AmountArg, opts?: IBCMsgTransferOptions) => Promise<unknown>;
241
+ /**
242
+ * Transfer an amount to another account in multiple steps. The promise settles when
243
+ * the entire path of the transfer is complete.
244
+ * @param amount - the amount to transfer
245
+ * @param msg - the transfer message, including follow-up steps
246
+ * @returns unknown
247
+ */
248
+ transferSteps: (amount: AmountArg, msg: TransferMsg) => Promise<unknown>;
249
+ /**
250
+ * Returns `invitationMakers` and `publicSubscribers` to the account
251
+ * holder's smart wallet so they can continue interacting with the account
252
+ * and read account state in vstorage if published.
253
+ */
254
+ asContinuingOffer: () => Promise<ResolvedContinuingOfferResult>;
255
+ /**
256
+ * Public topics are a map to different vstorage paths and subscribers that
257
+ * can be shared with on or offchain clients.
258
+ * When returned as part of a continuing invitation, it will appear
259
+ * in the {@link CurrentWalletRecord} in vstorage.
260
+ */
261
+ getPublicTopics: () => Promise<Record<string, ResolvedPublicTopic<unknown>>>;
262
+ }
263
+ /**
264
+ * Flows to orchestrate are regular Javascript functions but have some
265
+ * constraints to fulfill the requirements of resumability after termination of
266
+ * the enclosing vat. Some requirements for each orchestration flow:
267
+ * - must not close over any values that could change between invocations
268
+ * - must satisfy the `OrchestrationFlow` interface
269
+ * - must be hardened
270
+ * - must not use `E()` (eventual send)
271
+ *
272
+ * The call to `orchestrate` using a flow function in reincarnations of the vat
273
+ * must have the same `durableName` as before. To help enforce these
274
+ * constraints, we recommend:
275
+ *
276
+ * - keeping flows in a `.flows.js` module
277
+ * - importing them all with `import * as flows` to get a single object keyed by
278
+ * the export name
279
+ * - using `orchestrateAll` to treat each export name as the `durableName` of
280
+ * the flow
281
+ * - adopting `@agoric/eslint-config` that has rules to help detect problems
282
+ */
283
+ export interface OrchestrationFlow<CT = unknown> {
284
+ (orc: Orchestrator, ctx: CT, ...args: Passable[]): Promise<unknown>;
285
+ }
286
+ /**
287
+ * Internal structure for TransferMsgs.
288
+ * The type must be able to express transfers across different chains and transports.
289
+ *
290
+ * NOTE Expected to change, so consider an opaque structure.
291
+ * @internal
292
+ */
293
+ export interface TransferMsg {
294
+ toAccount: CosmosChainAddress;
295
+ timeout?: Timestamp;
296
+ next?: TransferMsg;
297
+ data?: object;
298
+ }
299
+ /** @alpha */
300
+ export interface AfterAction {
301
+ destChain: string;
302
+ destAddress: CosmosChainAddress;
303
+ }
304
+ /** @alpha */
305
+ export interface SwapExact {
306
+ amountIn: Amount;
307
+ amountOut: Amount;
308
+ }
309
+ /** @alpha */
310
+ export interface SwapMaxSlippage {
311
+ amountIn: Amount;
312
+ brandOut: Brand;
313
+ slippage: number;
314
+ }
315
+ //# sourceMappingURL=orchestration-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG;IACjD,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF;;GAEG;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AM,WAAW,WAAW;IAC1B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,aAAa;AACb,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,kBAAkB,CAAC;CACjC;AACD,aAAa;AACb,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * @import {TypedPattern} from '@agoric/internal';
3
+ * @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount,
4
+ * DenomInfo, AmountArg, CosmosValidatorAddress, CosmosActionOptions,
5
+ * OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions,
6
+ * AccountIdArg, BaseChainInfo, ChainInfo, Caip10Record,
7
+ * LegacyExecuteEncodedTxOptions, CosmosQuerierOptions,
8
+ * PacketOptions, OrchestrationOptions} from './types.js';
9
+ * @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
10
+ * @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
11
+ * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
12
+ * @import {TypedJson} from '@agoric/cosmic-proto';
13
+ * @import {DenomDetail} from './exos/chain-hub.js';
14
+ * @import {Amount} from '@agoric/ertp';
15
+ */
16
+ /**
17
+ * Used for IBC Channel Connections that only send outgoing transactions. If
18
+ * your channel expects incoming transactions, please extend this interface to
19
+ * include the `onReceive` handler.
20
+ */
21
+ export const OutboundConnectionHandlerI: import("@endo/patterns").InterfaceGuard<{
22
+ onOpen: import("@endo/patterns").MethodGuard;
23
+ onClose: import("@endo/patterns").MethodGuard;
24
+ }>;
25
+ export namespace CosmosChainAddressShape {
26
+ let chainId: import("@endo/patterns").Matcher;
27
+ let encoding: import("@endo/patterns").Matcher;
28
+ let value: import("@endo/patterns").Matcher;
29
+ }
30
+ /** @type {TypedPattern<Caip10Record>} */
31
+ export const Caip10RecordShape: TypedPattern<Caip10Record>;
32
+ export namespace ChainAddressShape { }
33
+ /**
34
+ * NB: For the AccountId case does not fully verify it is CAIP-10 (only string)
35
+ *
36
+ * @type {TypedPattern<AccountIdArg>}
37
+ */
38
+ export const AccountIdArgShape: TypedPattern<AccountIdArg>;
39
+ /** @type {TypedPattern<Proto3Msg>} */
40
+ export const Proto3Shape: TypedPattern<Proto3Msg>;
41
+ /** @internal */
42
+ export const IBCChannelIDShape: import("@endo/patterns").Matcher;
43
+ /** @internal */
44
+ export const IBCChannelInfoShape: import("@endo/patterns").Matcher;
45
+ /** @internal */
46
+ export const IBCConnectionIDShape: import("@endo/patterns").Matcher;
47
+ /** @internal */
48
+ export const IBCConnectionInfoShape: import("@endo/patterns").Matcher;
49
+ /** @type {TypedPattern<CosmosAssetInfo>} */
50
+ export const CosmosAssetInfoShape: TypedPattern<CosmosAssetInfo>;
51
+ /** @type {TypedPattern<BaseChainInfo>} */
52
+ export const BaseChainInfoShape: TypedPattern<BaseChainInfo>;
53
+ /** @type {TypedPattern<CosmosChainInfo>} */
54
+ export const CosmosChainInfoShape: TypedPattern<CosmosChainInfo>;
55
+ /** @type {TypedPattern<ChainInfo>} */
56
+ export const ChainInfoShape: TypedPattern<ChainInfo>;
57
+ export const DenomShape: import("@endo/patterns").Matcher;
58
+ /** @type {TypedPattern<Coin>} */
59
+ export const CoinShape: TypedPattern<Coin>;
60
+ /** @type {TypedPattern<DenomInfo<any, any>>} */
61
+ export const DenomInfoShape: TypedPattern<DenomInfo<any, any>>;
62
+ /** @type {TypedPattern<DenomDetail>} */
63
+ export const DenomDetailShape: TypedPattern<DenomDetail>;
64
+ /** @type {TypedPattern<DenomAmount>} */
65
+ export const DenomAmountShape: TypedPattern<DenomAmount>;
66
+ /** @type {TypedPattern<Amount<'nat'>>} */
67
+ export const AnyNatAmountShape: TypedPattern<Amount<"nat">>;
68
+ /** @type {TypedPattern<AmountArg>} */
69
+ export const AmountArgShape: TypedPattern<AmountArg>;
70
+ /**
71
+ * @type {TypedPattern<{
72
+ * validator: CosmosValidatorAddress;
73
+ * amount: AmountArg;
74
+ * }>}
75
+ */
76
+ export const DelegationShape: TypedPattern<{
77
+ validator: CosmosValidatorAddress;
78
+ amount: AmountArg;
79
+ }>;
80
+ /** Approximately @see RequestQuery */
81
+ export const ICQMsgShape: import("@endo/patterns").Matcher;
82
+ /** @type {TypedPattern<TypedJson>} */
83
+ export const TypedJsonShape: TypedPattern<TypedJson>;
84
+ /** @type {TypedPattern<OrchestrationOptions>} */
85
+ export const OrchestrationOptionsShape: TypedPattern<OrchestrationOptions>;
86
+ /** @type {TypedPattern<PacketOptions>} */
87
+ export const PacketOptionsShape: TypedPattern<PacketOptions>;
88
+ export namespace chainFacadeMethods {
89
+ let getChainInfo: import("@endo/patterns").MethodGuard;
90
+ let makeAccount: import("@endo/patterns").MethodGuard;
91
+ }
92
+ export namespace TimestampProtoShape {
93
+ let seconds: import("@endo/patterns").Matcher;
94
+ let nanos: import("@endo/patterns").Matcher;
95
+ }
96
+ /**
97
+ * see {@link TxBody} for more details
98
+ *
99
+ * @type {TypedPattern<NonNullable<CosmosActionOptions['txOpts']>>}
100
+ */
101
+ export const CosmosTxOptionsShape: TypedPattern<NonNullable<CosmosActionOptions["txOpts"]>>;
102
+ /** @type {TypedPattern<CosmosActionOptions>} */
103
+ export const CosmosActionOptionsShape: TypedPattern<CosmosActionOptions>;
104
+ /** @type {TypedPattern<LegacyExecuteEncodedTxOptions>} */
105
+ export const LegacyExecuteEncodedTxOptionsShape: TypedPattern<LegacyExecuteEncodedTxOptions>;
106
+ /** @type {TypedPattern<NonNullable<CosmosQuerierOptions['queryOpts']>>} */
107
+ export const RequestQueryOptionsShape: TypedPattern<NonNullable<CosmosQuerierOptions["queryOpts"]>>;
108
+ /** @type {TypedPattern<CosmosQuerierOptions>} */
109
+ export const CosmosQuerierOptionsShape: TypedPattern<CosmosQuerierOptions>;
110
+ /**
111
+ * @deprecated use {@link LegacyExecuteEncodedTxOptionsShape} instead
112
+ */
113
+ export const ExecuteICATxOptsShape: (import("@endo/pass-style").CopyRecordInterface<import("@endo/pass-style").PassableCap, Error> & {
114
+ "Symbol(validatedType)"?: (Partial<Omit<TxBody, "messages">> & Omit<CosmosActionOptions, "txOpts">) | undefined;
115
+ }) | (import("@endo/pass-style").CopyTaggedInterface<import("@endo/pass-style").PassableCap, Error> & {
116
+ "Symbol(validatedType)"?: (Partial<Omit<TxBody, "messages">> & Omit<CosmosActionOptions, "txOpts">) | undefined;
117
+ });
118
+ /**
119
+ * Ensures at least one {@link AmountKeywordRecord} entry is present and only
120
+ * permits Nat (fungible) amounts.
121
+ */
122
+ export const AnyNatAmountsRecord: import("@endo/patterns").Matcher;
123
+ /** @type {TypedPattern<OrchestrationPowers>} */
124
+ export const OrchestrationPowersShape: TypedPattern<OrchestrationPowers>;
125
+ /** @type {TypedPattern<ForwardInfo>} */
126
+ export const ForwardInfoShape: TypedPattern<ForwardInfo>;
127
+ /**
128
+ * Caller configurable values of {@link ForwardInfo}
129
+ *
130
+ * @type {TypedPattern<NonNullable<IBCMsgTransferOptions['forwardOpts']>>}
131
+ */
132
+ export const ForwardOptsShape: TypedPattern<NonNullable<IBCMsgTransferOptions["forwardOpts"]>>;
133
+ /**
134
+ * @type {TypedPattern<IBCMsgTransferOptions>}
135
+ * @internal
136
+ */
137
+ export const IBCTransferOptionsShape: TypedPattern<IBCMsgTransferOptions>;
138
+ import type { Caip10Record } from './types.js';
139
+ import type { TypedPattern } from '@agoric/internal';
140
+ import type { AccountIdArg } from './types.js';
141
+ import type { Any as Proto3Msg } from '@agoric/cosmic-proto/google/protobuf/any.js';
142
+ import type { CosmosAssetInfo } from './types.js';
143
+ import type { BaseChainInfo } from './types.js';
144
+ import type { CosmosChainInfo } from './types.js';
145
+ import type { ChainInfo } from './types.js';
146
+ import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
147
+ import type { DenomInfo } from './types.js';
148
+ import type { DenomDetail } from './exos/chain-hub.js';
149
+ import type { DenomAmount } from './types.js';
150
+ import type { Amount } from '@agoric/ertp';
151
+ import type { AmountArg } from './types.js';
152
+ import type { CosmosValidatorAddress } from './types.js';
153
+ import type { TypedJson } from '@agoric/cosmic-proto';
154
+ import type { OrchestrationOptions } from './types.js';
155
+ import type { PacketOptions } from './types.js';
156
+ import type { CosmosActionOptions } from './types.js';
157
+ import type { LegacyExecuteEncodedTxOptions } from './types.js';
158
+ import type { CosmosQuerierOptions } from './types.js';
159
+ import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
160
+ import type { OrchestrationPowers } from './types.js';
161
+ import type { ForwardInfo } from './types.js';
162
+ import type { IBCMsgTransferOptions } from './types.js';
163
+ //# sourceMappingURL=typeGuards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH;;;GAQE;;;;;;AAYF,yCAAyC;AACzC,gCADW,aAAa,YAAY,CAAC,CAKnC;;AAMF;;;;GAIG;AACH,gCAFU,aAAa,YAAY,CAAC,CAEuC;AAE3E,sCAAsC;AACtC,0BADW,aAAa,SAAS,CAAC,CACoC;AAGtE,gBAAgB;AAChB,iEAA4C;AAE5C,gBAAgB;AAChB,mEAQG;AAEH,gBAAgB;AAChB,oEAA+C;AAE/C,gBAAgB;AAChB,sEASG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CASrC;AAWH,0CAA0C;AAC1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uCADW,aAAa,mBAAmB,CAAC,CAO1C;AAYF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAWlC;AAGF;;;;GAIG;AACH,+BAFU,aAAa,WAAW,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAC,CAUvE;AAEF;;;GAGG;AACH,sCAHU,aAAa,qBAAqB,CAAC,CAkB3C;kCA/W6C,YAAY;kCAN5B,kBAAkB;kCAMF,YAAY;sCACxB,6CAA6C;qCADjC,YAAY;mCAAZ,YAAY;qCAAZ,YAAY;+BAAZ,YAAY;0BAGpC,kDAAkD;+BAH1B,YAAY;iCAK7B,qBAAqB;iCALJ,YAAY;4BAMlC,cAAc;+BANQ,YAAY;4CAAZ,YAAY;+BAI/B,sBAAsB;0CAJH,YAAY;mCAAZ,YAAY;yCAAZ,YAAY;mDAAZ,YAAY;0CAAZ,YAAY;4BAElC,8CAA8C;yCAFxB,YAAY;iCAAZ,YAAY;2CAAZ,YAAY"}
package/src/types.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ /** @file Rollup of all type definitions in the package, for local import and external export */
2
+ import type { ZCF } from '@agoric/zoe';
3
+ export type * from './chain-info.js';
4
+ export type * from './cosmos-api.js';
5
+ export type * from './exos/chain-hub.js';
6
+ export type * from './exos/combine-invitation-makers.js';
7
+ export type * from './exos/cosmos-interchain-service.js';
8
+ export type * from './exos/exo-interfaces.js';
9
+ export type * from './exos/ica-account-kit.js';
10
+ export type * from './exos/icq-connection-kit.js';
11
+ export type * from './exos/local-chain-facade.js';
12
+ export type * from './exos/portfolio-holder-kit.js';
13
+ export type * from './orchestration-api.js';
14
+ export type * from './vat-orchestration.js';
15
+ export type * from './utils/start-helper.js';
16
+ export type * from './utils/progress.js';
17
+ /**
18
+ * ({@link ZCF})-like tools for use in {@link OrchestrationFlow}s.
19
+ */
20
+ export interface ZcfTools {
21
+ assertUniqueKeyword: ZCF['assertUniqueKeyword'];
22
+ atomicRearrange: ZCF['atomicRearrange'];
23
+ makeInvitation: ZCF['makeInvitation'];
24
+ }
25
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,qBAAqB,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,mBAAmB,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAChD,eAAe,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACxC,cAAc,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACvC"}
@@ -0,0 +1,6 @@
1
+ import type { TypedDataType, TypedData } from 'abitype';
2
+ export type TypedDataParameter<TN extends string = string, TT extends string = TypedDataType | keyof TypedData | `${keyof TypedData}[${string | ''}]`> = {
3
+ name: TN;
4
+ type: TT;
5
+ };
6
+ //# sourceMappingURL=abitype.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abitype.d.ts","sourceRoot":"","sources":["abitype.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGxD,MAAM,MAAM,kBAAkB,CAC5B,EAAE,SAAS,MAAM,GAAG,MAAM,EAC1B,EAAE,SAAS,MAAM,GACb,aAAa,GACb,MAAM,SAAS,GACf,GAAG,MAAM,SAAS,IAAI,MAAM,GAAG,EAAE,GAAG,IACtC;IACF,IAAI,EAAE,EAAE,CAAC;IACT,IAAI,EAAE,EAAE,CAAC;CACV,CAAC"}
@@ -0,0 +1,44 @@
1
+ export function makeICAChannelAddress(hostConnectionId: IBCConnectionID, controllerConnectionId: IBCConnectionID, { version, encoding, ordering, txType, }?: ICAChannelAddressOpts): RemoteIbcAddress;
2
+ export const DEFAULT_ICQ_VERSION: "icq-1";
3
+ export function makeICQChannelAddress(controllerConnectionId: IBCConnectionID, version?: string): RemoteIbcAddress;
4
+ export function findAddressField(remoteAddressString: RemoteIbcAddress): CosmosChainAddress["value"] | undefined;
5
+ export function getBech32Prefix(address: Bech32Address | string): string;
6
+ export function sameEvmAddress(a: EvmAddress, b: EvmAddress | undefined): boolean;
7
+ export function coerceAccountId(idArg: AccountIdArg): AccountId;
8
+ export function parseAccountIdArg(idArg: AccountIdArg): Caip10Record;
9
+ export function parseAccountId(accountId: AccountId): Caip10Record;
10
+ export function chainOfAccount(accountIdArg: AccountIdArg): CaipChainId;
11
+ export function isBech32Address(address: string): boolean;
12
+ export function assertBech32Address(address: string): asserts address is Bech32Address;
13
+ export function leftPadEthAddressTo32Bytes(rawAddress: string): Uint8Array<ArrayBufferLike>;
14
+ export function accountIdTo32Bytes(accountId: AccountId): Uint8Array;
15
+ export type ICAChannelAddressOpts = {
16
+ /**
17
+ * message encoding format for the
18
+ * channel
19
+ */
20
+ encoding?: string | undefined;
21
+ /**
22
+ * channel ordering.
23
+ * currently only `ordered` is supported for ics27-1
24
+ */
25
+ ordering?: "ordered" | "unordered" | undefined;
26
+ /**
27
+ * default is `sdk_multi_msg`
28
+ */
29
+ txType?: string | undefined;
30
+ /**
31
+ * default is `ics27-1`
32
+ */
33
+ version?: string | undefined;
34
+ };
35
+ import type { IBCConnectionID } from '@agoric/network/ibc';
36
+ import type { RemoteIbcAddress } from '@agoric/network/ibc';
37
+ import type { CosmosChainAddress } from '../types.js';
38
+ import type { Bech32Address } from '../types.js';
39
+ import type { Address as EvmAddress } from 'viem';
40
+ import type { AccountIdArg } from '../orchestration-api.js';
41
+ import type { AccountId } from '../orchestration-api.js';
42
+ import type { Caip10Record } from '../orchestration-api.js';
43
+ import type { CaipChainId } from '../types.js';
44
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"AA4BO,wDALI,eAAe,0BACf,eAAe,6CACf,qBAAqB,GACnB,gBAAgB,CA4B5B;AAGD,kCAAmC,OAAO,CAAC;AAOpC,8DAJI,eAAe,YACf,MAAM,GACJ,gBAAgB,CAa5B;AAaM,sDAJI,gBAAgB,GAEd,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS,CAYnD;AAaM,yCAHI,aAAa,GAAG,MAAM,GACpB,MAAM,CAQlB;AASM,kCAJI,UAAU,KACV,UAAU,GAAG,SAAS,GACpB,OAAO,CAEwD;AAYrE,uCAJI,YAAY,GAEV,SAAS,CAQrB;AAUM,yCAJI,YAAY,GAEV,YAAY,CAaxB;AASM,0CAHI,SAAS,GACP,YAAY,CAaxB;AAUM,6CAJI,YAAY,GAEV,WAAW,CAKvB;AASM,yCAJI,MAAM,GACJ,OAAO,CAkBnB;AAUM,6CAHI,MAAM,GACJ,QAAQ,OAAO,IAAI,aAAa,CAM5C;AAUM,uDAFI,MAAM,+BAOhB;AAWM,8CAJI,SAAS,GACP,UAAU,CAatB;;;;;;;;;;;;;;;;;;;;;qCA1QmD,qBAAqB;sCAArB,qBAAqB;wCAER,aAAa;mCAAb,aAAa;2CADtC,MAAM;kCAEU,yBAAyB;+BAAzB,yBAAyB;kCAAzB,yBAAyB;iCADhB,aAAa"}