Skip to content

Commit 7267f82

Browse files
authored
Merge pull request #33 from curvefi/feat/add-optimism-and-fraxtal-networks
feat: add optimism and fraxtal networks
2 parents 4a50313 + 0210c8a commit 7267f82

File tree

9 files changed

+443
-5
lines changed

9 files changed

+443
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@curvefi/lending-api",
3-
"version": "2.1.4",
3+
"version": "2.2.0",
44
"description": "JavaScript library for Curve Lending",
55
"main": "lib/index.js",
66
"author": "Macket",

src/constants/L2Networks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const L2Networks = [10, 8453] // 42161 (arbitrum) is L2 network, but does not need a change to estimateGas.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
[
2+
{
3+
"inputs": [],
4+
"stateMutability": "nonpayable",
5+
"type": "constructor"
6+
},
7+
{
8+
"inputs": [],
9+
"name": "DECIMALS",
10+
"outputs": [
11+
{
12+
"internalType": "uint256",
13+
"name": "",
14+
"type": "uint256"
15+
}
16+
],
17+
"stateMutability": "view",
18+
"type": "function"
19+
},
20+
{
21+
"inputs": [],
22+
"name": "baseFee",
23+
"outputs": [
24+
{
25+
"internalType": "uint256",
26+
"name": "",
27+
"type": "uint256"
28+
}
29+
],
30+
"stateMutability": "view",
31+
"type": "function"
32+
},
33+
{
34+
"inputs": [],
35+
"name": "decimals",
36+
"outputs": [
37+
{
38+
"internalType": "uint256",
39+
"name": "",
40+
"type": "uint256"
41+
}
42+
],
43+
"stateMutability": "pure",
44+
"type": "function"
45+
},
46+
{
47+
"inputs": [],
48+
"name": "gasPrice",
49+
"outputs": [
50+
{
51+
"internalType": "uint256",
52+
"name": "",
53+
"type": "uint256"
54+
}
55+
],
56+
"stateMutability": "view",
57+
"type": "function"
58+
},
59+
{
60+
"inputs": [
61+
{
62+
"internalType": "bytes",
63+
"name": "_data",
64+
"type": "bytes"
65+
}
66+
],
67+
"name": "getL1Fee",
68+
"outputs": [
69+
{
70+
"internalType": "uint256",
71+
"name": "",
72+
"type": "uint256"
73+
}
74+
],
75+
"stateMutability": "view",
76+
"type": "function"
77+
},
78+
{
79+
"inputs": [
80+
{
81+
"internalType": "bytes",
82+
"name": "_data",
83+
"type": "bytes"
84+
}
85+
],
86+
"name": "getL1GasUsed",
87+
"outputs": [
88+
{
89+
"internalType": "uint256",
90+
"name": "",
91+
"type": "uint256"
92+
}
93+
],
94+
"stateMutability": "view",
95+
"type": "function"
96+
},
97+
{
98+
"inputs": [],
99+
"name": "l1BaseFee",
100+
"outputs": [
101+
{
102+
"internalType": "uint256",
103+
"name": "",
104+
"type": "uint256"
105+
}
106+
],
107+
"stateMutability": "view",
108+
"type": "function"
109+
},
110+
{
111+
"inputs": [],
112+
"name": "overhead",
113+
"outputs": [
114+
{
115+
"internalType": "uint256",
116+
"name": "",
117+
"type": "uint256"
118+
}
119+
],
120+
"stateMutability": "view",
121+
"type": "function"
122+
},
123+
{
124+
"inputs": [],
125+
"name": "scalar",
126+
"outputs": [
127+
{
128+
"internalType": "uint256",
129+
"name": "",
130+
"type": "uint256"
131+
}
132+
],
133+
"stateMutability": "view",
134+
"type": "function"
135+
},
136+
{
137+
"inputs": [],
138+
"name": "version",
139+
"outputs": [
140+
{
141+
"internalType": "string",
142+
"name": "",
143+
"type": "string"
144+
}
145+
],
146+
"stateMutability": "view",
147+
"type": "function"
148+
}
149+
]
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
[
2+
{
3+
"inputs": [],
4+
"name": "DECIMALS",
5+
"outputs": [
6+
{
7+
"internalType": "uint256",
8+
"name": "",
9+
"type": "uint256"
10+
}
11+
],
12+
"stateMutability": "view",
13+
"type": "function"
14+
},
15+
{
16+
"inputs": [],
17+
"name": "baseFee",
18+
"outputs": [
19+
{
20+
"internalType": "uint256",
21+
"name": "",
22+
"type": "uint256"
23+
}
24+
],
25+
"stateMutability": "view",
26+
"type": "function"
27+
},
28+
{
29+
"inputs": [],
30+
"name": "baseFeeScalar",
31+
"outputs": [
32+
{
33+
"internalType": "uint32",
34+
"name": "",
35+
"type": "uint32"
36+
}
37+
],
38+
"stateMutability": "view",
39+
"type": "function"
40+
},
41+
{
42+
"inputs": [],
43+
"name": "blobBaseFee",
44+
"outputs": [
45+
{
46+
"internalType": "uint256",
47+
"name": "",
48+
"type": "uint256"
49+
}
50+
],
51+
"stateMutability": "view",
52+
"type": "function"
53+
},
54+
{
55+
"inputs": [],
56+
"name": "blobBaseFeeScalar",
57+
"outputs": [
58+
{
59+
"internalType": "uint32",
60+
"name": "",
61+
"type": "uint32"
62+
}
63+
],
64+
"stateMutability": "view",
65+
"type": "function"
66+
},
67+
{
68+
"inputs": [],
69+
"name": "decimals",
70+
"outputs": [
71+
{
72+
"internalType": "uint256",
73+
"name": "",
74+
"type": "uint256"
75+
}
76+
],
77+
"stateMutability": "pure",
78+
"type": "function"
79+
},
80+
{
81+
"inputs": [],
82+
"name": "gasPrice",
83+
"outputs": [
84+
{
85+
"internalType": "uint256",
86+
"name": "",
87+
"type": "uint256"
88+
}
89+
],
90+
"stateMutability": "view",
91+
"type": "function"
92+
},
93+
{
94+
"inputs": [
95+
{
96+
"internalType": "bytes",
97+
"name": "_data",
98+
"type": "bytes"
99+
}
100+
],
101+
"name": "getL1Fee",
102+
"outputs": [
103+
{
104+
"internalType": "uint256",
105+
"name": "",
106+
"type": "uint256"
107+
}
108+
],
109+
"stateMutability": "view",
110+
"type": "function"
111+
},
112+
{
113+
"inputs": [
114+
{
115+
"internalType": "bytes",
116+
"name": "_data",
117+
"type": "bytes"
118+
}
119+
],
120+
"name": "getL1GasUsed",
121+
"outputs": [
122+
{
123+
"internalType": "uint256",
124+
"name": "",
125+
"type": "uint256"
126+
}
127+
],
128+
"stateMutability": "view",
129+
"type": "function"
130+
},
131+
{
132+
"inputs": [],
133+
"name": "isEcotone",
134+
"outputs": [
135+
{
136+
"internalType": "bool",
137+
"name": "",
138+
"type": "bool"
139+
}
140+
],
141+
"stateMutability": "view",
142+
"type": "function"
143+
},
144+
{
145+
"inputs": [],
146+
"name": "l1BaseFee",
147+
"outputs": [
148+
{
149+
"internalType": "uint256",
150+
"name": "",
151+
"type": "uint256"
152+
}
153+
],
154+
"stateMutability": "view",
155+
"type": "function"
156+
},
157+
{
158+
"inputs": [],
159+
"name": "overhead",
160+
"outputs": [
161+
{
162+
"internalType": "uint256",
163+
"name": "",
164+
"type": "uint256"
165+
}
166+
],
167+
"stateMutability": "view",
168+
"type": "function"
169+
},
170+
{
171+
"inputs": [],
172+
"name": "scalar",
173+
"outputs": [
174+
{
175+
"internalType": "uint256",
176+
"name": "",
177+
"type": "uint256"
178+
}
179+
],
180+
"stateMutability": "view",
181+
"type": "function"
182+
},
183+
{
184+
"inputs": [],
185+
"name": "setEcotone",
186+
"outputs": [],
187+
"stateMutability": "nonpayable",
188+
"type": "function"
189+
},
190+
{
191+
"inputs": [],
192+
"name": "version",
193+
"outputs": [
194+
{
195+
"internalType": "string",
196+
"name": "",
197+
"type": "string"
198+
}
199+
],
200+
"stateMutability": "view",
201+
"type": "function"
202+
}
203+
]

src/constants/aliases.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ export const ALIASES_ARBITRUM = lowerCaseValues({
4646

4747
export const ALIASES_OPTIMISM = lowerCaseValues({
4848
"crv": "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",
49-
"one_way_factory": "0x0000000000000000000000000000000000000000",
49+
"one_way_factory": "0x5EA8f3D674C70b020586933A0a5b250734798BeF",
5050
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
5151
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
5252
"leverage_zap": "0x0000000000000000000000000000000000000000",
53+
"gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f',
54+
"gas_oracle_blob": '0x420000000000000000000000000000000000000f',
5355
});
5456

5557
export const ALIASES_XDAI = lowerCaseValues({
@@ -114,3 +116,11 @@ export const ALIASES_BSC = lowerCaseValues({
114116
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
115117
"leverage_zap": "0x0000000000000000000000000000000000000000",
116118
});
119+
120+
export const ALIASES_FRAXTAL = lowerCaseValues({
121+
"crv": "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56",
122+
"one_way_factory": "0xf3c9bdAB17B7016fBE3B77D17b1602A7db93ac66",
123+
"gauge_controller": "0x0000000000000000000000000000000000000000", // <--- TODO CHANGE
124+
"gauge_factory": "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c",
125+
"leverage_zap": "0x0000000000000000000000000000000000000000",
126+
});

0 commit comments

Comments
 (0)