@swapkit/toolboxes 4.3.10 → 4.13.1

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 (266) hide show
  1. package/dist/LICENSE +246 -0
  2. package/dist/src/aptos/index.cjs +1 -0
  3. package/dist/src/aptos/index.js +1 -0
  4. package/dist/src/cardano/index.cjs +1 -4
  5. package/dist/src/cardano/index.js +1 -4
  6. package/dist/src/cosmos/index.cjs +1 -4
  7. package/dist/src/cosmos/index.js +1 -4
  8. package/dist/src/evm/index.cjs +1 -4
  9. package/dist/src/evm/index.js +1 -4
  10. package/dist/src/index.cjs +1 -5
  11. package/dist/src/index.js +1 -5
  12. package/dist/src/near/index.cjs +1 -4
  13. package/dist/src/near/index.js +1 -4
  14. package/dist/src/radix/index.cjs +1 -4
  15. package/dist/src/radix/index.js +1 -4
  16. package/dist/src/ripple/index.cjs +1 -4
  17. package/dist/src/ripple/index.js +1 -4
  18. package/dist/src/solana/index.cjs +1 -4
  19. package/dist/src/solana/index.js +1 -4
  20. package/dist/src/starknet/index.cjs +1 -0
  21. package/dist/src/starknet/index.js +1 -0
  22. package/dist/src/stellar/index.cjs +1 -0
  23. package/dist/src/stellar/index.js +1 -0
  24. package/dist/src/substrate/index.cjs +1 -4
  25. package/dist/src/substrate/index.js +1 -4
  26. package/dist/src/sui/index.cjs +1 -4
  27. package/dist/src/sui/index.js +1 -4
  28. package/dist/src/ton/index.cjs +1 -4
  29. package/dist/src/ton/index.js +1 -4
  30. package/dist/src/tron/index.cjs +1 -4
  31. package/dist/src/tron/index.js +1 -4
  32. package/dist/src/utxo/index.cjs +1 -5
  33. package/dist/src/utxo/index.js +1 -5
  34. package/dist/types/aptos/index.d.ts +3 -0
  35. package/dist/types/aptos/index.d.ts.map +1 -0
  36. package/dist/types/aptos/toolbox.d.ts +21 -0
  37. package/dist/types/aptos/toolbox.d.ts.map +1 -0
  38. package/dist/types/aptos/types.d.ts +27 -0
  39. package/dist/types/aptos/types.d.ts.map +1 -0
  40. package/dist/types/cardano/toolbox.d.ts +19 -22
  41. package/dist/types/cardano/toolbox.d.ts.map +1 -1
  42. package/dist/types/cardano/types.d.ts +8 -3
  43. package/dist/types/cardano/types.d.ts.map +1 -1
  44. package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts.map +1 -1
  45. package/dist/types/cosmos/thorchainUtils/messages.d.ts +3 -3
  46. package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -1
  47. package/dist/types/cosmos/toolbox/cosmos.d.ts +11 -9
  48. package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -1
  49. package/dist/types/cosmos/toolbox/thorchain.d.ts +6 -51
  50. package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -1
  51. package/dist/types/cosmos/types.d.ts +2 -2
  52. package/dist/types/cosmos/types.d.ts.map +1 -1
  53. package/dist/types/evm/helpers.d.ts +34 -1
  54. package/dist/types/evm/helpers.d.ts.map +1 -1
  55. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +14 -7
  56. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -1
  57. package/dist/types/evm/toolbox/evm.d.ts +236 -96
  58. package/dist/types/evm/toolbox/evm.d.ts.map +1 -1
  59. package/dist/types/evm/toolbox/index.d.ts +3 -2
  60. package/dist/types/evm/toolbox/index.d.ts.map +1 -1
  61. package/dist/types/evm/toolbox/op.d.ts +13 -8
  62. package/dist/types/evm/toolbox/op.d.ts.map +1 -1
  63. package/dist/types/evm/types.d.ts +49 -27
  64. package/dist/types/evm/types.d.ts.map +1 -1
  65. package/dist/types/index.d.ts +31 -25
  66. package/dist/types/index.d.ts.map +1 -1
  67. package/dist/types/near/helpers/core.d.ts +1 -1
  68. package/dist/types/near/helpers/core.d.ts.map +1 -1
  69. package/dist/types/near/index.d.ts +1 -1
  70. package/dist/types/near/index.d.ts.map +1 -1
  71. package/dist/types/near/toolbox.d.ts +13 -10
  72. package/dist/types/near/toolbox.d.ts.map +1 -1
  73. package/dist/types/near/types/index.d.ts +4 -0
  74. package/dist/types/near/types/index.d.ts.map +1 -0
  75. package/dist/types/near/types/toolbox.d.ts +2 -0
  76. package/dist/types/near/types/toolbox.d.ts.map +1 -1
  77. package/dist/types/radix/index.d.ts +7 -7
  78. package/dist/types/radix/index.d.ts.map +1 -1
  79. package/dist/types/ripple/currency.d.ts +5 -0
  80. package/dist/types/ripple/currency.d.ts.map +1 -0
  81. package/dist/types/ripple/index.d.ts +60 -17
  82. package/dist/types/ripple/index.d.ts.map +1 -1
  83. package/dist/types/ripple/tokens.d.ts +15 -0
  84. package/dist/types/ripple/tokens.d.ts.map +1 -0
  85. package/dist/types/solana/index.d.ts +1 -1
  86. package/dist/types/solana/index.d.ts.map +1 -1
  87. package/dist/types/solana/toolbox.d.ts +12 -10
  88. package/dist/types/solana/toolbox.d.ts.map +1 -1
  89. package/dist/types/starknet/index.d.ts +5 -0
  90. package/dist/types/starknet/index.d.ts.map +1 -0
  91. package/dist/types/starknet/toolbox.d.ts +34 -0
  92. package/dist/types/starknet/toolbox.d.ts.map +1 -0
  93. package/dist/types/starknet/types.d.ts +26 -0
  94. package/dist/types/starknet/types.d.ts.map +1 -0
  95. package/dist/types/stellar/index.d.ts +3 -0
  96. package/dist/types/stellar/index.d.ts.map +1 -0
  97. package/dist/types/stellar/toolbox.d.ts +21 -0
  98. package/dist/types/stellar/toolbox.d.ts.map +1 -0
  99. package/dist/types/stellar/types.d.ts +10 -0
  100. package/dist/types/stellar/types.d.ts.map +1 -0
  101. package/dist/types/substrate/balance.d.ts +3 -3
  102. package/dist/types/substrate/balance.d.ts.map +1 -1
  103. package/dist/types/substrate/substrate.d.ts +22 -97
  104. package/dist/types/substrate/substrate.d.ts.map +1 -1
  105. package/dist/types/substrate/types.d.ts +2 -2
  106. package/dist/types/substrate/types.d.ts.map +1 -1
  107. package/dist/types/sui/toolbox.d.ts +17 -8
  108. package/dist/types/sui/toolbox.d.ts.map +1 -1
  109. package/dist/types/sui/types.d.ts +11 -3
  110. package/dist/types/sui/types.d.ts.map +1 -1
  111. package/dist/types/ton/toolbox.d.ts +23 -13
  112. package/dist/types/ton/toolbox.d.ts.map +1 -1
  113. package/dist/types/ton/types.d.ts +9 -8
  114. package/dist/types/ton/types.d.ts.map +1 -1
  115. package/dist/types/tron/helpers/proto.d.ts +9 -0
  116. package/dist/types/tron/helpers/proto.d.ts.map +1 -0
  117. package/dist/types/tron/helpers/trongrid.d.ts +43 -3
  118. package/dist/types/tron/helpers/trongrid.d.ts.map +1 -1
  119. package/dist/types/tron/helpers/utils.d.ts +17 -0
  120. package/dist/types/tron/helpers/utils.d.ts.map +1 -0
  121. package/dist/types/tron/index.d.ts +4 -5
  122. package/dist/types/tron/index.d.ts.map +1 -1
  123. package/dist/types/tron/toolbox.d.ts +20 -18
  124. package/dist/types/tron/toolbox.d.ts.map +1 -1
  125. package/dist/types/tron/types.d.ts +31 -57
  126. package/dist/types/tron/types.d.ts.map +1 -1
  127. package/dist/types/types.d.ts +6 -0
  128. package/dist/types/types.d.ts.map +1 -1
  129. package/dist/types/utxo/hdWallet.d.ts +33 -0
  130. package/dist/types/utxo/hdWallet.d.ts.map +1 -0
  131. package/dist/types/utxo/helpers/api.d.ts +49 -1
  132. package/dist/types/utxo/helpers/api.d.ts.map +1 -1
  133. package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -1
  134. package/dist/types/utxo/helpers/cashaddr.d.ts +13 -0
  135. package/dist/types/utxo/helpers/cashaddr.d.ts.map +1 -0
  136. package/dist/types/utxo/helpers/coinselect.d.ts +9 -5
  137. package/dist/types/utxo/helpers/coinselect.d.ts.map +1 -1
  138. package/dist/types/utxo/helpers/txSize.d.ts +4 -3
  139. package/dist/types/utxo/helpers/txSize.d.ts.map +1 -1
  140. package/dist/types/utxo/index.d.ts +2 -1
  141. package/dist/types/utxo/index.d.ts.map +1 -1
  142. package/dist/types/utxo/toolbox/bitcoinCash.d.ts +75 -15
  143. package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -1
  144. package/dist/types/utxo/toolbox/index.d.ts +6 -5
  145. package/dist/types/utxo/toolbox/index.d.ts.map +1 -1
  146. package/dist/types/utxo/toolbox/params.d.ts +8 -16
  147. package/dist/types/utxo/toolbox/params.d.ts.map +1 -1
  148. package/dist/types/utxo/toolbox/utxo.d.ts +135 -46
  149. package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -1
  150. package/dist/types/utxo/toolbox/validators.d.ts +1 -1
  151. package/dist/types/utxo/toolbox/validators.d.ts.map +1 -1
  152. package/dist/types/utxo/toolbox/zcash.d.ts +63 -10
  153. package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -1
  154. package/dist/types/utxo/types.d.ts +78 -15
  155. package/dist/types/utxo/types.d.ts.map +1 -1
  156. package/package.json +43 -53
  157. package/dist/src/cardano/index.cjs.map +0 -11
  158. package/dist/src/cardano/index.js.map +0 -11
  159. package/dist/src/cosmos/index.cjs.map +0 -20
  160. package/dist/src/cosmos/index.js.map +0 -20
  161. package/dist/src/evm/index.cjs.map +0 -20
  162. package/dist/src/evm/index.js.map +0 -20
  163. package/dist/src/index.cjs.map +0 -67
  164. package/dist/src/index.js.map +0 -67
  165. package/dist/src/near/index.cjs.map +0 -16
  166. package/dist/src/near/index.js.map +0 -16
  167. package/dist/src/radix/index.cjs.map +0 -10
  168. package/dist/src/radix/index.js.map +0 -10
  169. package/dist/src/ripple/index.cjs.map +0 -10
  170. package/dist/src/ripple/index.js.map +0 -10
  171. package/dist/src/solana/index.cjs.map +0 -11
  172. package/dist/src/solana/index.js.map +0 -11
  173. package/dist/src/substrate/index.cjs.map +0 -13
  174. package/dist/src/substrate/index.js.map +0 -13
  175. package/dist/src/sui/index.cjs.map +0 -11
  176. package/dist/src/sui/index.js.map +0 -11
  177. package/dist/src/ton/index.cjs.map +0 -11
  178. package/dist/src/ton/index.js.map +0 -11
  179. package/dist/src/tron/index.cjs.map +0 -13
  180. package/dist/src/tron/index.js.map +0 -13
  181. package/dist/src/utxo/index.cjs.map +0 -21
  182. package/dist/src/utxo/index.js.map +0 -21
  183. package/dist/types/tron/helpers/trc20.abi.d.ts +0 -156
  184. package/dist/types/tron/helpers/trc20.abi.d.ts.map +0 -1
  185. package/src/__tests__/address-validation-all-chains.test.ts +0 -162
  186. package/src/__tests__/addressValidator.test.ts +0 -162
  187. package/src/cardano/__tests__/toolbox.test.ts +0 -48
  188. package/src/cardano/index.ts +0 -2
  189. package/src/cardano/toolbox.ts +0 -168
  190. package/src/cardano/types.ts +0 -10
  191. package/src/cosmos/__tests__/toolbox.test.ts +0 -95
  192. package/src/cosmos/index.ts +0 -4
  193. package/src/cosmos/thorchainUtils/addressFormat.ts +0 -22
  194. package/src/cosmos/thorchainUtils/index.ts +0 -4
  195. package/src/cosmos/thorchainUtils/messages.ts +0 -212
  196. package/src/cosmos/thorchainUtils/registry.ts +0 -43
  197. package/src/cosmos/thorchainUtils/types/MsgCompiled.ts +0 -2800
  198. package/src/cosmos/thorchainUtils/types/client-types.ts +0 -54
  199. package/src/cosmos/thorchainUtils/types/index.ts +0 -1
  200. package/src/cosmos/toolbox/cosmos.ts +0 -350
  201. package/src/cosmos/toolbox/index.ts +0 -35
  202. package/src/cosmos/toolbox/thorchain.ts +0 -249
  203. package/src/cosmos/types.ts +0 -48
  204. package/src/cosmos/util.ts +0 -214
  205. package/src/evm/__tests__/address-validation.test.ts +0 -84
  206. package/src/evm/__tests__/ethereum.test.ts +0 -137
  207. package/src/evm/__tests__/signMessage.test.ts +0 -60
  208. package/src/evm/api.ts +0 -10
  209. package/src/evm/contracts/eth/multicall.ts +0 -165
  210. package/src/evm/contracts/op/gasOracle.ts +0 -145
  211. package/src/evm/helpers.ts +0 -71
  212. package/src/evm/index.ts +0 -4
  213. package/src/evm/toolbox/baseEVMToolbox.ts +0 -698
  214. package/src/evm/toolbox/evm.ts +0 -66
  215. package/src/evm/toolbox/index.ts +0 -44
  216. package/src/evm/toolbox/op.ts +0 -143
  217. package/src/evm/types.ts +0 -146
  218. package/src/index.ts +0 -260
  219. package/src/near/__tests__/core.test.ts +0 -70
  220. package/src/near/helpers/core.ts +0 -85
  221. package/src/near/helpers/gasEstimation.ts +0 -96
  222. package/src/near/helpers/nep141.ts +0 -50
  223. package/src/near/index.ts +0 -21
  224. package/src/near/toolbox.ts +0 -421
  225. package/src/near/types/contract.ts +0 -32
  226. package/src/near/types/nep141.ts +0 -34
  227. package/src/near/types/toolbox.ts +0 -55
  228. package/src/near/types.ts +0 -44
  229. package/src/radix/index.ts +0 -138
  230. package/src/ripple/index.ts +0 -179
  231. package/src/solana/index.ts +0 -36
  232. package/src/solana/toolbox.ts +0 -409
  233. package/src/substrate/balance.ts +0 -88
  234. package/src/substrate/index.ts +0 -2
  235. package/src/substrate/substrate.ts +0 -281
  236. package/src/substrate/types.ts +0 -115
  237. package/src/sui/__tests__/toolbox.test.ts +0 -86
  238. package/src/sui/index.ts +0 -2
  239. package/src/sui/toolbox.ts +0 -166
  240. package/src/sui/types.ts +0 -11
  241. package/src/ton/__tests__/toolbox.test.ts +0 -67
  242. package/src/ton/index.ts +0 -2
  243. package/src/ton/toolbox.ts +0 -136
  244. package/src/ton/types.ts +0 -13
  245. package/src/tron/__tests__/toolbox.test.ts +0 -221
  246. package/src/tron/helpers/trc20.abi.ts +0 -107
  247. package/src/tron/helpers/trongrid.ts +0 -53
  248. package/src/tron/index.ts +0 -21
  249. package/src/tron/toolbox.ts +0 -585
  250. package/src/tron/types.ts +0 -83
  251. package/src/types.ts +0 -28
  252. package/src/utils.ts +0 -34
  253. package/src/utxo/__tests__/zcash-integration.test.ts +0 -97
  254. package/src/utxo/helpers/api.ts +0 -471
  255. package/src/utxo/helpers/bchaddrjs.ts +0 -166
  256. package/src/utxo/helpers/coinselect.ts +0 -92
  257. package/src/utxo/helpers/index.ts +0 -4
  258. package/src/utxo/helpers/txSize.ts +0 -137
  259. package/src/utxo/index.ts +0 -6
  260. package/src/utxo/toolbox/bitcoinCash.ts +0 -243
  261. package/src/utxo/toolbox/index.ts +0 -59
  262. package/src/utxo/toolbox/params.ts +0 -18
  263. package/src/utxo/toolbox/utxo.ts +0 -439
  264. package/src/utxo/toolbox/validators.ts +0 -36
  265. package/src/utxo/toolbox/zcash.ts +0 -242
  266. package/src/utxo/types.ts +0 -39
@@ -1,14 +1,13 @@
1
- import { bitgo } from "@bitgo/utxo-lib";
2
- import { type ZcashPsbt } from "@bitgo/utxo-lib/dist/src/bitgo";
3
1
  import { type ChainSigner, type DerivationPathArray, FeeOption } from "@swapkit/helpers";
2
+ import { PCZT, type ZcashTransaction } from "@swapkit/utxo-signer";
4
3
  import { accumulative } from "../helpers";
5
4
  import type { TargetOutput, UTXOBuildTxParams, UTXOTransferParams, UTXOType } from "../types";
6
5
  import { validateZcashAddress } from "./validators";
7
- type ZcashSigner = ChainSigner<ZcashPsbt, ZcashPsbt>;
6
+ type ZcashSigner = ChainSigner<ZcashTransaction | PCZT, ZcashTransaction>;
8
7
  declare function createTransaction(buildTxParams: UTXOBuildTxParams): Promise<{
9
8
  inputs: UTXOType[];
10
9
  outputs: TargetOutput[];
11
- psbt: bitgo.ZcashPsbt;
10
+ tx: ZcashTransaction;
12
11
  }>;
13
12
  export declare function createZcashToolbox(toolboxParams: {
14
13
  signer?: ZcashSigner;
@@ -16,21 +15,39 @@ export declare function createZcashToolbox(toolboxParams: {
16
15
  phrase?: string;
17
16
  derivationPath?: DerivationPathArray;
18
17
  index?: number;
19
- }): Promise<{
18
+ }): {
20
19
  createKeysForPath: ({ phrase, derivationPath, }: {
21
20
  phrase: string;
22
21
  derivationPath?: string;
23
- }) => import("@bitgo/utxo-lib").ECPairInterface;
22
+ }) => {
23
+ privateKey: Uint8Array<ArrayBufferLike>;
24
+ publicKey: Uint8Array<ArrayBufferLike>;
25
+ };
24
26
  createTransaction: typeof createTransaction;
25
27
  getPrivateKeyFromMnemonic: ({ phrase, derivationPath, }: {
26
28
  phrase: string;
27
29
  derivationPath: string;
28
30
  }) => string;
31
+ signAndBroadcastTransaction: (tx: ZcashTransaction | PCZT) => Promise<string>;
32
+ signTransaction: (tx: ZcashTransaction | PCZT) => Promise<ZcashTransaction>;
29
33
  transfer: ({ recipient, assetValue, feeOptionKey, ...rest }: UTXOTransferParams) => Promise<string>;
30
34
  validateAddress: typeof validateZcashAddress;
31
35
  accumulative: typeof accumulative;
32
36
  broadcastTx: (txHash: string) => Promise<string>;
37
+ bumpFee: ({ txid, newFeeRate, recipient, memo }: import("..").RBFTransactionParams) => Promise<{
38
+ newFee: number;
39
+ originalFee: number;
40
+ txid: string;
41
+ }>;
33
42
  calculateTxSize: ({ inputs, outputs, feeRate }: import("..").UTXOCalculateTxSizeParams) => number;
43
+ createReplacementTransaction: ({ txid, newFeeRate, recipient, memo, }: import("..").RBFTransactionParams) => Promise<import("./utxo").ReplacementTransactionResult>;
44
+ deriveAddressAtIndex: ({ index, change }: import("..").DeriveAddressParams) => {
45
+ address: string;
46
+ change: boolean;
47
+ index: number;
48
+ pubkey: string;
49
+ } | undefined;
50
+ derivePrivateKeyAtIndex: ({ index, change }: import("..").DeriveAddressParams) => Uint8Array<ArrayBufferLike> | undefined;
34
51
  estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
35
52
  from: string;
36
53
  memo?: string;
@@ -47,9 +64,12 @@ export declare function createZcashToolbox(toolboxParams: {
47
64
  feeRate?: number;
48
65
  fetchTxHex?: boolean;
49
66
  }) => Promise<import("@swapkit/helpers").AssetValue>;
50
- getAddress: () => Promise<string | undefined>;
51
- getAddressFromKeys: (keys: import("ecpair").ECPairInterface | import("..").BchECPair) => string;
67
+ getAddress: () => string | Promise<string> | Promise<undefined>;
68
+ getAddressFromKeys: (keys: {
69
+ publicKey: Uint8Array;
70
+ }) => string;
52
71
  getBalance: (address: string, scamFilter?: boolean) => Promise<import("@swapkit/helpers").AssetValue[]>;
72
+ getExtendedPublicKey: () => string | undefined;
53
73
  getFeeRates: () => Promise<{
54
74
  average: number;
55
75
  fast: number;
@@ -60,13 +80,46 @@ export declare function createZcashToolbox(toolboxParams: {
60
80
  feeRate?: number;
61
81
  }) => Promise<{
62
82
  fee: number;
63
- inputs: (UTXOType | import("..").UTXOInputWithScriptType)[];
83
+ inputs: {
84
+ address: string;
85
+ hash: string;
86
+ index: number;
87
+ txHex: string | undefined;
88
+ value: number;
89
+ witnessUtxo: {
90
+ script: Buffer<ArrayBuffer>;
91
+ value: number;
92
+ };
93
+ }[];
64
94
  outputs: TargetOutput[];
65
95
  } | {
66
96
  fee: number;
67
97
  inputs?: undefined;
68
98
  outputs?: undefined;
69
99
  }>;
70
- }>;
100
+ getNetworkForChain: () => import("@swapkit/utxo-signer").BTCNetwork;
101
+ isRBFEnabled: (txid: string) => Promise<import("./utxo").RBFStatusResult>;
102
+ keys: {
103
+ privateKey: import("@swapkit/utxo-signer/utils").Bytes;
104
+ publicKey: Uint8Array<ArrayBufferLike>;
105
+ } | undefined;
106
+ resolveDerivationIndex: ({ address, gapLimit }: import("..").ResolveDerivationParams) => {
107
+ change: boolean;
108
+ index: number;
109
+ } | undefined;
110
+ signTransactionWithMultipleKeys: ({ tx, inputDerivations, }: {
111
+ tx: InstanceType<typeof import("@swapkit/utxo-signer").Transaction>;
112
+ inputDerivations: import("..").InputDerivation[];
113
+ }) => import("@swapkit/utxo-signer").Transaction;
114
+ transferFromMultipleAddresses: ({ utxos, recipient, assetValue, memo, feeRate, feeOptionKey, changeAddress, }: {
115
+ utxos: import("..").UTXOForMultiAddressTransfer[];
116
+ recipient: string;
117
+ assetValue: import("@swapkit/helpers").AssetValue;
118
+ memo?: string;
119
+ feeRate?: number;
120
+ feeOptionKey?: FeeOption;
121
+ changeAddress?: string;
122
+ }) => Promise<string>;
123
+ };
71
124
  export {};
72
125
  //# sourceMappingURL=zcash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zcash.d.ts","sourceRoot":"","sources":["../../../../src/utxo/toolbox/zcash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqD,M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C1B,OAAO,EAIL,IAAI,EAOJ,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAA2B,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAepD,KAAK,WAAW,GAAG,WAAW,CAAC,gBAAgB,GAAG,IAAI,EAAE,gBAAgB,CAAC,CAAC;AAoG1E,iBAAe,iBAAiB,CAAC,aAAa,EAAE,iBAAiB;;;;GAoChE;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;qDAmChH;QACD,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;;;;;6DAeE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;KACxB;sCAcuD,gBAAgB,GAAG,IAAI;0BAPnC,gBAAgB,GAAG,IAAI;iEAhDwB,kBAAkB;;;;;;;;;;;;;;;;;;;;YAyEwwE,CAAC;eAAqB,CAAC;oBAA0B,CAAC;kBAA2B,CAAC;;;;;;YAAowC,CAAC;oBAA0B,CAAC;eAAwB,CAAC;kBAAwB,CAAC;;;;;;;;;;;;;;oBAA/+D,CAAC;eAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAD7zD"}
@@ -5,10 +5,10 @@ export type TransactionType = {
5
5
  };
6
6
  export type TargetOutput = {
7
7
  address: string;
8
- script?: Buffer;
8
+ script?: Uint8Array;
9
9
  value: number;
10
10
  } | {
11
- script: Buffer;
11
+ script: Uint8Array;
12
12
  value: number;
13
13
  };
14
14
  export type UTXOType = {
@@ -22,25 +22,88 @@ export type UTXOInputWithScriptType = UTXOType & {
22
22
  type: UTXOScriptType;
23
23
  address: string;
24
24
  };
25
+ export type UTXOSizeInput = {
26
+ value: number;
27
+ address?: string;
28
+ type?: UTXOScriptType;
29
+ };
25
30
  export type UTXOCalculateTxSizeParams = {
26
- inputs: (UTXOInputWithScriptType | UTXOType)[];
31
+ inputs: (UTXOInputWithScriptType | UTXOType | UTXOSizeInput)[];
27
32
  outputs?: TargetOutput[];
28
- feeRate: number;
33
+ feeRate?: number;
29
34
  };
30
35
  export type UTXOBuildTxParams = GenericCreateTransactionParams & {
31
36
  fetchTxHex?: boolean;
37
+ enableRBF?: boolean;
32
38
  };
33
39
  export type UTXOTransferParams = GenericTransferParams;
34
- export type BchECPair = {
35
- getAddress: (index?: number) => string;
36
- publicKey: Buffer;
37
- toWIF: () => string;
38
- };
39
- export type TransactionBuilderType = {
40
- inputs: any[];
41
- sign(vin: number, keyPair: BchECPair, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer, signatureAlgorithm?: string): void;
42
- build(): TransactionType;
43
- addOutput(addressOrScriptBuffer: string | Buffer, value: number): void;
44
- addInput(txHash: string | Buffer, vout: number, sequence?: number, prevOutScript?: Buffer): void;
40
+ export type DerivedAddress = {
41
+ address: string;
42
+ index: number;
43
+ change: boolean;
44
+ pubkey: string;
45
+ };
46
+ export type ExtendedPublicKeyResult = {
47
+ xpub: string;
48
+ path: string;
49
+ xpubSegwit?: string;
50
+ chainCode?: string;
51
+ publicKey?: string;
52
+ fingerprint?: number;
53
+ depth?: number;
54
+ };
55
+ export type UTXOWithDerivation = UTXOType & {
56
+ derivationIndex?: number;
57
+ isChange?: boolean;
58
+ address?: string;
59
+ };
60
+ export type AggregatedBalanceResult = {
61
+ total: number;
62
+ addresses: Array<{
63
+ address: string;
64
+ index: number;
65
+ change: boolean;
66
+ balance: number;
67
+ }>;
68
+ };
69
+ export type DeriveAddressParams = {
70
+ index: number;
71
+ change?: boolean;
72
+ };
73
+ export type DeriveAddressesParams = {
74
+ count: number;
75
+ startIndex?: number;
76
+ change?: boolean;
77
+ };
78
+ export type ScanAddressesParams = {
79
+ gapLimit?: number;
80
+ change?: boolean;
81
+ };
82
+ export type ResolveDerivationParams = {
83
+ address: string;
84
+ gapLimit?: number;
85
+ };
86
+ export type InputDerivation = {
87
+ derivationIndex: number;
88
+ isChange: boolean;
89
+ };
90
+ export type RBFTransactionParams = {
91
+ txid: string;
92
+ newFeeRate: number;
93
+ recipient: string;
94
+ memo?: string;
95
+ };
96
+ export type UTXOForMultiAddressTransfer = UTXOType & {
97
+ derivationIndex: number;
98
+ isChange: boolean;
99
+ address: string;
100
+ };
101
+ export type UTXOHDWalletMethods = {
102
+ getExtendedPublicKey: () => Promise<ExtendedPublicKeyResult | undefined> | ExtendedPublicKeyResult | undefined;
103
+ deriveAddressAtIndex: (params: DeriveAddressParams) => Promise<DerivedAddress | undefined> | DerivedAddress | undefined;
104
+ deriveAddresses: (params: DeriveAddressesParams) => Promise<DerivedAddress[]> | DerivedAddress[];
105
+ scanForAddresses: (params?: ScanAddressesParams) => Promise<DerivedAddress[]>;
106
+ getAggregatedBalance: (gapLimit?: number) => Promise<AggregatedBalanceResult>;
107
+ getAggregatedUtxos: (gapLimit?: number) => Promise<UTXOWithDerivation[]>;
45
108
  };
46
109
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utxo/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,IAAI,MAAM,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,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,cAAc,GAAG,SAAS,CAAC,GAAG,cAAc,GAAG,SAAS,CAAC;IACtE,eAAe,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC;IACjG,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9E,oBAAoB,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC9E,kBAAkB,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAC1E,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "dependencies": {
3
- "@bitcoinerlab/secp256k1": "~1.2.0",
4
- "@bitgo/utxo-lib": "11.16.1",
3
+ "@aptos-labs/ts-sdk": "~1.34.0",
5
4
  "@cosmjs/amino": "~0.37.0",
6
5
  "@cosmjs/crypto": "0.37.0",
7
6
  "@cosmjs/proto-signing": "~0.37.0",
8
7
  "@cosmjs/stargate": "~0.37.0",
9
- "@meshsdk/core": "1.9.0-beta.86",
10
8
  "@mysten/bcs": "~1.9.2",
11
9
  "@mysten/sui": "~1.44.0",
12
10
  "@near-js/accounts": "~2.5.0",
@@ -15,13 +13,14 @@
15
13
  "@near-js/signers": "~2.5.0",
16
14
  "@near-js/transactions": "~2.5.0",
17
15
  "@near-js/utils": "~2.5.0",
18
- "@noble/hashes": "2.0.1",
16
+ "@noble/curves": "2.0.1",
17
+ "@noble/hashes": "~2.0.1",
18
+ "@orbs-network/ton-access": "~2.3.3",
19
19
  "@polkadot/api": "15.10.2",
20
20
  "@polkadot/keyring": "~13.5.7",
21
21
  "@polkadot/rpc-provider": "~15.10.2",
22
22
  "@polkadot/util": "~13.5.7",
23
23
  "@polkadot/util-crypto": "~13.5.7",
24
- "@psf/bitcoincashjs-lib": "~4.0.3",
25
24
  "@radixdlt/babylon-gateway-api-sdk": "~1.10.0",
26
25
  "@radixdlt/radix-dapp-toolkit": "~2.2.0",
27
26
  "@scure/base": "~2.0.0",
@@ -29,53 +28,51 @@
29
28
  "@scure/bip39": "~2.0.1",
30
29
  "@solana/spl-memo": "~0.2.5",
31
30
  "@solana/spl-token": "~0.4.14",
32
- "@solana/web3.js": "~1.98.0",
33
- "@swapkit/helpers": "4.5.9",
31
+ "@solana/web3.js": "~1.98.4",
32
+ "@stellar/stellar-sdk": "~14.5.0",
33
+ "@stricahq/bip32ed25519": "1.1.2",
34
+ "@stricahq/cbors": "~1.0.2",
35
+ "@stricahq/typhonjs": "~3.0.1",
36
+ "@swapkit/helpers": "4.12.3",
37
+ "@swapkit/utxo-signer": "2.1.0",
34
38
  "@ton/crypto": "~3.3.0",
35
39
  "@ton/ton": "~15.4.0",
36
- "base64-js": "~1.5.1",
37
- "bitcoinjs-lib": "~6.1.0",
38
- "bs58check": "~4.0.0",
39
- "cashaddrjs": "~0.4.4",
40
- "coininfo": "~5.2.1",
40
+ "bignumber.js": "~9.3.1",
41
41
  "cosmjs-types": "~0.10.1",
42
- "ecpair": "~2.1.0",
43
42
  "ethers": "^6.14.0",
44
43
  "micro-key-producer": "~0.8.2",
45
- "near-sdk-js": "~2.0.0",
46
44
  "near-seed-phrase": "~0.2.1",
47
45
  "protobufjs": "~7.5.4",
48
- "tronweb": "6.1.0",
46
+ "starknet": "~9.2.1",
49
47
  "ts-pattern": "^5.9.0",
50
48
  "xrpl": "~4.4.2"
51
49
  },
52
50
  "description": "SwapKit - Toolboxes",
53
51
  "devDependencies": {
54
- "@bitcoinerlab/secp256k1": "1.2.0",
55
- "@bitgo/utxo-lib": "11.16.1",
52
+ "@aptos-labs/ts-sdk": "1.34.0",
56
53
  "@cosmjs/amino": "0.37.0",
57
54
  "@cosmjs/crypto": "0.37.0",
58
55
  "@cosmjs/proto-signing": "0.37.0",
59
56
  "@cosmjs/stargate": "0.37.0",
60
- "@meshsdk/core": "1.9.0-beta.86",
61
57
  "@mysten/bcs": "1.9.2",
62
- "@mysten/sui": "1.44.0",
58
+ "@mysten/sui": "~1.44.0",
63
59
  "@near-js/accounts": "2.5.0",
64
60
  "@near-js/crypto": "2.5.0",
65
61
  "@near-js/providers": "2.5.0",
66
62
  "@near-js/signers": "2.5.0",
67
63
  "@near-js/transactions": "2.5.0",
68
64
  "@near-js/utils": "2.5.0",
65
+ "@noble/curves": "2.0.1",
69
66
  "@noble/hashes": "2.0.1",
70
67
  "@nomicfoundation/hardhat-ethers": "4.0.3",
71
68
  "@nomicfoundation/hardhat-network-helpers": "3.0.2",
72
69
  "@nomicfoundation/hardhat-toolbox": "6.1.0",
70
+ "@orbs-network/ton-access": "2.3.3",
73
71
  "@polkadot/api": "15.10.2",
74
72
  "@polkadot/keyring": "13.5.7",
75
73
  "@polkadot/types": "15.10.2",
76
74
  "@polkadot/util": "13.5.7",
77
75
  "@polkadot/util-crypto": "13.5.7",
78
- "@psf/bitcoincashjs-lib": "4.0.3",
79
76
  "@radixdlt/babylon-gateway-api-sdk": "1.10.1",
80
77
  "@radixdlt/radix-dapp-toolkit": "2.2.1",
81
78
  "@scure/base": "2.0.0",
@@ -84,122 +81,115 @@
84
81
  "@solana/spl-memo": "0.2.5",
85
82
  "@solana/spl-token": "0.4.14",
86
83
  "@solana/web3.js": "1.98.4",
84
+ "@stellar/stellar-sdk": "14.5.0",
85
+ "@stricahq/bip32ed25519": "1.1.2",
86
+ "@stricahq/typhonjs": "~3.0.1",
87
87
  "@ton/crypto": "3.3.0",
88
- "@ton/ton": "15.4.0",
88
+ "@ton/ton": "~15.4.0",
89
89
  "@types/bn.js": "5.2.0",
90
90
  "@types/crypto-js": "4.2.2",
91
91
  "@types/elliptic": "6.4.18",
92
- "base64-js": "1.5.1",
93
- "bitcoinjs-lib": "6.1.7",
94
- "bs58check": "4.0.0",
95
- "cashaddrjs": "0.4.4",
96
- "coininfo": "5.2.1",
97
92
  "cosmjs-types": "0.10.1",
98
- "ecpair": "2.1.0",
99
- "ethers": "6.15.0",
93
+ "ethers": "6.16.0",
100
94
  "hardhat": "3.0.11",
101
95
  "micro-key-producer": "0.8.2",
102
- "near-sdk-js": "2.0.0",
103
96
  "near-seed-phrase": "0.2.1",
104
97
  "protobufjs": "7.5.4",
105
- "tronweb": "6.1.0",
106
- "ts-pattern": "5.9.0",
98
+ "starknet": "~9.2.1",
99
+ "ts-pattern": "^5.9.0",
107
100
  "xrpl": "4.4.2"
108
101
  },
109
102
  "exports": {
110
- ".": {
111
- "bun": "./src/index.ts",
112
- "default": "./dist/src/index.js",
113
- "require": "./dist/src/index.cjs",
114
- "types": "./dist/types/index.d.ts"
103
+ ".": { "default": "./dist/src/index.js", "require": "./dist/src/index.cjs", "types": "./dist/types/index.d.ts" },
104
+ "./aptos": {
105
+ "default": "./dist/src/aptos/index.js",
106
+ "require": "./dist/src/aptos/index.cjs",
107
+ "types": "./dist/types/aptos/index.d.ts"
115
108
  },
116
109
  "./cardano": {
117
- "bun": "./src/cardano/index.ts",
118
110
  "default": "./dist/src/cardano/index.js",
119
111
  "require": "./dist/src/cardano/index.cjs",
120
112
  "types": "./dist/types/cardano/index.d.ts"
121
113
  },
122
114
  "./cosmos": {
123
- "bun": "./src/cosmos/index.ts",
124
115
  "default": "./dist/src/cosmos/index.js",
125
116
  "require": "./dist/src/cosmos/index.cjs",
126
117
  "types": "./dist/types/cosmos/index.d.ts"
127
118
  },
128
119
  "./evm": {
129
- "bun": "./src/evm/index.ts",
130
120
  "default": "./dist/src/evm/index.js",
131
121
  "require": "./dist/src/evm/index.cjs",
132
122
  "types": "./dist/types/evm/index.d.ts"
133
123
  },
134
124
  "./near": {
135
- "bun": "./src/near/index.ts",
136
125
  "default": "./dist/src/near/index.js",
137
126
  "require": "./dist/src/near/index.cjs",
138
127
  "types": "./dist/types/near/index.d.ts"
139
128
  },
140
129
  "./radix": {
141
- "bun": "./src/radix/index.ts",
142
130
  "default": "./dist/src/radix/index.js",
143
131
  "require": "./dist/src/radix/index.cjs",
144
132
  "types": "./dist/types/radix/index.d.ts"
145
133
  },
146
134
  "./ripple": {
147
- "bun": "./src/ripple/index.ts",
148
135
  "default": "./dist/src/ripple/index.js",
149
136
  "require": "./dist/src/ripple/index.cjs",
150
137
  "types": "./dist/types/ripple/index.d.ts"
151
138
  },
152
139
  "./solana": {
153
- "bun": "./src/solana/index.ts",
154
140
  "default": "./dist/src/solana/index.js",
155
141
  "require": "./dist/src/solana/index.cjs",
156
142
  "types": "./dist/types/solana/index.d.ts"
157
143
  },
144
+ "./starknet": {
145
+ "default": "./dist/src/starknet/index.js",
146
+ "require": "./dist/src/starknet/index.cjs",
147
+ "types": "./dist/types/starknet/index.d.ts"
148
+ },
149
+ "./stellar": {
150
+ "default": "./dist/src/stellar/index.js",
151
+ "require": "./dist/src/stellar/index.cjs",
152
+ "types": "./dist/types/stellar/index.d.ts"
153
+ },
158
154
  "./substrate": {
159
- "bun": "./src/substrate/index.ts",
160
155
  "default": "./dist/src/substrate/index.js",
161
156
  "require": "./dist/src/substrate/index.cjs",
162
157
  "types": "./dist/types/substrate/index.d.ts"
163
158
  },
164
159
  "./sui": {
165
- "bun": "./src/sui/index.ts",
166
160
  "default": "./dist/src/sui/index.js",
167
161
  "require": "./dist/src/sui/index.cjs",
168
162
  "types": "./dist/types/sui/index.d.ts"
169
163
  },
170
164
  "./ton": {
171
- "bun": "./src/ton/index.ts",
172
165
  "default": "./dist/src/ton/index.js",
173
166
  "require": "./dist/src/ton/index.cjs",
174
167
  "types": "./dist/types/ton/index.d.ts"
175
168
  },
176
169
  "./tron": {
177
- "bun": "./src/tron/index.ts",
178
170
  "default": "./dist/src/tron/index.js",
179
171
  "require": "./dist/src/tron/index.cjs",
180
172
  "types": "./dist/types/tron/index.d.ts"
181
173
  },
182
174
  "./utxo": {
183
- "bun": "./src/utxo/index.ts",
184
175
  "default": "./dist/src/utxo/index.js",
185
176
  "require": "./dist/src/utxo/index.cjs",
186
177
  "types": "./dist/types/utxo/index.d.ts"
187
178
  }
188
179
  },
189
- "files": ["dist/", "src/"],
180
+ "files": ["dist/"],
190
181
  "homepage": "https://github.com/swapkit/SwapKit",
191
- "license": "Apache-2.0",
182
+ "license": "SEE LICENSE IN LICENSE",
192
183
  "name": "@swapkit/toolboxes",
184
+ "publishConfig": { "access": "public" },
193
185
  "repository": { "type": "git", "url": "git+https://github.com/swapkit/SwapKit.git" },
194
186
  "scripts": {
195
187
  "build": "bun run ./build.ts",
196
188
  "build:clean": "rm -rf dist && bun run ./build.ts",
197
189
  "clean": "rm -rf cache dist node_modules *.tsbuildinfo",
198
- "test": "bun test",
199
- "test:ci": "bun test --coverage",
200
190
  "type-check": "bun tsc --noEmit",
201
191
  "type-check:go": "tsgo"
202
192
  },
203
193
  "type": "module",
204
- "version": "4.3.10"
194
+ "version": "4.13.1"
205
195
  }
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/cardano/toolbox.ts", "../src/cardano/index.ts"],
4
- "sourcesContent": [
5
- "import { AssetValue, Chain, type DerivationPathArray, getChainConfig, SwapKitError } from \"@swapkit/helpers\";\nimport { match, P } from \"ts-pattern\";\nimport type { CardanoProvider } from \"./index\";\n\ntype CardanoSigner = CardanoProvider | { address: string };\n\n// TODO: this should done on BE side\nasync function getProvider() {\n const { BlockfrostProvider } = await import(\"@meshsdk/core\");\n const apiKey = \"mainnet3YT7XK6NidLPlkHxxyBB5V0WzXUOTIJS\"; // TODO: TEST API KEY\n return new BlockfrostProvider(apiKey);\n}\n\nconst ADA_ID = \"lovelace\";\n\nasync function getCardanoBalance(address: string) {\n try {\n const { MeshWallet } = await import(\"@meshsdk/core\");\n const provider = await getProvider();\n\n const wallet = new MeshWallet({ fetcher: provider, key: { address, type: \"address\" }, networkId: 1 });\n\n await wallet.init();\n const balance = await wallet.getBalance();\n\n const balances: AssetValue[] = [];\n\n for (const asset of balance) {\n if (asset.unit === ADA_ID) {\n const { baseDecimal } = getChainConfig(Chain.Cardano);\n balances.push(AssetValue.from({ chain: Chain.Cardano, fromBaseDecimal: baseDecimal, value: asset.quantity }));\n } else {\n balances.push(AssetValue.from({ asset: `${Chain.Cardano}.${asset.unit}`, value: asset.quantity }));\n }\n }\n\n if (balances.length === 0) {\n return [AssetValue.from({ chain: Chain.Cardano })];\n }\n\n return balances;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`Cardano balance fetch error: ${errorMessage}`);\n return [AssetValue.from({ chain: Chain.Cardano })];\n }\n}\n\nexport async function getCardanoAddressValidator() {\n const { deserializeAddress } = await import(\"@meshsdk/core\");\n\n return (address: string) => {\n try {\n deserializeAddress(address);\n return true;\n } catch {\n return false;\n }\n };\n}\n\nexport async function getCardanoToolbox(\n toolboxParams?:\n | { signer?: CardanoSigner }\n | { phrase?: string; index?: number; derivationPath?: DerivationPathArray },\n) {\n const validateAddress = await getCardanoAddressValidator();\n const signer = await match(toolboxParams)\n .with({ phrase: P.string }, async ({ phrase }) => {\n const { MeshWallet } = await import(\"@meshsdk/core\");\n const provider = await getProvider();\n\n const wallet = new MeshWallet({\n fetcher: provider,\n key: { type: \"mnemonic\", words: phrase.split(\" \") },\n networkId: 1,\n submitter: provider,\n });\n\n await wallet.init();\n return wallet;\n })\n .with({ signer: P.any }, ({ signer }) => signer)\n .otherwise(() => undefined);\n\n const signerAddress = signer && \"getChangeAddress\" in signer ? await signer.getChangeAddress() : \"\";\n\n function getAddress() {\n return signerAddress || \"\";\n }\n\n function getBalance(addressParam?: string) {\n const address = addressParam || getAddress();\n if (!address) throw new SwapKitError(\"core_wallet_connection_not_found\");\n return getCardanoBalance(address);\n }\n\n function estimateTransactionFee() {\n return Promise.resolve(AssetValue.from({ chain: Chain.Cardano, value: \"0.01\" }));\n }\n\n async function createTransaction({\n recipient,\n assetValue,\n memo,\n }: {\n recipient: string;\n assetValue: AssetValue;\n memo?: string;\n }) {\n if (!signer || !(\"getChangeAddress\" in signer)) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n const { Transaction } = await import(\"@meshsdk/core\");\n\n const [, policyId] = assetValue.symbol.split(\"-\");\n if (!assetValue.isGasAsset && !policyId) throw new SwapKitError(\"core_wallet_connection_not_found\");\n\n const tx = new Transaction({ initiator: signer });\n tx.sendAssets({ address: recipient }, [\n { quantity: assetValue.getBaseValue(\"string\"), unit: assetValue.isGasAsset ? \"lovelace\" : assetValue.symbol },\n ]);\n\n if (memo) tx.setMetadata(0, memo);\n\n const unsignedTx = await tx.build();\n return { tx, unsignedTx };\n }\n\n function signTransaction(txParams: string) {\n if (!signer || !(\"getChangeAddress\" in signer)) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n return signer.signTx(txParams);\n }\n\n async function transfer({\n recipient,\n assetValue,\n memo,\n }: {\n recipient: string;\n assetValue: AssetValue;\n memo?: string;\n }) {\n if (!signer || !(\"getChangeAddress\" in signer)) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n const { unsignedTx } = await createTransaction({ assetValue, memo, recipient });\n const signedTx = await signTransaction(unsignedTx);\n const provider = await getProvider();\n const txHash = await provider.submitTx(signedTx);\n\n return txHash;\n }\n\n return {\n createTransaction,\n estimateTransactionFee,\n getAddress,\n getBalance,\n signTransaction,\n transfer,\n validateAddress,\n };\n}\n",
6
- "export * from \"./toolbox\";\nexport * from \"./types\";\n"
7
- ],
8
- "mappings": "ssBAOA,eAAe,CAAW,EAAG,CAC3B,IAAQ,sBAAuB,KAAa,yBACtC,EAAS,0CACf,OAAO,IAAI,EADI,yCACqB,EAKtC,eAAe,CAAiB,CAAC,EAAiB,CAChD,GAAI,CACF,IAAQ,cAAe,KAAa,yBAC9B,EAAW,MAAM,EAAY,EAE7B,EAAS,IAAI,EAAW,CAAE,QAAS,EAAU,IAAK,CAAE,UAAS,KAAM,SAAU,EAAG,UAAW,CAAE,CAAC,EAEpG,MAAM,EAAO,KAAK,EAClB,IAAM,EAAU,MAAM,EAAO,WAAW,EA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ADE,MAAM,EAAY,GACL,SAAS,CAAQ,EAKjD,MAAO,CACL,oBACA,yBACA,aACA,aACA,kBACA,WACA,iBACF,MAtKF,EACA,EAYM,EAAS,wBAbf,8BACA,oICDA",
9
- "debugId": "F11D52CE0C208A0564756E2164756E21",
10
- "names": []
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/cardano/toolbox.ts", "../src/cardano/index.ts"],
4
- "sourcesContent": [
5
- "import { AssetValue, Chain, type DerivationPathArray, getChainConfig, SwapKitError } from \"@swapkit/helpers\";\nimport { match, P } from \"ts-pattern\";\nimport type { CardanoProvider } from \"./index\";\n\ntype CardanoSigner = CardanoProvider | { address: string };\n\n// TODO: this should done on BE side\nasync function getProvider() {\n const { BlockfrostProvider } = await import(\"@meshsdk/core\");\n const apiKey = \"mainnet3YT7XK6NidLPlkHxxyBB5V0WzXUOTIJS\"; // TODO: TEST API KEY\n return new BlockfrostProvider(apiKey);\n}\n\nconst ADA_ID = \"lovelace\";\n\nasync function getCardanoBalance(address: string) {\n try {\n const { MeshWallet } = await import(\"@meshsdk/core\");\n const provider = await getProvider();\n\n const wallet = new MeshWallet({ fetcher: provider, key: { address, type: \"address\" }, networkId: 1 });\n\n await wallet.init();\n const balance = await wallet.getBalance();\n\n const balances: AssetValue[] = [];\n\n for (const asset of balance) {\n if (asset.unit === ADA_ID) {\n const { baseDecimal } = getChainConfig(Chain.Cardano);\n balances.push(AssetValue.from({ chain: Chain.Cardano, fromBaseDecimal: baseDecimal, value: asset.quantity }));\n } else {\n balances.push(AssetValue.from({ asset: `${Chain.Cardano}.${asset.unit}`, value: asset.quantity }));\n }\n }\n\n if (balances.length === 0) {\n return [AssetValue.from({ chain: Chain.Cardano })];\n }\n\n return balances;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`Cardano balance fetch error: ${errorMessage}`);\n return [AssetValue.from({ chain: Chain.Cardano })];\n }\n}\n\nexport async function getCardanoAddressValidator() {\n const { deserializeAddress } = await import(\"@meshsdk/core\");\n\n return (address: string) => {\n try {\n deserializeAddress(address);\n return true;\n } catch {\n return false;\n }\n };\n}\n\nexport async function getCardanoToolbox(\n toolboxParams?:\n | { signer?: CardanoSigner }\n | { phrase?: string; index?: number; derivationPath?: DerivationPathArray },\n) {\n const validateAddress = await getCardanoAddressValidator();\n const signer = await match(toolboxParams)\n .with({ phrase: P.string }, async ({ phrase }) => {\n const { MeshWallet } = await import(\"@meshsdk/core\");\n const provider = await getProvider();\n\n const wallet = new MeshWallet({\n fetcher: provider,\n key: { type: \"mnemonic\", words: phrase.split(\" \") },\n networkId: 1,\n submitter: provider,\n });\n\n await wallet.init();\n return wallet;\n })\n .with({ signer: P.any }, ({ signer }) => signer)\n .otherwise(() => undefined);\n\n const signerAddress = signer && \"getChangeAddress\" in signer ? await signer.getChangeAddress() : \"\";\n\n function getAddress() {\n return signerAddress || \"\";\n }\n\n function getBalance(addressParam?: string) {\n const address = addressParam || getAddress();\n if (!address) throw new SwapKitError(\"core_wallet_connection_not_found\");\n return getCardanoBalance(address);\n }\n\n function estimateTransactionFee() {\n return Promise.resolve(AssetValue.from({ chain: Chain.Cardano, value: \"0.01\" }));\n }\n\n async function createTransaction({\n recipient,\n assetValue,\n memo,\n }: {\n recipient: string;\n assetValue: AssetValue;\n memo?: string;\n }) {\n if (!signer || !(\"getChangeAddress\" in signer)) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n const { Transaction } = await import(\"@meshsdk/core\");\n\n const [, policyId] = assetValue.symbol.split(\"-\");\n if (!assetValue.isGasAsset && !policyId) throw new SwapKitError(\"core_wallet_connection_not_found\");\n\n const tx = new Transaction({ initiator: signer });\n tx.sendAssets({ address: recipient }, [\n { quantity: assetValue.getBaseValue(\"string\"), unit: assetValue.isGasAsset ? \"lovelace\" : assetValue.symbol },\n ]);\n\n if (memo) tx.setMetadata(0, memo);\n\n const unsignedTx = await tx.build();\n return { tx, unsignedTx };\n }\n\n function signTransaction(txParams: string) {\n if (!signer || !(\"getChangeAddress\" in signer)) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n return signer.signTx(txParams);\n }\n\n async function transfer({\n recipient,\n assetValue,\n memo,\n }: {\n recipient: string;\n assetValue: AssetValue;\n memo?: string;\n }) {\n if (!signer || !(\"getChangeAddress\" in signer)) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n const { unsignedTx } = await createTransaction({ assetValue, memo, recipient });\n const signedTx = await signTransaction(unsignedTx);\n const provider = await getProvider();\n const txHash = await provider.submitTx(signedTx);\n\n return txHash;\n }\n\n return {\n createTransaction,\n estimateTransactionFee,\n getAddress,\n getBalance,\n signTransaction,\n transfer,\n validateAddress,\n };\n}\n",
6
- "export * from \"./toolbox\";\nexport * from \"./types\";\n"
7
- ],
8
- "mappings": "urBAAA,qBAAS,WAAY,oBAAiC,kBAAgB,yBACtE,gBAAS,OAAO,mBAMhB,eAAe,CAAW,EAAG,CAC3B,IAAQ,sBAAuB,KAAa,yBACtC,EAAS,0CACf,OAAO,IAAI,EADI,yCACqB,EAKtC,eAAe,CAAiB,CAAC,EAAiB,CAChD,GAAI,CACF,IAAQ,cAAe,KAAa,yBAC9B,EAAW,MAAM,EAAY,EAE7B,EAAS,IAAI,EAAW,CAAE,QAAS,EAAU,IAAK,CAAE,UAAS,KAAM,SAAU,EAAG,UAAW,CAAE,CAAC,EAEpG,MAAM,EAAO,KAAK,EAClB,IAAM,EAAU,MAAM,EAAO,WAAW,EAElC,EAAyB,CAAC,EAEhC,QAAW,KAAS,EAClB,GAAI,EAAM,OAAS,EAAQ,CACzB,IAAQ,eAAgB,EAAe,EAAM,OAAO,EACpD,EAAS,KAAK,EAAW,KAAK,CAAE,MAAO,EAAM,QAAS,gBAAiB,EAAa,MAAO,EAAM,QAAS,CAAC,CAAC,EAE5G,OAAS,KAAK,EAAW,KAAK,CAAE,MAAO,GAAG,EAAM,WAAW,EAAM,OAAQ,MAAO,EAAM,QAAS,CAAC,CA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