Skip to content

Commit 178b66b

Browse files
committed
create Toolbox and Pools view
1 parent d9a07c9 commit 178b66b

26 files changed

+5582
-391
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
root: true,
33

44
env: {
5+
es2020: true,
56
node: true,
67
},
78

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
export const BalancerQueriesAbi = [
2+
{
3+
inputs: [
4+
{ internalType: 'contract IVault', name: '_vault', type: 'address' },
5+
],
6+
stateMutability: 'nonpayable',
7+
type: 'constructor',
8+
},
9+
{
10+
inputs: [
11+
{ internalType: 'enum IVault.SwapKind', name: 'kind', type: 'uint8' },
12+
{
13+
components: [
14+
{ internalType: 'bytes32', name: 'poolId', type: 'bytes32' },
15+
{ internalType: 'uint256', name: 'assetInIndex', type: 'uint256' },
16+
{ internalType: 'uint256', name: 'assetOutIndex', type: 'uint256' },
17+
{ internalType: 'uint256', name: 'amount', type: 'uint256' },
18+
{ internalType: 'bytes', name: 'userData', type: 'bytes' },
19+
],
20+
internalType: 'struct IVault.BatchSwapStep[]',
21+
name: 'swaps',
22+
type: 'tuple[]',
23+
},
24+
{ internalType: 'contract IAsset[]', name: 'assets', type: 'address[]' },
25+
{
26+
components: [
27+
{ internalType: 'address', name: 'sender', type: 'address' },
28+
{ internalType: 'bool', name: 'fromInternalBalance', type: 'bool' },
29+
{
30+
internalType: 'address payable',
31+
name: 'recipient',
32+
type: 'address',
33+
},
34+
{ internalType: 'bool', name: 'toInternalBalance', type: 'bool' },
35+
],
36+
internalType: 'struct IVault.FundManagement',
37+
name: 'funds',
38+
type: 'tuple',
39+
},
40+
],
41+
name: 'queryBatchSwap',
42+
outputs: [
43+
{ internalType: 'int256[]', name: 'assetDeltas', type: 'int256[]' },
44+
],
45+
stateMutability: 'nonpayable',
46+
type: 'function',
47+
},
48+
{
49+
inputs: [
50+
{ internalType: 'bytes32', name: 'poolId', type: 'bytes32' },
51+
{ internalType: 'address', name: 'sender', type: 'address' },
52+
{ internalType: 'address', name: 'recipient', type: 'address' },
53+
{
54+
components: [
55+
{
56+
internalType: 'contract IAsset[]',
57+
name: 'assets',
58+
type: 'address[]',
59+
},
60+
{
61+
internalType: 'uint256[]',
62+
name: 'minAmountsOut',
63+
type: 'uint256[]',
64+
},
65+
{ internalType: 'bytes', name: 'userData', type: 'bytes' },
66+
{ internalType: 'bool', name: 'toInternalBalance', type: 'bool' },
67+
],
68+
internalType: 'struct IVault.ExitPoolRequest',
69+
name: 'request',
70+
type: 'tuple',
71+
},
72+
],
73+
name: 'queryExit',
74+
outputs: [
75+
{ internalType: 'uint256', name: 'bptIn', type: 'uint256' },
76+
{ internalType: 'uint256[]', name: 'amountsOut', type: 'uint256[]' },
77+
],
78+
stateMutability: 'nonpayable',
79+
type: 'function',
80+
},
81+
{
82+
inputs: [
83+
{ internalType: 'bytes32', name: 'poolId', type: 'bytes32' },
84+
{ internalType: 'address', name: 'sender', type: 'address' },
85+
{ internalType: 'address', name: 'recipient', type: 'address' },
86+
{
87+
components: [
88+
{
89+
internalType: 'contract IAsset[]',
90+
name: 'assets',
91+
type: 'address[]',
92+
},
93+
{
94+
internalType: 'uint256[]',
95+
name: 'maxAmountsIn',
96+
type: 'uint256[]',
97+
},
98+
{ internalType: 'bytes', name: 'userData', type: 'bytes' },
99+
{ internalType: 'bool', name: 'fromInternalBalance', type: 'bool' },
100+
],
101+
internalType: 'struct IVault.JoinPoolRequest',
102+
name: 'request',
103+
type: 'tuple',
104+
},
105+
],
106+
name: 'queryJoin',
107+
outputs: [
108+
{ internalType: 'uint256', name: 'bptOut', type: 'uint256' },
109+
{ internalType: 'uint256[]', name: 'amountsIn', type: 'uint256[]' },
110+
],
111+
stateMutability: 'nonpayable',
112+
type: 'function',
113+
},
114+
{
115+
inputs: [
116+
{
117+
components: [
118+
{ internalType: 'bytes32', name: 'poolId', type: 'bytes32' },
119+
{ internalType: 'enum IVault.SwapKind', name: 'kind', type: 'uint8' },
120+
{ internalType: 'contract IAsset', name: 'assetIn', type: 'address' },
121+
{
122+
internalType: 'contract IAsset',
123+
name: 'assetOut',
124+
type: 'address',
125+
},
126+
{ internalType: 'uint256', name: 'amount', type: 'uint256' },
127+
{ internalType: 'bytes', name: 'userData', type: 'bytes' },
128+
],
129+
internalType: 'struct IVault.SingleSwap',
130+
name: 'singleSwap',
131+
type: 'tuple',
132+
},
133+
{
134+
components: [
135+
{ internalType: 'address', name: 'sender', type: 'address' },
136+
{ internalType: 'bool', name: 'fromInternalBalance', type: 'bool' },
137+
{
138+
internalType: 'address payable',
139+
name: 'recipient',
140+
type: 'address',
141+
},
142+
{ internalType: 'bool', name: 'toInternalBalance', type: 'bool' },
143+
],
144+
internalType: 'struct IVault.FundManagement',
145+
name: 'funds',
146+
type: 'tuple',
147+
},
148+
],
149+
name: 'querySwap',
150+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
151+
stateMutability: 'nonpayable',
152+
type: 'function',
153+
},
154+
{
155+
inputs: [],
156+
name: 'vault',
157+
outputs: [{ internalType: 'contract IVault', name: '', type: 'address' }],
158+
stateMutability: 'view',
159+
type: 'function',
160+
},
161+
];

0 commit comments

Comments
 (0)