Skip to content

Commit

Permalink
Merge pull request #33 from curvefi/feat/add-optimism-and-fraxtal-net…
Browse files Browse the repository at this point in the history
…works

feat: add optimism and fraxtal networks
  • Loading branch information
fedorovdg authored Sep 18, 2024
2 parents 4a50313 + 0210c8a commit 7267f82
Show file tree
Hide file tree
Showing 9 changed files with 443 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/lending-api",
"version": "2.1.4",
"version": "2.2.0",
"description": "JavaScript library for Curve Lending",
"main": "lib/index.js",
"author": "Macket",
Expand Down
1 change: 1 addition & 0 deletions src/constants/L2Networks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const L2Networks = [10, 8453] // 42161 (arbitrum) is L2 network, but does not need a change to estimateGas.
149 changes: 149 additions & 0 deletions src/constants/abis/gas_oracle_optimism.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "DECIMALS",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "gasPrice",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "getL1Fee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "getL1GasUsed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "l1BaseFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "overhead",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "scalar",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
203 changes: 203 additions & 0 deletions src/constants/abis/gas_oracle_optimism_blob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
[
{
"inputs": [],
"name": "DECIMALS",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseFeeScalar",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "blobBaseFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "blobBaseFeeScalar",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "gasPrice",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "getL1Fee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "getL1GasUsed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isEcotone",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "l1BaseFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "overhead",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "scalar",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "setEcotone",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
12 changes: 11 additions & 1 deletion src/constants/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ export const ALIASES_ARBITRUM = lowerCaseValues({

export const ALIASES_OPTIMISM = lowerCaseValues({
"crv": "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",
"one_way_factory": "0x0000000000000000000000000000000000000000",
"one_way_factory": "0x5EA8f3D674C70b020586933A0a5b250734798BeF",
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
"leverage_zap": "0x0000000000000000000000000000000000000000",
"gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f',
"gas_oracle_blob": '0x420000000000000000000000000000000000000f',
});

export const ALIASES_XDAI = lowerCaseValues({
Expand Down Expand Up @@ -114,3 +116,11 @@ export const ALIASES_BSC = lowerCaseValues({
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
"leverage_zap": "0x0000000000000000000000000000000000000000",
});

export const ALIASES_FRAXTAL = lowerCaseValues({
"crv": "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56",
"one_way_factory": "0xf3c9bdAB17B7016fBE3B77D17b1602A7db93ac66",
"gauge_controller": "0x0000000000000000000000000000000000000000", // <--- TODO CHANGE
"gauge_factory": "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c",
"leverage_zap": "0x0000000000000000000000000000000000000000",
});
Loading

0 comments on commit 7267f82

Please sign in to comment.