@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.
- package/dist/chunk-fazw0jvt.js +3 -0
- package/dist/chunk-fazw0jvt.js.map +9 -0
- package/dist/chunk-tvrdndbw.js +4 -0
- package/dist/chunk-tvrdndbw.js.map +9 -0
- package/dist/cosmos/index.cjs +3 -0
- package/dist/cosmos/index.cjs.map +19 -0
- package/dist/cosmos/index.js +3 -0
- package/dist/cosmos/index.js.map +19 -0
- package/dist/evm/index.cjs +3 -0
- package/dist/evm/index.cjs.map +18 -0
- package/dist/evm/index.js +3 -0
- package/dist/evm/index.js.map +18 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +9 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +9 -0
- package/dist/radix/index.cjs +3 -0
- package/dist/radix/index.cjs.map +10 -0
- package/dist/radix/index.js +3 -0
- package/dist/radix/index.js.map +10 -0
- package/dist/solana/index.cjs +3 -0
- package/dist/solana/index.cjs.map +10 -0
- package/dist/solana/index.js +3 -0
- package/dist/solana/index.js.map +10 -0
- package/dist/substrate/index.cjs +3 -0
- package/dist/substrate/index.cjs.map +12 -0
- package/dist/substrate/index.js +3 -0
- package/dist/substrate/index.js.map +12 -0
- package/dist/utxo/index.cjs +3 -0
- package/dist/utxo/index.cjs.map +17 -0
- package/dist/utxo/index.js +3 -0
- package/dist/utxo/index.js.map +17 -0
- package/package.json +102 -0
- package/src/cosmos/index.ts +8 -0
- package/src/cosmos/thorchainUtils/addressFormat.ts +23 -0
- package/src/cosmos/thorchainUtils/index.ts +4 -0
- package/src/cosmos/thorchainUtils/messages.ts +244 -0
- package/src/cosmos/thorchainUtils/registry.ts +47 -0
- package/src/cosmos/thorchainUtils/types/client-types.ts +79 -0
- package/src/cosmos/thorchainUtils/types/index.ts +1 -0
- package/src/cosmos/thorchainUtils/types/proto/MsgCompiled.js +2806 -0
- package/src/cosmos/thorchainUtils/types/proto/MsgCompiled.ts +2802 -0
- package/src/cosmos/thorchainUtils/util.ts +46 -0
- package/src/cosmos/toolbox/BaseCosmosToolbox.ts +257 -0
- package/src/cosmos/toolbox/gaia.ts +39 -0
- package/src/cosmos/toolbox/getToolboxByChain.ts +29 -0
- package/src/cosmos/toolbox/kujira.ts +61 -0
- package/src/cosmos/toolbox/thorchain.ts +305 -0
- package/src/cosmos/types.ts +42 -0
- package/src/cosmos/util.ts +230 -0
- package/src/evm/__tests__/ethereum.test.ts +147 -0
- package/src/evm/api.ts +157 -0
- package/src/evm/contracts/eth/multicall.ts +165 -0
- package/src/evm/contracts/op/gasOracle.ts +151 -0
- package/src/evm/helpers.ts +213 -0
- package/src/evm/index.ts +15 -0
- package/src/evm/toolbox/baseEVMToolbox.ts +670 -0
- package/src/evm/toolbox/evm.ts +89 -0
- package/src/evm/toolbox/getToolboxByChain.ts +37 -0
- package/src/evm/toolbox/op.ts +152 -0
- package/src/evm/types.ts +110 -0
- package/src/index.ts +0 -0
- package/src/radix/index.ts +151 -0
- package/src/radix/toolbox.ts +693 -0
- package/src/solana/index.ts +49 -0
- package/src/solana/toolbox.ts +271 -0
- package/src/substrate/index.ts +3 -0
- package/src/substrate/toolbox/baseSubstrateToolbox.ts +288 -0
- package/src/substrate/toolbox/index.ts +40 -0
- package/src/substrate/types/index.ts +2 -0
- package/src/substrate/types/network.ts +42 -0
- package/src/substrate/types/wallet.ts +78 -0
- package/src/utxo/helpers/api.ts +431 -0
- package/src/utxo/helpers/bchaddrjs.ts +177 -0
- package/src/utxo/helpers/coinselect.ts +96 -0
- package/src/utxo/helpers/index.ts +5 -0
- package/src/utxo/helpers/txSize.ts +103 -0
- package/src/utxo/helpers/utils.ts +48 -0
- package/src/utxo/index.ts +7 -0
- package/src/utxo/toolbox/bitcoinCash.ts +268 -0
- package/src/utxo/toolbox/index.ts +41 -0
- package/src/utxo/toolbox/utxo.ts +372 -0
- 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";
|