@uswap/toolboxes 4.3.6

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 +34 -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 +5 -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 +208 -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 +62 -0
  76. package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -0
  77. package/dist/types/cosmos/toolbox/index.d.ts +15 -0
  78. package/dist/types/cosmos/toolbox/index.d.ts.map +1 -0
  79. package/dist/types/cosmos/toolbox/thorchain.d.ts +158 -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 +74 -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 +83 -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 +76 -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 +75 -0
  106. package/dist/types/index.d.ts.map +1 -0
  107. package/dist/types/near/helpers/core.d.ts +15 -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 +32 -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 +14 -0
  126. package/dist/types/radix/index.d.ts.map +1 -0
  127. package/dist/types/ripple/index.d.ts +46 -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 +51 -0
  132. package/dist/types/solana/toolbox.d.ts.map +1 -0
  133. package/dist/types/substrate/balance.d.ts +17 -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 +148 -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 +19 -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 +14 -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 +8 -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 +26 -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 +4 -0
  166. package/dist/types/utils.d.ts.map +1 -0
  167. package/dist/types/utxo/helpers/api.d.ts +101 -0
  168. package/dist/types/utxo/helpers/api.d.ts.map +1 -0
  169. package/dist/types/utxo/helpers/bchaddrjs.d.ts +10 -0
  170. package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -0
  171. package/dist/types/utxo/helpers/coinselect.d.ts +17 -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 +21 -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 +93 -0
  180. package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -0
  181. package/dist/types/utxo/toolbox/index.d.ts +28 -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 +103 -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 +72 -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 +168 -0
  199. package/src/cardano/types.ts +10 -0
  200. package/src/cosmos/__tests__/toolbox.test.ts +91 -0
  201. package/src/cosmos/index.ts +4 -0
  202. package/src/cosmos/thorchainUtils/addressFormat.ts +22 -0
  203. package/src/cosmos/thorchainUtils/index.ts +4 -0
  204. package/src/cosmos/thorchainUtils/messages.ts +212 -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 +345 -0
  210. package/src/cosmos/toolbox/index.ts +35 -0
  211. package/src/cosmos/toolbox/thorchain.ts +249 -0
  212. package/src/cosmos/types.ts +48 -0
  213. package/src/cosmos/util.ts +214 -0
  214. package/src/evm/__tests__/address-validation.test.ts +84 -0
  215. package/src/evm/__tests__/ethereum.test.ts +137 -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 +73 -0
  221. package/src/evm/index.ts +4 -0
  222. package/src/evm/toolbox/baseEVMToolbox.ts +695 -0
  223. package/src/evm/toolbox/evm.ts +67 -0
  224. package/src/evm/toolbox/index.ts +44 -0
  225. package/src/evm/toolbox/op.ts +156 -0
  226. package/src/evm/types.ts +146 -0
  227. package/src/index.ts +260 -0
  228. package/src/near/__tests__/core.test.ts +70 -0
  229. package/src/near/helpers/core.ts +85 -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 +421 -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 +132 -0
  239. package/src/ripple/index.ts +179 -0
  240. package/src/solana/index.ts +36 -0
  241. package/src/solana/toolbox.ts +415 -0
  242. package/src/substrate/balance.ts +88 -0
  243. package/src/substrate/index.ts +2 -0
  244. package/src/substrate/substrate.ts +281 -0
  245. package/src/substrate/types.ts +115 -0
  246. package/src/sui/__tests__/toolbox.test.ts +82 -0
  247. package/src/sui/index.ts +2 -0
  248. package/src/sui/toolbox.ts +165 -0
  249. package/src/sui/types.ts +11 -0
  250. package/src/ton/__tests__/toolbox.test.ts +63 -0
  251. package/src/ton/index.ts +2 -0
  252. package/src/ton/toolbox.ts +136 -0
  253. package/src/ton/types.ts +13 -0
  254. package/src/tron/__tests__/toolbox.test.ts +221 -0
  255. package/src/tron/helpers/trc20.abi.ts +107 -0
  256. package/src/tron/helpers/trongrid.ts +53 -0
  257. package/src/tron/index.ts +21 -0
  258. package/src/tron/toolbox.ts +585 -0
  259. package/src/tron/types.ts +83 -0
  260. package/src/types.ts +28 -0
  261. package/src/utils.ts +27 -0
  262. package/src/utxo/__tests__/zcash-integration.test.ts +97 -0
  263. package/src/utxo/helpers/api.ts +471 -0
  264. package/src/utxo/helpers/bchaddrjs.ts +166 -0
  265. package/src/utxo/helpers/coinselect.ts +92 -0
  266. package/src/utxo/helpers/index.ts +4 -0
  267. package/src/utxo/helpers/txSize.ts +137 -0
  268. package/src/utxo/index.ts +6 -0
  269. package/src/utxo/toolbox/bitcoinCash.ts +243 -0
  270. package/src/utxo/toolbox/index.ts +59 -0
  271. package/src/utxo/toolbox/params.ts +18 -0
  272. package/src/utxo/toolbox/utxo.ts +439 -0
  273. package/src/utxo/toolbox/validators.ts +36 -0
  274. package/src/utxo/toolbox/zcash.ts +245 -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 "@uswap/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,gBAAgB,CAAC;AAExB,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,14 @@
1
+ import type { GatewayApiClient } from "@radixdlt/babylon-gateway-api-sdk";
2
+ import { AssetValue, type SKConfigIntegrations } from "@uswap/helpers";
3
+ export type RadixWallet = Awaited<ReturnType<typeof RadixToolbox>>;
4
+ export declare function radixValidateAddress(address: string): boolean;
5
+ export declare const RadixToolbox: ({ dappConfig }?: {
6
+ dappConfig?: SKConfigIntegrations["radix"];
7
+ }) => Promise<{
8
+ getAddress: () => string;
9
+ getBalance: (address: string) => Promise<AssetValue[]>;
10
+ networkApi: GatewayApiClient;
11
+ signAndBroadcast: (params: any) => Promise<string>;
12
+ validateAddress: typeof radixValidateAddress;
13
+ }>;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/radix/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAIjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAmB,KAAK,oBAAoB,EAAgB,MAAM,gBAAgB,CAAC;AAEtG,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAInE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,WAEnD;AAkGD,eAAO,MAAM,YAAY,GAAU,iBAAgB;IAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAA;CAAO;;0BA/F1D,MAAM;;sBA8GxC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC;;EAGzC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { AssetValue, type ChainSigner, type GenericTransferParams } from "@uswap/helpers";
2
+ import type { Transaction } from "xrpl";
3
+ import { type Payment } from "xrpl";
4
+ export type RippleWallet = Awaited<ReturnType<typeof getRippleToolbox>>;
5
+ export { hashes, type Transaction } from "xrpl";
6
+ declare function createSigner(phrase: string): ChainSigner<Transaction, {
7
+ tx_blob: string;
8
+ hash: string;
9
+ }>;
10
+ export declare function rippleValidateAddress(address: string): boolean;
11
+ type RippleToolboxParams = {
12
+ phrase?: string;
13
+ } | {
14
+ signer?: ChainSigner<Transaction, {
15
+ tx_blob: string;
16
+ hash: string;
17
+ }>;
18
+ };
19
+ export declare const getRippleToolbox: (params?: RippleToolboxParams) => Promise<{
20
+ broadcastTransaction: (signedTxHex: string) => Promise<string>;
21
+ createSigner: typeof createSigner;
22
+ createTransaction: ({ assetValue, recipient, memo, sender, }: {
23
+ assetValue: AssetValue;
24
+ recipient: string;
25
+ sender?: string;
26
+ memo?: string;
27
+ }) => Promise<Payment>;
28
+ disconnect: () => Promise<void>;
29
+ estimateTransactionFee: () => Promise<AssetValue>;
30
+ getAddress: () => string | Promise<string>;
31
+ getBalance: (address?: string) => Promise<AssetValue[]>;
32
+ signer: ChainSigner<Transaction, {
33
+ tx_blob: string;
34
+ hash: string;
35
+ }> | undefined;
36
+ signTransaction: (tx: Transaction) => {
37
+ tx_blob: string;
38
+ hash: string;
39
+ } | Promise<{
40
+ tx_blob: string;
41
+ hash: string;
42
+ }>;
43
+ transfer: (params: GenericTransferParams) => Promise<string>;
44
+ validateAddress: typeof rippleValidateAddress;
45
+ }>;
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ripple/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAK3B,MAAM,gBAAgB,CAAC;AACxB,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;wCAqGpB,MAAM;;kEAzCpD;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;;0BAgGxC,WAAW;iBAhGS,MAAM;cAAQ,MAAM;;iBAApB,MAAM;cAAQ,MAAM;;uBAkHrC,qBAAqB;;EA2BtD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { PublicKey, Transaction, VersionedTransaction } from "@solana/web3.js";
2
+ import type { GenericCreateTransactionParams, GenericTransferParams } from "@uswap/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,gBAAgB,CAAC;AAC5F,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,51 @@
1
+ import type { Connection, PublicKey, Signer, Transaction, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
2
+ import { AssetValue, type DerivationPathArray, type GenericCreateTransactionParams } from "@uswap/helpers";
3
+ import type { SolanaCreateTransactionParams, SolanaProvider, SolanaTransferParams } from "./index";
4
+ type SolanaSigner = SolanaProvider | Signer;
5
+ type TokenMetadata = {
6
+ name: string;
7
+ symbol: string;
8
+ decimals: number;
9
+ logoURI?: string;
10
+ tags?: string[];
11
+ daily_volume?: number;
12
+ id: string;
13
+ };
14
+ export declare function fetchTokenMetaData(mintAddress: string): Promise<TokenMetadata | null>;
15
+ export declare function getSolanaAddressValidator(): Promise<(address: string) => boolean>;
16
+ export declare function getSolanaToolbox(toolboxParams?: {
17
+ signer?: SolanaSigner;
18
+ } | {
19
+ phrase?: string;
20
+ index?: number;
21
+ derivationPath?: DerivationPathArray;
22
+ }): Promise<{
23
+ broadcastTransaction: (transaction: Transaction | VersionedTransaction) => Promise<string>;
24
+ createKeysForPath: typeof createKeysForPath;
25
+ createTransaction: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender }: SolanaCreateTransactionParams) => Promise<Transaction>;
26
+ createTransactionFromInstructions: typeof createTransactionFromInstructions;
27
+ estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
28
+ isProgramDerivedAddress?: boolean;
29
+ }) => Promise<AssetValue>;
30
+ getAddress: () => string;
31
+ getAddressFromPubKey: typeof getAddressFromPubKey;
32
+ getAddressValidator: typeof getSolanaAddressValidator;
33
+ getBalance: (addressParam?: string) => Promise<AssetValue[]>;
34
+ getConnection: typeof getConnection;
35
+ getPubkeyFromAddress: typeof getPubkeyFromAddress;
36
+ signTransaction: (transaction: Transaction | VersionedTransaction) => Promise<Transaction | VersionedTransaction>;
37
+ transfer: ({ recipient, assetValue, memo, isProgramDerivedAddress }: SolanaTransferParams) => Promise<string>;
38
+ }>;
39
+ declare function getConnection(): Promise<Connection>;
40
+ declare function createTransactionFromInstructions({ instructions, }: {
41
+ instructions: TransactionInstruction[];
42
+ isProgramDerivedAddress?: boolean;
43
+ }): Promise<Transaction>;
44
+ export declare function createKeysForPath({ phrase, derivationPath, }: {
45
+ phrase: string;
46
+ derivationPath?: string;
47
+ }): Promise<import("@solana/web3.js").Keypair>;
48
+ declare function getAddressFromPubKey(publicKey: PublicKey): string;
49
+ declare function getPubkeyFromAddress(address: string): Promise<PublicKey>;
50
+ export {};
51
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/solana/toolbox.ts"],"names":[],"mappings":"AAAA,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,gBAAgB,CAAC;AAExB,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;AAuCD,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,17 @@
1
+ import type { ApiPromise } from "@polkadot/api";
2
+ import { AssetValue, Chain } from "@uswap/helpers";
3
+ /**
4
+ * Get balance for standard Substrate chains (Polkadot, etc.)
5
+ * Uses api.query.system.account to query free and reserved balances
6
+ */
7
+ export declare function getSubstrateBalance(api: ApiPromise, gasAsset: AssetValue, address: string): Promise<AssetValue[]>;
8
+ /**
9
+ * Get balance for Chainflip chain
10
+ * Uses api.query.flip.account to query FLIP balances
11
+ */
12
+ export declare function getChainflipBalance(api: ApiPromise, gasAsset: AssetValue, address: string): Promise<AssetValue[]>;
13
+ /**
14
+ * Factory function to create chain-specific balance getter
15
+ */
16
+ export declare function createBalanceGetter(chain: Chain, api: ApiPromise): (address: string) => Promise<AssetValue[]>;
17
+ //# sourceMappingURL=balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/substrate/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAiB,MAAM,gBAAgB,CAAC;AAElE;;;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,148 @@
1
+ import type { ApiPromise } from "@polkadot/api";
2
+ import type { SubmittableExtrinsic } from "@polkadot/api/types";
3
+ import type { KeyringPair } from "@polkadot/keyring/types";
4
+ import type { Callback, IKeyringPair, ISubmittableResult, Signer } from "@polkadot/types/types";
5
+ import { AssetValue, type DerivationPathArray, type GenericCreateTransactionParams, type SubstrateChain } from "@uswap/helpers";
6
+ import { SubstrateNetwork, type SubstrateTransferParams } from "./types";
7
+ export declare const PolkadotToolbox: ({ generic, ...signerParams }?: ToolboxParams) => Promise<{
8
+ api: ApiPromise;
9
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
10
+ convertAddress: typeof convertAddress;
11
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
12
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
13
+ decodeAddress: typeof decodeAddress;
14
+ encodeAddress: typeof encodeAddress;
15
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
16
+ gasAsset: AssetValue;
17
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
18
+ getBalance: (address: string) => Promise<AssetValue[]>;
19
+ network: SubstrateNetwork;
20
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
21
+ signAndBroadcast: ({ tx, callback, address, }: {
22
+ tx: SubmittableExtrinsic<"promise">;
23
+ callback?: Callback<ISubmittableResult>;
24
+ address?: string;
25
+ }) => string | Promise<string> | Promise<() => void>;
26
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
27
+ validateAddress: (address: string) => boolean;
28
+ }>;
29
+ export declare const ChainflipToolbox: ({ generic, ...signerParams }?: ToolboxParams) => Promise<{
30
+ api: ApiPromise;
31
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
32
+ convertAddress: typeof convertAddress;
33
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
34
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
35
+ decodeAddress: typeof decodeAddress;
36
+ encodeAddress: typeof encodeAddress;
37
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
38
+ gasAsset: AssetValue;
39
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
40
+ getBalance: (address: string) => Promise<AssetValue[]>;
41
+ network: SubstrateNetwork;
42
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
43
+ signAndBroadcast: ({ tx, callback, address, }: {
44
+ tx: SubmittableExtrinsic<"promise">;
45
+ callback?: Callback<ISubmittableResult>;
46
+ address?: string;
47
+ }) => string | Promise<string> | Promise<() => void>;
48
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
49
+ validateAddress: (address: string) => boolean;
50
+ }>;
51
+ export type SubstrateToolboxes = {
52
+ DOT: Awaited<ReturnType<typeof PolkadotToolbox>>;
53
+ FLIP: Awaited<ReturnType<typeof ChainflipToolbox>>;
54
+ };
55
+ export declare function getSubstrateToolbox<T extends SubstrateChain>(chain: T, params?: ToolboxParams): Promise<{
56
+ api: ApiPromise;
57
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
58
+ convertAddress: typeof convertAddress;
59
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
60
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
61
+ decodeAddress: typeof decodeAddress;
62
+ encodeAddress: typeof encodeAddress;
63
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
64
+ gasAsset: AssetValue;
65
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
66
+ getBalance: (address: string) => Promise<AssetValue[]>;
67
+ network: SubstrateNetwork;
68
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
69
+ signAndBroadcast: ({ tx, callback, address, }: {
70
+ tx: SubmittableExtrinsic<"promise">;
71
+ callback?: Callback<ISubmittableResult>;
72
+ address?: string;
73
+ }) => string | Promise<string> | Promise<() => void>;
74
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
75
+ validateAddress: (address: string) => boolean;
76
+ }>;
77
+ export declare function isKeyringPair(account: IKeyringPair | Signer): account is IKeyringPair;
78
+ export declare function createKeyring(phrase: string, networkPrefix: number): Promise<KeyringPair>;
79
+ declare function convertAddress(address: string, newPrefix: number): string;
80
+ declare function decodeAddress(address: string, networkPrefix?: number): Uint8Array<ArrayBufferLike>;
81
+ declare function encodeAddress(address: Uint8Array, encoding?: "ss58" | "hex", networkPrefix?: number): string;
82
+ export declare const BaseSubstrateToolbox: ({ api, network, gasAsset, signer, chain, }: {
83
+ api: ApiPromise;
84
+ network: SubstrateNetwork;
85
+ gasAsset: AssetValue;
86
+ signer?: IKeyringPair | Signer;
87
+ chain?: SubstrateChain;
88
+ }) => {
89
+ api: ApiPromise;
90
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
91
+ convertAddress: typeof convertAddress;
92
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
93
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
94
+ decodeAddress: typeof decodeAddress;
95
+ encodeAddress: typeof encodeAddress;
96
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
97
+ gasAsset: AssetValue;
98
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
99
+ getBalance: (address: string) => Promise<AssetValue[]>;
100
+ network: SubstrateNetwork;
101
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
102
+ signAndBroadcast: ({ tx, callback, address, }: {
103
+ tx: SubmittableExtrinsic<"promise">;
104
+ callback?: Callback<ISubmittableResult>;
105
+ address?: string;
106
+ }) => string | Promise<string> | Promise<() => void>;
107
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
108
+ validateAddress: (address: string) => boolean;
109
+ };
110
+ export declare const substrateValidateAddress: ({ address, chain }: {
111
+ address: string;
112
+ chain: SubstrateChain;
113
+ }) => boolean;
114
+ export declare function createSubstrateToolbox({ generic, chain, ...signerParams }: ToolboxParams & {
115
+ chain: SubstrateChain;
116
+ }): Promise<{
117
+ api: ApiPromise;
118
+ broadcast: (tx: SubmittableExtrinsic<"promise">, callback?: Callback<ISubmittableResult>) => Promise<string | (() => void)>;
119
+ convertAddress: typeof convertAddress;
120
+ createKeyring: (phrase: string) => Promise<KeyringPair>;
121
+ createTransaction: (params: GenericCreateTransactionParams) => SubmittableExtrinsic<"promise", ISubmittableResult> | undefined;
122
+ decodeAddress: typeof decodeAddress;
123
+ encodeAddress: typeof encodeAddress;
124
+ estimateTransactionFee: (params: SubstrateTransferParams) => Promise<AssetValue | undefined>;
125
+ gasAsset: AssetValue;
126
+ getAddress: (keyring?: IKeyringPair | Signer) => string | undefined;
127
+ getBalance: (address: string) => Promise<AssetValue[]>;
128
+ network: SubstrateNetwork;
129
+ sign: (tx: SubmittableExtrinsic<"promise">) => Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>;
130
+ signAndBroadcast: ({ tx, callback, address, }: {
131
+ tx: SubmittableExtrinsic<"promise">;
132
+ callback?: Callback<ISubmittableResult>;
133
+ address?: string;
134
+ }) => string | Promise<string> | Promise<() => void>;
135
+ transfer: (params: SubstrateTransferParams) => Promise<string>;
136
+ validateAddress: (address: string) => boolean;
137
+ }>;
138
+ export type ToolboxParams = {
139
+ generic?: boolean;
140
+ } & ({
141
+ signer?: KeyringPair | Signer;
142
+ } | {
143
+ phrase?: string;
144
+ derivationPath?: DerivationPathArray;
145
+ index?: number;
146
+ });
147
+ export {};
148
+ //# sourceMappingURL=substrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"substrate.d.ts","sourceRoot":"","sources":["../../../src/substrate/substrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGhG,OAAO,EACL,UAAU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adot/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 "@uswap/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,MAAM,EAAE,MAAM,kDAAkD,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE5E,QAAA,MAAM,eAAe;;;;;;;;CAQpB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;CAQrB,CAAC;AAEF,QAAA,MAAM,eAAe;;;;;;;;CAQpB,CAAC;AA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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,19 @@
1
+ import { AssetValue } from "@uswap/helpers";
2
+ import type { SuiCreateTransactionParams, SuiToolboxParams, SuiTransferParams } from "./types";
3
+ export declare function getSuiAddressValidator(): Promise<(address: string) => boolean>;
4
+ export declare function getSuiToolbox({ provider: providerParam, ...signerParams }?: SuiToolboxParams): Promise<{
5
+ createTransaction: ({ recipient, assetValue, gasBudget, sender }: SuiCreateTransactionParams) => Promise<{
6
+ tx: import("@mysten/sui/transactions").Transaction;
7
+ txBytes: Uint8Array<ArrayBuffer>;
8
+ }>;
9
+ estimateTransactionFee: (params?: SuiCreateTransactionParams) => Promise<AssetValue>;
10
+ getAddress: () => string;
11
+ getBalance: (targetAddress?: string) => Promise<AssetValue[]>;
12
+ signTransaction: (params: Uint8Array<ArrayBuffer> | SuiCreateTransactionParams | Awaited<ReturnType<({ recipient, assetValue, gasBudget, sender }: SuiCreateTransactionParams) => Promise<{
13
+ tx: import("@mysten/sui/transactions").Transaction;
14
+ txBytes: Uint8Array<ArrayBuffer>;
15
+ }>>>) => Promise<import("@mysten/sui/cryptography").SignatureWithBytes>;
16
+ transfer: ({ assetValue, gasBudget, recipient }: SuiTransferParams) => Promise<string>;
17
+ validateAddress: (address: string) => boolean;
18
+ }>;
19
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/sui/toolbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuC,MAAM,gBAAgB,CAAC;AAEjF,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;sEAyEtB,0BAA0B;;;;sCAtB1D,0BAA0B;;iCA/B/B,MAAM;8BAuFtC,UAAU,CAAC,WAAW,CAAC,GAAG,0BAA0B,GAAG,OAAO,CAAC,UAAU,gDAlCJ,0BAA0B;;;OAkCI,CAAC;qDAehD,iBAAiB;+BAnItC,MAAM;GA6JhD"}
@@ -0,0 +1,16 @@
1
+ import type { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
2
+ import type { GenericCreateTransactionParams, GenericTransferParams } from "@uswap/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,gBAAgB,CAAC;AAC5F,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,14 @@
1
+ import type { Cell } from "@ton/ton";
2
+ import { AssetValue } from "@uswap/helpers";
3
+ import type { TONToolboxParams, TONTransferParams } from "./types";
4
+ export declare function getTONToolbox(toolboxParams?: TONToolboxParams): Promise<{
5
+ createTransaction: ({ assetValue, recipient, memo }: TONTransferParams) => Promise<Cell>;
6
+ estimateTransactionFee: () => Promise<AssetValue>;
7
+ getAddress: () => string;
8
+ getBalance: (address: string) => Promise<AssetValue[]>;
9
+ sendTransaction: (transferCell: Cell) => Promise<string>;
10
+ transfer: ({ assetValue, recipient, memo }: TONTransferParams) => Promise<string>;
11
+ validateAddress: (address: string) => boolean;
12
+ }>;
13
+ export declare function getTONAddressValidator(): Promise<(address: string) => boolean>;
14
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/ton/toolbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA+C,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,UAAU,EAAsD,MAAM,gBAAgB,CAAC;AAGhG,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 "@uswap/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,gBAAgB,CAAC;AAC7F,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"}