@getomnichain/omnichain 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +66 -0
  3. package/dist/abstract_gas_pricing.d.ts +31 -0
  4. package/dist/abstract_gas_pricing.d.ts.map +1 -0
  5. package/dist/abstract_gas_pricing.js +22 -0
  6. package/dist/abstract_gas_pricing.js.map +1 -0
  7. package/dist/address.d.ts +10 -0
  8. package/dist/address.d.ts.map +1 -0
  9. package/dist/address.factory.d.ts +26 -0
  10. package/dist/address.factory.d.ts.map +1 -0
  11. package/dist/address.factory.js +75 -0
  12. package/dist/address.factory.js.map +1 -0
  13. package/dist/address.js +13 -0
  14. package/dist/address.js.map +1 -0
  15. package/dist/address_field.decorator.d.ts +17 -0
  16. package/dist/address_field.decorator.d.ts.map +1 -0
  17. package/dist/address_field.decorator.js +34 -0
  18. package/dist/address_field.decorator.js.map +1 -0
  19. package/dist/chain.base.d.ts +79 -0
  20. package/dist/chain.base.d.ts.map +1 -0
  21. package/dist/chain.base.js +113 -0
  22. package/dist/chain.base.js.map +1 -0
  23. package/dist/chain_ids.d.ts +122 -0
  24. package/dist/chain_ids.d.ts.map +1 -0
  25. package/dist/chain_ids.js +193 -0
  26. package/dist/chain_ids.js.map +1 -0
  27. package/dist/errors.d.ts +42 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +62 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/evm/evm_address.d.ts +11 -0
  32. package/dist/evm/evm_address.d.ts.map +1 -0
  33. package/dist/evm/evm_address.js +56 -0
  34. package/dist/evm/evm_address.js.map +1 -0
  35. package/dist/evm/evm_chain.d.ts +123 -0
  36. package/dist/evm/evm_chain.d.ts.map +1 -0
  37. package/dist/evm/evm_chain.js +685 -0
  38. package/dist/evm/evm_chain.js.map +1 -0
  39. package/dist/evm/evm_chains.d.ts +83 -0
  40. package/dist/evm/evm_chains.d.ts.map +1 -0
  41. package/dist/evm/evm_chains.js +493 -0
  42. package/dist/evm/evm_chains.js.map +1 -0
  43. package/dist/evm/evm_gas_estimate.d.ts +45 -0
  44. package/dist/evm/evm_gas_estimate.d.ts.map +1 -0
  45. package/dist/evm/evm_gas_estimate.js +70 -0
  46. package/dist/evm/evm_gas_estimate.js.map +1 -0
  47. package/dist/evm/evm_gas_pricing.d.ts +40 -0
  48. package/dist/evm/evm_gas_pricing.d.ts.map +1 -0
  49. package/dist/evm/evm_gas_pricing.js +56 -0
  50. package/dist/evm/evm_gas_pricing.js.map +1 -0
  51. package/dist/evm/evm_token.d.ts +7 -0
  52. package/dist/evm/evm_token.d.ts.map +1 -0
  53. package/dist/evm/evm_token.js +22 -0
  54. package/dist/evm/evm_token.js.map +1 -0
  55. package/dist/evm/evm_tokens.d.ts +81 -0
  56. package/dist/evm/evm_tokens.d.ts.map +1 -0
  57. package/dist/evm/evm_tokens.js +104 -0
  58. package/dist/evm/evm_tokens.js.map +1 -0
  59. package/dist/evm/evm_transaction_status.d.ts +108 -0
  60. package/dist/evm/evm_transaction_status.d.ts.map +1 -0
  61. package/dist/evm/evm_transaction_status.js +177 -0
  62. package/dist/evm/evm_transaction_status.js.map +1 -0
  63. package/dist/evm/index.d.ts +10 -0
  64. package/dist/evm/index.d.ts.map +1 -0
  65. package/dist/evm/index.js +10 -0
  66. package/dist/evm/index.js.map +1 -0
  67. package/dist/evm/unsigned_evm_transaction.d.ts +19 -0
  68. package/dist/evm/unsigned_evm_transaction.d.ts.map +1 -0
  69. package/dist/evm/unsigned_evm_transaction.js +18 -0
  70. package/dist/evm/unsigned_evm_transaction.js.map +1 -0
  71. package/dist/index.d.ts +18 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +18 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/is_address.decorator.d.ts +3 -0
  76. package/dist/is_address.decorator.d.ts.map +1 -0
  77. package/dist/is_address.decorator.js +51 -0
  78. package/dist/is_address.decorator.js.map +1 -0
  79. package/dist/network_type.d.ts +73 -0
  80. package/dist/network_type.d.ts.map +1 -0
  81. package/dist/network_type.js +144 -0
  82. package/dist/network_type.js.map +1 -0
  83. package/dist/priority.d.ts +23 -0
  84. package/dist/priority.d.ts.map +1 -0
  85. package/dist/priority.js +23 -0
  86. package/dist/priority.js.map +1 -0
  87. package/dist/solana/index.d.ts +9 -0
  88. package/dist/solana/index.d.ts.map +1 -0
  89. package/dist/solana/index.js +9 -0
  90. package/dist/solana/index.js.map +1 -0
  91. package/dist/solana/solana_address.d.ts +20 -0
  92. package/dist/solana/solana_address.d.ts.map +1 -0
  93. package/dist/solana/solana_address.js +45 -0
  94. package/dist/solana/solana_address.js.map +1 -0
  95. package/dist/solana/solana_chain.d.ts +213 -0
  96. package/dist/solana/solana_chain.d.ts.map +1 -0
  97. package/dist/solana/solana_chain.js +704 -0
  98. package/dist/solana/solana_chain.js.map +1 -0
  99. package/dist/solana/solana_chains.d.ts +24 -0
  100. package/dist/solana/solana_chains.d.ts.map +1 -0
  101. package/dist/solana/solana_chains.js +84 -0
  102. package/dist/solana/solana_chains.js.map +1 -0
  103. package/dist/solana/solana_gas_pricing.d.ts +30 -0
  104. package/dist/solana/solana_gas_pricing.d.ts.map +1 -0
  105. package/dist/solana/solana_gas_pricing.js +26 -0
  106. package/dist/solana/solana_gas_pricing.js.map +1 -0
  107. package/dist/solana/solana_token.d.ts +19 -0
  108. package/dist/solana/solana_token.d.ts.map +1 -0
  109. package/dist/solana/solana_token.js +34 -0
  110. package/dist/solana/solana_token.js.map +1 -0
  111. package/dist/solana/solana_tokens.d.ts +22 -0
  112. package/dist/solana/solana_tokens.d.ts.map +1 -0
  113. package/dist/solana/solana_tokens.js +26 -0
  114. package/dist/solana/solana_tokens.js.map +1 -0
  115. package/dist/solana/solana_transaction_status.d.ts +59 -0
  116. package/dist/solana/solana_transaction_status.d.ts.map +1 -0
  117. package/dist/solana/solana_transaction_status.js +144 -0
  118. package/dist/solana/solana_transaction_status.js.map +1 -0
  119. package/dist/solana/unsigned_solana_transaction.d.ts +31 -0
  120. package/dist/solana/unsigned_solana_transaction.d.ts.map +1 -0
  121. package/dist/solana/unsigned_solana_transaction.js +26 -0
  122. package/dist/solana/unsigned_solana_transaction.js.map +1 -0
  123. package/dist/token.d.ts +35 -0
  124. package/dist/token.d.ts.map +1 -0
  125. package/dist/token.js +62 -0
  126. package/dist/token.js.map +1 -0
  127. package/dist/ton/index.d.ts +2 -0
  128. package/dist/ton/index.d.ts.map +1 -0
  129. package/dist/ton/index.js +2 -0
  130. package/dist/ton/index.js.map +1 -0
  131. package/dist/ton/ton_address.d.ts +10 -0
  132. package/dist/ton/ton_address.d.ts.map +1 -0
  133. package/dist/ton/ton_address.js +53 -0
  134. package/dist/ton/ton_address.js.map +1 -0
  135. package/dist/transaction_status.d.ts +140 -0
  136. package/dist/transaction_status.d.ts.map +1 -0
  137. package/dist/transaction_status.js +271 -0
  138. package/dist/transaction_status.js.map +1 -0
  139. package/dist/unsigned_transaction.d.ts +7 -0
  140. package/dist/unsigned_transaction.d.ts.map +1 -0
  141. package/dist/unsigned_transaction.js +9 -0
  142. package/dist/unsigned_transaction.js.map +1 -0
  143. package/dist/utxo/btc/btc_address.d.ts +15 -0
  144. package/dist/utxo/btc/btc_address.d.ts.map +1 -0
  145. package/dist/utxo/btc/btc_address.js +39 -0
  146. package/dist/utxo/btc/btc_address.js.map +1 -0
  147. package/dist/utxo/btc/btc_chain.d.ts +34 -0
  148. package/dist/utxo/btc/btc_chain.d.ts.map +1 -0
  149. package/dist/utxo/btc/btc_chain.js +62 -0
  150. package/dist/utxo/btc/btc_chain.js.map +1 -0
  151. package/dist/utxo/btc/btc_chains.d.ts +25 -0
  152. package/dist/utxo/btc/btc_chains.d.ts.map +1 -0
  153. package/dist/utxo/btc/btc_chains.js +43 -0
  154. package/dist/utxo/btc/btc_chains.js.map +1 -0
  155. package/dist/utxo/btc/btc_token.d.ts +6 -0
  156. package/dist/utxo/btc/btc_token.d.ts.map +1 -0
  157. package/dist/utxo/btc/btc_token.js +11 -0
  158. package/dist/utxo/btc/btc_token.js.map +1 -0
  159. package/dist/utxo/btc/index.d.ts +14 -0
  160. package/dist/utxo/btc/index.d.ts.map +1 -0
  161. package/dist/utxo/btc/index.js +14 -0
  162. package/dist/utxo/btc/index.js.map +1 -0
  163. package/dist/utxo/btc/network_params.d.ts +50 -0
  164. package/dist/utxo/btc/network_params.d.ts.map +1 -0
  165. package/dist/utxo/btc/network_params.js +188 -0
  166. package/dist/utxo/btc/network_params.js.map +1 -0
  167. package/dist/utxo/btc/tools/asset_outpoint.d.ts +7 -0
  168. package/dist/utxo/btc/tools/asset_outpoint.d.ts.map +1 -0
  169. package/dist/utxo/btc/tools/asset_outpoint.js +12 -0
  170. package/dist/utxo/btc/tools/asset_outpoint.js.map +1 -0
  171. package/dist/utxo/btc/tools/bitcoin_core.tool.d.ts +41 -0
  172. package/dist/utxo/btc/tools/bitcoin_core.tool.d.ts.map +1 -0
  173. package/dist/utxo/btc/tools/bitcoin_core.tool.js +172 -0
  174. package/dist/utxo/btc/tools/bitcoin_core.tool.js.map +1 -0
  175. package/dist/utxo/btc/tools/esplora.tool.d.ts +27 -0
  176. package/dist/utxo/btc/tools/esplora.tool.d.ts.map +1 -0
  177. package/dist/utxo/btc/tools/esplora.tool.js +113 -0
  178. package/dist/utxo/btc/tools/esplora.tool.js.map +1 -0
  179. package/dist/utxo/btc/tools/inscription_index.d.ts +6 -0
  180. package/dist/utxo/btc/tools/inscription_index.d.ts.map +1 -0
  181. package/dist/utxo/btc/tools/inscription_index.js +2 -0
  182. package/dist/utxo/btc/tools/inscription_index.js.map +1 -0
  183. package/dist/utxo/btc/tools/ordiscan.tool.d.ts +19 -0
  184. package/dist/utxo/btc/tools/ordiscan.tool.d.ts.map +1 -0
  185. package/dist/utxo/btc/tools/ordiscan.tool.js +53 -0
  186. package/dist/utxo/btc/tools/ordiscan.tool.js.map +1 -0
  187. package/dist/utxo/btc/tools/rare_sat_index.d.ts +6 -0
  188. package/dist/utxo/btc/tools/rare_sat_index.d.ts.map +1 -0
  189. package/dist/utxo/btc/tools/rare_sat_index.js +2 -0
  190. package/dist/utxo/btc/tools/rare_sat_index.js.map +1 -0
  191. package/dist/utxo/btc/tools/rune_index.d.ts +6 -0
  192. package/dist/utxo/btc/tools/rune_index.d.ts.map +1 -0
  193. package/dist/utxo/btc/tools/rune_index.js +2 -0
  194. package/dist/utxo/btc/tools/rune_index.js.map +1 -0
  195. package/dist/utxo/btc/tools/unisat.tool.d.ts +18 -0
  196. package/dist/utxo/btc/tools/unisat.tool.d.ts.map +1 -0
  197. package/dist/utxo/btc/tools/unisat.tool.js +49 -0
  198. package/dist/utxo/btc/tools/unisat.tool.js.map +1 -0
  199. package/dist/utxo/coin_selection.d.ts +29 -0
  200. package/dist/utxo/coin_selection.d.ts.map +1 -0
  201. package/dist/utxo/coin_selection.js +156 -0
  202. package/dist/utxo/coin_selection.js.map +1 -0
  203. package/dist/utxo/doge/doge_chains.d.ts +17 -0
  204. package/dist/utxo/doge/doge_chains.d.ts.map +1 -0
  205. package/dist/utxo/doge/doge_chains.js +28 -0
  206. package/dist/utxo/doge/doge_chains.js.map +1 -0
  207. package/dist/utxo/doge/index.d.ts +3 -0
  208. package/dist/utxo/doge/index.d.ts.map +1 -0
  209. package/dist/utxo/doge/index.js +3 -0
  210. package/dist/utxo/doge/index.js.map +1 -0
  211. package/dist/utxo/doge/network_params.d.ts +4 -0
  212. package/dist/utxo/doge/network_params.d.ts.map +1 -0
  213. package/dist/utxo/doge/network_params.js +24 -0
  214. package/dist/utxo/doge/network_params.js.map +1 -0
  215. package/dist/utxo/ecc.d.ts +2 -0
  216. package/dist/utxo/ecc.d.ts.map +1 -0
  217. package/dist/utxo/ecc.js +11 -0
  218. package/dist/utxo/ecc.js.map +1 -0
  219. package/dist/utxo/fee.d.ts +12 -0
  220. package/dist/utxo/fee.d.ts.map +1 -0
  221. package/dist/utxo/fee.js +51 -0
  222. package/dist/utxo/fee.js.map +1 -0
  223. package/dist/utxo/index.d.ts +20 -0
  224. package/dist/utxo/index.d.ts.map +1 -0
  225. package/dist/utxo/index.js +20 -0
  226. package/dist/utxo/index.js.map +1 -0
  227. package/dist/utxo/ltc/index.d.ts +3 -0
  228. package/dist/utxo/ltc/index.d.ts.map +1 -0
  229. package/dist/utxo/ltc/index.js +3 -0
  230. package/dist/utxo/ltc/index.js.map +1 -0
  231. package/dist/utxo/ltc/ltc_chains.d.ts +17 -0
  232. package/dist/utxo/ltc/ltc_chains.d.ts.map +1 -0
  233. package/dist/utxo/ltc/ltc_chains.js +28 -0
  234. package/dist/utxo/ltc/ltc_chains.js.map +1 -0
  235. package/dist/utxo/ltc/network_params.d.ts +4 -0
  236. package/dist/utxo/ltc/network_params.d.ts.map +1 -0
  237. package/dist/utxo/ltc/network_params.js +27 -0
  238. package/dist/utxo/ltc/network_params.js.map +1 -0
  239. package/dist/utxo/script.d.ts +16 -0
  240. package/dist/utxo/script.d.ts.map +1 -0
  241. package/dist/utxo/script.js +52 -0
  242. package/dist/utxo/script.js.map +1 -0
  243. package/dist/utxo/tools/broadcaster.d.ts +6 -0
  244. package/dist/utxo/tools/broadcaster.d.ts.map +1 -0
  245. package/dist/utxo/tools/broadcaster.js +2 -0
  246. package/dist/utxo/tools/broadcaster.js.map +1 -0
  247. package/dist/utxo/tools/chain_tip_provider.d.ts +5 -0
  248. package/dist/utxo/tools/chain_tip_provider.d.ts.map +1 -0
  249. package/dist/utxo/tools/chain_tip_provider.js +2 -0
  250. package/dist/utxo/tools/chain_tip_provider.js.map +1 -0
  251. package/dist/utxo/tools/fee_estimator.d.ts +6 -0
  252. package/dist/utxo/tools/fee_estimator.d.ts.map +1 -0
  253. package/dist/utxo/tools/fee_estimator.js +2 -0
  254. package/dist/utxo/tools/fee_estimator.js.map +1 -0
  255. package/dist/utxo/tools/raw_transaction_provider.d.ts +8 -0
  256. package/dist/utxo/tools/raw_transaction_provider.d.ts.map +1 -0
  257. package/dist/utxo/tools/raw_transaction_provider.js +2 -0
  258. package/dist/utxo/tools/raw_transaction_provider.js.map +1 -0
  259. package/dist/utxo/tools/utxo_provider.d.ts +7 -0
  260. package/dist/utxo/tools/utxo_provider.d.ts.map +1 -0
  261. package/dist/utxo/tools/utxo_provider.js +2 -0
  262. package/dist/utxo/tools/utxo_provider.js.map +1 -0
  263. package/dist/utxo/unsigned_utxo_transaction.d.ts +32 -0
  264. package/dist/utxo/unsigned_utxo_transaction.d.ts.map +1 -0
  265. package/dist/utxo/unsigned_utxo_transaction.js +32 -0
  266. package/dist/utxo/unsigned_utxo_transaction.js.map +1 -0
  267. package/dist/utxo/utxo.d.ts +43 -0
  268. package/dist/utxo/utxo.d.ts.map +1 -0
  269. package/dist/utxo/utxo.js +2 -0
  270. package/dist/utxo/utxo.js.map +1 -0
  271. package/dist/utxo/utxo_chain.d.ts +102 -0
  272. package/dist/utxo/utxo_chain.d.ts.map +1 -0
  273. package/dist/utxo/utxo_chain.js +524 -0
  274. package/dist/utxo/utxo_chain.js.map +1 -0
  275. package/dist/utxo/utxo_chains.d.ts +29 -0
  276. package/dist/utxo/utxo_chains.d.ts.map +1 -0
  277. package/dist/utxo/utxo_chains.js +63 -0
  278. package/dist/utxo/utxo_chains.js.map +1 -0
  279. package/dist/utxo/utxo_gas_pricing.d.ts +22 -0
  280. package/dist/utxo/utxo_gas_pricing.d.ts.map +1 -0
  281. package/dist/utxo/utxo_gas_pricing.js +20 -0
  282. package/dist/utxo/utxo_gas_pricing.js.map +1 -0
  283. package/dist/utxo/utxo_network_params.d.ts +25 -0
  284. package/dist/utxo/utxo_network_params.d.ts.map +1 -0
  285. package/dist/utxo/utxo_network_params.js +15 -0
  286. package/dist/utxo/utxo_network_params.js.map +1 -0
  287. package/dist/utxo/utxo_transaction_status.d.ts +73 -0
  288. package/dist/utxo/utxo_transaction_status.d.ts.map +1 -0
  289. package/dist/utxo/utxo_transaction_status.js +89 -0
  290. package/dist/utxo/utxo_transaction_status.js.map +1 -0
  291. package/docs/PUBLISHING.md +119 -0
  292. package/docs/README.md +273 -0
  293. package/docs/evm.md +205 -0
  294. package/docs/solana.md +220 -0
  295. package/docs/utxo.md +364 -0
  296. package/package.json +94 -0
@@ -0,0 +1,177 @@
1
+ import { ChainError, ChainErrorKinds } from "../errors.js";
2
+ import { TransactionStatus, TransactionStatusTypes, } from "../transaction_status.js";
3
+ export class EvmTransactionGasFees {
4
+ gasLimit;
5
+ gasLimitUsed;
6
+ effectiveGasPrice;
7
+ gasPrice;
8
+ maxFeePerGas;
9
+ maxPriorityFeePerGas;
10
+ l1FeeWei;
11
+ constructor(init) {
12
+ // Observed on-chain values (not caller inputs) — reject negatives only.
13
+ // Zero-gas / subsidised environments and pruned-node receipts return 0
14
+ // for one or more of these fields; throwing there would turn
15
+ // getTransactionStatus from "returns a status" into "throws".
16
+ if (init.gasLimit !== null && init.gasLimit < 0n) {
17
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `EvmTransactionGasFees.gasLimit must be >= 0 or null, got ${init.gasLimit}`);
18
+ }
19
+ if (init.gasLimitUsed < 0n) {
20
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `EvmTransactionGasFees.gasLimitUsed must be >= 0, got ${init.gasLimitUsed}`);
21
+ }
22
+ if (init.effectiveGasPrice < 0n) {
23
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `EvmTransactionGasFees.effectiveGasPrice must be >= 0, got ${init.effectiveGasPrice}`);
24
+ }
25
+ if (init.l1FeeWei !== undefined && init.l1FeeWei < 0n) {
26
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `EvmTransactionGasFees.l1FeeWei must be >= 0, got ${init.l1FeeWei}`);
27
+ }
28
+ this.gasLimit = init.gasLimit;
29
+ this.gasLimitUsed = init.gasLimitUsed;
30
+ this.effectiveGasPrice = init.effectiveGasPrice;
31
+ this.gasPrice = init.gasPrice;
32
+ this.maxFeePerGas = init.maxFeePerGas;
33
+ this.maxPriorityFeePerGas = init.maxPriorityFeePerGas;
34
+ this.l1FeeWei = init.l1FeeWei;
35
+ }
36
+ /** L2 execution gas only. Does NOT include OP-stack `l1FeeWei`. */
37
+ get totalGasInWei() {
38
+ return this.gasLimitUsed * this.effectiveGasPrice;
39
+ }
40
+ /** Full sender native debit: L2 gas + OP-stack L1 data fee (when present). */
41
+ get totalNativeDebitWei() {
42
+ return this.totalGasInWei + (this.l1FeeWei ?? 0n);
43
+ }
44
+ }
45
+ /**
46
+ * Canonical ERC-20 `Transfer(address indexed from, address indexed to,
47
+ * uint256 value)` topic0 — keccak256("Transfer(address,address,uint256)").
48
+ */
49
+ export const ERC20_TRANSFER_TOPIC = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
50
+ /**
51
+ * Event log entry surfaced on a receipt. `isTransferLog()` / `asTransferLog()`
52
+ * mirror Python's `EvmParsedTransactionLog` API (`impl/evm/base.py:1551+`).
53
+ *
54
+ * The `evm_chain.ts` receipt-decoder shares the `ERC20_TRANSFER_TOPIC`
55
+ * topic0 constant with this class but runs its own **lenient** parse
56
+ * (skips non-standard logs) for the `NestedBalanceChanges` construction.
57
+ * This class's `asTransferLog()` is **strict** (throws on wrong length /
58
+ * bad hex). Rewiring the decoder to consume the strict accessor requires
59
+ * a policy decision on whether non-standard logs should silently drop
60
+ * or surface as `TransactionDecodeFailed`, and is deferred to a
61
+ * follow-up card. Consumers doing their own log extraction should
62
+ * either use the guard/accessor pair with a `try/catch` per log or
63
+ * wait for a `tryAsTransferLog()` variant to land.
64
+ */
65
+ export class EvmParsedTransactionLog {
66
+ address;
67
+ topics;
68
+ data;
69
+ constructor(address, topics, data) {
70
+ this.address = address;
71
+ this.topics = topics;
72
+ this.data = data;
73
+ }
74
+ isTransferLog() {
75
+ return this.topics.length === 3 && this.topics[0].toLowerCase() === ERC20_TRANSFER_TOPIC;
76
+ }
77
+ /**
78
+ * Decode this log as an ERC-20 Transfer. Throws
79
+ * `ChainError(InvalidArgument)` if the log doesn't match the topic0
80
+ * / topic-count shape, or `ChainError(TransactionDecodeFailed)` if
81
+ * `data` isn't parseable as a `uint256`. Addresses are returned
82
+ * lowercased (matches the `balanceChanges` wallet-key convention;
83
+ * consumers who need EIP-55 should checksum via `EvmAddress`).
84
+ */
85
+ asTransferLog() {
86
+ if (!this.isTransferLog()) {
87
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `Log is not an ERC-20 Transfer (topics=${this.topics.length}, topic0=${this.topics[0] ?? ''})`);
88
+ }
89
+ const topic1 = this.topics[1];
90
+ const topic2 = this.topics[2];
91
+ // 32-byte hex-encoded topics: exactly `0x` + 64 hex chars = 66 total.
92
+ // Anything else is either truncated (would `slice(26)` a wrong window)
93
+ // or padded (should not have reached a Transfer topic slot).
94
+ if (!/^0x[0-9a-fA-F]{64}$/.test(topic1) || !/^0x[0-9a-fA-F]{64}$/.test(topic2)) {
95
+ throw new ChainError(ChainErrorKinds.TransactionDecodeFailed, `Transfer log topics malformed (topic1=${topic1}, topic2=${topic2})`);
96
+ }
97
+ // ERC-20 Transfer data is exactly one uint256 = 32 bytes = 66-char hex.
98
+ // Empty string, short data, or blobs longer than 32 bytes all reach
99
+ // the decoder in the wild via non-standard tokens; fail loudly.
100
+ if (!/^0x[0-9a-fA-F]{64}$/.test(this.data)) {
101
+ throw new ChainError(ChainErrorKinds.TransactionDecodeFailed, `Transfer log data must be exactly 32 hex bytes, got '${this.data}'`);
102
+ }
103
+ let value;
104
+ try {
105
+ value = BigInt(this.data);
106
+ }
107
+ catch (err) {
108
+ throw new ChainError(ChainErrorKinds.TransactionDecodeFailed, `Failed to parse Transfer log data as bigint: ${this.data}`, undefined, err instanceof Error ? err : undefined);
109
+ }
110
+ return {
111
+ tokenContract: this.address.toLowerCase(),
112
+ fromAddress: `0x${topic1.slice(26)}`.toLowerCase(),
113
+ toAddress: `0x${topic2.slice(26)}`.toLowerCase(),
114
+ value,
115
+ };
116
+ }
117
+ }
118
+ export class EvmTransactionStatus extends TransactionStatus {
119
+ logs;
120
+ fees;
121
+ constructor(init) {
122
+ super({
123
+ chainId: init.chainId,
124
+ status: init.status,
125
+ inclusionAt: init.inclusionAt,
126
+ error: init.error,
127
+ balanceChanges: init.balanceChanges,
128
+ });
129
+ this.logs = init.logs ?? null;
130
+ this.fees = init.fees ?? null;
131
+ }
132
+ static successful(args) {
133
+ return new EvmTransactionStatus({
134
+ chainId: args.chainId,
135
+ status: TransactionStatusTypes.Success,
136
+ inclusionAt: args.inclusionAt,
137
+ balanceChanges: args.balanceChanges,
138
+ logs: args.logs,
139
+ fees: args.fees,
140
+ error: null,
141
+ });
142
+ }
143
+ static failed(args) {
144
+ return new EvmTransactionStatus({
145
+ chainId: args.chainId,
146
+ status: TransactionStatusTypes.Failed,
147
+ inclusionAt: args.inclusionAt,
148
+ error: args.error,
149
+ balanceChanges: null,
150
+ logs: null,
151
+ fees: args.fees,
152
+ });
153
+ }
154
+ static pending(chainId) {
155
+ return new EvmTransactionStatus({
156
+ chainId,
157
+ status: TransactionStatusTypes.Pending,
158
+ inclusionAt: null,
159
+ error: null,
160
+ balanceChanges: null,
161
+ logs: null,
162
+ fees: null,
163
+ });
164
+ }
165
+ static notFound(chainId, error) {
166
+ return new EvmTransactionStatus({
167
+ chainId,
168
+ status: TransactionStatusTypes.NotFound,
169
+ inclusionAt: null,
170
+ error,
171
+ balanceChanges: null,
172
+ logs: null,
173
+ fees: null,
174
+ });
175
+ }
176
+ }
177
+ //# sourceMappingURL=evm_transaction_status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evm_transaction_status.js","sourceRoot":"","sources":["../../evm/evm_transaction_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAGL,iBAAiB,EAEjB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAwBlC,MAAM,OAAO,qBAAqB;IACvB,QAAQ,CAAgB;IACxB,YAAY,CAAS;IACrB,iBAAiB,CAAS;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IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,KAAkC;QACjE,OAAO,IAAI,oBAAoB,CAAC;YAC9B,OAAO;YACP,MAAM,EAAE,sBAAsB,CAAC,QAAQ;YACvC,WAAW,EAAE,IAAI;YACjB,KAAK;YACL,cAAc,EAAE,IAAI;YACpB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ export * from './evm_address.ts';
2
+ export * from './evm_chain.ts';
3
+ export * from './evm_chains.ts';
4
+ export * from './evm_gas_estimate.ts';
5
+ export * from './evm_gas_pricing.ts';
6
+ export * from './evm_transaction_status.ts';
7
+ export * from './evm_token.ts';
8
+ export * from './evm_tokens.ts';
9
+ export * from './unsigned_evm_transaction.ts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../evm/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from "./evm_address.js";
2
+ export * from "./evm_chain.js";
3
+ export * from "./evm_chains.js";
4
+ export * from "./evm_gas_estimate.js";
5
+ export * from "./evm_gas_pricing.js";
6
+ export * from "./evm_transaction_status.js";
7
+ export * from "./evm_token.js";
8
+ export * from "./evm_tokens.js";
9
+ export * from "./unsigned_evm_transaction.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../evm/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { UnsignedTransaction } from '../unsigned_transaction.ts';
2
+ import { EvmGasEstimate } from './evm_gas_estimate.ts';
3
+ export interface UnsignedEvmTransactionInit {
4
+ chainId: number;
5
+ to: string;
6
+ value: bigint;
7
+ data?: string;
8
+ from?: string;
9
+ gasEstimate?: EvmGasEstimate;
10
+ }
11
+ export declare class UnsignedEvmTransaction extends UnsignedTransaction {
12
+ readonly to: string;
13
+ readonly value: bigint;
14
+ readonly data: string;
15
+ readonly from?: string;
16
+ readonly gasEstimate?: EvmGasEstimate;
17
+ constructor(init: UnsignedEvmTransactionInit);
18
+ }
19
+ //# sourceMappingURL=unsigned_evm_transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsigned_evm_transaction.d.ts","sourceRoot":"","sources":["../../evm/unsigned_evm_transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;gBAE1B,IAAI,EAAE,0BAA0B;CAQ7C"}
@@ -0,0 +1,18 @@
1
+ import { NetworkType } from "../network_type.js";
2
+ import { UnsignedTransaction } from "../unsigned_transaction.js";
3
+ export class UnsignedEvmTransaction extends UnsignedTransaction {
4
+ to;
5
+ value;
6
+ data;
7
+ from;
8
+ gasEstimate;
9
+ constructor(init) {
10
+ super(init.chainId, NetworkType.EVM);
11
+ this.to = init.to;
12
+ this.value = init.value;
13
+ this.data = init.data ?? '0x';
14
+ this.from = init.from;
15
+ this.gasEstimate = init.gasEstimate;
16
+ }
17
+ }
18
+ //# sourceMappingURL=unsigned_evm_transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsigned_evm_transaction.js","sourceRoot":"","sources":["../../evm/unsigned_evm_transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAYjE,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IACpD,EAAE,CAAS;IACX,KAAK,CAAS;IACd,IAAI,CAAS;IACb,IAAI,CAAU;IACd,WAAW,CAAkB;IAEtC,YAAY,IAAgC;QAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ export * from './abstract_gas_pricing.ts';
2
+ export * from './address.ts';
3
+ export * from './address.factory.ts';
4
+ export * from './address_field.decorator.ts';
5
+ export * from './chain.base.ts';
6
+ export * from './chain_ids.ts';
7
+ export * from './errors.ts';
8
+ export * from './is_address.decorator.ts';
9
+ export * from './network_type.ts';
10
+ export * from './priority.ts';
11
+ export * from './token.ts';
12
+ export * from './transaction_status.ts';
13
+ export * from './unsigned_transaction.ts';
14
+ export * from './evm/index.ts';
15
+ export * from './solana/index.ts';
16
+ export * from './ton/index.ts';
17
+ export * from './utxo/index.ts';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ export * from "./abstract_gas_pricing.js";
2
+ export * from "./address.js";
3
+ export * from "./address.factory.js";
4
+ export * from "./address_field.decorator.js";
5
+ export * from "./chain.base.js";
6
+ export * from "./chain_ids.js";
7
+ export * from "./errors.js";
8
+ export * from "./is_address.decorator.js";
9
+ export * from "./network_type.js";
10
+ export * from "./priority.js";
11
+ export * from "./token.js";
12
+ export * from "./transaction_status.js";
13
+ export * from "./unsigned_transaction.js";
14
+ export * from "./evm/index.js";
15
+ export * from "./solana/index.js";
16
+ export * from "./ton/index.js";
17
+ export * from "./utxo/index.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ValidationOptions } from 'class-validator';
2
+ export declare function IsAddress(chainIdProperty: string, options?: ValidationOptions): (object: object, propertyName: string) => void;
3
+ //# sourceMappingURL=is_address.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_address.decorator.d.ts","sourceRoot":"","sources":["../is_address.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAuBzB,wBAAgB,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,IAC3D,QAAQ,MAAM,EAAE,cAAc,MAAM,KAAG,IAAI,CA4B7D"}
@@ -0,0 +1,51 @@
1
+ import { registerDecorator, } from 'class-validator';
2
+ import { addressFor } from "./address.factory.js";
3
+ import { ChainErrorKinds, isChainError } from "./errors.js";
4
+ function classifyValidation(value, chainIdProp, host) {
5
+ if (typeof value !== 'string')
6
+ return { ok: false, kind: 'not-string' };
7
+ const chainId = host[chainIdProp];
8
+ if (typeof chainId !== 'number')
9
+ return { ok: false, kind: 'no-chain-id' };
10
+ try {
11
+ addressFor(chainId, value);
12
+ return { ok: true, kind: 'ok' };
13
+ }
14
+ catch (err) {
15
+ return {
16
+ ok: false,
17
+ kind: isChainError(err, ChainErrorKinds.ChainNotSupported) ? 'chain-not-supported' : 'malformed',
18
+ };
19
+ }
20
+ }
21
+ export function IsAddress(chainIdProperty, options) {
22
+ return function (object, propertyName) {
23
+ registerDecorator({
24
+ name: 'isAddress',
25
+ target: object.constructor,
26
+ propertyName,
27
+ constraints: [chainIdProperty],
28
+ options,
29
+ validator: {
30
+ validate(value, args) {
31
+ const [chainIdProp] = args.constraints;
32
+ return classifyValidation(value, chainIdProp, args.object).ok;
33
+ },
34
+ defaultMessage(args) {
35
+ const [chainIdProp] = args.constraints;
36
+ // Re-derive the failure classification deterministically. This is
37
+ // idempotent with validate() and avoids per-instance mutable state
38
+ // that misattributes under `{ each: true }` element iteration.
39
+ const host = args.object;
40
+ const chainId = host[chainIdProp];
41
+ const { kind } = classifyValidation(args.value, chainIdProp, host);
42
+ if (kind === 'chain-not-supported') {
43
+ return `${args.property}: chainId ${chainId} is not routable by the SDK (unregistered, or registered as a family with no address parser in v0)`;
44
+ }
45
+ return `${args.property} must be a valid address for the chain identified by '${chainIdProp}'`;
46
+ },
47
+ },
48
+ });
49
+ };
50
+ }
51
+ //# sourceMappingURL=is_address.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_address.decorator.js","sourceRoot":"","sources":["../is_address.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,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,cAAc,CAAC,IAAyB;oBACtC,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAuB,CAAC;oBACnD,kEAAkE;oBAClE,mEAAmE;oBACnE,+DAA+D;oBAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,MAAiC,CAAC;oBACpD,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;oBAClC,MAAM,EAAE,IAAI,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;oBACnE,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;wBACnC,OAAO,GAAG,IAAI,CAAC,QAAQ,aAAa,OAAO,oGAAoG,CAAC;oBAClJ,CAAC;oBACD,OAAO,GAAG,IAAI,CAAC,QAAQ,yDAAyD,WAAW,GAAG,CAAC;gBACjG,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,73 @@
1
+ export declare enum NetworkType {
2
+ EVM = "EVM",
3
+ COSMOS = "COSMOS",
4
+ TON = "TON",
5
+ SOLANA = "SOLANA",
6
+ BTC = "BTC",
7
+ TRON = "TRON"
8
+ }
9
+ /**
10
+ * Register (or re-register) a chainId's NetworkType. Idempotent for the SAME
11
+ * NetworkType; throws `ChainError(InvalidArgument)` on a conflict — silently
12
+ * flipping a chainId's family would let `addressFor` parse addresses under
13
+ * the wrong rules.
14
+ *
15
+ * **Positive chainIds are EVM by construction (EIP-155) and cannot be
16
+ * reclassified.** `unregisterChain(id)` only removes an explicit
17
+ * registration entry; `tryNetworkTypeOf` still synthesizes `EVM` for any
18
+ * positive integer, so a subsequent
19
+ * `registerNonEvmChain(<positive>, SOLANA)` still conflicts and throws.
20
+ * Matches `omnichain-py`'s static family sets in
21
+ * `chain_ids.py` — the Python side has no reclassification hook at all.
22
+ * Consumers who need a non-EVM chain must use a distinct (negative)
23
+ * chainId reserved by the family seed.
24
+ */
25
+ export declare function registerNonEvmChain(chainId: number, networkType: NetworkType): void;
26
+ /**
27
+ * Remove a chainId from the network-type registry. Advanced — intended for
28
+ * test isolation and for consumers who need to reclassify a chainId that
29
+ * collides with a family seed (e.g. treating a Cosmos-labelled positive
30
+ * chainId as EVM). Silent no-op if the chainId isn't registered.
31
+ *
32
+ * After `unregisterChain(id)`, `networkTypeOf(id)` returns EVM for positive
33
+ * ids and throws for negatives (same as an id that was never seeded).
34
+ *
35
+ * **Paired cleanup**: if you had also called
36
+ * `registerBtcChainParams(BigInt(id), …)` for the same id, call
37
+ * `unregisterBtcChainParams(BigInt(id))` from `utxo/btc/network_params.ts`
38
+ * to keep the two registries in sync. `unregisterChain` deliberately does
39
+ * NOT reach across into `btcParamsByChainId` to avoid a layering
40
+ * dependency from this base module into the utxo/btc leaf.
41
+ */
42
+ export declare function unregisterChain(chainId: number): void;
43
+ /**
44
+ * Snapshot of the current registry. Read-only; mutations don't affect the
45
+ * live registry. Useful for consumer startup diagnostics ("show me every
46
+ * chainId this SDK will route and how").
47
+ */
48
+ export declare function networkTypeRegistrations(): ReadonlyMap<number, NetworkType>;
49
+ /**
50
+ * Resolve the NetworkType for a chainId.
51
+ *
52
+ * - Static seeds (UTXO / Solana / TON / Tron families from `chain_ids.ts`)
53
+ * win first.
54
+ * - Instance constructors override via `registerNonEvmChain` (idempotent per
55
+ * the guard above).
56
+ * - Positive chainIds NOT in a static family default to `EVM` (EIP-155).
57
+ * - Negative chainIds without a registration throw
58
+ * `ChainError(ChainNotSupported)` rather than silently misclassifying.
59
+ *
60
+ * The `is*` predicates in `chain_ids.ts` operate on the static family sets
61
+ * only (Python parity, immutable); `networkTypeOf` is the runtime authority
62
+ * that also reflects consumer registrations.
63
+ */
64
+ export declare function networkTypeOf(chainId: number): NetworkType;
65
+ /**
66
+ * Non-throwing variant of `networkTypeOf`. Returns `undefined` instead of
67
+ * throwing `ChainError(ChainNotSupported)` for unregistered negative
68
+ * chainIds. Use when the caller legitimately needs "unknown" as a valid
69
+ * outcome (e.g. a pre-validation guard that wants to route to a custom
70
+ * error type rather than a try/catch around every lookup).
71
+ */
72
+ export declare function tryNetworkTypeOf(chainId: number): NetworkType | undefined;
73
+ //# sourceMappingURL=network_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network_type.d.ts","sourceRoot":"","sources":["../network_type.ts"],"names":[],"mappings":"AAmBA,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAuBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAmBnF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAErD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAE3E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAmB1D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAMzE"}
@@ -0,0 +1,144 @@
1
+ import { CHAIN_ID_BITCOIN_MAINNET, CHAIN_ID_BITCOIN_SIGNET, CHAIN_ID_BITCOIN_TESTNET, CHAIN_FAMILY_SOLANA, CHAIN_FAMILY_TON, CHAIN_FAMILY_TRON, } from "./chain_ids.js";
2
+ import { ChainError, ChainErrorKinds } from "./errors.js";
3
+ /** BTC address-grammar family. Distinct from the full `CHAIN_FAMILY_UTXO`
4
+ * (which includes LTC/DOGE/DASH/ZEC/BCH — those have their own address
5
+ * grammars and must not route through the BTC parser). */
6
+ const BTC_ADDRESS_GRAMMAR_IDS = [
7
+ CHAIN_ID_BITCOIN_MAINNET,
8
+ CHAIN_ID_BITCOIN_TESTNET,
9
+ CHAIN_ID_BITCOIN_SIGNET,
10
+ ];
11
+ export var NetworkType;
12
+ (function (NetworkType) {
13
+ NetworkType["EVM"] = "EVM";
14
+ NetworkType["COSMOS"] = "COSMOS";
15
+ NetworkType["TON"] = "TON";
16
+ NetworkType["SOLANA"] = "SOLANA";
17
+ NetworkType["BTC"] = "BTC";
18
+ NetworkType["TRON"] = "TRON";
19
+ })(NetworkType || (NetworkType = {}));
20
+ const networkTypeRegistry = new Map();
21
+ // Seed the registry statically for families that have a working address
22
+ // parser in v0. Only BTC (bech32 + base58 with BTC HRPs), Solana, TON, Tron.
23
+ //
24
+ // LTC/DOGE/DASH/ZEC/BCH are NOT statically seeded: their address grammars
25
+ // differ from BTC's (different HRPs, different version bytes, CashAddr for
26
+ // BCH, t-addr/z-addr for ZEC). `networkTypeOf` on those ids throws until a
27
+ // chain instance is constructed.
28
+ //
29
+ // **Known v0 gap**: `UtxoChain`'s constructor currently registers *every*
30
+ // UTXO coin as `NetworkType.BTC`, so `addressFor(-10, 'ltc1q…')` (after
31
+ // constructing a Litecoin chain) throws from `btcParamsForChainId` — the
32
+ // only currently-workable path is `chain.validateAddress(raw)` on the chain
33
+ // instance itself. Full LTC/DOGE `addressFor` support requires per-family
34
+ // NetworkType values (deferred; noted in the migration guide).
35
+ for (const id of BTC_ADDRESS_GRAMMAR_IDS)
36
+ networkTypeRegistry.set(id, NetworkType.BTC);
37
+ for (const id of CHAIN_FAMILY_SOLANA)
38
+ networkTypeRegistry.set(id, NetworkType.SOLANA);
39
+ for (const id of CHAIN_FAMILY_TON)
40
+ networkTypeRegistry.set(id, NetworkType.TON);
41
+ for (const id of CHAIN_FAMILY_TRON)
42
+ networkTypeRegistry.set(id, NetworkType.TRON);
43
+ /**
44
+ * Register (or re-register) a chainId's NetworkType. Idempotent for the SAME
45
+ * NetworkType; throws `ChainError(InvalidArgument)` on a conflict — silently
46
+ * flipping a chainId's family would let `addressFor` parse addresses under
47
+ * the wrong rules.
48
+ *
49
+ * **Positive chainIds are EVM by construction (EIP-155) and cannot be
50
+ * reclassified.** `unregisterChain(id)` only removes an explicit
51
+ * registration entry; `tryNetworkTypeOf` still synthesizes `EVM` for any
52
+ * positive integer, so a subsequent
53
+ * `registerNonEvmChain(<positive>, SOLANA)` still conflicts and throws.
54
+ * Matches `omnichain-py`'s static family sets in
55
+ * `chain_ids.py` — the Python side has no reclassification hook at all.
56
+ * Consumers who need a non-EVM chain must use a distinct (negative)
57
+ * chainId reserved by the family seed.
58
+ */
59
+ export function registerNonEvmChain(chainId, networkType) {
60
+ // iter-15 minor #1: reject non-integers at the registration point rather than
61
+ // letting the failure surface much later at first networkTypeOf() lookup.
62
+ if (!Number.isInteger(chainId)) {
63
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `chainId must be an integer (got ${chainId})`, { chainId });
64
+ }
65
+ const existing = tryNetworkTypeOf(chainId);
66
+ if (existing !== undefined && existing !== networkType) {
67
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `chainId ${chainId} already registered as ${existing}; refusing to reclassify as ${networkType}. Call unregisterChain(${chainId}) first if this is intentional.`, { chainId });
68
+ }
69
+ networkTypeRegistry.set(chainId, networkType);
70
+ }
71
+ /**
72
+ * Remove a chainId from the network-type registry. Advanced — intended for
73
+ * test isolation and for consumers who need to reclassify a chainId that
74
+ * collides with a family seed (e.g. treating a Cosmos-labelled positive
75
+ * chainId as EVM). Silent no-op if the chainId isn't registered.
76
+ *
77
+ * After `unregisterChain(id)`, `networkTypeOf(id)` returns EVM for positive
78
+ * ids and throws for negatives (same as an id that was never seeded).
79
+ *
80
+ * **Paired cleanup**: if you had also called
81
+ * `registerBtcChainParams(BigInt(id), …)` for the same id, call
82
+ * `unregisterBtcChainParams(BigInt(id))` from `utxo/btc/network_params.ts`
83
+ * to keep the two registries in sync. `unregisterChain` deliberately does
84
+ * NOT reach across into `btcParamsByChainId` to avoid a layering
85
+ * dependency from this base module into the utxo/btc leaf.
86
+ */
87
+ export function unregisterChain(chainId) {
88
+ networkTypeRegistry.delete(chainId);
89
+ }
90
+ /**
91
+ * Snapshot of the current registry. Read-only; mutations don't affect the
92
+ * live registry. Useful for consumer startup diagnostics ("show me every
93
+ * chainId this SDK will route and how").
94
+ */
95
+ export function networkTypeRegistrations() {
96
+ return new Map(networkTypeRegistry);
97
+ }
98
+ /**
99
+ * Resolve the NetworkType for a chainId.
100
+ *
101
+ * - Static seeds (UTXO / Solana / TON / Tron families from `chain_ids.ts`)
102
+ * win first.
103
+ * - Instance constructors override via `registerNonEvmChain` (idempotent per
104
+ * the guard above).
105
+ * - Positive chainIds NOT in a static family default to `EVM` (EIP-155).
106
+ * - Negative chainIds without a registration throw
107
+ * `ChainError(ChainNotSupported)` rather than silently misclassifying.
108
+ *
109
+ * The `is*` predicates in `chain_ids.ts` operate on the static family sets
110
+ * only (Python parity, immutable); `networkTypeOf` is the runtime authority
111
+ * that also reflects consumer registrations.
112
+ */
113
+ export function networkTypeOf(chainId) {
114
+ if (!Number.isInteger(chainId)) {
115
+ throw new ChainError(ChainErrorKinds.InvalidArgument, `chainId must be an integer (got ${chainId})`, { chainId });
116
+ }
117
+ const registered = networkTypeRegistry.get(chainId);
118
+ if (registered !== undefined)
119
+ return registered;
120
+ // Positive integers default to EVM (EIP-155). `0` is not a valid EIP-155
121
+ // chainId (0-conflict is why EIP-155 exists) — treat like an unregistered
122
+ // negative and fail closed.
123
+ if (chainId > 0)
124
+ return NetworkType.EVM;
125
+ throw new ChainError(ChainErrorKinds.ChainNotSupported, `Unregistered non-positive chainId ${chainId} — no NetworkType known`, { chainId });
126
+ }
127
+ /**
128
+ * Non-throwing variant of `networkTypeOf`. Returns `undefined` instead of
129
+ * throwing `ChainError(ChainNotSupported)` for unregistered negative
130
+ * chainIds. Use when the caller legitimately needs "unknown" as a valid
131
+ * outcome (e.g. a pre-validation guard that wants to route to a custom
132
+ * error type rather than a try/catch around every lookup).
133
+ */
134
+ export function tryNetworkTypeOf(chainId) {
135
+ if (!Number.isInteger(chainId))
136
+ return undefined;
137
+ const registered = networkTypeRegistry.get(chainId);
138
+ if (registered !== undefined)
139
+ return registered;
140
+ if (chainId > 0)
141
+ return NetworkType.EVM;
142
+ return undefined;
143
+ }
144
+ //# sourceMappingURL=network_type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network_type.js","sourceRoot":"","sources":["../network_type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1D;;2DAE2D;AAC3D,MAAM,uBAAuB,GAAsB;IACjD,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;CACxB,CAAC;AAEF,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,0BAAW,CAAA;IACX,4BAAa,CAAA;AACf,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAED,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAuB,CAAC;AAE3D,wEAAwE;AACxE,6EAA6E;AAC7E,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,iCAAiC;AACjC,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,+DAA+D;AAC/D,KAAK,MAAM,EAAE,IAAI,uBAAuB;IAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;AACvF,KAAK,MAAM,EAAE,IAAI,mBAAmB;IAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CA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AM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,UAAU,CAClB,eAAe,CAAC,eAAe,EAC/B,mCAAmC,OAAO,GAAG,EAC7C,EAAE,OAAO,EAAE,CACZ,CAAC;IACJ,CAAC;IACD,MAAM,UAAU,GAAG,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAChD,yEAAyE;IACzE,0EAA0E;IAC1E,4BAA4B;IAC5B,IAAI,OAAO,GAAG,CAAC;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC;IACxC,MAAM,IAAI,UAAU,CAClB,eAAe,CAAC,iBAAiB,EACjC,qCAAqC,OAAO,yBAAyB,EACrE,EAAE,OAAO,EAAE,CACZ,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IACjD,MAAM,UAAU,GAAG,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAChD,IAAI,OAAO,GAAG,CAAC;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC;IACxC,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Speed-vs-cost knob for landing a transaction on chain. Lives in the chain SDK so that
3
+ * every chain's `suggest*` helpers and `createTransferUnsignedTransaction` can speak the
4
+ * same vocabulary. Consumers (depositron, pluton) re-export or re-use this enum directly —
5
+ * they should never invent their own three-tier mirror.
6
+ *
7
+ * The semantics per chain are documented on each chain's `suggest*` method.
8
+ */
9
+ export declare enum Priority {
10
+ SLOW = "SLOW",
11
+ NORMAL = "NORMAL",
12
+ FAST = "FAST"
13
+ }
14
+ export declare const DEFAULT_PRIORITY: Priority;
15
+ /**
16
+ * Python-name alias for `Priority`. omnichain-py names the same enum
17
+ * `FeePriority` (base/base.py:123); consumers writing Python-parity code
18
+ * can import either identifier. `Priority` remains the canonical TS name
19
+ * for back-compat.
20
+ */
21
+ export declare const FeePriority: typeof Priority;
22
+ export type FeePriority = Priority;
23
+ //# sourceMappingURL=priority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"priority.d.ts","sourceRoot":"","sources":["../priority.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,gBAAgB,EAAE,QAA0B,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,iBAAW,CAAC;AACpC,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC"}