@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.
- package/dist/LICENSE +246 -0
- package/dist/src/aptos/index.cjs +1 -0
- package/dist/src/aptos/index.js +1 -0
- package/dist/src/cardano/index.cjs +1 -4
- package/dist/src/cardano/index.js +1 -4
- package/dist/src/cosmos/index.cjs +1 -4
- package/dist/src/cosmos/index.js +1 -4
- package/dist/src/evm/index.cjs +1 -4
- package/dist/src/evm/index.js +1 -4
- package/dist/src/index.cjs +1 -5
- package/dist/src/index.js +1 -5
- package/dist/src/near/index.cjs +1 -4
- package/dist/src/near/index.js +1 -4
- package/dist/src/radix/index.cjs +1 -4
- package/dist/src/radix/index.js +1 -4
- package/dist/src/ripple/index.cjs +1 -4
- package/dist/src/ripple/index.js +1 -4
- package/dist/src/solana/index.cjs +1 -4
- package/dist/src/solana/index.js +1 -4
- package/dist/src/starknet/index.cjs +1 -0
- package/dist/src/starknet/index.js +1 -0
- package/dist/src/stellar/index.cjs +1 -0
- package/dist/src/stellar/index.js +1 -0
- package/dist/src/substrate/index.cjs +1 -4
- package/dist/src/substrate/index.js +1 -4
- package/dist/src/sui/index.cjs +1 -4
- package/dist/src/sui/index.js +1 -4
- package/dist/src/ton/index.cjs +1 -4
- package/dist/src/ton/index.js +1 -4
- package/dist/src/tron/index.cjs +1 -4
- package/dist/src/tron/index.js +1 -4
- package/dist/src/utxo/index.cjs +1 -5
- package/dist/src/utxo/index.js +1 -5
- package/dist/types/aptos/index.d.ts +3 -0
- package/dist/types/aptos/index.d.ts.map +1 -0
- package/dist/types/aptos/toolbox.d.ts +21 -0
- package/dist/types/aptos/toolbox.d.ts.map +1 -0
- package/dist/types/aptos/types.d.ts +27 -0
- package/dist/types/aptos/types.d.ts.map +1 -0
- package/dist/types/cardano/toolbox.d.ts +19 -22
- package/dist/types/cardano/toolbox.d.ts.map +1 -1
- package/dist/types/cardano/types.d.ts +8 -3
- package/dist/types/cardano/types.d.ts.map +1 -1
- package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts.map +1 -1
- package/dist/types/cosmos/thorchainUtils/messages.d.ts +3 -3
- package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -1
- package/dist/types/cosmos/toolbox/cosmos.d.ts +11 -9
- package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -1
- package/dist/types/cosmos/toolbox/thorchain.d.ts +6 -51
- package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -1
- package/dist/types/cosmos/types.d.ts +2 -2
- package/dist/types/cosmos/types.d.ts.map +1 -1
- package/dist/types/evm/helpers.d.ts +34 -1
- package/dist/types/evm/helpers.d.ts.map +1 -1
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +14 -7
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -1
- package/dist/types/evm/toolbox/evm.d.ts +236 -96
- package/dist/types/evm/toolbox/evm.d.ts.map +1 -1
- package/dist/types/evm/toolbox/index.d.ts +3 -2
- package/dist/types/evm/toolbox/index.d.ts.map +1 -1
- package/dist/types/evm/toolbox/op.d.ts +13 -8
- package/dist/types/evm/toolbox/op.d.ts.map +1 -1
- package/dist/types/evm/types.d.ts +49 -27
- package/dist/types/evm/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +31 -25
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/near/helpers/core.d.ts +1 -1
- package/dist/types/near/helpers/core.d.ts.map +1 -1
- package/dist/types/near/index.d.ts +1 -1
- package/dist/types/near/index.d.ts.map +1 -1
- package/dist/types/near/toolbox.d.ts +13 -10
- package/dist/types/near/toolbox.d.ts.map +1 -1
- package/dist/types/near/types/index.d.ts +4 -0
- package/dist/types/near/types/index.d.ts.map +1 -0
- package/dist/types/near/types/toolbox.d.ts +2 -0
- package/dist/types/near/types/toolbox.d.ts.map +1 -1
- package/dist/types/radix/index.d.ts +7 -7
- package/dist/types/radix/index.d.ts.map +1 -1
- package/dist/types/ripple/currency.d.ts +5 -0
- package/dist/types/ripple/currency.d.ts.map +1 -0
- package/dist/types/ripple/index.d.ts +60 -17
- package/dist/types/ripple/index.d.ts.map +1 -1
- package/dist/types/ripple/tokens.d.ts +15 -0
- package/dist/types/ripple/tokens.d.ts.map +1 -0
- package/dist/types/solana/index.d.ts +1 -1
- package/dist/types/solana/index.d.ts.map +1 -1
- package/dist/types/solana/toolbox.d.ts +12 -10
- package/dist/types/solana/toolbox.d.ts.map +1 -1
- package/dist/types/starknet/index.d.ts +5 -0
- package/dist/types/starknet/index.d.ts.map +1 -0
- package/dist/types/starknet/toolbox.d.ts +34 -0
- package/dist/types/starknet/toolbox.d.ts.map +1 -0
- package/dist/types/starknet/types.d.ts +26 -0
- package/dist/types/starknet/types.d.ts.map +1 -0
- package/dist/types/stellar/index.d.ts +3 -0
- package/dist/types/stellar/index.d.ts.map +1 -0
- package/dist/types/stellar/toolbox.d.ts +21 -0
- package/dist/types/stellar/toolbox.d.ts.map +1 -0
- package/dist/types/stellar/types.d.ts +10 -0
- package/dist/types/stellar/types.d.ts.map +1 -0
- package/dist/types/substrate/balance.d.ts +3 -3
- package/dist/types/substrate/balance.d.ts.map +1 -1
- package/dist/types/substrate/substrate.d.ts +22 -97
- package/dist/types/substrate/substrate.d.ts.map +1 -1
- package/dist/types/substrate/types.d.ts +2 -2
- package/dist/types/substrate/types.d.ts.map +1 -1
- package/dist/types/sui/toolbox.d.ts +17 -8
- package/dist/types/sui/toolbox.d.ts.map +1 -1
- package/dist/types/sui/types.d.ts +11 -3
- package/dist/types/sui/types.d.ts.map +1 -1
- package/dist/types/ton/toolbox.d.ts +23 -13
- package/dist/types/ton/toolbox.d.ts.map +1 -1
- package/dist/types/ton/types.d.ts +9 -8
- package/dist/types/ton/types.d.ts.map +1 -1
- package/dist/types/tron/helpers/proto.d.ts +9 -0
- package/dist/types/tron/helpers/proto.d.ts.map +1 -0
- package/dist/types/tron/helpers/trongrid.d.ts +43 -3
- package/dist/types/tron/helpers/trongrid.d.ts.map +1 -1
- package/dist/types/tron/helpers/utils.d.ts +17 -0
- package/dist/types/tron/helpers/utils.d.ts.map +1 -0
- package/dist/types/tron/index.d.ts +4 -5
- package/dist/types/tron/index.d.ts.map +1 -1
- package/dist/types/tron/toolbox.d.ts +20 -18
- package/dist/types/tron/toolbox.d.ts.map +1 -1
- package/dist/types/tron/types.d.ts +31 -57
- package/dist/types/tron/types.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utxo/hdWallet.d.ts +33 -0
- package/dist/types/utxo/hdWallet.d.ts.map +1 -0
- package/dist/types/utxo/helpers/api.d.ts +49 -1
- package/dist/types/utxo/helpers/api.d.ts.map +1 -1
- package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -1
- package/dist/types/utxo/helpers/cashaddr.d.ts +13 -0
- package/dist/types/utxo/helpers/cashaddr.d.ts.map +1 -0
- package/dist/types/utxo/helpers/coinselect.d.ts +9 -5
- package/dist/types/utxo/helpers/coinselect.d.ts.map +1 -1
- package/dist/types/utxo/helpers/txSize.d.ts +4 -3
- package/dist/types/utxo/helpers/txSize.d.ts.map +1 -1
- package/dist/types/utxo/index.d.ts +2 -1
- package/dist/types/utxo/index.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/bitcoinCash.d.ts +75 -15
- package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/index.d.ts +6 -5
- package/dist/types/utxo/toolbox/index.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/params.d.ts +8 -16
- package/dist/types/utxo/toolbox/params.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/utxo.d.ts +135 -46
- package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/validators.d.ts +1 -1
- package/dist/types/utxo/toolbox/validators.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/zcash.d.ts +63 -10
- package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -1
- package/dist/types/utxo/types.d.ts +78 -15
- package/dist/types/utxo/types.d.ts.map +1 -1
- package/package.json +43 -53
- package/dist/src/cardano/index.cjs.map +0 -11
- package/dist/src/cardano/index.js.map +0 -11
- package/dist/src/cosmos/index.cjs.map +0 -20
- package/dist/src/cosmos/index.js.map +0 -20
- package/dist/src/evm/index.cjs.map +0 -20
- package/dist/src/evm/index.js.map +0 -20
- package/dist/src/index.cjs.map +0 -67
- package/dist/src/index.js.map +0 -67
- package/dist/src/near/index.cjs.map +0 -16
- package/dist/src/near/index.js.map +0 -16
- package/dist/src/radix/index.cjs.map +0 -10
- package/dist/src/radix/index.js.map +0 -10
- package/dist/src/ripple/index.cjs.map +0 -10
- package/dist/src/ripple/index.js.map +0 -10
- package/dist/src/solana/index.cjs.map +0 -11
- package/dist/src/solana/index.js.map +0 -11
- package/dist/src/substrate/index.cjs.map +0 -13
- package/dist/src/substrate/index.js.map +0 -13
- package/dist/src/sui/index.cjs.map +0 -11
- package/dist/src/sui/index.js.map +0 -11
- package/dist/src/ton/index.cjs.map +0 -11
- package/dist/src/ton/index.js.map +0 -11
- package/dist/src/tron/index.cjs.map +0 -13
- package/dist/src/tron/index.js.map +0 -13
- package/dist/src/utxo/index.cjs.map +0 -21
- package/dist/src/utxo/index.js.map +0 -21
- package/dist/types/tron/helpers/trc20.abi.d.ts +0 -156
- package/dist/types/tron/helpers/trc20.abi.d.ts.map +0 -1
- package/src/__tests__/address-validation-all-chains.test.ts +0 -162
- package/src/__tests__/addressValidator.test.ts +0 -162
- package/src/cardano/__tests__/toolbox.test.ts +0 -48
- package/src/cardano/index.ts +0 -2
- package/src/cardano/toolbox.ts +0 -168
- package/src/cardano/types.ts +0 -10
- package/src/cosmos/__tests__/toolbox.test.ts +0 -95
- package/src/cosmos/index.ts +0 -4
- package/src/cosmos/thorchainUtils/addressFormat.ts +0 -22
- package/src/cosmos/thorchainUtils/index.ts +0 -4
- package/src/cosmos/thorchainUtils/messages.ts +0 -212
- package/src/cosmos/thorchainUtils/registry.ts +0 -43
- package/src/cosmos/thorchainUtils/types/MsgCompiled.ts +0 -2800
- package/src/cosmos/thorchainUtils/types/client-types.ts +0 -54
- package/src/cosmos/thorchainUtils/types/index.ts +0 -1
- package/src/cosmos/toolbox/cosmos.ts +0 -350
- package/src/cosmos/toolbox/index.ts +0 -35
- package/src/cosmos/toolbox/thorchain.ts +0 -249
- package/src/cosmos/types.ts +0 -48
- package/src/cosmos/util.ts +0 -214
- package/src/evm/__tests__/address-validation.test.ts +0 -84
- package/src/evm/__tests__/ethereum.test.ts +0 -137
- package/src/evm/__tests__/signMessage.test.ts +0 -60
- package/src/evm/api.ts +0 -10
- package/src/evm/contracts/eth/multicall.ts +0 -165
- package/src/evm/contracts/op/gasOracle.ts +0 -145
- package/src/evm/helpers.ts +0 -71
- package/src/evm/index.ts +0 -4
- package/src/evm/toolbox/baseEVMToolbox.ts +0 -698
- package/src/evm/toolbox/evm.ts +0 -66
- package/src/evm/toolbox/index.ts +0 -44
- package/src/evm/toolbox/op.ts +0 -143
- package/src/evm/types.ts +0 -146
- package/src/index.ts +0 -260
- package/src/near/__tests__/core.test.ts +0 -70
- package/src/near/helpers/core.ts +0 -85
- package/src/near/helpers/gasEstimation.ts +0 -96
- package/src/near/helpers/nep141.ts +0 -50
- package/src/near/index.ts +0 -21
- package/src/near/toolbox.ts +0 -421
- package/src/near/types/contract.ts +0 -32
- package/src/near/types/nep141.ts +0 -34
- package/src/near/types/toolbox.ts +0 -55
- package/src/near/types.ts +0 -44
- package/src/radix/index.ts +0 -138
- package/src/ripple/index.ts +0 -179
- package/src/solana/index.ts +0 -36
- package/src/solana/toolbox.ts +0 -409
- package/src/substrate/balance.ts +0 -88
- package/src/substrate/index.ts +0 -2
- package/src/substrate/substrate.ts +0 -281
- package/src/substrate/types.ts +0 -115
- package/src/sui/__tests__/toolbox.test.ts +0 -86
- package/src/sui/index.ts +0 -2
- package/src/sui/toolbox.ts +0 -166
- package/src/sui/types.ts +0 -11
- package/src/ton/__tests__/toolbox.test.ts +0 -67
- package/src/ton/index.ts +0 -2
- package/src/ton/toolbox.ts +0 -136
- package/src/ton/types.ts +0 -13
- package/src/tron/__tests__/toolbox.test.ts +0 -221
- package/src/tron/helpers/trc20.abi.ts +0 -107
- package/src/tron/helpers/trongrid.ts +0 -53
- package/src/tron/index.ts +0 -21
- package/src/tron/toolbox.ts +0 -585
- package/src/tron/types.ts +0 -83
- package/src/types.ts +0 -28
- package/src/utils.ts +0 -34
- package/src/utxo/__tests__/zcash-integration.test.ts +0 -97
- package/src/utxo/helpers/api.ts +0 -471
- package/src/utxo/helpers/bchaddrjs.ts +0 -166
- package/src/utxo/helpers/coinselect.ts +0 -92
- package/src/utxo/helpers/index.ts +0 -4
- package/src/utxo/helpers/txSize.ts +0 -137
- package/src/utxo/index.ts +0 -6
- package/src/utxo/toolbox/bitcoinCash.ts +0 -243
- package/src/utxo/toolbox/index.ts +0 -59
- package/src/utxo/toolbox/params.ts +0 -18
- package/src/utxo/toolbox/utxo.ts +0 -439
- package/src/utxo/toolbox/validators.ts +0 -36
- package/src/utxo/toolbox/zcash.ts +0 -242
- package/src/utxo/types.ts +0 -39
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
export const multicallAbi = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [
|
|
4
|
-
{
|
|
5
|
-
components: [
|
|
6
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
7
|
-
{ internalType: "bytes", name: "callData", type: "bytes" },
|
|
8
|
-
],
|
|
9
|
-
internalType: "struct Multicall2.Call[]",
|
|
10
|
-
name: "calls",
|
|
11
|
-
type: "tuple[]",
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
name: "aggregate",
|
|
15
|
-
outputs: [
|
|
16
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" },
|
|
17
|
-
{ internalType: "bytes[]", name: "returnData", type: "bytes[]" },
|
|
18
|
-
],
|
|
19
|
-
stateMutability: "nonpayable",
|
|
20
|
-
type: "function",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
inputs: [
|
|
24
|
-
{
|
|
25
|
-
components: [
|
|
26
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
27
|
-
{ internalType: "bytes", name: "callData", type: "bytes" },
|
|
28
|
-
],
|
|
29
|
-
internalType: "struct Multicall2.Call[]",
|
|
30
|
-
name: "calls",
|
|
31
|
-
type: "tuple[]",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
name: "blockAndAggregate",
|
|
35
|
-
outputs: [
|
|
36
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" },
|
|
37
|
-
{ internalType: "bytes32", name: "blockHash", type: "bytes32" },
|
|
38
|
-
{
|
|
39
|
-
components: [
|
|
40
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
41
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" },
|
|
42
|
-
],
|
|
43
|
-
internalType: "struct Multicall2.Result[]",
|
|
44
|
-
name: "returnData",
|
|
45
|
-
type: "tuple[]",
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
stateMutability: "nonpayable",
|
|
49
|
-
type: "function",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
inputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }],
|
|
53
|
-
name: "getBlockHash",
|
|
54
|
-
outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }],
|
|
55
|
-
stateMutability: "view",
|
|
56
|
-
type: "function",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
inputs: [],
|
|
60
|
-
name: "getBlockNumber",
|
|
61
|
-
outputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }],
|
|
62
|
-
stateMutability: "view",
|
|
63
|
-
type: "function",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
inputs: [],
|
|
67
|
-
name: "getCurrentBlockCoinbase",
|
|
68
|
-
outputs: [{ internalType: "address", name: "coinbase", type: "address" }],
|
|
69
|
-
stateMutability: "view",
|
|
70
|
-
type: "function",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
inputs: [],
|
|
74
|
-
name: "getCurrentBlockDifficulty",
|
|
75
|
-
outputs: [{ internalType: "uint256", name: "difficulty", type: "uint256" }],
|
|
76
|
-
stateMutability: "view",
|
|
77
|
-
type: "function",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
inputs: [],
|
|
81
|
-
name: "getCurrentBlockGasLimit",
|
|
82
|
-
outputs: [{ internalType: "uint256", name: "gaslimit", type: "uint256" }],
|
|
83
|
-
stateMutability: "view",
|
|
84
|
-
type: "function",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
inputs: [],
|
|
88
|
-
name: "getCurrentBlockTimestamp",
|
|
89
|
-
outputs: [{ internalType: "uint256", name: "timestamp", type: "uint256" }],
|
|
90
|
-
stateMutability: "view",
|
|
91
|
-
type: "function",
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
inputs: [{ internalType: "address", name: "addr", type: "address" }],
|
|
95
|
-
name: "getEthBalance",
|
|
96
|
-
outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }],
|
|
97
|
-
stateMutability: "view",
|
|
98
|
-
type: "function",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
inputs: [],
|
|
102
|
-
name: "getLastBlockHash",
|
|
103
|
-
outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }],
|
|
104
|
-
stateMutability: "view",
|
|
105
|
-
type: "function",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
inputs: [
|
|
109
|
-
{ internalType: "bool", name: "requireSuccess", type: "bool" },
|
|
110
|
-
{
|
|
111
|
-
components: [
|
|
112
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
113
|
-
{ internalType: "bytes", name: "callData", type: "bytes" },
|
|
114
|
-
],
|
|
115
|
-
internalType: "struct Multicall2.Call[]",
|
|
116
|
-
name: "calls",
|
|
117
|
-
type: "tuple[]",
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
name: "tryAggregate",
|
|
121
|
-
outputs: [
|
|
122
|
-
{
|
|
123
|
-
components: [
|
|
124
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
125
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" },
|
|
126
|
-
],
|
|
127
|
-
internalType: "struct Multicall2.Result[]",
|
|
128
|
-
name: "returnData",
|
|
129
|
-
type: "tuple[]",
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
stateMutability: "nonpayable",
|
|
133
|
-
type: "function",
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
inputs: [
|
|
137
|
-
{ internalType: "bool", name: "requireSuccess", type: "bool" },
|
|
138
|
-
{
|
|
139
|
-
components: [
|
|
140
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
141
|
-
{ internalType: "bytes", name: "callData", type: "bytes" },
|
|
142
|
-
],
|
|
143
|
-
internalType: "struct Multicall2.Call[]",
|
|
144
|
-
name: "calls",
|
|
145
|
-
type: "tuple[]",
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
name: "tryBlockAndAggregate",
|
|
149
|
-
outputs: [
|
|
150
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" },
|
|
151
|
-
{ internalType: "bytes32", name: "blockHash", type: "bytes32" },
|
|
152
|
-
{
|
|
153
|
-
components: [
|
|
154
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
155
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" },
|
|
156
|
-
],
|
|
157
|
-
internalType: "struct Multicall2.Result[]",
|
|
158
|
-
name: "returnData",
|
|
159
|
-
type: "tuple[]",
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
stateMutability: "nonpayable",
|
|
163
|
-
type: "function",
|
|
164
|
-
},
|
|
165
|
-
];
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
export const gasOracleAbi = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [{ internalType: "address", name: "_owner", type: "address" }],
|
|
4
|
-
stateMutability: "nonpayable",
|
|
5
|
-
type: "constructor",
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
anonymous: false,
|
|
9
|
-
inputs: [{ indexed: false, internalType: "uint256", name: "", type: "uint256" }],
|
|
10
|
-
name: "DecimalsUpdated",
|
|
11
|
-
type: "event",
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
anonymous: false,
|
|
15
|
-
inputs: [{ indexed: false, internalType: "uint256", name: "", type: "uint256" }],
|
|
16
|
-
name: "GasPriceUpdated",
|
|
17
|
-
type: "event",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
anonymous: false,
|
|
21
|
-
inputs: [{ indexed: false, internalType: "uint256", name: "", type: "uint256" }],
|
|
22
|
-
name: "L1BaseFeeUpdated",
|
|
23
|
-
type: "event",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
anonymous: false,
|
|
27
|
-
inputs: [{ indexed: false, internalType: "uint256", name: "", type: "uint256" }],
|
|
28
|
-
name: "OverheadUpdated",
|
|
29
|
-
type: "event",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
anonymous: false,
|
|
33
|
-
inputs: [
|
|
34
|
-
{ indexed: true, internalType: "address", name: "previousOwner", type: "address" },
|
|
35
|
-
{ indexed: true, internalType: "address", name: "newOwner", type: "address" },
|
|
36
|
-
],
|
|
37
|
-
name: "OwnershipTransferred",
|
|
38
|
-
type: "event",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
anonymous: false,
|
|
42
|
-
inputs: [{ indexed: false, internalType: "uint256", name: "", type: "uint256" }],
|
|
43
|
-
name: "ScalarUpdated",
|
|
44
|
-
type: "event",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
inputs: [],
|
|
48
|
-
name: "decimals",
|
|
49
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
50
|
-
stateMutability: "view",
|
|
51
|
-
type: "function",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
inputs: [],
|
|
55
|
-
name: "gasPrice",
|
|
56
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
57
|
-
stateMutability: "view",
|
|
58
|
-
type: "function",
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
inputs: [{ internalType: "bytes", name: "_data", type: "bytes" }],
|
|
62
|
-
name: "getL1Fee",
|
|
63
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
64
|
-
stateMutability: "view",
|
|
65
|
-
type: "function",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
inputs: [{ internalType: "bytes", name: "_data", type: "bytes" }],
|
|
69
|
-
name: "getL1GasUsed",
|
|
70
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
71
|
-
stateMutability: "view",
|
|
72
|
-
type: "function",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
inputs: [],
|
|
76
|
-
name: "l1BaseFee",
|
|
77
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
78
|
-
stateMutability: "view",
|
|
79
|
-
type: "function",
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
inputs: [],
|
|
83
|
-
name: "overhead",
|
|
84
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
85
|
-
stateMutability: "view",
|
|
86
|
-
type: "function",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
inputs: [],
|
|
90
|
-
name: "owner",
|
|
91
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
92
|
-
stateMutability: "view",
|
|
93
|
-
type: "function",
|
|
94
|
-
},
|
|
95
|
-
{ inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
|
|
96
|
-
{
|
|
97
|
-
inputs: [],
|
|
98
|
-
name: "scalar",
|
|
99
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
100
|
-
stateMutability: "view",
|
|
101
|
-
type: "function",
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
inputs: [{ internalType: "uint256", name: "_decimals", type: "uint256" }],
|
|
105
|
-
name: "setDecimals",
|
|
106
|
-
outputs: [],
|
|
107
|
-
stateMutability: "nonpayable",
|
|
108
|
-
type: "function",
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
inputs: [{ internalType: "uint256", name: "_gasPrice", type: "uint256" }],
|
|
112
|
-
name: "setGasPrice",
|
|
113
|
-
outputs: [],
|
|
114
|
-
stateMutability: "nonpayable",
|
|
115
|
-
type: "function",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
inputs: [{ internalType: "uint256", name: "_baseFee", type: "uint256" }],
|
|
119
|
-
name: "setL1BaseFee",
|
|
120
|
-
outputs: [],
|
|
121
|
-
stateMutability: "nonpayable",
|
|
122
|
-
type: "function",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
inputs: [{ internalType: "uint256", name: "_overhead", type: "uint256" }],
|
|
126
|
-
name: "setOverhead",
|
|
127
|
-
outputs: [],
|
|
128
|
-
stateMutability: "nonpayable",
|
|
129
|
-
type: "function",
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
inputs: [{ internalType: "uint256", name: "_scalar", type: "uint256" }],
|
|
133
|
-
name: "setScalar",
|
|
134
|
-
outputs: [],
|
|
135
|
-
stateMutability: "nonpayable",
|
|
136
|
-
type: "function",
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
140
|
-
name: "transferOwnership",
|
|
141
|
-
outputs: [],
|
|
142
|
-
stateMutability: "nonpayable",
|
|
143
|
-
type: "function",
|
|
144
|
-
},
|
|
145
|
-
];
|
package/src/evm/helpers.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Chain, type EVMChain, getChainConfig, getRPCUrl, type NetworkParams } from "@swapkit/helpers";
|
|
2
|
-
import { match } from "ts-pattern";
|
|
3
|
-
|
|
4
|
-
export async function getProvider(chain: EVMChain, customUrl?: string) {
|
|
5
|
-
const { JsonRpcProvider } = await import("ethers");
|
|
6
|
-
|
|
7
|
-
return new JsonRpcProvider(customUrl || (await getRPCUrl(chain)));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function toHexString(value: bigint) {
|
|
11
|
-
return value > 0n ? `0x${value.toString(16)}` : "0x0";
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function getNetworkParams<C extends EVMChain>(chain: C) {
|
|
15
|
-
const { explorerUrl, chainIdHex, rpcUrls } = getChainConfig(chain);
|
|
16
|
-
|
|
17
|
-
return function getNetworkParams(): C extends Chain.Ethereum ? undefined : NetworkParams {
|
|
18
|
-
return (
|
|
19
|
-
chain !== Chain.Ethereum
|
|
20
|
-
? { ...getNetworkInfo({ chain }), blockExplorerUrls: [explorerUrl], chainId: chainIdHex, rpcUrls }
|
|
21
|
-
: undefined
|
|
22
|
-
) as C extends Chain.Ethereum ? undefined : NetworkParams;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function getIsEIP1559Compatible<C extends EVMChain>(chain: C) {
|
|
27
|
-
const notCompatible = [Chain.Arbitrum, Chain.BinanceSmartChain] as EVMChain[];
|
|
28
|
-
|
|
29
|
-
return !notCompatible.includes(chain);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function getNetworkInfo({ chain }: { chain: EVMChain }) {
|
|
33
|
-
const { name, nativeCurrency, baseDecimal: decimals } = getChainConfig(chain);
|
|
34
|
-
|
|
35
|
-
return match(chain)
|
|
36
|
-
.with(Chain.Arbitrum, () => ({
|
|
37
|
-
chainName: "Arbitrum One",
|
|
38
|
-
nativeCurrency: { decimals, name: "Ethereum", symbol: Chain.Ethereum },
|
|
39
|
-
}))
|
|
40
|
-
.with(Chain.Aurora, () => ({
|
|
41
|
-
chainName: "Aurora Mainnet",
|
|
42
|
-
nativeCurrency: { decimals, name: "Ethereum", symbol: Chain.Ethereum },
|
|
43
|
-
}))
|
|
44
|
-
.with(Chain.Avalanche, () => ({
|
|
45
|
-
chainName: "Avalanche Network",
|
|
46
|
-
nativeCurrency: { decimals, name: "Avalanche", symbol: chain },
|
|
47
|
-
}))
|
|
48
|
-
.with(Chain.Base, () => ({
|
|
49
|
-
chainName: "Base Mainnet",
|
|
50
|
-
nativeCurrency: { decimals, name: "Ethereum", symbol: Chain.Ethereum },
|
|
51
|
-
}))
|
|
52
|
-
.with(Chain.Berachain, () => ({
|
|
53
|
-
chainName: "Berachain",
|
|
54
|
-
nativeCurrency: { decimals, name: "Berachain", symbol: "BERA" },
|
|
55
|
-
}))
|
|
56
|
-
.with(Chain.XLayer, () => ({ chainName: "X Layer", nativeCurrency: { decimals, name: "OKB", symbol: "OKB" } }))
|
|
57
|
-
.with(Chain.BinanceSmartChain, () => ({
|
|
58
|
-
chainName: "BNB Smart Chain Mainnet",
|
|
59
|
-
nativeCurrency: { decimals, name: "Binance Coin", symbol: "BNB" },
|
|
60
|
-
}))
|
|
61
|
-
.with(Chain.Gnosis, () => ({ chainName: "Gnosis", nativeCurrency: { decimals, name: "xDAI", symbol: "XDAI" } }))
|
|
62
|
-
.with(Chain.Optimism, () => ({
|
|
63
|
-
chainName: "OP Mainnet",
|
|
64
|
-
nativeCurrency: { decimals, name: "Ethereum", symbol: Chain.Ethereum },
|
|
65
|
-
}))
|
|
66
|
-
.with(Chain.Polygon, () => ({
|
|
67
|
-
chainName: "Polygon Mainnet",
|
|
68
|
-
nativeCurrency: { decimals, name: "Polygon", symbol: Chain.Polygon },
|
|
69
|
-
}))
|
|
70
|
-
.otherwise(() => ({ chainName: name, nativeCurrency: { decimals, name: nativeCurrency, symbol: nativeCurrency } }));
|
|
71
|
-
}
|
package/src/evm/index.ts
DELETED