@swapkit/core 0.0.0-nightly-20240208140027
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/LICENSE +201 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +305 -0
- package/dist/index.es.js +9109 -0
- package/dist/index.es.js.map +1 -0
- package/package.json +60 -0
- package/src/aggregator/contracts/avaxGeneric.ts +92 -0
- package/src/aggregator/contracts/avaxWoofi.ts +145 -0
- package/src/aggregator/contracts/bscGeneric.ts +106 -0
- package/src/aggregator/contracts/ethGeneric.ts +92 -0
- package/src/aggregator/contracts/index.ts +76 -0
- package/src/aggregator/contracts/pancakeV2.ts +145 -0
- package/src/aggregator/contracts/pangolin.ts +120 -0
- package/src/aggregator/contracts/routers/index.ts +58 -0
- package/src/aggregator/contracts/routers/kyber.ts +402 -0
- package/src/aggregator/contracts/routers/oneinch.ts +2188 -0
- package/src/aggregator/contracts/routers/pancakeswap.ts +340 -0
- package/src/aggregator/contracts/routers/pangolin.ts +340 -0
- package/src/aggregator/contracts/routers/sushiswap.ts +340 -0
- package/src/aggregator/contracts/routers/traderJoe.ts +340 -0
- package/src/aggregator/contracts/routers/uniswapv2.ts +340 -0
- package/src/aggregator/contracts/routers/uniswapv3.ts +254 -0
- package/src/aggregator/contracts/routers/woofi.ts +171 -0
- package/src/aggregator/contracts/sushiswap.ts +120 -0
- package/src/aggregator/contracts/traderJoe.ts +120 -0
- package/src/aggregator/contracts/uniswapV2.ts +120 -0
- package/src/aggregator/contracts/uniswapV2Leg.ts +128 -0
- package/src/aggregator/contracts/uniswapV3_100.ts +128 -0
- package/src/aggregator/contracts/uniswapV3_10000.ts +128 -0
- package/src/aggregator/contracts/uniswapV3_3000.ts +128 -0
- package/src/aggregator/contracts/uniswapV3_500.ts +128 -0
- package/src/aggregator/getSwapParams.ts +70 -0
- package/src/client/__tests__/helpers.test.ts +77 -0
- package/src/client/explorerUrls.ts +61 -0
- package/src/client/index.ts +769 -0
- package/src/client/thornode.ts +31 -0
- package/src/client/types.ts +108 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
export const woofiRouter = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{ internalType: 'address', name: '_weth', type: 'address' },
|
|
5
|
+
{ internalType: 'address', name: '_pool', type: 'address' },
|
|
6
|
+
],
|
|
7
|
+
stateMutability: 'nonpayable',
|
|
8
|
+
type: 'constructor',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
anonymous: false,
|
|
12
|
+
inputs: [
|
|
13
|
+
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
|
|
14
|
+
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
|
|
15
|
+
],
|
|
16
|
+
name: 'OwnershipTransferred',
|
|
17
|
+
type: 'event',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
anonymous: false,
|
|
21
|
+
inputs: [{ indexed: false, internalType: 'address', name: 'newPool', type: 'address' }],
|
|
22
|
+
name: 'WooPoolChanged',
|
|
23
|
+
type: 'event',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
anonymous: false,
|
|
27
|
+
inputs: [
|
|
28
|
+
{
|
|
29
|
+
indexed: false,
|
|
30
|
+
internalType: 'enum IWooRouterV2.SwapType',
|
|
31
|
+
name: 'swapType',
|
|
32
|
+
type: 'uint8',
|
|
33
|
+
},
|
|
34
|
+
{ indexed: true, internalType: 'address', name: 'fromToken', type: 'address' },
|
|
35
|
+
{ indexed: true, internalType: 'address', name: 'toToken', type: 'address' },
|
|
36
|
+
{ indexed: false, internalType: 'uint256', name: 'fromAmount', type: 'uint256' },
|
|
37
|
+
{ indexed: false, internalType: 'uint256', name: 'toAmount', type: 'uint256' },
|
|
38
|
+
{ indexed: false, internalType: 'address', name: 'from', type: 'address' },
|
|
39
|
+
{ indexed: true, internalType: 'address', name: 'to', type: 'address' },
|
|
40
|
+
{ indexed: false, internalType: 'address', name: 'rebateTo', type: 'address' },
|
|
41
|
+
],
|
|
42
|
+
name: 'WooRouterSwap',
|
|
43
|
+
type: 'event',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
inputs: [],
|
|
47
|
+
name: 'WETH',
|
|
48
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
49
|
+
stateMutability: 'view',
|
|
50
|
+
type: 'function',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
inputs: [
|
|
54
|
+
{ internalType: 'address', name: 'approveTarget', type: 'address' },
|
|
55
|
+
{ internalType: 'address', name: 'swapTarget', type: 'address' },
|
|
56
|
+
{ internalType: 'address', name: 'fromToken', type: 'address' },
|
|
57
|
+
{ internalType: 'address', name: 'toToken', type: 'address' },
|
|
58
|
+
{ internalType: 'uint256', name: 'fromAmount', type: 'uint256' },
|
|
59
|
+
{ internalType: 'uint256', name: 'minToAmount', type: 'uint256' },
|
|
60
|
+
{ internalType: 'address payable', name: 'to', type: 'address' },
|
|
61
|
+
{ internalType: 'bytes', name: 'data', type: 'bytes' },
|
|
62
|
+
],
|
|
63
|
+
name: 'externalSwap',
|
|
64
|
+
outputs: [{ internalType: 'uint256', name: 'realToAmount', type: 'uint256' }],
|
|
65
|
+
stateMutability: 'payable',
|
|
66
|
+
type: 'function',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
inputs: [{ internalType: 'address', name: 'stuckToken', type: 'address' }],
|
|
70
|
+
name: 'inCaseTokenGotStuck',
|
|
71
|
+
outputs: [],
|
|
72
|
+
stateMutability: 'nonpayable',
|
|
73
|
+
type: 'function',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
inputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
77
|
+
name: 'isWhitelisted',
|
|
78
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
79
|
+
stateMutability: 'view',
|
|
80
|
+
type: 'function',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
inputs: [],
|
|
84
|
+
name: 'owner',
|
|
85
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
86
|
+
stateMutability: 'view',
|
|
87
|
+
type: 'function',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
inputs: [
|
|
91
|
+
{ internalType: 'address', name: 'fromToken', type: 'address' },
|
|
92
|
+
{ internalType: 'address', name: 'toToken', type: 'address' },
|
|
93
|
+
{ internalType: 'uint256', name: 'fromAmount', type: 'uint256' },
|
|
94
|
+
],
|
|
95
|
+
name: 'querySwap',
|
|
96
|
+
outputs: [{ internalType: 'uint256', name: 'toAmount', type: 'uint256' }],
|
|
97
|
+
stateMutability: 'view',
|
|
98
|
+
type: 'function',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
inputs: [],
|
|
102
|
+
name: 'quoteToken',
|
|
103
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
104
|
+
stateMutability: 'view',
|
|
105
|
+
type: 'function',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
inputs: [],
|
|
109
|
+
name: 'renounceOwnership',
|
|
110
|
+
outputs: [],
|
|
111
|
+
stateMutability: 'nonpayable',
|
|
112
|
+
type: 'function',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
inputs: [{ internalType: 'address', name: 'newPool', type: 'address' }],
|
|
116
|
+
name: 'setPool',
|
|
117
|
+
outputs: [],
|
|
118
|
+
stateMutability: 'nonpayable',
|
|
119
|
+
type: 'function',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
inputs: [
|
|
123
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
124
|
+
{ internalType: 'bool', name: 'whitelisted', type: 'bool' },
|
|
125
|
+
],
|
|
126
|
+
name: 'setWhitelisted',
|
|
127
|
+
outputs: [],
|
|
128
|
+
stateMutability: 'nonpayable',
|
|
129
|
+
type: 'function',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
inputs: [
|
|
133
|
+
{ internalType: 'address', name: 'fromToken', type: 'address' },
|
|
134
|
+
{ internalType: 'address', name: 'toToken', type: 'address' },
|
|
135
|
+
{ internalType: 'uint256', name: 'fromAmount', type: 'uint256' },
|
|
136
|
+
{ internalType: 'uint256', name: 'minToAmount', type: 'uint256' },
|
|
137
|
+
{ internalType: 'address payable', name: 'to', type: 'address' },
|
|
138
|
+
{ internalType: 'address', name: 'rebateTo', type: 'address' },
|
|
139
|
+
],
|
|
140
|
+
name: 'swap',
|
|
141
|
+
outputs: [{ internalType: 'uint256', name: 'realToAmount', type: 'uint256' }],
|
|
142
|
+
stateMutability: 'payable',
|
|
143
|
+
type: 'function',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
|
|
147
|
+
name: 'transferOwnership',
|
|
148
|
+
outputs: [],
|
|
149
|
+
stateMutability: 'nonpayable',
|
|
150
|
+
type: 'function',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
inputs: [
|
|
154
|
+
{ internalType: 'address', name: 'fromToken', type: 'address' },
|
|
155
|
+
{ internalType: 'address', name: 'toToken', type: 'address' },
|
|
156
|
+
{ internalType: 'uint256', name: 'fromAmount', type: 'uint256' },
|
|
157
|
+
],
|
|
158
|
+
name: 'tryQuerySwap',
|
|
159
|
+
outputs: [{ internalType: 'uint256', name: 'toAmount', type: 'uint256' }],
|
|
160
|
+
stateMutability: 'view',
|
|
161
|
+
type: 'function',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
inputs: [],
|
|
165
|
+
name: 'wooPool',
|
|
166
|
+
outputs: [{ internalType: 'contract IWooPPV2', name: '', type: 'address' }],
|
|
167
|
+
stateMutability: 'view',
|
|
168
|
+
type: 'function',
|
|
169
|
+
},
|
|
170
|
+
{ stateMutability: 'payable', type: 'receive' },
|
|
171
|
+
];
|
|
@@ -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
|
+
];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export const traderJoe = [
|
|
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 IUniswapRouterV2AVAX', 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
|
+
];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export const uniswapV2 = [
|
|
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
|
+
];
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export const uniswapV2Leg = [
|
|
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
|
+
{ internalType: 'address', name: '_legToken', type: 'address' },
|
|
8
|
+
],
|
|
9
|
+
stateMutability: 'nonpayable',
|
|
10
|
+
type: 'constructor',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
anonymous: false,
|
|
14
|
+
inputs: [
|
|
15
|
+
{ indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' },
|
|
16
|
+
{ indexed: false, internalType: 'address', name: 'feeRecipient', type: 'address' },
|
|
17
|
+
],
|
|
18
|
+
name: 'FeeSet',
|
|
19
|
+
type: 'event',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
anonymous: false,
|
|
23
|
+
inputs: [
|
|
24
|
+
{ indexed: true, internalType: 'address', name: 'owner', type: 'address' },
|
|
25
|
+
{ indexed: false, internalType: 'bool', name: 'active', type: 'bool' },
|
|
26
|
+
],
|
|
27
|
+
name: 'OwnerSet',
|
|
28
|
+
type: 'event',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
inputs: [],
|
|
32
|
+
name: 'fee',
|
|
33
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
34
|
+
stateMutability: 'view',
|
|
35
|
+
type: 'function',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
inputs: [],
|
|
39
|
+
name: 'feeRecipient',
|
|
40
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
41
|
+
stateMutability: 'view',
|
|
42
|
+
type: 'function',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
inputs: [],
|
|
46
|
+
name: 'legToken',
|
|
47
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
48
|
+
stateMutability: 'view',
|
|
49
|
+
type: 'function',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
inputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
53
|
+
name: 'owners',
|
|
54
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
55
|
+
stateMutability: 'view',
|
|
56
|
+
type: 'function',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
inputs: [
|
|
60
|
+
{ internalType: 'uint256', name: '_fee', type: 'uint256' },
|
|
61
|
+
{ internalType: 'address', name: '_feeRecipient', type: 'address' },
|
|
62
|
+
],
|
|
63
|
+
name: 'setFee',
|
|
64
|
+
outputs: [],
|
|
65
|
+
stateMutability: 'nonpayable',
|
|
66
|
+
type: 'function',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
inputs: [
|
|
70
|
+
{ internalType: 'address', name: 'owner', type: 'address' },
|
|
71
|
+
{ internalType: 'bool', name: 'active', type: 'bool' },
|
|
72
|
+
],
|
|
73
|
+
name: 'setOwner',
|
|
74
|
+
outputs: [],
|
|
75
|
+
stateMutability: 'nonpayable',
|
|
76
|
+
type: 'function',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
inputs: [
|
|
80
|
+
{ internalType: 'address', name: 'tcRouter', type: 'address' },
|
|
81
|
+
{ internalType: 'address', name: 'tcVault', type: 'address' },
|
|
82
|
+
{ internalType: 'string', name: 'tcMemo', type: 'string' },
|
|
83
|
+
{ internalType: 'address', name: 'token', type: 'address' },
|
|
84
|
+
{ internalType: 'uint256', name: 'amount', type: 'uint256' },
|
|
85
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
|
86
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' },
|
|
87
|
+
],
|
|
88
|
+
name: 'swapIn',
|
|
89
|
+
outputs: [],
|
|
90
|
+
stateMutability: 'nonpayable',
|
|
91
|
+
type: 'function',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
inputs: [
|
|
95
|
+
{ internalType: 'address', name: 'token', type: 'address' },
|
|
96
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
|
97
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
|
98
|
+
],
|
|
99
|
+
name: 'swapOut',
|
|
100
|
+
outputs: [],
|
|
101
|
+
stateMutability: 'payable',
|
|
102
|
+
type: 'function',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
inputs: [],
|
|
106
|
+
name: 'swapRouter',
|
|
107
|
+
outputs: [{ internalType: 'contract IUniswapRouterV2', name: '', type: 'address' }],
|
|
108
|
+
stateMutability: 'view',
|
|
109
|
+
type: 'function',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
inputs: [],
|
|
113
|
+
name: 'tokenTransferProxy',
|
|
114
|
+
outputs: [
|
|
115
|
+
{ internalType: 'contract TSAggregatorTokenTransferProxy', name: '', type: 'address' },
|
|
116
|
+
],
|
|
117
|
+
stateMutability: 'view',
|
|
118
|
+
type: 'function',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
inputs: [],
|
|
122
|
+
name: 'weth',
|
|
123
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
124
|
+
stateMutability: 'view',
|
|
125
|
+
type: 'function',
|
|
126
|
+
},
|
|
127
|
+
{ stateMutability: 'payable', type: 'receive' },
|
|
128
|
+
];
|