@swapkit/toolboxes 1.0.0-beta.0 → 1.0.0-beta.10
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-0f0249b1.js +3 -0
- package/dist/chunk-0f0249b1.js.map +10 -0
- package/dist/chunk-0h4xdrwz.js +4 -0
- package/dist/chunk-0h4xdrwz.js.map +10 -0
- package/dist/chunk-4yap1fvd.js +3 -0
- package/dist/chunk-4yap1fvd.js.map +10 -0
- package/dist/chunk-fjfxga2v.js +3 -0
- package/dist/chunk-fjfxga2v.js.map +10 -0
- package/dist/{chunk-tvrdndbw.js → chunk-p1kdg37m.js} +2 -2
- package/dist/{chunk-tvrdndbw.js.map → chunk-p1kdg37m.js.map} +1 -1
- package/dist/cosmos/index.cjs +2 -2
- package/dist/cosmos/index.cjs.map +10 -13
- package/dist/cosmos/index.js +2 -2
- package/dist/cosmos/index.js.map +10 -13
- package/dist/evm/index.cjs +2 -2
- package/dist/evm/index.cjs.map +10 -16
- package/dist/evm/index.js +2 -2
- package/dist/evm/index.js.map +10 -16
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +4 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -3
- package/dist/radix/index.cjs +2 -2
- package/dist/radix/index.cjs.map +3 -3
- package/dist/radix/index.js +2 -2
- package/dist/radix/index.js.map +3 -3
- package/dist/ripple/index.cjs +3 -0
- package/dist/ripple/index.cjs.map +10 -0
- package/dist/ripple/index.js +3 -0
- package/dist/ripple/index.js.map +10 -0
- package/dist/solana/index.cjs +2 -2
- package/dist/solana/index.cjs.map +3 -3
- package/dist/solana/index.js +2 -2
- package/dist/solana/index.js.map +3 -3
- package/dist/substrate/index.cjs +2 -2
- package/dist/substrate/index.cjs.map +5 -6
- package/dist/substrate/index.js +2 -2
- package/dist/substrate/index.js.map +5 -6
- package/dist/utxo/index.cjs +2 -2
- package/dist/utxo/index.cjs.map +9 -11
- package/dist/utxo/index.js +2 -2
- package/dist/utxo/index.js.map +9 -11
- package/package.json +27 -23
- package/src/cosmos/index.ts +2 -9
- package/src/cosmos/thorchainUtils/addressFormat.ts +1 -2
- package/src/cosmos/thorchainUtils/index.ts +1 -1
- package/src/cosmos/thorchainUtils/messages.ts +74 -56
- package/src/cosmos/thorchainUtils/registry.ts +19 -26
- package/src/cosmos/thorchainUtils/types/{proto/MsgCompiled.ts → MsgCompiled.ts} +1 -3
- package/src/cosmos/thorchainUtils/types/client-types.ts +16 -23
- package/src/cosmos/toolbox/cosmos.ts +334 -0
- package/src/cosmos/toolbox/index.ts +33 -0
- package/src/cosmos/toolbox/thorchain.ts +125 -137
- package/src/cosmos/types.ts +37 -18
- package/src/cosmos/util.ts +24 -74
- package/src/evm/__tests__/ethereum.test.ts +110 -116
- package/src/evm/api.ts +11 -147
- package/src/evm/helpers.ts +111 -83
- package/src/evm/index.ts +1 -17
- package/src/evm/toolbox/baseEVMToolbox.ts +744 -0
- package/src/evm/toolbox/evm.ts +69 -0
- package/src/evm/toolbox/index.ts +36 -0
- package/src/evm/toolbox/op.ts +97 -143
- package/src/evm/types.ts +50 -28
- package/src/index.ts +235 -0
- package/src/radix/index.ts +18 -19
- package/src/ripple/index.ts +199 -0
- package/src/solana/index.ts +11 -5
- package/src/solana/toolbox.ts +227 -137
- package/src/substrate/index.ts +2 -3
- package/src/substrate/{toolbox/baseSubstrateToolbox.ts → substrate.ts} +104 -72
- package/src/substrate/types.ts +120 -0
- package/src/utils.ts +27 -0
- package/src/utxo/helpers/api.ts +27 -23
- package/src/utxo/helpers/bchaddrjs.ts +21 -21
- package/src/utxo/helpers/index.ts +0 -1
- package/src/utxo/helpers/txSize.ts +3 -4
- package/src/utxo/index.ts +3 -7
- package/src/utxo/toolbox/bitcoinCash.ts +165 -155
- package/src/utxo/toolbox/index.ts +63 -24
- package/src/utxo/toolbox/utxo.ts +376 -229
- package/src/utxo/types.ts +26 -39
- package/src/cosmos/thorchainUtils/types/proto/MsgCompiled.js +0 -2806
- package/src/cosmos/thorchainUtils/util.ts +0 -46
- package/src/cosmos/toolbox/BaseCosmosToolbox.ts +0 -254
- package/src/cosmos/toolbox/gaia.ts +0 -39
- package/src/cosmos/toolbox/getToolboxByChain.ts +0 -29
- package/src/cosmos/toolbox/kujira.ts +0 -61
- package/src/evm/provider.ts +0 -6
- package/src/evm/toolbox/EVMToolbox.ts +0 -662
- package/src/evm/toolbox/arb.ts +0 -61
- package/src/evm/toolbox/avax.ts +0 -36
- package/src/evm/toolbox/base.ts +0 -42
- package/src/evm/toolbox/bsc.ts +0 -34
- package/src/evm/toolbox/eth.ts +0 -44
- package/src/evm/toolbox/getToolboxByChain.ts +0 -42
- package/src/evm/toolbox/matic.ts +0 -42
- package/src/radix/toolbox.ts +0 -693
- package/src/substrate/toolbox/index.ts +0 -40
- package/src/substrate/types/index.ts +0 -2
- package/src/substrate/types/network.ts +0 -42
- package/src/substrate/types/wallet.ts +0 -78
- package/src/utxo/helpers/utils.ts +0 -45
package/src/utxo/types.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GenericCreateTransactionParams,
|
|
3
|
+
GenericTransferParams,
|
|
4
|
+
Witness,
|
|
5
|
+
} from "@swapkit/helpers";
|
|
2
6
|
|
|
3
7
|
import type { UTXOScriptType } from "./helpers";
|
|
4
|
-
import type { BCHToolbox, BTCToolbox, DOGEToolbox, LTCToolbox } from "./index";
|
|
5
8
|
|
|
6
9
|
export type TransactionType = {
|
|
7
10
|
toHex(): string;
|
|
@@ -11,24 +14,6 @@ export type TargetOutput =
|
|
|
11
14
|
| { address: string; script?: Buffer; value: number }
|
|
12
15
|
| { script: Buffer; value: number };
|
|
13
16
|
|
|
14
|
-
export type TransactionBuilderType = {
|
|
15
|
-
inputs: any[];
|
|
16
|
-
sign(
|
|
17
|
-
vin: number,
|
|
18
|
-
keyPair: { getAddress: (index?: number) => string },
|
|
19
|
-
redeemScript?: Buffer,
|
|
20
|
-
hashType?: number,
|
|
21
|
-
witnessValue?: number,
|
|
22
|
-
witnessScript?: Buffer,
|
|
23
|
-
signatureAlgorithm?: string,
|
|
24
|
-
): void;
|
|
25
|
-
build(): TransactionType;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type UTXOToolbox = ReturnType<
|
|
29
|
-
typeof BTCToolbox | typeof BCHToolbox | typeof DOGEToolbox | typeof LTCToolbox
|
|
30
|
-
>;
|
|
31
|
-
|
|
32
17
|
export type UTXOType = {
|
|
33
18
|
hash: string;
|
|
34
19
|
index: number;
|
|
@@ -45,26 +30,28 @@ export type UTXOCalculateTxSizeParams = {
|
|
|
45
30
|
feeRate: number;
|
|
46
31
|
};
|
|
47
32
|
|
|
48
|
-
export type UTXOBuildTxParams = {
|
|
49
|
-
assetValue: AssetValue;
|
|
50
|
-
recipient: string;
|
|
51
|
-
memo?: string;
|
|
52
|
-
feeRate: number;
|
|
53
|
-
sender: string;
|
|
54
|
-
fetchTxHex?: boolean;
|
|
55
|
-
};
|
|
33
|
+
export type UTXOBuildTxParams = GenericCreateTransactionParams & { fetchTxHex?: boolean };
|
|
56
34
|
|
|
57
|
-
export type UTXOTransferParams =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
recipient: string;
|
|
64
|
-
assetValue: AssetValue;
|
|
65
|
-
memo?: string;
|
|
35
|
+
export type UTXOTransferParams = GenericTransferParams;
|
|
36
|
+
|
|
37
|
+
export type BchECPair = {
|
|
38
|
+
getAddress: (index?: number) => string;
|
|
39
|
+
publicKey: Buffer;
|
|
40
|
+
toWIF: () => string;
|
|
66
41
|
};
|
|
67
42
|
|
|
68
|
-
export type
|
|
69
|
-
|
|
43
|
+
export type TransactionBuilderType = {
|
|
44
|
+
inputs: any[];
|
|
45
|
+
sign(
|
|
46
|
+
vin: number,
|
|
47
|
+
keyPair: BchECPair,
|
|
48
|
+
redeemScript?: Buffer,
|
|
49
|
+
hashType?: number,
|
|
50
|
+
witnessValue?: number,
|
|
51
|
+
witnessScript?: Buffer,
|
|
52
|
+
signatureAlgorithm?: string,
|
|
53
|
+
): void;
|
|
54
|
+
build(): TransactionType;
|
|
55
|
+
addOutput(addressOrScriptBuffer: string | Buffer, value: number): void;
|
|
56
|
+
addInput(txHash: string | Buffer, vout: number, sequence?: number, prevOutScript?: Buffer): void;
|
|
70
57
|
};
|