@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,156 @@
1
+ export declare const trc20ABI: readonly [{
2
+ readonly constant: true;
3
+ readonly inputs: readonly [{
4
+ readonly name: "_owner";
5
+ readonly type: "address";
6
+ }];
7
+ readonly name: "balanceOf";
8
+ readonly outputs: readonly [{
9
+ readonly name: "balance";
10
+ readonly type: "uint256";
11
+ }];
12
+ readonly stateMutability: "view";
13
+ readonly type: "function";
14
+ }, {
15
+ readonly constant: false;
16
+ readonly inputs: readonly [{
17
+ readonly name: "_to";
18
+ readonly type: "address";
19
+ }, {
20
+ readonly name: "_value";
21
+ readonly type: "uint256";
22
+ }];
23
+ readonly name: "transfer";
24
+ readonly outputs: readonly [{
25
+ readonly name: "success";
26
+ readonly type: "bool";
27
+ }];
28
+ readonly stateMutability: "nonpayable";
29
+ readonly type: "function";
30
+ }, {
31
+ readonly constant: true;
32
+ readonly inputs: readonly [];
33
+ readonly name: "decimals";
34
+ readonly outputs: readonly [{
35
+ readonly name: "";
36
+ readonly type: "uint8";
37
+ }];
38
+ readonly stateMutability: "view";
39
+ readonly type: "function";
40
+ }, {
41
+ readonly constant: true;
42
+ readonly inputs: readonly [];
43
+ readonly name: "symbol";
44
+ readonly outputs: readonly [{
45
+ readonly name: "";
46
+ readonly type: "string";
47
+ }];
48
+ readonly stateMutability: "view";
49
+ readonly type: "function";
50
+ }, {
51
+ readonly constant: true;
52
+ readonly inputs: readonly [];
53
+ readonly name: "name";
54
+ readonly outputs: readonly [{
55
+ readonly name: "";
56
+ readonly type: "string";
57
+ }];
58
+ readonly stateMutability: "view";
59
+ readonly type: "function";
60
+ }, {
61
+ readonly constant: true;
62
+ readonly inputs: readonly [{
63
+ readonly name: "_owner";
64
+ readonly type: "address";
65
+ }, {
66
+ readonly name: "_spender";
67
+ readonly type: "address";
68
+ }];
69
+ readonly name: "allowance";
70
+ readonly outputs: readonly [{
71
+ readonly name: "remaining";
72
+ readonly type: "uint256";
73
+ }];
74
+ readonly stateMutability: "view";
75
+ readonly type: "function";
76
+ }, {
77
+ readonly constant: false;
78
+ readonly inputs: readonly [{
79
+ readonly name: "_spender";
80
+ readonly type: "address";
81
+ }, {
82
+ readonly name: "_value";
83
+ readonly type: "uint256";
84
+ }];
85
+ readonly name: "approve";
86
+ readonly outputs: readonly [{
87
+ readonly name: "success";
88
+ readonly type: "bool";
89
+ }];
90
+ readonly stateMutability: "nonpayable";
91
+ readonly type: "function";
92
+ }, {
93
+ readonly constant: true;
94
+ readonly inputs: readonly [];
95
+ readonly name: "totalSupply";
96
+ readonly outputs: readonly [{
97
+ readonly name: "";
98
+ readonly type: "uint256";
99
+ }];
100
+ readonly stateMutability: "view";
101
+ readonly type: "function";
102
+ }, {
103
+ readonly constant: false;
104
+ readonly inputs: readonly [{
105
+ readonly name: "_from";
106
+ readonly type: "address";
107
+ }, {
108
+ readonly name: "_to";
109
+ readonly type: "address";
110
+ }, {
111
+ readonly name: "_value";
112
+ readonly type: "uint256";
113
+ }];
114
+ readonly name: "transferFrom";
115
+ readonly outputs: readonly [{
116
+ readonly name: "success";
117
+ readonly type: "bool";
118
+ }];
119
+ readonly stateMutability: "nonpayable";
120
+ readonly type: "function";
121
+ }, {
122
+ readonly anonymous: false;
123
+ readonly inputs: readonly [{
124
+ readonly indexed: true;
125
+ readonly name: "_from";
126
+ readonly type: "address";
127
+ }, {
128
+ readonly indexed: true;
129
+ readonly name: "_to";
130
+ readonly type: "address";
131
+ }, {
132
+ readonly indexed: false;
133
+ readonly name: "_value";
134
+ readonly type: "uint256";
135
+ }];
136
+ readonly name: "Transfer";
137
+ readonly type: "event";
138
+ }, {
139
+ readonly anonymous: false;
140
+ readonly inputs: readonly [{
141
+ readonly indexed: true;
142
+ readonly name: "_owner";
143
+ readonly type: "address";
144
+ }, {
145
+ readonly indexed: true;
146
+ readonly name: "_spender";
147
+ readonly type: "address";
148
+ }, {
149
+ readonly indexed: false;
150
+ readonly name: "_value";
151
+ readonly type: "uint256";
152
+ }];
153
+ readonly name: "Approval";
154
+ readonly type: "event";
155
+ }];
156
+ //# sourceMappingURL=trc20.abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trc20.abi.d.ts","sourceRoot":"","sources":["../../../../src/tron/helpers/trc20.abi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GX,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Fetch account information including TRC20 balances from TronGrid API
3
+ */
4
+ export declare function fetchAccountFromTronGrid(address: string): Promise<{
5
+ balance: number;
6
+ trc20: import("../types").TronGridTRC20Balance;
7
+ } | undefined>;
8
+ //# sourceMappingURL=trongrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trongrid.d.ts","sourceRoot":"","sources":["../../../../src/tron/helpers/trongrid.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM;;;eA4C7D"}
@@ -0,0 +1,6 @@
1
+ export { trc20ABI } from "./helpers/trc20.abi";
2
+ export { createTronToolbox, getTronAddressValidator, getTronPrivateKeyFromMnemonic, } from "./toolbox";
3
+ export type { TronApprovedParams, TronApproveParams, TronContract, TronCreateTransactionParams, TronIsApprovedParams, TronSignedTransaction, TronSigner, TronToolboxOptions, TronTransaction, TronTransferParams, } from "./types";
4
+ import type { createTronToolbox } from "./toolbox";
5
+ export type TronWallet = Awaited<ReturnType<typeof createTronToolbox>>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tron/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { AssetValue } from "@uswap/helpers";
2
+ import type { TronWeb } from "tronweb";
3
+ import type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronSignedTransaction, TronToolboxOptions, TronTransaction, TronTransferParams } from "./types";
4
+ export declare function getTronAddressValidator(): Promise<(address: string) => boolean>;
5
+ export declare function getTronPrivateKeyFromMnemonic({ phrase, derivationPath: customPath, index, }: {
6
+ phrase: string;
7
+ derivationPath?: string;
8
+ index?: number;
9
+ }): Promise<string>;
10
+ export declare const createTronToolbox: (options?: TronToolboxOptions) => Promise<{
11
+ tronWeb: TronWeb;
12
+ getAddress: () => Promise<string>;
13
+ validateAddress: (address: string) => boolean;
14
+ getBalance: (address: string) => Promise<AssetValue[]>;
15
+ transfer: (params: TronTransferParams) => Promise<string>;
16
+ estimateTransactionFee: (params: TronTransferParams & {
17
+ sender?: string;
18
+ }) => Promise<AssetValue>;
19
+ createTransaction: (params: TronCreateTransactionParams) => Promise<TronTransaction>;
20
+ signTransaction: (transaction: TronTransaction) => Promise<TronSignedTransaction>;
21
+ broadcastTransaction: (signedTransaction: TronSignedTransaction) => Promise<string>;
22
+ approve: (params: TronApproveParams) => Promise<string>;
23
+ isApproved: (params: TronIsApprovedParams) => Promise<boolean>;
24
+ getApprovedAmount: (params: TronApprovedParams) => Promise<bigint>;
25
+ }>;
26
+ //# sourceMappingURL=toolbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/tron/toolbox.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EASX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EAErB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAYjB,wBAAsB,uBAAuB,sBAI1B,MAAM,cAGxB;AAED,wBAAsB,6BAA6B,CAAC,EAClD,MAAM,EACN,cAAc,EAAE,UAAU,EAC1B,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,mBAiBA;AAsCD,eAAO,MAAM,iBAAiB,GAC5B,UAAS,kBAAuB,KAC/B,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACvD,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,sBAAsB,EAAE,CAAC,MAAM,EAAE,kBAAkB,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClG,iBAAiB,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACrF,eAAe,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClF,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpF,OAAO,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,UAAU,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,iBAAiB,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACpE,CA4cA,CAAC"}
@@ -0,0 +1,103 @@
1
+ import type { DerivationPathArray, FeeOption, GenericCreateTransactionParams, GenericTransferParams } from "@uswap/helpers";
2
+ import type { Contract, Types } from "tronweb";
3
+ export type TronTransaction = Types.Transaction;
4
+ export type TronContract = Contract;
5
+ export type TronSignedTransaction = Types.SignedTransaction;
6
+ export interface TronSigner {
7
+ getAddress(): Promise<string>;
8
+ signTransaction(transaction: TronTransaction): Promise<TronSignedTransaction>;
9
+ }
10
+ export type TronToolboxOptions = {
11
+ signer?: TronSigner;
12
+ } | {
13
+ phrase?: string;
14
+ derivationPath?: DerivationPathArray;
15
+ index?: number;
16
+ } | {};
17
+ export interface TronTransferParams extends GenericTransferParams {
18
+ expiration?: number;
19
+ }
20
+ export interface TronCreateTransactionParams extends Omit<GenericCreateTransactionParams, "feeRate"> {
21
+ expiration?: number;
22
+ }
23
+ export type TronApproveParams = {
24
+ assetAddress: string;
25
+ spenderAddress: string;
26
+ feeOptionKey?: FeeOption;
27
+ amount?: bigint | string | number;
28
+ from?: string;
29
+ gasLimitFallback?: bigint | string | number;
30
+ nonce?: number;
31
+ };
32
+ export type TronApprovedParams = {
33
+ assetAddress: string;
34
+ spenderAddress: string;
35
+ from: string;
36
+ };
37
+ export type TronIsApprovedParams = TronApprovedParams & {
38
+ amount?: bigint | string | number;
39
+ };
40
+ export type TronGridTRC20Balance = Array<{
41
+ [contractAddress: string]: string;
42
+ }>;
43
+ export interface TronGridAccountResponse {
44
+ data: Array<{
45
+ address: string;
46
+ balance: number;
47
+ create_time: number;
48
+ latest_opration_time: number;
49
+ free_net_usage: number;
50
+ net_window_size: number;
51
+ net_window_optimized: boolean;
52
+ trc20: TronGridTRC20Balance;
53
+ assetV2?: Array<{
54
+ key: string;
55
+ value: number;
56
+ }>;
57
+ frozenV2?: Array<{
58
+ type?: string;
59
+ }>;
60
+ free_asset_net_usageV2?: Array<{
61
+ key: string;
62
+ value: number;
63
+ }>;
64
+ latest_consume_free_time?: number;
65
+ owner_permission?: {
66
+ keys: Array<{
67
+ address: string;
68
+ weight: number;
69
+ }>;
70
+ threshold: number;
71
+ permission_name: string;
72
+ };
73
+ active_permission?: Array<{
74
+ operations: string;
75
+ keys: Array<{
76
+ address: string;
77
+ weight: number;
78
+ }>;
79
+ threshold: number;
80
+ id: number;
81
+ type: string;
82
+ permission_name: string;
83
+ }>;
84
+ account_resource?: {
85
+ energy_window_optimized: boolean;
86
+ energy_window_size: number;
87
+ };
88
+ }>;
89
+ success: boolean;
90
+ meta: {
91
+ at: number;
92
+ page_size: number;
93
+ };
94
+ }
95
+ export interface TronGridTokenInfo {
96
+ symbol: string;
97
+ address: string;
98
+ decimals: number;
99
+ name: string;
100
+ totalSupply: string;
101
+ owner: string;
102
+ }
103
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tron/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,8BAA8B,EAC9B,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC;AAChD,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;AACpC,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,iBAAiB,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC/E;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,GACvB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACzE,EAAE,CAAC;AAEP,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA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
1
+ import { type BaseWallet, Chain } from "@uswap/helpers";
2
+ import type { CardanoWallet } from "./cardano";
3
+ import type { CosmosWallets, ThorchainWallets } from "./cosmos";
4
+ import type { EVMToolboxes } from "./evm";
5
+ import type { NearWallet } from "./near";
6
+ import type { RadixWallet } from "./radix";
7
+ import type { RippleWallet } from "./ripple";
8
+ import type { SolanaWallet } from "./solana";
9
+ import type { SubstrateToolboxes } from "./substrate";
10
+ import type { SuiWallet } from "./sui";
11
+ import type { TONWallet } from "./ton";
12
+ import type { TronWallet } from "./tron";
13
+ import type { UTXOToolboxes } from "./utxo";
14
+ type OtherWallets = {
15
+ [Chain.Radix]: RadixWallet;
16
+ [Chain.Ripple]: RippleWallet;
17
+ [Chain.Solana]: SolanaWallet;
18
+ [Chain.Ton]: TONWallet;
19
+ [Chain.Sui]: SuiWallet;
20
+ [Chain.Tron]: TronWallet;
21
+ [Chain.Near]: NearWallet;
22
+ [Chain.Cardano]: CardanoWallet;
23
+ };
24
+ export type FullWallet = BaseWallet<EVMToolboxes & UTXOToolboxes & CosmosWallets & ThorchainWallets & SubstrateToolboxes & OtherWallets>;
25
+ export {};
26
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,KAAK,YAAY,GAAG;IAClB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC3B,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC7B,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC7B,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACvB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACvB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,YAAY,CACpG,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AssetValue, type Chain } from "@uswap/helpers";
2
+ export declare function uniqid(): string;
3
+ export declare function getBalance<T extends Chain>(chain: T): (address: string, scamFilter?: boolean) => Promise<AssetValue[]>;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK,EAAkB,MAAM,gBAAgB,CAAC;AAMxE,wBAAgB,MAAM,WAUrB;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,IACjB,SAAS,MAAM,EAAE,oBAAiB,2BAOpE"}
@@ -0,0 +1,101 @@
1
+ import { Chain, type UTXOChain } from "@uswap/helpers";
2
+ export declare function getUtxoApi(chain: UTXOChain): {
3
+ broadcastTx: (txHash: string) => Promise<string>;
4
+ getAddressData: (address: string) => Promise<{
5
+ address: BlockchairAddressCoreData;
6
+ transactions: BlockchairTransaction[];
7
+ utxo: BlockchairUtxo[];
8
+ } | {
9
+ address: {
10
+ balance: number;
11
+ transaction_count: number;
12
+ };
13
+ utxo: never[];
14
+ } | undefined>;
15
+ getBalance: (address: string) => Promise<number>;
16
+ getRawTx: (txHash: string) => Promise<string>;
17
+ getSuggestedTxFee: () => Promise<number>;
18
+ getUtxos: (params: {
19
+ address: string;
20
+ fetchTxHex?: boolean;
21
+ targetValue?: number;
22
+ }) => Promise<{
23
+ address: string;
24
+ hash: string;
25
+ index: number;
26
+ txHex: string | undefined;
27
+ value: number;
28
+ witnessUtxo: {
29
+ script: Buffer<ArrayBuffer>;
30
+ value: number;
31
+ };
32
+ }[]>;
33
+ };
34
+ /**
35
+ * "Factory" to ensure typing for custom UTXO APIs
36
+ */
37
+ export declare function createCustomUtxoApi(methods: ReturnType<typeof getUtxoApi>): {
38
+ broadcastTx: (txHash: string) => Promise<string>;
39
+ getAddressData: (address: string) => Promise<{
40
+ address: BlockchairAddressCoreData;
41
+ transactions: BlockchairTransaction[];
42
+ utxo: BlockchairUtxo[];
43
+ } | {
44
+ address: {
45
+ balance: number;
46
+ transaction_count: number;
47
+ };
48
+ utxo: never[];
49
+ } | undefined>;
50
+ getBalance: (address: string) => Promise<number>;
51
+ getRawTx: (txHash: string) => Promise<string>;
52
+ getSuggestedTxFee: () => Promise<number>;
53
+ getUtxos: (params: {
54
+ address: string;
55
+ fetchTxHex?: boolean;
56
+ targetValue?: number;
57
+ }) => Promise<{
58
+ address: string;
59
+ hash: string;
60
+ index: number;
61
+ txHex: string | undefined;
62
+ value: number;
63
+ witnessUtxo: {
64
+ script: Buffer<ArrayBuffer>;
65
+ value: number;
66
+ };
67
+ }[]>;
68
+ };
69
+ export declare function getUtxoNetwork(): (chain: Chain) => any;
70
+ interface BlockchairTransaction {
71
+ block_id: number;
72
+ hash: string;
73
+ time: string;
74
+ balance_change: number;
75
+ }
76
+ interface BlockchairUtxo {
77
+ block_id: number;
78
+ transaction_hash: string;
79
+ index: number;
80
+ value: number;
81
+ }
82
+ interface BlockchairAddressCoreData {
83
+ type: string;
84
+ script_hex: string;
85
+ balance: number;
86
+ balance_usd: number;
87
+ received: number;
88
+ received_usd: number;
89
+ spent: number;
90
+ spent_usd: number;
91
+ output_count: number;
92
+ unspent_output_count: number;
93
+ first_seen_receiving: string;
94
+ last_seen_receiving: string;
95
+ first_seen_spending: null | string;
96
+ last_seen_spending: null | string;
97
+ transaction_count: number;
98
+ scripthash_type: null | string;
99
+ }
100
+ export {};
101
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAoD,KAAK,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAkSnH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS;0BAUjB,MAAM;8BACF,MAAM;iBA4HR,yBAAyB;sBAAgB,qBAAqB,EAAE;cAAQ,cAAc,EAAE;;;;;;;;0BA3H1F,MAAM;uBACT,MAAM;;uBAEN;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;EAGrF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,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+ Testnet = "testnet"
4
+ }
5
+ declare function isValidAddress(input: any): boolean;
6
+ declare function detectAddressNetwork(address: string): UtxoNetwork;
7
+ declare function toLegacyAddress(address: string): string;
8
+ declare function toCashAddress(address: string): string;
9
+ export { detectAddressNetwork, isValidAddress, UtxoNetwork, toCashAddress, toLegacyAddress };
10
+ //# sourceMappingURL=bchaddrjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bchaddrjs.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/bchaddrjs.ts"],"names":[],"mappings":"AAUA,aAAK,WAAW;IACd,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAmBD,iBAAS,cAAc,CAAC,KAAK,EAAE,GAAG,WAOjC;AAED,iBAAS,oBAAoB,CAAC,OAAO,EAAE,MAAM,eAE5C;AAED,iBAAS,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED,iBAAS,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG9C;AA6GD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type UTXOChain } from "@uswap/helpers";
2
+ import type { TargetOutput, UTXOCalculateTxSizeParams, UTXOType } from "../types";
3
+ export declare function getDustThreshold(chain: UTXOChain): 100000 | 550 | 5500 | 546;
4
+ export declare function accumulative({ inputs, outputs, feeRate: initialFeeRate, chain, changeAddress, }: UTXOCalculateTxSizeParams & {
5
+ outputs: TargetOutput[];
6
+ chain: UTXOChain;
7
+ changeAddress?: string;
8
+ }): {
9
+ fee: number;
10
+ inputs: (UTXOType | import("..").UTXOInputWithScriptType)[];
11
+ outputs: TargetOutput[];
12
+ } | {
13
+ fee: number;
14
+ inputs?: undefined;
15
+ outputs?: undefined;
16
+ };
17
+ //# sourceMappingURL=coinselect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coinselect.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/coinselect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAUrE,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAElF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,6BAehD;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,OAAO,EAAE,cAAkB,EAC3B,KAAqB,EACrB,aAAkB,GACnB,EAAE,yBAAyB,GAAG;IAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;EAwDnG"}
@@ -0,0 +1,5 @@
1
+ export * from "./api";
2
+ export * from "./bchaddrjs";
3
+ export * from "./coinselect";
4
+ export * from "./txSize";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { TargetOutput, UTXOCalculateTxSizeParams, UTXOInputWithScriptType, UTXOType } from "../types";
2
+ /**
3
+ * Minimum transaction fee
4
+ * 1000 satoshi/kB (similar to current `minrelaytxfee`)
5
+ * @see https://github.com/bitcoin/bitcoin/blob/db88db47278d2e7208c50d16ab10cb355067d071/src/validation.h#L56
6
+ */
7
+ export declare const MIN_TX_FEE = 1000;
8
+ export declare const TX_OVERHEAD: number;
9
+ export declare const OP_RETURN_OVERHEAD: number;
10
+ export declare function compileMemo(memo: string): Buffer<ArrayBufferLike>;
11
+ export declare enum UTXOScriptType {
12
+ P2PKH = "P2PKH",// legacy
13
+ P2WPKH = "P2WPKH"
14
+ }
15
+ export declare const InputSizes: Record<UTXOScriptType, number>;
16
+ export declare const OutputSizes: Record<UTXOScriptType, number>;
17
+ export declare const getScriptTypeForAddress: (address: string) => UTXOScriptType;
18
+ export declare const calculateTxSize: ({ inputs, outputs, feeRate }: UTXOCalculateTxSizeParams) => number;
19
+ export declare const getInputSize: (input: UTXOInputWithScriptType | UTXOType) => number;
20
+ export declare const getOutputSize: (output: TargetOutput, scriptType?: UTXOScriptType) => number;
21
+ //# sourceMappingURL=txSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"txSize.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/txSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,WAAW,QAAgB,CAAC;AACzC,eAAO,MAAM,kBAAkB,QAAY,CAAC;AAI5C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,2BAGvC;AAED,oBAAY,cAAc;IACxB,KAAK,UAAU,CAAE,SAAS;IAE1B,MAAM,WAAW;CAElB;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAIrD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAItD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,mBA+DtD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,8BAA8B,yBAAyB,WAYtF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,uBAAuB,GAAG,QAAQ,WAQrE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,EAAE,aAAa,cAAc,WAQ9E,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./helpers";
2
+ export * from "./toolbox";
3
+ export * from "./toolbox/bitcoinCash";
4
+ export * from "./toolbox/utxo";
5
+ export * from "./toolbox/zcash";
6
+ export * from "./types";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utxo/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,93 @@
1
+ import { Chain, type DerivationPathArray, FeeOption } from "@uswap/helpers";
2
+ import { Psbt } from "bitcoinjs-lib";
3
+ import { accumulative } from "../helpers";
4
+ import type { BchECPair, TargetOutput, TransactionBuilderType, UTXOBuildTxParams, UTXOTransferParams, UTXOType } from "../types";
5
+ import type { UtxoToolboxParams } from "./params";
6
+ import { bchValidateAddress, stripPrefix } from "./validators";
7
+ export declare function stripToCashAddress(address: string): string;
8
+ export declare function createBCHToolbox<T extends typeof Chain.BitcoinCash>(toolboxParams: UtxoToolboxParams[T] | {
9
+ phrase?: string;
10
+ derivationPath?: DerivationPathArray;
11
+ index?: number;
12
+ }): Promise<{
13
+ broadcastTx: (txHash: string) => Promise<string>;
14
+ buildTx: typeof buildTx;
15
+ createTransaction: typeof createTransaction;
16
+ getAddress: () => Promise<string | undefined>;
17
+ getAddressFromKeys: typeof getAddressFromKeys;
18
+ getBalance: (address: string, _scamFilter?: boolean) => Promise<import("@uswap/helpers").AssetValue[]>;
19
+ getFeeRates: () => Promise<{
20
+ average: number;
21
+ fast: number;
22
+ fastest: number;
23
+ }>;
24
+ stripPrefix: typeof stripPrefix;
25
+ stripToCashAddress: typeof stripToCashAddress;
26
+ transfer: ({ recipient, assetValue, feeOptionKey, ...rest }: UTXOTransferParams) => Promise<string>;
27
+ validateAddress: typeof bchValidateAddress;
28
+ accumulative: typeof accumulative;
29
+ calculateTxSize: ({ inputs, outputs, feeRate }: import("..").UTXOCalculateTxSizeParams) => number;
30
+ createKeysForPath: (params: {
31
+ wif?: string;
32
+ phrase?: string;
33
+ derivationPath?: string;
34
+ }) => BchECPair;
35
+ estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
36
+ from: string;
37
+ memo?: string;
38
+ feeRate?: number;
39
+ feeOptionKey?: FeeOption;
40
+ recipients?: number | TargetOutput[];
41
+ }) => Promise<import("@uswap/helpers").AssetValue>;
42
+ estimateTransactionFee: (params: {
43
+ assetValue: import("@uswap/helpers").AssetValue;
44
+ recipient: string;
45
+ sender: string;
46
+ memo?: string;
47
+ feeOptionKey?: FeeOption;
48
+ feeRate?: number;
49
+ fetchTxHex?: boolean;
50
+ }) => Promise<import("@uswap/helpers").AssetValue>;
51
+ getInputsOutputsFee: ({ assetValue, feeOptionKey, feeRate, memo, sender, recipient, }: Omit<UTXOBuildTxParams, "feeRate"> & {
52
+ feeOptionKey?: FeeOption;
53
+ feeRate?: number;
54
+ }) => Promise<{
55
+ fee: number;
56
+ inputs: (UTXOType | import("..").UTXOInputWithScriptType)[];
57
+ outputs: TargetOutput[];
58
+ } | {
59
+ fee: number;
60
+ inputs?: undefined;
61
+ outputs?: undefined;
62
+ }>;
63
+ getPrivateKeyFromMnemonic: (params: {
64
+ phrase: string;
65
+ derivationPath: string;
66
+ }) => string;
67
+ }>;
68
+ declare function createTransaction({ assetValue, recipient, memo, feeRate, sender }: UTXOBuildTxParams): Promise<{
69
+ builder: TransactionBuilderType;
70
+ utxos: (UTXOType | import("..").UTXOInputWithScriptType)[];
71
+ }>;
72
+ declare function buildTx({ assetValue, recipient, memo, feeRate, sender, setSigHashType, }: UTXOBuildTxParams & {
73
+ setSigHashType?: boolean;
74
+ }): Promise<{
75
+ inputs: UTXOType[];
76
+ psbt: Psbt;
77
+ utxos: {
78
+ address: string;
79
+ hash: string;
80
+ index: number;
81
+ txHex: string | undefined;
82
+ value: number;
83
+ witnessUtxo: {
84
+ script: Buffer<ArrayBuffer>;
85
+ value: number;
86
+ };
87
+ }[];
88
+ }>;
89
+ declare function getAddressFromKeys(keys: {
90
+ getAddress: (index?: number) => string;
91
+ }): string;
92
+ export {};
93
+ //# sourceMappingURL=bitcoinCash.d.ts.map