@tcswap/toolboxes 4.3.15

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 (275) hide show
  1. package/dist/src/cardano/index.cjs +4 -0
  2. package/dist/src/cardano/index.cjs.map +11 -0
  3. package/dist/src/cardano/index.js +4 -0
  4. package/dist/src/cardano/index.js.map +11 -0
  5. package/dist/src/cosmos/index.cjs +4 -0
  6. package/dist/src/cosmos/index.cjs.map +20 -0
  7. package/dist/src/cosmos/index.js +4 -0
  8. package/dist/src/cosmos/index.js.map +20 -0
  9. package/dist/src/evm/index.cjs +4 -0
  10. package/dist/src/evm/index.cjs.map +20 -0
  11. package/dist/src/evm/index.js +4 -0
  12. package/dist/src/evm/index.js.map +20 -0
  13. package/dist/src/index.cjs +5 -0
  14. package/dist/src/index.cjs.map +67 -0
  15. package/dist/src/index.js +5 -0
  16. package/dist/src/index.js.map +67 -0
  17. package/dist/src/near/index.cjs +4 -0
  18. package/dist/src/near/index.cjs.map +16 -0
  19. package/dist/src/near/index.js +4 -0
  20. package/dist/src/near/index.js.map +16 -0
  21. package/dist/src/radix/index.cjs +4 -0
  22. package/dist/src/radix/index.cjs.map +10 -0
  23. package/dist/src/radix/index.js +4 -0
  24. package/dist/src/radix/index.js.map +10 -0
  25. package/dist/src/ripple/index.cjs +4 -0
  26. package/dist/src/ripple/index.cjs.map +10 -0
  27. package/dist/src/ripple/index.js +4 -0
  28. package/dist/src/ripple/index.js.map +10 -0
  29. package/dist/src/solana/index.cjs +4 -0
  30. package/dist/src/solana/index.cjs.map +11 -0
  31. package/dist/src/solana/index.js +4 -0
  32. package/dist/src/solana/index.js.map +11 -0
  33. package/dist/src/substrate/index.cjs +4 -0
  34. package/dist/src/substrate/index.cjs.map +13 -0
  35. package/dist/src/substrate/index.js +4 -0
  36. package/dist/src/substrate/index.js.map +13 -0
  37. package/dist/src/sui/index.cjs +4 -0
  38. package/dist/src/sui/index.cjs.map +11 -0
  39. package/dist/src/sui/index.js +4 -0
  40. package/dist/src/sui/index.js.map +11 -0
  41. package/dist/src/ton/index.cjs +4 -0
  42. package/dist/src/ton/index.cjs.map +11 -0
  43. package/dist/src/ton/index.js +4 -0
  44. package/dist/src/ton/index.js.map +11 -0
  45. package/dist/src/tron/index.cjs +4 -0
  46. package/dist/src/tron/index.cjs.map +13 -0
  47. package/dist/src/tron/index.js +4 -0
  48. package/dist/src/tron/index.js.map +13 -0
  49. package/dist/src/utxo/index.cjs +5 -0
  50. package/dist/src/utxo/index.cjs.map +21 -0
  51. package/dist/src/utxo/index.js +5 -0
  52. package/dist/src/utxo/index.js.map +21 -0
  53. package/dist/types/cardano/index.d.ts +3 -0
  54. package/dist/types/cardano/index.d.ts.map +1 -0
  55. package/dist/types/cardano/toolbox.d.ts +37 -0
  56. package/dist/types/cardano/toolbox.d.ts.map +1 -0
  57. package/dist/types/cardano/types.d.ts +11 -0
  58. package/dist/types/cardano/types.d.ts.map +1 -0
  59. package/dist/types/cosmos/index.d.ts +5 -0
  60. package/dist/types/cosmos/index.d.ts.map +1 -0
  61. package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts +8 -0
  62. package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts.map +1 -0
  63. package/dist/types/cosmos/thorchainUtils/index.d.ts +5 -0
  64. package/dist/types/cosmos/thorchainUtils/index.d.ts.map +1 -0
  65. package/dist/types/cosmos/thorchainUtils/messages.d.ts +211 -0
  66. package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -0
  67. package/dist/types/cosmos/thorchainUtils/registry.d.ts +4 -0
  68. package/dist/types/cosmos/thorchainUtils/registry.d.ts.map +1 -0
  69. package/dist/types/cosmos/thorchainUtils/types/MsgCompiled.d.ts +2 -0
  70. package/dist/types/cosmos/thorchainUtils/types/MsgCompiled.d.ts.map +1 -0
  71. package/dist/types/cosmos/thorchainUtils/types/client-types.d.ts +63 -0
  72. package/dist/types/cosmos/thorchainUtils/types/client-types.d.ts.map +1 -0
  73. package/dist/types/cosmos/thorchainUtils/types/index.d.ts +2 -0
  74. package/dist/types/cosmos/thorchainUtils/types/index.d.ts.map +1 -0
  75. package/dist/types/cosmos/toolbox/cosmos.d.ts +65 -0
  76. package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -0
  77. package/dist/types/cosmos/toolbox/index.d.ts +18 -0
  78. package/dist/types/cosmos/toolbox/index.d.ts.map +1 -0
  79. package/dist/types/cosmos/toolbox/thorchain.d.ts +161 -0
  80. package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -0
  81. package/dist/types/cosmos/types.d.ts +49 -0
  82. package/dist/types/cosmos/types.d.ts.map +1 -0
  83. package/dist/types/cosmos/util.d.ts +77 -0
  84. package/dist/types/cosmos/util.d.ts.map +1 -0
  85. package/dist/types/evm/api.d.ts +8 -0
  86. package/dist/types/evm/api.d.ts.map +1 -0
  87. package/dist/types/evm/contracts/eth/multicall.d.ts +36 -0
  88. package/dist/types/evm/contracts/eth/multicall.d.ts.map +1 -0
  89. package/dist/types/evm/contracts/op/gasOracle.d.ts +40 -0
  90. package/dist/types/evm/contracts/op/gasOracle.d.ts.map +1 -0
  91. package/dist/types/evm/helpers.d.ts +6 -0
  92. package/dist/types/evm/helpers.d.ts.map +1 -0
  93. package/dist/types/evm/index.d.ts +5 -0
  94. package/dist/types/evm/index.d.ts.map +1 -0
  95. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +88 -0
  96. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -0
  97. package/dist/types/evm/toolbox/evm.d.ts +767 -0
  98. package/dist/types/evm/toolbox/evm.d.ts.map +1 -0
  99. package/dist/types/evm/toolbox/index.d.ts +7 -0
  100. package/dist/types/evm/toolbox/index.d.ts.map +1 -0
  101. package/dist/types/evm/toolbox/op.d.ts +67 -0
  102. package/dist/types/evm/toolbox/op.d.ts.map +1 -0
  103. package/dist/types/evm/types.d.ts +108 -0
  104. package/dist/types/evm/types.d.ts.map +1 -0
  105. package/dist/types/index.d.ts +78 -0
  106. package/dist/types/index.d.ts.map +1 -0
  107. package/dist/types/near/helpers/core.d.ts +18 -0
  108. package/dist/types/near/helpers/core.d.ts.map +1 -0
  109. package/dist/types/near/helpers/gasEstimation.d.ts +41 -0
  110. package/dist/types/near/helpers/gasEstimation.d.ts.map +1 -0
  111. package/dist/types/near/helpers/nep141.d.ts +36 -0
  112. package/dist/types/near/helpers/nep141.d.ts.map +1 -0
  113. package/dist/types/near/index.d.ts +10 -0
  114. package/dist/types/near/index.d.ts.map +1 -0
  115. package/dist/types/near/toolbox.d.ts +35 -0
  116. package/dist/types/near/toolbox.d.ts.map +1 -0
  117. package/dist/types/near/types/contract.d.ts +38 -0
  118. package/dist/types/near/types/contract.d.ts.map +1 -0
  119. package/dist/types/near/types/nep141.d.ts +29 -0
  120. package/dist/types/near/types/nep141.d.ts.map +1 -0
  121. package/dist/types/near/types/toolbox.d.ts +51 -0
  122. package/dist/types/near/types/toolbox.d.ts.map +1 -0
  123. package/dist/types/near/types.d.ts +47 -0
  124. package/dist/types/near/types.d.ts.map +1 -0
  125. package/dist/types/radix/index.d.ts +17 -0
  126. package/dist/types/radix/index.d.ts.map +1 -0
  127. package/dist/types/ripple/index.d.ts +49 -0
  128. package/dist/types/ripple/index.d.ts.map +1 -0
  129. package/dist/types/solana/index.d.ts +23 -0
  130. package/dist/types/solana/index.d.ts.map +1 -0
  131. package/dist/types/solana/toolbox.d.ts +54 -0
  132. package/dist/types/solana/toolbox.d.ts.map +1 -0
  133. package/dist/types/substrate/balance.d.ts +20 -0
  134. package/dist/types/substrate/balance.d.ts.map +1 -0
  135. package/dist/types/substrate/index.d.ts +3 -0
  136. package/dist/types/substrate/index.d.ts.map +1 -0
  137. package/dist/types/substrate/substrate.d.ts +151 -0
  138. package/dist/types/substrate/substrate.d.ts.map +1 -0
  139. package/dist/types/substrate/types.d.ts +100 -0
  140. package/dist/types/substrate/types.d.ts.map +1 -0
  141. package/dist/types/sui/index.d.ts +3 -0
  142. package/dist/types/sui/index.d.ts.map +1 -0
  143. package/dist/types/sui/toolbox.d.ts +22 -0
  144. package/dist/types/sui/toolbox.d.ts.map +1 -0
  145. package/dist/types/sui/types.d.ts +16 -0
  146. package/dist/types/sui/types.d.ts.map +1 -0
  147. package/dist/types/ton/index.d.ts +3 -0
  148. package/dist/types/ton/index.d.ts.map +1 -0
  149. package/dist/types/ton/toolbox.d.ts +17 -0
  150. package/dist/types/ton/toolbox.d.ts.map +1 -0
  151. package/dist/types/ton/types.d.ts +22 -0
  152. package/dist/types/ton/types.d.ts.map +1 -0
  153. package/dist/types/tron/helpers/trc20.abi.d.ts +156 -0
  154. package/dist/types/tron/helpers/trc20.abi.d.ts.map +1 -0
  155. package/dist/types/tron/helpers/trongrid.d.ts +11 -0
  156. package/dist/types/tron/helpers/trongrid.d.ts.map +1 -0
  157. package/dist/types/tron/index.d.ts +6 -0
  158. package/dist/types/tron/index.d.ts.map +1 -0
  159. package/dist/types/tron/toolbox.d.ts +29 -0
  160. package/dist/types/tron/toolbox.d.ts.map +1 -0
  161. package/dist/types/tron/types.d.ts +103 -0
  162. package/dist/types/tron/types.d.ts.map +1 -0
  163. package/dist/types/types.d.ts +26 -0
  164. package/dist/types/types.d.ts.map +1 -0
  165. package/dist/types/utils.d.ts +7 -0
  166. package/dist/types/utils.d.ts.map +1 -0
  167. package/dist/types/utxo/helpers/api.d.ts +104 -0
  168. package/dist/types/utxo/helpers/api.d.ts.map +1 -0
  169. package/dist/types/utxo/helpers/bchaddrjs.d.ts +13 -0
  170. package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -0
  171. package/dist/types/utxo/helpers/coinselect.d.ts +20 -0
  172. package/dist/types/utxo/helpers/coinselect.d.ts.map +1 -0
  173. package/dist/types/utxo/helpers/index.d.ts +5 -0
  174. package/dist/types/utxo/helpers/index.d.ts.map +1 -0
  175. package/dist/types/utxo/helpers/txSize.d.ts +24 -0
  176. package/dist/types/utxo/helpers/txSize.d.ts.map +1 -0
  177. package/dist/types/utxo/index.d.ts +7 -0
  178. package/dist/types/utxo/index.d.ts.map +1 -0
  179. package/dist/types/utxo/toolbox/bitcoinCash.d.ts +96 -0
  180. package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -0
  181. package/dist/types/utxo/toolbox/index.d.ts +31 -0
  182. package/dist/types/utxo/toolbox/index.d.ts.map +1 -0
  183. package/dist/types/utxo/toolbox/params.d.ts +32 -0
  184. package/dist/types/utxo/toolbox/params.d.ts.map +1 -0
  185. package/dist/types/utxo/toolbox/utxo.d.ts +106 -0
  186. package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -0
  187. package/dist/types/utxo/toolbox/validators.d.ts +4 -0
  188. package/dist/types/utxo/toolbox/validators.d.ts.map +1 -0
  189. package/dist/types/utxo/toolbox/zcash.d.ts +75 -0
  190. package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -0
  191. package/dist/types/utxo/types.d.ts +46 -0
  192. package/dist/types/utxo/types.d.ts.map +1 -0
  193. package/package.json +205 -0
  194. package/src/__tests__/address-validation-all-chains.test.ts +162 -0
  195. package/src/__tests__/addressValidator.test.ts +162 -0
  196. package/src/cardano/__tests__/toolbox.test.ts +48 -0
  197. package/src/cardano/index.ts +2 -0
  198. package/src/cardano/toolbox.ts +172 -0
  199. package/src/cardano/types.ts +10 -0
  200. package/src/cosmos/__tests__/toolbox.test.ts +95 -0
  201. package/src/cosmos/index.ts +4 -0
  202. package/src/cosmos/thorchainUtils/addressFormat.ts +26 -0
  203. package/src/cosmos/thorchainUtils/index.ts +4 -0
  204. package/src/cosmos/thorchainUtils/messages.ts +216 -0
  205. package/src/cosmos/thorchainUtils/registry.ts +43 -0
  206. package/src/cosmos/thorchainUtils/types/MsgCompiled.ts +2800 -0
  207. package/src/cosmos/thorchainUtils/types/client-types.ts +54 -0
  208. package/src/cosmos/thorchainUtils/types/index.ts +1 -0
  209. package/src/cosmos/toolbox/cosmos.ts +354 -0
  210. package/src/cosmos/toolbox/index.ts +39 -0
  211. package/src/cosmos/toolbox/thorchain.ts +253 -0
  212. package/src/cosmos/types.ts +48 -0
  213. package/src/cosmos/util.ts +218 -0
  214. package/src/evm/__tests__/address-validation.test.ts +84 -0
  215. package/src/evm/__tests__/ethereum.test.ts +141 -0
  216. package/src/evm/__tests__/signMessage.test.ts +60 -0
  217. package/src/evm/api.ts +10 -0
  218. package/src/evm/contracts/eth/multicall.ts +165 -0
  219. package/src/evm/contracts/op/gasOracle.ts +145 -0
  220. package/src/evm/helpers.ts +71 -0
  221. package/src/evm/index.ts +4 -0
  222. package/src/evm/toolbox/baseEVMToolbox.ts +701 -0
  223. package/src/evm/toolbox/evm.ts +66 -0
  224. package/src/evm/toolbox/index.ts +44 -0
  225. package/src/evm/toolbox/op.ts +147 -0
  226. package/src/evm/types.ts +146 -0
  227. package/src/index.ts +264 -0
  228. package/src/near/__tests__/core.test.ts +70 -0
  229. package/src/near/helpers/core.ts +89 -0
  230. package/src/near/helpers/gasEstimation.ts +96 -0
  231. package/src/near/helpers/nep141.ts +50 -0
  232. package/src/near/index.ts +21 -0
  233. package/src/near/toolbox.ts +425 -0
  234. package/src/near/types/contract.ts +32 -0
  235. package/src/near/types/nep141.ts +34 -0
  236. package/src/near/types/toolbox.ts +55 -0
  237. package/src/near/types.ts +44 -0
  238. package/src/radix/index.ts +142 -0
  239. package/src/ripple/index.ts +180 -0
  240. package/src/solana/index.ts +36 -0
  241. package/src/solana/toolbox.ts +413 -0
  242. package/src/substrate/balance.ts +92 -0
  243. package/src/substrate/index.ts +2 -0
  244. package/src/substrate/substrate.ts +285 -0
  245. package/src/substrate/types.ts +115 -0
  246. package/src/sui/__tests__/toolbox.test.ts +86 -0
  247. package/src/sui/index.ts +2 -0
  248. package/src/sui/toolbox.ts +170 -0
  249. package/src/sui/types.ts +11 -0
  250. package/src/ton/__tests__/toolbox.test.ts +67 -0
  251. package/src/ton/index.ts +2 -0
  252. package/src/ton/toolbox.ts +140 -0
  253. package/src/ton/types.ts +13 -0
  254. package/src/tron/__tests__/toolbox.test.ts +225 -0
  255. package/src/tron/helpers/trc20.abi.ts +107 -0
  256. package/src/tron/helpers/trongrid.ts +57 -0
  257. package/src/tron/index.ts +21 -0
  258. package/src/tron/toolbox.ts +589 -0
  259. package/src/tron/types.ts +83 -0
  260. package/src/types.ts +28 -0
  261. package/src/utils.ts +38 -0
  262. package/src/utxo/__tests__/zcash-integration.test.ts +97 -0
  263. package/src/utxo/helpers/api.ts +475 -0
  264. package/src/utxo/helpers/bchaddrjs.ts +170 -0
  265. package/src/utxo/helpers/coinselect.ts +96 -0
  266. package/src/utxo/helpers/index.ts +4 -0
  267. package/src/utxo/helpers/txSize.ts +141 -0
  268. package/src/utxo/index.ts +6 -0
  269. package/src/utxo/toolbox/bitcoinCash.ts +247 -0
  270. package/src/utxo/toolbox/index.ts +63 -0
  271. package/src/utxo/toolbox/params.ts +18 -0
  272. package/src/utxo/toolbox/utxo.ts +443 -0
  273. package/src/utxo/toolbox/validators.ts +36 -0
  274. package/src/utxo/toolbox/zcash.ts +246 -0
  275. package/src/utxo/types.ts +39 -0
@@ -0,0 +1,47 @@
1
+ import type { Signer } from "@near-js/signers";
2
+ import type { SignedTransaction, Transaction } from "@near-js/transactions";
3
+ import type { ChainSigner, DerivationPathArray, GenericCreateTransactionParams, GenericTransferParams } from "@tcswap/helpers";
4
+ export interface NearSigner extends Signer, Omit<ChainSigner<Transaction, SignedTransaction>, "signTransaction"> {
5
+ signAndSendTransactions?(params: {
6
+ transactions: Transaction[];
7
+ }): Promise<string>;
8
+ }
9
+ export type NearToolboxParams = {
10
+ signer?: NearSigner;
11
+ accountId?: string;
12
+ } | {
13
+ phrase?: string;
14
+ index?: number;
15
+ derivationPath?: DerivationPathArray;
16
+ };
17
+ export interface NearTransferParams extends GenericTransferParams {
18
+ }
19
+ export interface NearConfig {
20
+ networkId: "mainnet" | "testnet" | "betanet";
21
+ nodeUrl: string;
22
+ walletUrl?: string;
23
+ helperUrl?: string;
24
+ keyStore?: any;
25
+ }
26
+ export interface NearFunctionCallParams {
27
+ contractId: string;
28
+ methodName: string;
29
+ args: Uint8Array | Record<string, any>;
30
+ deposit?: bigint | string | number;
31
+ gas?: bigint | string | number;
32
+ }
33
+ export interface NearCreateTransactionParams extends Omit<GenericCreateTransactionParams, "feeRate"> {
34
+ attachedDeposit?: string;
35
+ functionCall?: {
36
+ methodName: string;
37
+ args: object;
38
+ attachedDeposit: string;
39
+ gas: string;
40
+ contractId: string;
41
+ };
42
+ }
43
+ export * from "./toolbox";
44
+ export * from "./types/contract";
45
+ export * from "./types/nep141";
46
+ export * from "./types/toolbox";
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/near/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,UAAW,SAAQ,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAC9G,uBAAuB,CAAC,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,WAAW,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACpF;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAE9E,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;CAAG;AAEpE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC;IAClG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/G;AAED,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import type { GatewayApiClient } from "@radixdlt/babylon-gateway-api-sdk";
5
+ import { AssetValue, type USwapConfigIntegrations } from "@tcswap/helpers";
6
+ export type RadixWallet = Awaited<ReturnType<typeof RadixToolbox>>;
7
+ export declare function radixValidateAddress(address: string): boolean;
8
+ export declare const RadixToolbox: ({ dappConfig }?: {
9
+ dappConfig?: USwapConfigIntegrations["radix"];
10
+ }) => Promise<{
11
+ getAddress: () => string;
12
+ getBalance: (address: string) => Promise<AssetValue[]>;
13
+ networkApi: GatewayApiClient;
14
+ signAndBroadcast: (params: any) => Promise<string>;
15
+ validateAddress: typeof radixValidateAddress;
16
+ }>;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/radix/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAEV,gBAAgB,EAIjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAsB,KAAK,uBAAuB,EAAc,MAAM,iBAAiB,CAAC;AAE3G,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAInE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,WAEnD;AAwGD,eAAO,MAAM,YAAY,GAAU,iBAAgB;IAAE,UAAU,CAAC,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAA;CAAO;;0BArG7D,MAAM;;sBAoHxC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC;;EAGzC,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import { AssetValue, type ChainSigner, type GenericTransferParams } from "@tcswap/helpers";
5
+ import type { Transaction } from "xrpl";
6
+ import { type Payment } from "xrpl";
7
+ export type RippleWallet = Awaited<ReturnType<typeof getRippleToolbox>>;
8
+ export { hashes, type Transaction } from "xrpl";
9
+ declare function createSigner(phrase: string): ChainSigner<Transaction, {
10
+ tx_blob: string;
11
+ hash: string;
12
+ }>;
13
+ export declare function rippleValidateAddress(address: string): boolean;
14
+ type RippleToolboxParams = {
15
+ phrase?: string;
16
+ } | {
17
+ signer?: ChainSigner<Transaction, {
18
+ tx_blob: string;
19
+ hash: string;
20
+ }>;
21
+ };
22
+ export declare const getRippleToolbox: (params?: RippleToolboxParams) => Promise<{
23
+ broadcastTransaction: (signedTxHex: string) => Promise<string>;
24
+ createSigner: typeof createSigner;
25
+ createTransaction: ({ assetValue, recipient, memo, sender, }: {
26
+ assetValue: AssetValue;
27
+ recipient: string;
28
+ sender?: string;
29
+ memo?: string;
30
+ }) => Promise<Payment>;
31
+ disconnect: () => Promise<void>;
32
+ estimateTransactionFee: () => Promise<AssetValue>;
33
+ getAddress: () => string | Promise<string>;
34
+ getBalance: (address?: string) => Promise<AssetValue[]>;
35
+ signer: ChainSigner<Transaction, {
36
+ tx_blob: string;
37
+ hash: string;
38
+ }> | undefined;
39
+ signTransaction: (tx: Transaction) => {
40
+ tx_blob: string;
41
+ hash: string;
42
+ } | Promise<{
43
+ tx_blob: string;
44
+ hash: string;
45
+ }>;
46
+ transfer: (params: GenericTransferParams) => Promise<string>;
47
+ validateAddress: typeof rippleValidateAddress;
48
+ }>;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ripple/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,EAEV,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAK3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAA0B,KAAK,OAAO,EAAsB,MAAM,MAAM,CAAC;AAEhF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,MAAM,CAAC;AAKhD,iBAAS,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CASjG;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,WAEpD;AAED,KAAK,mBAAmB,GACpB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAE7E,eAAO,MAAM,gBAAgB,GAAU,SAAQ,mBAAwB;wCAkGpB,MAAM;;kEAtCpD;QACD,UAAU,EAAE,UAAU,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;;;;2BA1CmC,MAAM;;iBAzBO,MAAM;cAAQ,MAAM;;0BA6FxC,WAAW;iBA7FS,MAAM;cAAQ,MAAM;;iBAApB,MAAM;cAAQ,MAAM;;uBA+GrC,qBAAqB;;EA2BtD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { PublicKey, Transaction, VersionedTransaction } from "@solana/web3.js";
2
+ import type { GenericCreateTransactionParams, GenericTransferParams } from "@tcswap/helpers";
3
+ import type { getSolanaToolbox } from "./toolbox";
4
+ interface ConnectOpts {
5
+ onlyIfTrusted: boolean;
6
+ }
7
+ export * from "./toolbox";
8
+ export type SolanaWallet = Awaited<ReturnType<typeof getSolanaToolbox>>;
9
+ export interface SolanaProvider {
10
+ connect: (opts?: Partial<ConnectOpts>) => Promise<{
11
+ publicKey: PublicKey;
12
+ }>;
13
+ disconnect: () => Promise<void>;
14
+ publicKey: PublicKey | null;
15
+ signTransaction: <T extends Transaction | VersionedTransaction = Transaction>(transaction: T) => Promise<T>;
16
+ }
17
+ export type SolanaCreateTransactionParams = Omit<GenericCreateTransactionParams, "feeRate"> & {
18
+ isProgramDerivedAddress?: boolean;
19
+ };
20
+ export type SolanaTransferParams = Omit<GenericTransferParams, "feeRate"> & {
21
+ isProgramDerivedAddress?: boolean;
22
+ };
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/solana/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,KAAK,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAclD,UAAU,WAAW;IACnB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,cAAc,WAAW,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAC5E,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,CAAC,SAAS,WAAW,GAAG,oBAAoB,GAAG,WAAW,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC7G;AAED,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,GAAG;IAC5F,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import type { Connection, PublicKey, Signer, Transaction, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
5
+ import { AssetValue, type DerivationPathArray, type GenericCreateTransactionParams } from "@tcswap/helpers";
6
+ import type { SolanaCreateTransactionParams, SolanaProvider, SolanaTransferParams } from "./index";
7
+ type SolanaSigner = SolanaProvider | Signer;
8
+ type TokenMetadata = {
9
+ name: string;
10
+ symbol: string;
11
+ decimals: number;
12
+ logoURI?: string;
13
+ tags?: string[];
14
+ daily_volume?: number;
15
+ id: string;
16
+ };
17
+ export declare function fetchTokenMetaData(mintAddress: string): Promise<TokenMetadata | null>;
18
+ export declare function getSolanaAddressValidator(): Promise<(address: string) => boolean>;
19
+ export declare function getSolanaToolbox(toolboxParams?: {
20
+ signer?: SolanaSigner;
21
+ } | {
22
+ phrase?: string;
23
+ index?: number;
24
+ derivationPath?: DerivationPathArray;
25
+ }): Promise<{
26
+ broadcastTransaction: (transaction: Transaction | VersionedTransaction) => Promise<string>;
27
+ createKeysForPath: typeof createKeysForPath;
28
+ createTransaction: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender }: SolanaCreateTransactionParams) => Promise<Transaction>;
29
+ createTransactionFromInstructions: typeof createTransactionFromInstructions;
30
+ estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
31
+ isProgramDerivedAddress?: boolean;
32
+ }) => Promise<AssetValue>;
33
+ getAddress: () => string;
34
+ getAddressFromPubKey: typeof getAddressFromPubKey;
35
+ getAddressValidator: typeof getSolanaAddressValidator;
36
+ getBalance: (addressParam?: string) => Promise<AssetValue[]>;
37
+ getConnection: typeof getConnection;
38
+ getPubkeyFromAddress: typeof getPubkeyFromAddress;
39
+ signTransaction: (transaction: Transaction | VersionedTransaction) => Promise<Transaction | VersionedTransaction>;
40
+ transfer: ({ recipient, assetValue, memo, isProgramDerivedAddress }: SolanaTransferParams) => Promise<string>;
41
+ }>;
42
+ declare function getConnection(): Promise<Connection>;
43
+ declare function createTransactionFromInstructions({ instructions, }: {
44
+ instructions: TransactionInstruction[];
45
+ isProgramDerivedAddress?: boolean;
46
+ }): Promise<Transaction>;
47
+ export declare function createKeysForPath({ phrase, derivationPath, }: {
48
+ phrase: string;
49
+ derivationPath?: string;
50
+ }): Promise<import("@solana/web3.js").Keypair>;
51
+ declare function getAddressFromPubKey(publicKey: PublicKey): string;
52
+ declare function getPubkeyFromAddress(address: string): Promise<PublicKey>;
53
+ export {};
54
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/solana/toolbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,EAGV,KAAK,mBAAmB,EAExB,KAAK,8BAA8B,EAMpC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,6BAA6B,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEnG,KAAK,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAE5C,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA0B3F;AAiCD,wBAAsB,yBAAyB,sBAG5B,MAAM,cAQxB;AAED,wBAAsB,gBAAgB,CACpC,aAAa,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAA;CAAE;wCAqP1F,WAAW,GAAG,oBAAoB;;0FA5EmB,6BAA6B;;gGAzH1G,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,GAAG;QAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;KAAE;;;;gCA9BvD,MAAM;;;mCA0Od,WAAW,GAAG,oBAAoB;yEAlCW,oBAAoB;GAnL7F;AAiCD,iBAAe,aAAa,wBAI3B;AA6HD,iBAAe,iCAAiC,CAAC,EAC/C,YAAY,GACb,EAAE;IACD,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,wBASA;AA6DD,wBAAsB,iBAAiB,CAAC,EACtC,MAAM,EACN,cAAmC,GACpC,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,8CAQA;AAED,iBAAS,oBAAoB,CAAC,SAAS,EAAE,SAAS,UAEjD;AAED,iBAAe,oBAAoB,CAAC,OAAO,EAAE,MAAM,sBAGlD"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import type { ApiPromise } from "@polkadot/api";
5
+ import { AssetValue, Chain } from "@tcswap/helpers";
6
+ /**
7
+ * Get balance for standard Substrate chains (Polkadot, etc.)
8
+ * Uses api.query.system.account to query free and reserved balances
9
+ */
10
+ export declare function getSubstrateBalance(api: ApiPromise, gasAsset: AssetValue, address: string): Promise<AssetValue[]>;
11
+ /**
12
+ * Get balance for Chainflip chain
13
+ * Uses api.query.flip.account to query FLIP balances
14
+ */
15
+ export declare function getChainflipBalance(api: ApiPromise, gasAsset: AssetValue, address: string): Promise<AssetValue[]>;
16
+ /**
17
+ * Factory function to create chain-specific balance getter
18
+ */
19
+ export declare function createBalanceGetter(chain: Chain, api: ApiPromise): (address: string) => Promise<AssetValue[]>;
20
+ //# sourceMappingURL=balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/substrate/balance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAe,MAAM,iBAAiB,CAAC;AAEjE;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,EAAE,CAAC,CAsBvB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,EAAE,CAAC,CA2BvB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,IACpC,SAAS,MAAM,KAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAWnE"}
@@ -0,0 +1,3 @@
1
+ export * from "./substrate";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/substrate/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import type { ApiPromise } from "@polkadot/api";
5
+ import type { SubmittableExtrinsic } from "@polkadot/api/types";
6
+ import type { KeyringPair } from "@polkadot/keyring/types";
7
+ import type { Callback, IKeyringPair, ISubmittableResult, Signer } from "@polkadot/types/types";
8
+ import { AssetValue, type DerivationPathArray, type GenericCreateTransactionParams, type SubstrateChain } from "@tcswap/helpers";
9
+ import { SubstrateNetwork, type SubstrateTransferParams } from "./types";
10
+ export declare const PolkadotToolbox: ({ generic, ...signerParams }?: ToolboxParams) => Promise<{
11
+ api: ApiPromise;
12
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
13
+ convertAddress: typeof convertAddress;
14
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
15
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
16
+ decodeAddress: typeof decodeAddress;
17
+ encodeAddress: typeof encodeAddress;
18
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
19
+ gasAsset: AssetValue;
20
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
21
+ getBalance: (address: string) => Promise<AssetValue[]>;
22
+ network: SubstrateNetwork;
23
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
24
+ signAndBroadcast: ({ tx, callback, address, }: {
25
+ tx: SubmittableExtrinsic<"promise">;
26
+ callback?: Callback<ISubmittableResult>;
27
+ address?: string;
28
+ }) => string | Promise<string> | Promise<() => void>;
29
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
30
+ validateAddress: (address: string) => boolean;
31
+ }>;
32
+ export declare const ChainflipToolbox: ({ generic, ...signerParams }?: ToolboxParams) => Promise<{
33
+ api: ApiPromise;
34
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
35
+ convertAddress: typeof convertAddress;
36
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
37
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
38
+ decodeAddress: typeof decodeAddress;
39
+ encodeAddress: typeof encodeAddress;
40
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
41
+ gasAsset: AssetValue;
42
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
43
+ getBalance: (address: string) => Promise<AssetValue[]>;
44
+ network: SubstrateNetwork;
45
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
46
+ signAndBroadcast: ({ tx, callback, address, }: {
47
+ tx: SubmittableExtrinsic<"promise">;
48
+ callback?: Callback<ISubmittableResult>;
49
+ address?: string;
50
+ }) => string | Promise<string> | Promise<() => void>;
51
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
52
+ validateAddress: (address: string) => boolean;
53
+ }>;
54
+ export type SubstrateToolboxes = {
55
+ DOT: Awaited<ReturnType<typeof PolkadotToolbox>>;
56
+ FLIP: Awaited<ReturnType<typeof ChainflipToolbox>>;
57
+ };
58
+ export declare function getSubstrateToolbox<T extends SubstrateChain>(chain: T, params?: ToolboxParams): Promise<{
59
+ api: ApiPromise;
60
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
61
+ convertAddress: typeof convertAddress;
62
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
63
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
64
+ decodeAddress: typeof decodeAddress;
65
+ encodeAddress: typeof encodeAddress;
66
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
67
+ gasAsset: AssetValue;
68
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
69
+ getBalance: (address: string) => Promise<AssetValue[]>;
70
+ network: SubstrateNetwork;
71
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
72
+ signAndBroadcast: ({ tx, callback, address, }: {
73
+ tx: SubmittableExtrinsic<"promise">;
74
+ callback?: Callback<ISubmittableResult>;
75
+ address?: string;
76
+ }) => string | Promise<string> | Promise<() => void>;
77
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
78
+ validateAddress: (address: string) => boolean;
79
+ }>;
80
+ export declare function isKeyringPair(account: IKeyringPair | Signer): account is IKeyringPair;
81
+ export declare function createKeyring(phrase: string, networkPrefix: number): Promise<KeyringPair>;
82
+ declare function convertAddress(address: string, newPrefix: number): string;
83
+ declare function decodeAddress(address: string, networkPrefix?: number): Uint8Array<ArrayBufferLike>;
84
+ declare function encodeAddress(address: Uint8Array, encoding?: "ss58" | "hex", networkPrefix?: number): string;
85
+ export declare const BaseSubstrateToolbox: ({ api, network, gasAsset, signer, chain, }: {
86
+ api: ApiPromise;
87
+ network: SubstrateNetwork;
88
+ gasAsset: AssetValue;
89
+ signer?: IKeyringPair | Signer;
90
+ chain?: SubstrateChain;
91
+ }) => {
92
+ api: ApiPromise;
93
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
94
+ convertAddress: typeof convertAddress;
95
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
96
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
97
+ decodeAddress: typeof decodeAddress;
98
+ encodeAddress: typeof encodeAddress;
99
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
100
+ gasAsset: AssetValue;
101
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
102
+ getBalance: (address: string) => Promise<AssetValue[]>;
103
+ network: SubstrateNetwork;
104
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
105
+ signAndBroadcast: ({ tx, callback, address, }: {
106
+ tx: SubmittableExtrinsic<"promise">;
107
+ callback?: Callback<ISubmittableResult>;
108
+ address?: string;
109
+ }) => string | Promise<string> | Promise<() => void>;
110
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
111
+ validateAddress: (address: string) => boolean;
112
+ };
113
+ export declare const substrateValidateAddress: ({ address, chain }: {
114
+ address: string;
115
+ chain: SubstrateChain;
116
+ }) => boolean;
117
+ export declare function createSubstrateToolbox({ generic, chain, ...signerParams }: ToolboxParams & {
118
+ chain: SubstrateChain;
119
+ }): Promise<{
120
+ api: ApiPromise;
121
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
122
+ convertAddress: typeof convertAddress;
123
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
124
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
125
+ decodeAddress: typeof decodeAddress;
126
+ encodeAddress: typeof encodeAddress;
127
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
128
+ gasAsset: AssetValue;
129
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
130
+ getBalance: (address: string) => Promise<AssetValue[]>;
131
+ network: SubstrateNetwork;
132
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
133
+ signAndBroadcast: ({ tx, callback, address, }: {
134
+ tx: SubmittableExtrinsic<"promise">;
135
+ callback?: Callback<ISubmittableResult>;
136
+ address?: string;
137
+ }) => string | Promise<string> | Promise<() => void>;
138
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
139
+ validateAddress: (address: string) => boolean;
140
+ }>;
141
+ export type ToolboxParams = {
142
+ generic?: boolean;
143
+ } & ({
144
+ signer?: KeyringPair | Signer;
145
+ } | {
146
+ phrase?: string;
147
+ derivationPath?: DerivationPathArray;
148
+ index?: number;
149
+ });
150
+ export {};
151
+ //# sourceMappingURL=substrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"substrate.d.ts","sourceRoot":"","sources":["../../../src/substrate/substrate.ts"],"names":[],"mappings":"AA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GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,CAChD;IAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;CAAE,GACjC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAC5E,CAAC"}
@@ -0,0 +1,100 @@
1
+ import type { Signer as InjectedSigner } from "@polkadot/api/types";
2
+ import type { ProviderInterface } from "@polkadot/rpc-provider/types";
3
+ import type { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
4
+ import type { KeypairType } from "@polkadot/util-crypto/types";
5
+ import type { GenericTransferParams, SubstrateChain } from "@tcswap/helpers";
6
+ declare const polkadotNetwork: {
7
+ decimals: number[];
8
+ displayName: string;
9
+ network: string;
10
+ prefix: number;
11
+ standardAccount: string;
12
+ symbols: string[];
13
+ website: string;
14
+ };
15
+ declare const chainflipNetwork: {
16
+ decimals: number[];
17
+ displayName: string;
18
+ network: string;
19
+ prefix: number;
20
+ standardAccount: string;
21
+ symbols: string[];
22
+ website: string;
23
+ };
24
+ declare const subtrateNetwork: {
25
+ decimals: never[];
26
+ displayName: string;
27
+ network: string;
28
+ prefix: number;
29
+ standardAccount: string;
30
+ symbols: never[];
31
+ website: string;
32
+ };
33
+ export declare const SubstrateNetwork: Record<SubstrateChain | "GENERIC", SubstrateNetwork>;
34
+ export type SubstrateNetwork = typeof polkadotNetwork | typeof chainflipNetwork | typeof subtrateNetwork;
35
+ export type SubstrateTransferParams = GenericTransferParams & {
36
+ sender?: string;
37
+ };
38
+ type Unsubcall = () => void;
39
+ interface InjectedAccount {
40
+ address: string;
41
+ genesisHash?: string | null;
42
+ name?: string;
43
+ type?: KeypairType;
44
+ }
45
+ interface InjectedAccounts {
46
+ get: (anyType?: boolean) => Promise<InjectedAccount[]>;
47
+ subscribe: (cb: (accounts: InjectedAccount[]) => void | Promise<void>) => Unsubcall;
48
+ }
49
+ interface InjectedExtensionInfo {
50
+ name: string;
51
+ version: string;
52
+ }
53
+ interface ProviderMeta {
54
+ network: string;
55
+ node: "full" | "light";
56
+ source: string;
57
+ transport: string;
58
+ }
59
+ interface MetadataDefBase {
60
+ chain: string;
61
+ genesisHash: string;
62
+ icon: string;
63
+ ss58Format: number;
64
+ chainType?: "substrate" | "ethereum";
65
+ }
66
+ interface MetadataDef extends MetadataDefBase {
67
+ color?: string;
68
+ specVersion: number;
69
+ tokenDecimals: number;
70
+ tokenSymbol: string;
71
+ types: Record<string, Record<string, string> | string>;
72
+ metaCalls?: string;
73
+ userExtensions?: ExtDef;
74
+ }
75
+ interface InjectedMetadataKnown {
76
+ genesisHash: string;
77
+ specVersion: number;
78
+ }
79
+ interface InjectedMetadata {
80
+ get: () => Promise<InjectedMetadataKnown[]>;
81
+ provide: (definition: MetadataDef) => Promise<boolean>;
82
+ }
83
+ type ProviderList = Record<string, ProviderMeta>;
84
+ interface InjectedProvider extends ProviderInterface {
85
+ listProviders: () => Promise<ProviderList>;
86
+ startProvider: (key: string) => Promise<ProviderMeta>;
87
+ }
88
+ type InjectedWalletData = {
89
+ accounts: InjectedAccounts;
90
+ metadata?: InjectedMetadata;
91
+ provider?: InjectedProvider;
92
+ signer: InjectedSigner;
93
+ };
94
+ export type SubstrateInjectedExtension = Record<string, {
95
+ connect?: (origin: string) => Promise<InjectedExtensionInfo & InjectedWalletData>;
96
+ enable?: (origin: string) => Promise<InjectedWalletData>;
97
+ version?: string;
98
+ }>;
99
+ export {};
100
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/substrate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,MAA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AAC;CACxB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC7C,MAAM,EACN;IACE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,GAAG,kBAAkB,CAAC,CAAC;IAClF,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./toolbox";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sui/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import { AssetValue } from "@tcswap/helpers";
5
+ import type { SuiCreateTransactionParams, SuiToolboxParams, SuiTransferParams } from "./types";
6
+ export declare function getSuiAddressValidator(): Promise<(address: string) => boolean>;
7
+ export declare function getSuiToolbox({ provider: providerParam, ...signerParams }?: SuiToolboxParams): Promise<{
8
+ createTransaction: ({ recipient, assetValue, gasBudget, sender }: SuiCreateTransactionParams) => Promise<{
9
+ tx: import("@mysten/sui/transactions").Transaction;
10
+ txBytes: Uint8Array<ArrayBuffer>;
11
+ }>;
12
+ estimateTransactionFee: (params?: SuiCreateTransactionParams) => Promise<AssetValue>;
13
+ getAddress: () => string;
14
+ getBalance: (targetAddress?: string) => Promise<AssetValue[]>;
15
+ signTransaction: (params: Uint8Array<ArrayBuffer> | SuiCreateTransactionParams | Awaited<ReturnType<({ recipient, assetValue, gasBudget, sender }: SuiCreateTransactionParams) => Promise<{
16
+ tx: import("@mysten/sui/transactions").Transaction;
17
+ txBytes: Uint8Array<ArrayBuffer>;
18
+ }>>>) => Promise<import("@mysten/sui/cryptography").SignatureWithBytes>;
19
+ transfer: ({ assetValue, gasBudget, recipient }: SuiTransferParams) => Promise<string>;
20
+ validateAddress: (address: string) => boolean;
21
+ }>;
22
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/sui/toolbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAqC,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/F,wBAAsB,sBAAsB,sBAGD,MAAM,cAOhD;AAED,wBAAsB,aAAa,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,GAAE,gBAAqB;sEA0EtB,0BAA0B;;;;sCAtB1D,0BAA0B;;iCAhC/B,MAAM;8BAwFtC,UAAU,CAAC,WAAW,CAAC,GAAG,0BAA0B,GAAG,OAAO,CAAC,UAAU,gDAlCJ,0BAA0B;;;OAkCI,CAAC;qDAehD,iBAAiB;+BApItC,MAAM;GA8JhD"}
@@ -0,0 +1,16 @@
1
+ import type { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
2
+ import type { GenericCreateTransactionParams, GenericTransferParams } from "@tcswap/helpers";
3
+ import type { getSuiToolbox } from "./toolbox";
4
+ export type SuiWallet = Awaited<ReturnType<typeof getSuiToolbox>>;
5
+ export type SuiCreateTransactionParams = Omit<GenericCreateTransactionParams, "feeRate"> & {
6
+ gasBudget?: number;
7
+ };
8
+ export type SuiTransferParams = Omit<GenericTransferParams, "feeRate"> & {
9
+ gasBudget?: number;
10
+ };
11
+ export type SuiToolboxParams = {
12
+ provider?: string;
13
+ phrase?: string;
14
+ signer?: Ed25519Keypair;
15
+ };
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sui/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC;AAElE,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./toolbox";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ton/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Modifications © 2025 Horizontal Systems.
3
+ */
4
+ import { AssetValue } from "@tcswap/helpers";
5
+ import type { Cell } from "@ton/ton";
6
+ import type { TONToolboxParams, TONTransferParams } from "./types";
7
+ export declare function getTONToolbox(toolboxParams?: TONToolboxParams): Promise<{
8
+ createTransaction: ({ assetValue, recipient, memo }: TONTransferParams) => Promise<Cell>;
9
+ estimateTransactionFee: () => Promise<AssetValue>;
10
+ getAddress: () => string;
11
+ getBalance: (address: string) => Promise<AssetValue[]>;
12
+ sendTransaction: (transferCell: Cell) => Promise<string>;
13
+ transfer: ({ assetValue, recipient, memo }: TONTransferParams) => Promise<string>;
14
+ validateAddress: (address: string) => boolean;
15
+ }>;
16
+ export declare function getTONAddressValidator(): Promise<(address: string) => boolean>;
17
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/ton/toolbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAkD,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,IAAI,EAA+C,MAAM,UAAU,CAAC;AAGlF,OAAO,KAAK,EAAa,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE9E,wBAAsB,aAAa,CAAC,aAAa,GAAE,gBAAqB;yDAqDJ,iBAAiB;;;0BAZhD,MAAM;oCA4CI,IAAI;gDAZQ,iBAAiB;+BAgDjC,MAAM;GAJhD;AAED,wBAAsB,sBAAsB,sBAED,MAAM,cAQhD"}
@@ -0,0 +1,22 @@
1
+ import type { AssetValue, DerivationPathArray, GenericTransferParams } from "@tcswap/helpers";
2
+ import type { getTONToolbox } from "./toolbox";
3
+ export type TONSigner = {
4
+ publicKey: any;
5
+ secretKey: any;
6
+ };
7
+ export type TONToolboxParams = {
8
+ provider?: string;
9
+ } & ({
10
+ signer?: TONSigner;
11
+ } | {
12
+ phrase?: string;
13
+ derivationPath?: DerivationPathArray;
14
+ index?: number;
15
+ });
16
+ export type TONTransferParams = GenericTransferParams & {
17
+ assetValue: AssetValue;
18
+ recipient: string;
19
+ memo?: string;
20
+ };
21
+ export type TONWallet = Awaited<ReturnType<typeof getTONToolbox>>;
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IAAE,SAAS,EAAE,GAAG,CAAC;IAAC,SAAS,EAAE,GAAG,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CACnD;IAAE,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAC5E,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC"}