@agoric/orchestration 0.2.0 → 0.2.1-upgrade-23-dev-bd79330.0.bd79330

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 (234) hide show
  1. package/index.js +0 -4
  2. package/package.json +27 -27
  3. package/src/axelar-types.d.ts +2 -0
  4. package/src/axelar-types.d.ts.map +1 -1
  5. package/src/axelar-types.js +2 -0
  6. package/src/cctp-chain-info.js +4 -1
  7. package/src/chain-info.d.ts +21 -6
  8. package/src/chain-info.d.ts.map +1 -1
  9. package/src/chain-info.js +9 -8
  10. package/src/cosmos-api.d.ts +102 -29
  11. package/src/cosmos-api.d.ts.map +1 -1
  12. package/src/cosmos-api.js +585 -0
  13. package/src/{ethereum-api.ts → ethereum-api.js} +1 -1
  14. package/src/examples/auto-stake-it-tap-kit.d.ts +4 -3
  15. package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
  16. package/src/examples/auto-stake-it-tap-kit.js +3 -4
  17. package/src/examples/auto-stake-it.contract.d.ts +6 -4
  18. package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
  19. package/src/examples/auto-stake-it.contract.js +3 -1
  20. package/src/examples/auto-stake-it.flows.d.ts +2 -1
  21. package/src/examples/auto-stake-it.flows.d.ts.map +1 -1
  22. package/src/examples/auto-stake-it.flows.js +1 -0
  23. package/src/examples/axelar-gmp-account-kit.d.ts +6 -4
  24. package/src/examples/axelar-gmp-account-kit.d.ts.map +1 -1
  25. package/src/examples/axelar-gmp-account-kit.js +4 -2
  26. package/src/examples/axelar-gmp.contract.d.ts +8 -8
  27. package/src/examples/axelar-gmp.contract.d.ts.map +1 -1
  28. package/src/examples/axelar-gmp.contract.js +2 -2
  29. package/src/examples/axelar-gmp.flows.d.ts +1 -1
  30. package/src/examples/basic-flows.contract.d.ts +7 -5
  31. package/src/examples/basic-flows.contract.d.ts.map +1 -1
  32. package/src/examples/basic-flows.contract.js +3 -1
  33. package/src/examples/basic-flows.flows.d.ts +2 -1
  34. package/src/examples/basic-flows.flows.d.ts.map +1 -1
  35. package/src/examples/basic-flows.flows.js +1 -0
  36. package/src/examples/send-anywhere.contract.d.ts +12 -6
  37. package/src/examples/send-anywhere.contract.d.ts.map +1 -1
  38. package/src/examples/send-anywhere.contract.js +4 -1
  39. package/src/examples/send-anywhere.flows.d.ts +3 -2
  40. package/src/examples/send-anywhere.flows.d.ts.map +1 -1
  41. package/src/examples/send-anywhere.flows.js +3 -6
  42. package/src/examples/stake-bld.contract.d.ts +206 -25
  43. package/src/examples/stake-bld.contract.d.ts.map +1 -1
  44. package/src/examples/stake-bld.contract.js +19 -4
  45. package/src/examples/stake-ica.contract.d.ts +434 -71
  46. package/src/examples/stake-ica.contract.d.ts.map +1 -1
  47. package/src/examples/stake-ica.contract.js +28 -6
  48. package/src/examples/staking-combinations.contract.d.ts +4 -2
  49. package/src/examples/staking-combinations.contract.d.ts.map +1 -1
  50. package/src/examples/staking-combinations.contract.js +5 -3
  51. package/src/examples/staking-combinations.flows.d.ts +3 -2
  52. package/src/examples/staking-combinations.flows.d.ts.map +1 -1
  53. package/src/examples/staking-combinations.flows.js +7 -6
  54. package/src/examples/swap-anything.contract.d.ts +14 -7
  55. package/src/examples/swap-anything.contract.d.ts.map +1 -1
  56. package/src/examples/swap-anything.contract.js +12 -8
  57. package/src/examples/swap.contract.d.ts +18 -6
  58. package/src/examples/swap.contract.d.ts.map +1 -1
  59. package/src/examples/swap.contract.js +9 -3
  60. package/src/examples/swap.flows.d.ts +2 -0
  61. package/src/examples/swap.flows.d.ts.map +1 -1
  62. package/src/examples/swap.flows.js +2 -0
  63. package/src/examples/unbond.contract.d.ts +7 -4
  64. package/src/examples/unbond.contract.d.ts.map +1 -1
  65. package/src/examples/unbond.contract.js +6 -3
  66. package/src/exos/chain-hub-admin.d.ts +1 -19
  67. package/src/exos/chain-hub-admin.d.ts.map +1 -1
  68. package/src/exos/chain-hub-admin.js +1 -1
  69. package/src/exos/chain-hub.d.ts +4 -2
  70. package/src/exos/chain-hub.d.ts.map +1 -1
  71. package/src/exos/chain-hub.js +2 -1
  72. package/src/exos/combine-invitation-makers.d.ts +2 -1
  73. package/src/exos/combine-invitation-makers.d.ts.map +1 -1
  74. package/src/exos/combine-invitation-makers.js +2 -1
  75. package/src/exos/cosmos-orchestration-account.d.ts +615 -98
  76. package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
  77. package/src/exos/cosmos-orchestration-account.js +695 -306
  78. package/src/exos/exo-interfaces.js +35 -0
  79. package/src/exos/ibc-packet.d.ts +11 -9
  80. package/src/exos/ibc-packet.d.ts.map +1 -1
  81. package/src/exos/ibc-packet.js +33 -8
  82. package/src/exos/ica-account-kit.d.ts +4 -9
  83. package/src/exos/ica-account-kit.d.ts.map +1 -1
  84. package/src/exos/ica-account-kit.js +10 -7
  85. package/src/exos/icq-connection-kit.d.ts +1 -1
  86. package/src/exos/local-chain-facade.d.ts +1542 -5
  87. package/src/exos/local-chain-facade.d.ts.map +1 -1
  88. package/src/exos/local-chain-facade.js +4 -2
  89. package/src/exos/local-orchestration-account.d.ts +201 -56
  90. package/src/exos/local-orchestration-account.d.ts.map +1 -1
  91. package/src/exos/local-orchestration-account.js +260 -51
  92. package/src/exos/orchestrator.d.ts +35813 -73
  93. package/src/exos/orchestrator.d.ts.map +1 -1
  94. package/src/exos/orchestrator.js +7 -10
  95. package/src/exos/packet-tools.d.ts +19 -8
  96. package/src/exos/packet-tools.d.ts.map +1 -1
  97. package/src/exos/packet-tools.js +92 -9
  98. package/src/exos/portfolio-holder-kit.d.ts +90 -2
  99. package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
  100. package/src/exos/remote-chain-facade.d.ts +1499 -1
  101. package/src/exos/remote-chain-facade.d.ts.map +1 -1
  102. package/src/exos/remote-chain-facade.js +8 -3
  103. package/src/facade.d.ts +1 -0
  104. package/src/facade.d.ts.map +1 -1
  105. package/src/facade.js +4 -6
  106. package/src/fixtures/query-flows.contract.d.ts +8 -6
  107. package/src/fixtures/query-flows.contract.d.ts.map +1 -1
  108. package/src/fixtures/query-flows.contract.js +3 -1
  109. package/src/fixtures/query-flows.flows.d.ts +1 -0
  110. package/src/fixtures/query-flows.flows.d.ts.map +1 -1
  111. package/src/fixtures/query-flows.flows.js +1 -0
  112. package/src/orchestration-api.d.ts +46 -16
  113. package/src/orchestration-api.d.ts.map +1 -1
  114. package/src/orchestration-api.js +410 -0
  115. package/src/proposals/init-chain-info.js +10 -2
  116. package/src/proposals/orchestration-proposal.js +3 -0
  117. package/src/proposals/revise-chain-info.js +4 -1
  118. package/src/proposals/start-auto-stake-it.js +1 -0
  119. package/src/proposals/start-axelar-gmp.js +2 -2
  120. package/src/proposals/start-basic-flows.js +5 -0
  121. package/src/proposals/start-send-anywhere.js +4 -2
  122. package/src/proposals/start-stakeAtom.js +5 -4
  123. package/src/proposals/start-stakeBld.js +8 -6
  124. package/src/proposals/start-stakeOsmo.js +5 -4
  125. package/src/proposals/start-swap-anything.js +4 -2
  126. package/src/stubs/{viem-abi.d.ts → viem-typedData.js} +10 -4
  127. package/src/typeGuards.d.ts +38 -5
  128. package/src/typeGuards.d.ts.map +1 -1
  129. package/src/typeGuards.js +92 -22
  130. package/src/types.d.ts +1 -0
  131. package/src/types.d.ts.map +1 -1
  132. package/src/types.js +27 -0
  133. package/src/utils/abitype.d.ts +6 -0
  134. package/src/utils/abitype.d.ts.map +1 -0
  135. package/src/utils/abitype.js +13 -0
  136. package/src/utils/address.d.ts +3 -1
  137. package/src/utils/address.d.ts.map +1 -1
  138. package/src/utils/address.js +24 -2
  139. package/src/utils/agd-lib.d.ts +1 -51
  140. package/src/utils/agd-lib.d.ts.map +1 -1
  141. package/src/utils/agd-lib.js +1 -1
  142. package/src/utils/amounts.d.ts +1 -0
  143. package/src/utils/amounts.d.ts.map +1 -1
  144. package/src/utils/amounts.js +1 -0
  145. package/src/utils/asset.d.ts +1 -0
  146. package/src/utils/asset.d.ts.map +1 -1
  147. package/src/utils/asset.js +1 -0
  148. package/src/utils/chain-hub-helper.d.ts +1 -0
  149. package/src/utils/chain-hub-helper.d.ts.map +1 -1
  150. package/src/utils/chain-hub-helper.js +1 -0
  151. package/src/utils/codecs.d.ts +145 -0
  152. package/src/utils/codecs.d.ts.map +1 -0
  153. package/src/utils/codecs.js +206 -0
  154. package/src/utils/cosmos.d.ts +5 -4
  155. package/src/utils/cosmos.d.ts.map +1 -1
  156. package/src/utils/cosmos.js +29 -9
  157. package/src/utils/exo-helpers.d.ts +156 -0
  158. package/src/utils/exo-helpers.d.ts.map +1 -0
  159. package/src/utils/exo-helpers.js +241 -0
  160. package/src/utils/gmp.d.ts +2 -2
  161. package/src/utils/gmp.d.ts.map +1 -1
  162. package/src/utils/gmp.js +31 -15
  163. package/src/utils/orchestrationAccount.d.ts +79 -0
  164. package/src/utils/orchestrationAccount.d.ts.map +1 -1
  165. package/src/utils/orchestrationAccount.js +210 -6
  166. package/src/utils/packet.d.ts.map +1 -1
  167. package/src/utils/packet.js +5 -0
  168. package/src/utils/permit2/signatureTransfer.d.ts +221 -0
  169. package/src/utils/permit2/signatureTransfer.d.ts.map +1 -0
  170. package/src/utils/permit2/signatureTransfer.js +265 -0
  171. package/src/utils/permit2/signatureTransferHelpers.d.ts +334 -0
  172. package/src/utils/permit2/signatureTransferHelpers.d.ts.map +1 -0
  173. package/src/utils/permit2/signatureTransferHelpers.js +270 -0
  174. package/src/utils/permit2.d.ts +11 -0
  175. package/src/utils/permit2.d.ts.map +1 -0
  176. package/src/utils/permit2.js +11 -0
  177. package/src/utils/progress.d.ts +41 -0
  178. package/src/utils/progress.d.ts.map +1 -0
  179. package/src/utils/progress.js +180 -0
  180. package/src/utils/start-helper.d.ts +28 -10
  181. package/src/utils/start-helper.d.ts.map +1 -1
  182. package/src/utils/start-helper.js +30 -7
  183. package/src/utils/time.d.ts +2 -2
  184. package/src/utils/time.d.ts.map +1 -1
  185. package/src/utils/time.js +1 -1
  186. package/src/utils/viem-utils/hashTypedData.d.ts +21 -0
  187. package/src/utils/viem-utils/hashTypedData.d.ts.map +1 -0
  188. package/src/utils/viem-utils/hashTypedData.js +61 -0
  189. package/src/utils/viem-utils/types.d.ts +6 -0
  190. package/src/utils/viem-utils/types.d.ts.map +1 -0
  191. package/src/utils/viem-utils/types.js +18 -0
  192. package/src/utils/viem.d.ts +11 -0
  193. package/src/utils/viem.d.ts.map +1 -0
  194. package/src/utils/viem.js +11 -0
  195. package/src/utils/zcf-tools.d.ts +15 -1
  196. package/src/utils/zcf-tools.d.ts.map +1 -1
  197. package/src/utils/zcf-tools.js +19 -3
  198. package/src/utils/zoe-tools.d.ts +5 -2
  199. package/src/utils/zoe-tools.d.ts.map +1 -1
  200. package/src/utils/zoe-tools.js +8 -2
  201. package/src/vat-orchestration.d.ts +5 -3
  202. package/src/vat-orchestration.d.ts.map +1 -1
  203. package/src/vat-orchestration.js +4 -3
  204. package/src/vendor/viem/{_esm-YOAV66U4.js → _esm-OKAICHVC.js} +2 -2
  205. package/src/vendor/viem/{ccip-AAQDZF3N.js → ccip-34BSSMV5.js} +1 -2
  206. package/src/vendor/viem/{chunk-4EF4K2MH.js → chunk-GCI53Z2G.js} +35 -1
  207. package/src/vendor/viem/chunk-ZKSIP2AM.js +326 -0
  208. package/src/vendor/viem/viem-abi.js +2 -2
  209. package/src/vendor/viem/viem-typedData.d.ts +19 -0
  210. package/src/vendor/viem/viem-typedData.js +59 -0
  211. package/tools/contract-tests.d.ts +34 -19
  212. package/tools/contract-tests.d.ts.map +1 -1
  213. package/tools/contract-tests.ts +15 -3
  214. package/tools/ibc-mock-fixtures.d.ts +49 -0
  215. package/tools/ibc-mock-fixtures.d.ts.map +1 -0
  216. package/tools/ibc-mock-fixtures.ts +161 -0
  217. package/tools/ibc-mocks.d.ts +2 -3
  218. package/tools/ibc-mocks.d.ts.map +1 -1
  219. package/tools/ibc-mocks.ts +2 -1
  220. package/tools/make-test-address.d.ts +1 -1
  221. package/tools/make-test-address.d.ts.map +1 -1
  222. package/tools/make-test-address.js +1 -2
  223. package/tools/network-fakes.d.ts +142 -0
  224. package/tools/network-fakes.d.ts.map +1 -0
  225. package/tools/network-fakes.ts +388 -0
  226. package/tsup.config.ts +3 -1
  227. package/src/cosmos-api.ts +0 -469
  228. package/src/exos/exo-interfaces.ts +0 -35
  229. package/src/orchestration-api.ts +0 -365
  230. package/src/stubs/viem-abi.d.ts.map +0 -1
  231. package/src/types.ts +0 -26
  232. package/src/vendor/viem/chunk-XN4LUOIH.js +0 -253
  233. package/src/vendor/viem/secp256k1-WHBDSQB2.js +0 -1914
  234. /package/src/stubs/{viem-abi.ts → viem-abi.js} +0 -0
@@ -1,11 +1,17 @@
1
1
  /**
2
2
  * @import {TypedPattern} from '@agoric/internal';
3
- * @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount, DenomInfo, AmountArg, CosmosValidatorAddress, OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions, AccountIdArg, BaseChainInfo, ChainInfo,Caip10Record} from './types.js';
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';
4
9
  * @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
5
10
  * @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
6
11
  * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
7
12
  * @import {TypedJson} from '@agoric/cosmic-proto';
8
13
  * @import {DenomDetail} from './exos/chain-hub.js';
14
+ * @import {Amount} from '@agoric/ertp';
9
15
  */
10
16
  /**
11
17
  * Used for IBC Channel Connections that only send outgoing transactions. If
@@ -75,6 +81,10 @@ export const DelegationShape: TypedPattern<{
75
81
  export const ICQMsgShape: import("@endo/patterns").Matcher;
76
82
  /** @type {TypedPattern<TypedJson>} */
77
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>;
78
88
  export namespace chainFacadeMethods {
79
89
  let getChainInfo: import("@endo/patterns").MethodGuard;
80
90
  let makeAccount: import("@endo/patterns").MethodGuard;
@@ -86,9 +96,25 @@ export namespace TimestampProtoShape {
86
96
  /**
87
97
  * see {@link TxBody} for more details
88
98
  *
89
- * @internal
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
90
112
  */
91
- export const ExecuteICATxOptsShape: import("@endo/patterns").Matcher;
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
+ });
92
118
  /**
93
119
  * Ensures at least one {@link AmountKeywordRecord} entry is present and only
94
120
  * permits Nat (fungible) amounts.
@@ -101,9 +127,9 @@ export const ForwardInfoShape: TypedPattern<ForwardInfo>;
101
127
  /**
102
128
  * Caller configurable values of {@link ForwardInfo}
103
129
  *
104
- * @type {TypedPattern<IBCMsgTransferOptions['forwardOpts']>}
130
+ * @type {TypedPattern<NonNullable<IBCMsgTransferOptions['forwardOpts']>>}
105
131
  */
106
- export const ForwardOptsShape: TypedPattern<IBCMsgTransferOptions["forwardOpts"]>;
132
+ export const ForwardOptsShape: TypedPattern<NonNullable<IBCMsgTransferOptions["forwardOpts"]>>;
107
133
  /**
108
134
  * @type {TypedPattern<IBCMsgTransferOptions>}
109
135
  * @internal
@@ -121,9 +147,16 @@ import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
121
147
  import type { DenomInfo } from './types.js';
122
148
  import type { DenomDetail } from './exos/chain-hub.js';
123
149
  import type { DenomAmount } from './types.js';
150
+ import type { Amount } from '@agoric/ertp';
124
151
  import type { AmountArg } from './types.js';
125
152
  import type { CosmosValidatorAddress } from './types.js';
126
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';
127
160
  import type { OrchestrationPowers } from './types.js';
128
161
  import type { ForwardInfo } from './types.js';
129
162
  import type { IBCMsgTransferOptions } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"typeGuards.d.ts","sourceR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B,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/typeGuards.js CHANGED
@@ -5,12 +5,18 @@ import { M } from '@endo/patterns';
5
5
 
6
6
  /**
7
7
  * @import {TypedPattern} from '@agoric/internal';
8
- * @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount, DenomInfo, AmountArg, CosmosValidatorAddress, OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions, AccountIdArg, BaseChainInfo, ChainInfo,Caip10Record} from './types.js';
8
+ * @import {CosmosAssetInfo, CosmosChainInfo, DenomAmount,
9
+ * DenomInfo, AmountArg, CosmosValidatorAddress, CosmosActionOptions,
10
+ * OrchestrationPowers, ForwardInfo, IBCMsgTransferOptions,
11
+ * AccountIdArg, BaseChainInfo, ChainInfo, Caip10Record,
12
+ * LegacyExecuteEncodedTxOptions, CosmosQuerierOptions,
13
+ * PacketOptions, OrchestrationOptions} from './types.js';
9
14
  * @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
10
15
  * @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
11
16
  * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
12
17
  * @import {TypedJson} from '@agoric/cosmic-proto';
13
18
  * @import {DenomDetail} from './exos/chain-hub.js';
19
+ * @import {Amount} from '@agoric/ertp';
14
20
  */
15
21
 
16
22
  /**
@@ -201,10 +207,29 @@ export const ICQMsgShape = M.splitRecord(
201
207
  /** @type {TypedPattern<TypedJson>} */
202
208
  export const TypedJsonShape = M.splitRecord({ '@type': M.string() });
203
209
 
210
+ /** @type {TypedPattern<OrchestrationOptions>} */
211
+ export const OrchestrationOptionsShape = M.splitRecord(
212
+ {},
213
+ {
214
+ progressTracker: M.remotable('ProgressTracker'),
215
+ },
216
+ );
217
+
218
+ /** @type {TypedPattern<PacketOptions>} */
219
+ export const PacketOptionsShape = M.and(
220
+ OrchestrationOptionsShape,
221
+ M.splitRecord(
222
+ {},
223
+ {
224
+ sendOpts: SendOptionsShape,
225
+ },
226
+ ),
227
+ );
228
+
204
229
  /** @see {Chain} */
205
230
  export const chainFacadeMethods = {
206
231
  getChainInfo: M.call().returns(VowShape),
207
- makeAccount: M.call().returns(VowShape),
232
+ makeAccount: M.call().optional(OrchestrationOptionsShape).returns(VowShape),
208
233
  };
209
234
  harden(chainFacadeMethods);
210
235
 
@@ -221,19 +246,61 @@ harden(TimestampProtoShape);
221
246
  /**
222
247
  * see {@link TxBody} for more details
223
248
  *
224
- * @internal
249
+ * @type {TypedPattern<NonNullable<CosmosActionOptions['txOpts']>>}
225
250
  */
226
- export const ExecuteICATxOptsShape = M.splitRecord(
251
+ export const CosmosTxOptionsShape = M.splitRecord(
227
252
  {},
228
253
  {
229
254
  memo: M.string(),
230
255
  timeoutHeight: M.bigint(),
231
256
  extensionOptions: M.arrayOf(M.any()),
232
257
  nonCriticalExtensionOptions: M.arrayOf(M.any()),
233
- sendOpts: SendOptionsShape,
234
258
  },
235
259
  );
236
260
 
261
+ /** @type {TypedPattern<CosmosActionOptions>} */
262
+ export const CosmosActionOptionsShape = M.and(
263
+ PacketOptionsShape,
264
+ M.splitRecord(
265
+ {},
266
+ {
267
+ txOpts: CosmosTxOptionsShape,
268
+ },
269
+ ),
270
+ );
271
+
272
+ /** @type {TypedPattern<LegacyExecuteEncodedTxOptions>} */
273
+ export const LegacyExecuteEncodedTxOptionsShape = M.and(
274
+ CosmosActionOptionsShape,
275
+ // XXX this tolerates top-level txOpts for backward compatibility
276
+ CosmosTxOptionsShape,
277
+ );
278
+
279
+ /** @type {TypedPattern<NonNullable<CosmosQuerierOptions['queryOpts']>>} */
280
+ export const RequestQueryOptionsShape = M.splitRecord(
281
+ {},
282
+ {
283
+ height: M.bigint(),
284
+ prove: M.boolean(),
285
+ },
286
+ );
287
+
288
+ /** @type {TypedPattern<CosmosQuerierOptions>} */
289
+ export const CosmosQuerierOptionsShape = M.and(
290
+ PacketOptionsShape,
291
+ M.splitRecord(
292
+ {},
293
+ {
294
+ queryOpts: RequestQueryOptionsShape,
295
+ },
296
+ ),
297
+ );
298
+
299
+ /**
300
+ * @deprecated use {@link LegacyExecuteEncodedTxOptionsShape} instead
301
+ */
302
+ export const ExecuteICATxOptsShape = LegacyExecuteEncodedTxOptionsShape;
303
+
237
304
  /**
238
305
  * Ensures at least one {@link AmountKeywordRecord} entry is present and only
239
306
  * permits Nat (fungible) amounts.
@@ -245,11 +312,11 @@ export const AnyNatAmountsRecord = M.and(
245
312
 
246
313
  /** @type {TypedPattern<OrchestrationPowers>} */
247
314
  export const OrchestrationPowersShape = {
248
- agoricNames: M.remotable(),
249
- localchain: M.remotable(),
250
- orchestrationService: M.remotable(),
251
- storageNode: M.remotable(),
252
- timerService: M.remotable(),
315
+ agoricNames: M.remotable('AgoricNames'),
316
+ localchain: M.remotable('Localchain'),
317
+ orchestrationService: M.remotable('OrchestrationService'),
318
+ storageNode: M.remotable('StorageNode'),
319
+ timerService: M.remotable('TimerService'),
253
320
  };
254
321
  harden(OrchestrationPowersShape);
255
322
 
@@ -279,7 +346,7 @@ harden(ForwardInfoShape);
279
346
  /**
280
347
  * Caller configurable values of {@link ForwardInfo}
281
348
  *
282
- * @type {TypedPattern<IBCMsgTransferOptions['forwardOpts']>}
349
+ * @type {TypedPattern<NonNullable<IBCMsgTransferOptions['forwardOpts']>>}
283
350
  */
284
351
  export const ForwardOptsShape = M.splitRecord(
285
352
  {},
@@ -295,16 +362,19 @@ export const ForwardOptsShape = M.splitRecord(
295
362
  * @type {TypedPattern<IBCMsgTransferOptions>}
296
363
  * @internal
297
364
  */
298
- export const IBCTransferOptionsShape = M.splitRecord(
299
- {},
300
- {
301
- timeoutTimestamp: M.bigint(),
302
- timeoutHeight: {
303
- revisionHeight: M.bigint(),
304
- revisionNumber: M.bigint(),
365
+ export const IBCTransferOptionsShape = M.and(
366
+ M.splitRecord(
367
+ {},
368
+ {
369
+ timeoutTimestamp: M.bigint(),
370
+ timeoutHeight: {
371
+ revisionHeight: M.bigint(),
372
+ revisionNumber: M.bigint(),
373
+ },
374
+ timeoutRelativeSeconds: M.bigint(),
375
+ memo: M.string(),
376
+ forwardOpts: ForwardOptsShape,
305
377
  },
306
- timeoutRelativeSeconds: M.bigint(),
307
- memo: M.string(),
308
- forwardOpts: ForwardOptsShape,
309
- },
378
+ ),
379
+ CosmosActionOptionsShape,
310
380
  );
package/src/types.d.ts CHANGED
@@ -13,6 +13,7 @@ export type * from './exos/portfolio-holder-kit.js';
13
13
  export type * from './orchestration-api.js';
14
14
  export type * from './vat-orchestration.js';
15
15
  export type * from './utils/start-helper.js';
16
+ export type * from './utils/progress.js';
16
17
  /**
17
18
  * ({@link ZCF})-like tools for use in {@link OrchestrationFlow}s.
18
19
  */
@@ -1 +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;AAE7C;;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"}
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"}
package/src/types.js ADDED
@@ -0,0 +1,27 @@
1
+ /** @file Rollup of all type definitions in the package, for local import and external export */
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+ /**
21
+ * ({@link ZCF})-like tools for use in {@link OrchestrationFlow}s.
22
+ */
23
+
24
+
25
+
26
+
27
+
@@ -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,13 @@
1
+
2
+
3
+ // Redefine abitype's TypedDataParameter to make it generic
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
@@ -3,6 +3,7 @@ export const DEFAULT_ICQ_VERSION: "icq-1";
3
3
  export function makeICQChannelAddress(controllerConnectionId: IBCConnectionID, version?: string): RemoteIbcAddress;
4
4
  export function findAddressField(remoteAddressString: RemoteIbcAddress): CosmosChainAddress["value"] | undefined;
5
5
  export function getBech32Prefix(address: Bech32Address | string): string;
6
+ export function sameEvmAddress(a: EvmAddress, b: EvmAddress | undefined): boolean;
6
7
  export function coerceAccountId(idArg: AccountIdArg): AccountId;
7
8
  export function parseAccountIdArg(idArg: AccountIdArg): Caip10Record;
8
9
  export function parseAccountId(accountId: AccountId): Caip10Record;
@@ -21,7 +22,7 @@ export type ICAChannelAddressOpts = {
21
22
  * channel ordering.
22
23
  * currently only `ordered` is supported for ics27-1
23
24
  */
24
- ordering?: "ordered" | "unordered" | undefined;
25
+ ordering?: "unordered" | "ordered" | undefined;
25
26
  /**
26
27
  * default is `sdk_multi_msg`
27
28
  */
@@ -35,6 +36,7 @@ import type { IBCConnectionID } from '@agoric/vats';
35
36
  import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
36
37
  import type { CosmosChainAddress } from '../types.js';
37
38
  import type { Bech32Address } from '../types.js';
39
+ import type { Address as EvmAddress } from 'viem';
38
40
  import type { AccountIdArg } from '../orchestration-api.js';
39
41
  import type { AccountId } from '../orchestration-api.js';
40
42
  import type { Caip10Record } from '../orchestration-api.js';
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"AA2BO,wDALI,eAAe,0BACf,eAAe,6CACf,qBAAqB,GACnB,gBAAgB,CAuB5B;AAGD,kCAAmC,OAAO,CAAC;AAOpC,8DAJI,eAAe,YACf,MAAM,GACJ,gBAAgB,CAQ5B;AAaM,sDAJI,gBAAgB,GAEd,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS,CAYnD;AAaM,yCAHI,aAAa,GAAG,MAAM,GACpB,MAAM,CAQlB;AAWM,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;;;;;;;;;;;;;;;;;;;;;qCAtPiC,cAAc;sCAGb,iCAAiC;wCAFH,aAAa;mCAAb,aAAa;kCACtB,yBAAyB;+BAAzB,yBAAyB;kCAAzB,yBAAyB;iCADhB,aAAa"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"AA6BO,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;;;;;;;;;;;;;;;;;;;;;qCA3QiC,cAAc;sCAIb,iCAAiC;wCAFH,aAAa;mCAAb,aAAa;2CADtC,MAAM;kCAEU,yBAAyB;+BAAzB,yBAAyB;kCAAzB,yBAAyB;iCADhB,aAAa"}
@@ -1,9 +1,11 @@
1
+ import { encodeRemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
1
2
  import { fromBech32, fromHex } from '@cosmjs/encoding';
2
3
  import { Fail, q } from '@endo/errors';
3
4
  import bs58 from 'bs58';
4
5
 
5
6
  /**
6
7
  * @import {IBCConnectionID} from '@agoric/vats';
8
+ * @import {Address as EvmAddress} from 'viem';
7
9
  * @import {Bech32Address, CosmosChainAddress, CaipChainId} from '../types.js';
8
10
  * @import {AccountId, AccountIdArg, Caip10Record} from '../orchestration-api.js';
9
11
  * @import {RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
@@ -45,7 +47,12 @@ export const makeICAChannelAddress = (
45
47
  encoding,
46
48
  txType,
47
49
  });
48
- return `/ibc-hop/${controllerConnectionId}/ibc-port/icahost/${ordering}/${connString}`;
50
+ return encodeRemoteIbcAddress(
51
+ [controllerConnectionId],
52
+ 'icahost',
53
+ ordering,
54
+ connString,
55
+ );
49
56
  };
50
57
  harden(makeICAChannelAddress);
51
58
 
@@ -61,7 +68,12 @@ export const makeICQChannelAddress = (
61
68
  version = DEFAULT_ICQ_VERSION,
62
69
  ) => {
63
70
  controllerConnectionId || Fail`controllerConnectionId is required`;
64
- return `/ibc-hop/${controllerConnectionId}/ibc-port/icqhost/unordered/${version}`;
71
+ return encodeRemoteIbcAddress(
72
+ [controllerConnectionId],
73
+ 'icqhost',
74
+ 'unordered',
75
+ version,
76
+ );
65
77
  };
66
78
  harden(makeICQChannelAddress);
67
79
 
@@ -106,6 +118,16 @@ export const getBech32Prefix = address => {
106
118
  return address.slice(0, split);
107
119
  };
108
120
 
121
+ /**
122
+ * Compare two EVM addresses for equality, case-insensitive.
123
+ *
124
+ * @param {EvmAddress} a
125
+ * @param {EvmAddress | undefined} b
126
+ * @returns {boolean}
127
+ */
128
+ export const sameEvmAddress = (a, b) => a.toLowerCase() === b?.toLowerCase();
129
+ harden(sameEvmAddress);
130
+
109
131
  /**
110
132
  * Coerce an AccountIdArg into a plain AccountId. The latter is now preferred so
111
133
  * this utility can be used to adapt legacy calls, in particular from vows
@@ -54,55 +54,5 @@ export type ExecSync = (file: string, args: string[], opts: {
54
54
  } & {
55
55
  [k: string]: unknown;
56
56
  }) => string;
57
- export type Agd = ReturnType<({ execFileSync, log }: {
58
- execFileSync: ExecSync;
59
- log?: typeof console.log;
60
- }) => Readonly<{
61
- readOnly: () => Readonly<{
62
- status: () => Promise<any>;
63
- /**
64
- * @param {[kind: 'gov', domain: string, ...rest: any]
65
- * | [kind: 'tx', txhash: string]
66
- * | [mod: 'vstorage', kind: 'data' | 'children', path: string]
67
- * | [mod: 'ibc', ...rest: string[]]} qArgs
68
- */
69
- query: (qArgs: [kind: "gov", domain: string, ...rest: any] | [kind: "tx", txhash: string] | [mod: "vstorage", kind: "data" | "children", path: string] | [mod: "ibc", ...rest: string[]]) => Promise<any>;
70
- }>;
71
- nameHub: () => Readonly<{
72
- /**
73
- * NOTE: synchronous I/O
74
- *
75
- * @param {string[]} path
76
- */
77
- lookup: (...path: string[]) => string;
78
- }>;
79
- keys: {
80
- /**
81
- * @param {string} name
82
- * @param {string} mnemonic
83
- */
84
- add: (name: string, mnemonic: string) => string;
85
- showAddress: (...path: string[]) => string;
86
- /** @param {string} name */
87
- delete: (name: string) => string;
88
- };
89
- /**
90
- * @param {Record<string, unknown>} opts
91
- */
92
- withOpts: (opts: Record<string, unknown>) => Readonly</*elided*/ any>;
93
- lookup: (...path: string[]) => string;
94
- status: () => Promise<any>;
95
- query: (qArgs: [kind: "gov", domain: string, ...rest: any] | [kind: "tx", txhash: string] | [mod: "vstorage", kind: "data" | "children", path: string] | [mod: "ibc", ...rest: string[]]) => Promise<any>;
96
- /**
97
- * TODO: gas
98
- *
99
- * @param {string[]} txArgs
100
- * @param {{ chainId: string; from: string; yes?: boolean }} opts
101
- */
102
- tx: (txArgs: string[], { chainId, from, yes }: {
103
- chainId: string;
104
- from: string;
105
- yes?: boolean;
106
- }) => Promise<any>;
107
- }>>;
57
+ export type Agd = ReturnType<typeof makeAgd>;
108
58
  //# sourceMappingURL=agd-lib.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agd-lib.d.ts","sourceRoot":"","sources":["agd-lib.js"],"names":[],"mappings":"AAkBO,+CAFI;IAAE,YAAY,EAAE,QAAQ,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAA;CAAE;;;QAmCzD;;;;;WAKG;uBAJQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,E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M,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,GAC1D,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;;;QAiBtC;;;;WAIG;0BADQ,MAAM,EAAE;;;QAuDjB;;;WAGG;oBAFQ,MAAM,YACN,MAAM;+BAzDR,MAAM,EAAE;QAmEjB,2BAA2B;uBAAf,MAAM;;IAKpB;;OAEG;qBADQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;sBAzEvB,MAAM,EAAE;;mBAvBR,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,GAC1D,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;IAoCtC;;;;;OAKG;iBAFQ,MAAM,EAAE,0BACR;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE;GA4DhE;8BAlJU,MAAM,QACN,MAAM,EAAE,QACR;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,KAC9C,MAAM;kBAiJL,UAAU,CAAC,OAAO,OAAO,CAAC"}
@@ -155,4 +155,4 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
155
155
  return make();
156
156
  };
157
157
 
158
- /** @typedef {ReturnType<makeAgd>} Agd */
158
+ /** @typedef {ReturnType<typeof makeAgd>} Agd */
@@ -5,6 +5,7 @@ import type { ChainHub } from "../types.js";
5
5
  import type { DenomArg } from "../orchestration-api.js";
6
6
  import type { Denom } from "../orchestration-api.js";
7
7
  import type { DenomAmount } from "../orchestration-api.js";
8
+ import type { Amount } from '@agoric/ertp';
8
9
  import type { AmountArg } from "../orchestration-api.js";
9
10
  import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
10
11
  //# sourceMappingURL=amounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"amounts.d.ts","sourceRoot":"","sources":["amounts.js"],"names":[],"mappings":"AAeO,sCANI,QAAQ,YACR,QAAQ,GACN,KAAK,CAajB;AASM,4CANI,QAAQ,UACR,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GACzB,WAAW,CAavB;AASM,qCANI,QAAQ,UACR,SAAS,GACP,IAAI,CAWhB;8BAvD0B,aAAa;8BACkB,yBAAyB;2BAAzB,yBAAyB;iCAAzB,yBAAyB;+BAAzB,yBAAyB;0BAC5D,kDAAkD"}
1
+ {"version":3,"file":"amounts.d.ts","sourceRoot":"","sources":["amounts.js"],"names":[],"mappings":"AAgBO,sCANI,QAAQ,YACR,QAAQ,GACN,KAAK,CAajB;AASM,4CANI,QAAQ,UACR,WAAW,GAAG,OAAO,KAAK,CAAC,GACzB,WAAW,CAavB;AASM,qCANI,QAAQ,UACR,SAAS,GACP,IAAI,CAWhB;8BAxD0B,aAAa;8BACkB,yBAAyB;2BAAzB,yBAAyB;iCAAzB,yBAAyB;4BAE1D,cAAc;+BAFmB,yBAAyB;0BAC5D,kDAAkD"}
@@ -4,6 +4,7 @@ import { makeError } from '@endo/errors';
4
4
  * @import {ChainHub} from "../types.js";
5
5
  * @import {AmountArg, Denom, DenomAmount, DenomArg} from "../orchestration-api.js";
6
6
  * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
7
+ * @import {Amount} from '@agoric/ertp';
7
8
  */
8
9
 
9
10
  /**
@@ -1,5 +1,6 @@
1
1
  export function assetOn(baseDenom: Denom, baseName: string, brand?: Brand<"nat">, chainName?: string, infoOf?: Record<string, CosmosChainInfo>): [string, DenomDetail];
2
2
  import type { Denom } from '../types.js';
3
+ import type { Brand } from '@agoric/ertp';
3
4
  import type { CosmosChainInfo } from '../types.js';
4
5
  import type { DenomDetail } from '../types.js';
5
6
  //# sourceMappingURL=asset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["asset.js"],"names":[],"mappings":"AAiBO,mCAPI,KAAK,YACL,MAAM,UACN,KAAK,CAAC,KAAK,CAAC,cACZ,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAC7B,CAAC,MAAM,EAAE,WAAW,CAAC,CAiBjC;2BA7B+D,aAAa;qCAAb,aAAa;iCAAb,aAAa"}
1
+ {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["asset.js"],"names":[],"mappings":"AAkBO,mCAPI,KAAK,YACL,MAAM,UACN,MAAM,KAAK,CAAC,cACZ,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAC7B,CAAC,MAAM,EAAE,WAAW,CAAC,CAiBjC;2BA9B+D,aAAa;2BACrD,cAAc;qCAD0B,aAAa;iCAAb,aAAa"}
@@ -2,6 +2,7 @@ import { denomHash } from './denomHash.js';
2
2
 
3
3
  /**
4
4
  * @import {ChainHub, CosmosChainInfo, Denom, DenomDetail} from '../types.js';
5
+ * @import {Brand} from '@agoric/ertp';
5
6
  */
6
7
 
7
8
  /**
@@ -7,6 +7,7 @@ export function registerChainsAndAssets(chainHub: ChainHub, brands: Record<strin
7
7
  } | undefined;
8
8
  }): void;
9
9
  import type { ChainHub } from '../types.js';
10
+ import type { Brand } from '@agoric/ertp';
10
11
  import type { ChainInfo } from '../types.js';
11
12
  import type { Denom } from '../types.js';
12
13
  import type { DenomDetail } from '../types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"chain-hub-helper.d.ts","sourceRoot":"","sources":["chain-hub-helper.js"],"names":[],"mappings":"AAkBO,kDAPI,QAAQ,UACR,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,aAC5B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,aACrC,CAAC,KAAK,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,GAAG,SAAS,YAElE;IAA8B,GAAG;;;;CAAC,QAkDpC;8BAjEyD,aAAa;+BAAb,aAAa;2BAAb,aAAa;iCAAb,aAAa"}
1
+ {"version":3,"file":"chain-hub-helper.d.ts","sourceRoot":"","sources":["chain-hub-helper.js"],"names":[],"mappings":"AAmBO,kDAPI,QAAQ,UACR,MAAM,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC,aAC5B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,aACrC,CAAC,KAAK,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,GAAG,SAAS,YAElE;IAA8B,GAAG;;;;CAAC,QAkDpC;8BAlEyD,aAAa;2BAC/C,cAAc;+BADoB,aAAa;2BAAb,aAAa;iCAAb,aAAa"}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * @import {ChainHub, ChainInfo, Denom, DenomDetail} from '../types.js';
3
+ * @import {Brand} from '@agoric/ertp';
3
4
  */
4
5
 
5
6
  /**