@swapkit/toolboxes 0.0.0-nightly-20250304130539

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 (83) hide show
  1. package/dist/chunk-fazw0jvt.js +3 -0
  2. package/dist/chunk-fazw0jvt.js.map +9 -0
  3. package/dist/chunk-tvrdndbw.js +4 -0
  4. package/dist/chunk-tvrdndbw.js.map +9 -0
  5. package/dist/cosmos/index.cjs +3 -0
  6. package/dist/cosmos/index.cjs.map +19 -0
  7. package/dist/cosmos/index.js +3 -0
  8. package/dist/cosmos/index.js.map +19 -0
  9. package/dist/evm/index.cjs +3 -0
  10. package/dist/evm/index.cjs.map +18 -0
  11. package/dist/evm/index.js +3 -0
  12. package/dist/evm/index.js.map +18 -0
  13. package/dist/index.cjs +3 -0
  14. package/dist/index.cjs.map +9 -0
  15. package/dist/index.js +3 -0
  16. package/dist/index.js.map +9 -0
  17. package/dist/radix/index.cjs +3 -0
  18. package/dist/radix/index.cjs.map +10 -0
  19. package/dist/radix/index.js +3 -0
  20. package/dist/radix/index.js.map +10 -0
  21. package/dist/solana/index.cjs +3 -0
  22. package/dist/solana/index.cjs.map +10 -0
  23. package/dist/solana/index.js +3 -0
  24. package/dist/solana/index.js.map +10 -0
  25. package/dist/substrate/index.cjs +3 -0
  26. package/dist/substrate/index.cjs.map +12 -0
  27. package/dist/substrate/index.js +3 -0
  28. package/dist/substrate/index.js.map +12 -0
  29. package/dist/utxo/index.cjs +3 -0
  30. package/dist/utxo/index.cjs.map +17 -0
  31. package/dist/utxo/index.js +3 -0
  32. package/dist/utxo/index.js.map +17 -0
  33. package/package.json +102 -0
  34. package/src/cosmos/index.ts +8 -0
  35. package/src/cosmos/thorchainUtils/addressFormat.ts +23 -0
  36. package/src/cosmos/thorchainUtils/index.ts +4 -0
  37. package/src/cosmos/thorchainUtils/messages.ts +244 -0
  38. package/src/cosmos/thorchainUtils/registry.ts +47 -0
  39. package/src/cosmos/thorchainUtils/types/client-types.ts +79 -0
  40. package/src/cosmos/thorchainUtils/types/index.ts +1 -0
  41. package/src/cosmos/thorchainUtils/types/proto/MsgCompiled.js +2806 -0
  42. package/src/cosmos/thorchainUtils/types/proto/MsgCompiled.ts +2802 -0
  43. package/src/cosmos/thorchainUtils/util.ts +46 -0
  44. package/src/cosmos/toolbox/BaseCosmosToolbox.ts +257 -0
  45. package/src/cosmos/toolbox/gaia.ts +39 -0
  46. package/src/cosmos/toolbox/getToolboxByChain.ts +29 -0
  47. package/src/cosmos/toolbox/kujira.ts +61 -0
  48. package/src/cosmos/toolbox/thorchain.ts +305 -0
  49. package/src/cosmos/types.ts +42 -0
  50. package/src/cosmos/util.ts +230 -0
  51. package/src/evm/__tests__/ethereum.test.ts +147 -0
  52. package/src/evm/api.ts +157 -0
  53. package/src/evm/contracts/eth/multicall.ts +165 -0
  54. package/src/evm/contracts/op/gasOracle.ts +151 -0
  55. package/src/evm/helpers.ts +213 -0
  56. package/src/evm/index.ts +15 -0
  57. package/src/evm/toolbox/baseEVMToolbox.ts +670 -0
  58. package/src/evm/toolbox/evm.ts +89 -0
  59. package/src/evm/toolbox/getToolboxByChain.ts +37 -0
  60. package/src/evm/toolbox/op.ts +152 -0
  61. package/src/evm/types.ts +110 -0
  62. package/src/index.ts +0 -0
  63. package/src/radix/index.ts +151 -0
  64. package/src/radix/toolbox.ts +693 -0
  65. package/src/solana/index.ts +49 -0
  66. package/src/solana/toolbox.ts +271 -0
  67. package/src/substrate/index.ts +3 -0
  68. package/src/substrate/toolbox/baseSubstrateToolbox.ts +288 -0
  69. package/src/substrate/toolbox/index.ts +40 -0
  70. package/src/substrate/types/index.ts +2 -0
  71. package/src/substrate/types/network.ts +42 -0
  72. package/src/substrate/types/wallet.ts +78 -0
  73. package/src/utxo/helpers/api.ts +431 -0
  74. package/src/utxo/helpers/bchaddrjs.ts +177 -0
  75. package/src/utxo/helpers/coinselect.ts +96 -0
  76. package/src/utxo/helpers/index.ts +5 -0
  77. package/src/utxo/helpers/txSize.ts +103 -0
  78. package/src/utxo/helpers/utils.ts +48 -0
  79. package/src/utxo/index.ts +7 -0
  80. package/src/utxo/toolbox/bitcoinCash.ts +268 -0
  81. package/src/utxo/toolbox/index.ts +41 -0
  82. package/src/utxo/toolbox/utxo.ts +372 -0
  83. package/src/utxo/types.ts +51 -0
@@ -0,0 +1,79 @@
1
+ import type { OfflineAminoSigner } from "@cosmjs/amino";
2
+ import type { EncodeObject, OfflineDirectSigner } from "@cosmjs/proto-signing";
3
+ import type { Asset, AssetValue, Chain, ChainId } from "@swapkit/helpers";
4
+
5
+ enum TxType {
6
+ Transfer = "transfer",
7
+ Unknown = "unknown",
8
+ }
9
+
10
+ type Tx = {
11
+ asset: Asset; // asset
12
+ from: { from: string }[]; // list of "from" txs. BNC will have one `TxFrom` only, `BTC` might have many transactions going "in" (based on UTXO)
13
+ to: { to: string }[]; // list of "to" transactions. BNC will have one `TxTo` only, `BTC` might have many transactions going "out" (based on UTXO)
14
+ date: Date; // timestamp of tx
15
+ type: TxType; // type
16
+ hash: string; // Tx hash
17
+ };
18
+
19
+ export type NodeUrl = {
20
+ node: string;
21
+ rpc: string;
22
+ };
23
+
24
+ export type DepositParam = {
25
+ signer?: OfflineDirectSigner | OfflineAminoSigner;
26
+ assetValue: AssetValue;
27
+ memo: string;
28
+ };
29
+
30
+ export type TxData = Pick<Tx, "from" | "to" | "type">;
31
+
32
+ /**
33
+ * Response from `thorchain/constants` endpoint
34
+ */
35
+ export type ThorchainConstantsResponse = {
36
+ int_64_values: {
37
+ // We are in fee interested only - ignore all other values
38
+ NativeTransactionFee: number;
39
+ };
40
+ };
41
+
42
+ /**
43
+ * Response of `/cosmos/base/tendermint/v1beta1/node_info`
44
+ * Note: We are interested in `network` (aka chain id) only
45
+ */
46
+ export type NodeInfoResponse = {
47
+ default_node_info: {
48
+ network: string;
49
+ };
50
+ };
51
+
52
+ export type TransferTransaction = {
53
+ memo: string;
54
+ accountNumber: number;
55
+ sequence: number;
56
+ chainId: ChainId;
57
+ msgs: EncodeObject[];
58
+ fee: { amount: { denom: string; amount: string }[]; gas: string };
59
+ };
60
+
61
+ export type CosmosNativeTransferTxParams = {
62
+ fromAddress: string;
63
+ toAddress: string;
64
+ assetValue: AssetValue;
65
+ memo?: string;
66
+ fee?: string;
67
+ };
68
+
69
+ export type ThorchainTransferTxParams = {
70
+ from: string;
71
+ recipient: string;
72
+ assetValue: AssetValue;
73
+ memo?: string;
74
+ chain: Chain.THORChain | Chain.Maya;
75
+ asSignable?: boolean;
76
+ asAminoMessage?: boolean;
77
+ };
78
+
79
+ export type ThorchainDepositTxParams = Omit<ThorchainTransferTxParams, "recipient">;
@@ -0,0 +1 @@
1
+ export * from "./client-types";