@swapkit/helpers 2.5.0 → 3.0.0-beta.0
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/api/index.cjs +3 -0
- package/dist/api/index.cjs.map +16 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +16 -0
- package/dist/chunk-fazw0jvt.js +3 -0
- package/dist/chunk-fazw0jvt.js.map +9 -0
- package/dist/chunk-nm00d52v.js +4 -0
- package/dist/chunk-nm00d52v.js.map +9 -0
- package/dist/contracts/index.cjs +3 -0
- package/dist/contracts/index.cjs.map +38 -0
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/index.js.map +38 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +29 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +19 -20
- package/dist/tokens/index.cjs +3 -0
- package/dist/tokens/index.cjs.map +23 -0
- package/dist/tokens/index.js +3 -0
- package/dist/tokens/index.js.map +23 -0
- package/package.json +31 -15
- package/src/api/index.ts +19 -0
- package/src/api/microgard/endpoints.ts +83 -0
- package/src/api/microgard/types.ts +60 -0
- package/src/api/midgard/endpoints.ts +166 -0
- package/src/api/midgard/types.ts +155 -0
- package/src/api/swapkitApi/endpoints.ts +266 -0
- package/src/api/swapkitApi/types.ts +772 -0
- package/src/api/thornode/endpoints.ts +78 -0
- package/src/api/thornode/types.ts +241 -0
- package/src/api/thorswapStatic/endpoints.ts +30 -0
- package/src/api/thorswapStatic/types.ts +18 -0
- package/src/contracts/abis/avaxGeneric.ts +92 -0
- package/src/contracts/abis/avaxWoofi.ts +145 -0
- package/src/contracts/abis/bscGeneric.ts +106 -0
- package/src/contracts/abis/chainflipGateway.ts +330 -0
- package/src/contracts/abis/erc20.ts +99 -0
- package/src/contracts/abis/ethGeneric.ts +92 -0
- package/src/contracts/abis/mayaEvmVaults.ts +331 -0
- package/src/contracts/abis/pancakeV2.ts +145 -0
- package/src/contracts/abis/pangolin.ts +120 -0
- package/src/contracts/abis/sushiswap.ts +120 -0
- package/src/contracts/abis/tcEthVault.ts +650 -0
- package/src/contracts/abis/traderJoe.ts +120 -0
- package/src/contracts/abis/uniswapV2.ts +120 -0
- package/src/contracts/abis/uniswapV2Leg.ts +128 -0
- package/src/contracts/abis/uniswapV3_100.ts +128 -0
- package/src/contracts/abis/uniswapV3_10000.ts +128 -0
- package/src/contracts/abis/uniswapV3_3000.ts +128 -0
- package/src/contracts/abis/uniswapV3_500.ts +128 -0
- package/src/contracts/index.ts +95 -0
- package/src/contracts/routers/index.ts +58 -0
- package/src/contracts/routers/kyber.ts +402 -0
- package/src/contracts/routers/oneinch.ts +2188 -0
- package/src/contracts/routers/pancakeswap.ts +340 -0
- package/src/contracts/routers/pangolin.ts +340 -0
- package/src/contracts/routers/sushiswap.ts +340 -0
- package/src/contracts/routers/traderJoe.ts +340 -0
- package/src/contracts/routers/uniswapv2.ts +340 -0
- package/src/contracts/routers/uniswapv3.ts +254 -0
- package/src/contracts/routers/woofi.ts +171 -0
- package/src/index.ts +11 -12
- package/src/modules/__tests__/assetValue.test.ts +0 -2
- package/src/modules/__tests__/swapKitConfig.test.ts +37 -0
- package/src/modules/assetValue.ts +26 -92
- package/src/modules/bigIntArithmetics.ts +6 -2
- package/src/modules/requestClient.ts +26 -35
- package/src/modules/swapKitConfig.ts +131 -0
- package/src/modules/swapKitError.ts +6 -6
- package/src/tokens/index.ts +15 -0
- package/src/tokens/lists/camelot_v3.ts +15920 -0
- package/src/tokens/lists/caviar_v1.ts +1694 -0
- package/src/tokens/lists/chainflip.ts +104 -0
- package/src/tokens/lists/index.ts +13 -0
- package/src/tokens/lists/jupiter.ts +29606 -0
- package/src/tokens/lists/mayachain.ts +513 -0
- package/src/tokens/lists/oneinch.ts +14238 -0
- package/src/tokens/lists/openocean_v2.ts +11514 -0
- package/src/tokens/lists/pancakeswap.ts +4296 -0
- package/src/tokens/lists/pangolin_v1.ts +175 -0
- package/src/tokens/lists/sushiswap_v2.ts +965 -0
- package/src/tokens/lists/thorchain.ts +669 -0
- package/src/tokens/lists/traderjoe_v2.ts +1384 -0
- package/src/tokens/lists/uniswap_v2.ts +5596 -0
- package/src/tokens/lists/uniswap_v3.ts +5946 -0
- package/src/types/chains.ts +26 -46
- package/src/types/commonTypes.ts +3 -90
- package/src/types/index.ts +3 -4
- package/src/types/sdk.ts +0 -30
- package/src/types/tokens.ts +2 -2
- package/src/types/wallet.ts +37 -21
- package/src/{helpers → utils}/asset.ts +49 -19
- package/src/{helpers → utils}/derivationPath.ts +7 -2
- package/src/{helpers → utils}/memo.ts +0 -65
- package/src/{helpers → utils}/others.ts +12 -5
- package/src/utils/plugin.ts +13 -0
- package/src/{helpers/web3wallets.ts → utils/wallets.ts} +175 -139
- package/src/modules/walletUtils.ts +0 -30
- package/src/types/network.ts +0 -49
- /package/src/{helpers → utils}/__tests__/asset.test.ts +0 -0
- /package/src/{helpers/__tests__/derivationPath.ts → utils/__tests__/derivationPath.test.ts} +0 -0
- /package/src/{helpers → utils}/__tests__/memo.test.ts +0 -0
- /package/src/{helpers → utils}/__tests__/others.test.ts +0 -0
- /package/src/{helpers → utils}/__tests__/validators.test.ts +0 -0
- /package/src/{helpers → utils}/liquidity.ts +0 -0
- /package/src/{helpers → utils}/validators.ts +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export const sushiswap = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{ internalType: "address", name: "_ttp", type: "address" },
|
|
5
|
+
{ internalType: "address", name: "_weth", type: "address" },
|
|
6
|
+
{ internalType: "address", name: "_swapRouter", type: "address" },
|
|
7
|
+
],
|
|
8
|
+
stateMutability: "nonpayable",
|
|
9
|
+
type: "constructor",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
anonymous: false,
|
|
13
|
+
inputs: [
|
|
14
|
+
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
15
|
+
{ indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
|
|
16
|
+
],
|
|
17
|
+
name: "FeeSet",
|
|
18
|
+
type: "event",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
anonymous: false,
|
|
22
|
+
inputs: [
|
|
23
|
+
{ indexed: true, internalType: "address", name: "owner", type: "address" },
|
|
24
|
+
{ indexed: false, internalType: "bool", name: "active", type: "bool" },
|
|
25
|
+
],
|
|
26
|
+
name: "OwnerSet",
|
|
27
|
+
type: "event",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
inputs: [],
|
|
31
|
+
name: "fee",
|
|
32
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
33
|
+
stateMutability: "view",
|
|
34
|
+
type: "function",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
inputs: [],
|
|
38
|
+
name: "feeRecipient",
|
|
39
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
40
|
+
stateMutability: "view",
|
|
41
|
+
type: "function",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
45
|
+
name: "owners",
|
|
46
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
47
|
+
stateMutability: "view",
|
|
48
|
+
type: "function",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
inputs: [
|
|
52
|
+
{ internalType: "uint256", name: "_fee", type: "uint256" },
|
|
53
|
+
{ internalType: "address", name: "_feeRecipient", type: "address" },
|
|
54
|
+
],
|
|
55
|
+
name: "setFee",
|
|
56
|
+
outputs: [],
|
|
57
|
+
stateMutability: "nonpayable",
|
|
58
|
+
type: "function",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
inputs: [
|
|
62
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
63
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
64
|
+
],
|
|
65
|
+
name: "setOwner",
|
|
66
|
+
outputs: [],
|
|
67
|
+
stateMutability: "nonpayable",
|
|
68
|
+
type: "function",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
inputs: [
|
|
72
|
+
{ internalType: "address", name: "tcRouter", type: "address" },
|
|
73
|
+
{ internalType: "address", name: "tcVault", type: "address" },
|
|
74
|
+
{ internalType: "string", name: "tcMemo", type: "string" },
|
|
75
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
76
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
77
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
78
|
+
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
79
|
+
],
|
|
80
|
+
name: "swapIn",
|
|
81
|
+
outputs: [],
|
|
82
|
+
stateMutability: "nonpayable",
|
|
83
|
+
type: "function",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
inputs: [
|
|
87
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
88
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
89
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
90
|
+
],
|
|
91
|
+
name: "swapOut",
|
|
92
|
+
outputs: [],
|
|
93
|
+
stateMutability: "payable",
|
|
94
|
+
type: "function",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
inputs: [],
|
|
98
|
+
name: "swapRouter",
|
|
99
|
+
outputs: [{ internalType: "contract IUniswapRouterV2", name: "", type: "address" }],
|
|
100
|
+
stateMutability: "view",
|
|
101
|
+
type: "function",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
inputs: [],
|
|
105
|
+
name: "tokenTransferProxy",
|
|
106
|
+
outputs: [
|
|
107
|
+
{ internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
|
|
108
|
+
],
|
|
109
|
+
stateMutability: "view",
|
|
110
|
+
type: "function",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
inputs: [],
|
|
114
|
+
name: "weth",
|
|
115
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
116
|
+
stateMutability: "view",
|
|
117
|
+
type: "function",
|
|
118
|
+
},
|
|
119
|
+
{ stateMutability: "payable", type: "receive" },
|
|
120
|
+
];
|