Skip to content

Commit

Permalink
Merge pull request #319 from balancer/permit2
Browse files Browse the repository at this point in the history
Update b-sdk to work with Permit2 + new testnet deployment
  • Loading branch information
brunoguerios authored Jun 3, 2024
2 parents 68b45ac + d81de73 commit 7aece86
Show file tree
Hide file tree
Showing 31 changed files with 5,143 additions and 4,035 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-carpets-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@balancer/sdk": minor
---

Update SDK to use Permit2 and conform with new SC deployment
13 changes: 3 additions & 10 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.2/schema.json",
"files": {
"ignore": [
"./node_modules",
"dist",
"pnpm-lock.yaml",
"./local"
]
"ignore": ["./node_modules", "dist", "pnpm-lock.yaml", "./local"]
},
"organizeImports": {
"ignore": [
"."
]
"ignore": ["."]
},
"formatter": {
"enabled": true,
Expand Down Expand Up @@ -53,4 +46,4 @@
"semicolons": "always"
}
}
}
}
4 changes: 2 additions & 2 deletions examples/addLiquidity/addLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ async function runAgainstFork() {
const userAccount = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
// 80BAL-20WETH
const pool = {
id: '0x204d4194e4e42364E3D1841d0a9B1eF857879C31',
address: '0x204d4194e4e42364E3D1841d0a9B1eF857879C31' as Address,
id: '0xB2456A6f51530053bC41b0EE700fe6A2C37282e8',
address: '0xB2456A6f51530053bC41b0EE700fe6A2C37282e8' as Address,
};
const amountsIn = [
{
Expand Down
1 change: 1 addition & 0 deletions examples/addLiquidity/addLiquidityCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async function runAgainstFork() {
const userAccount = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
// Pool from a custom factory that is not currently supported in Balancer API
const pool = {
// TODO: update with pool from testnet deployment 4
id: '0xd851b2b78c41c40a4fa134f6fc4282b71f0f1491',
address: '0xd851b2b78c41c40a4fa134f6fc4282b71f0f1491' as Address,
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"decimal.js-light": "^2.5.1",
"lodash.clonedeep": "^4.5.0",
"viem": "^2.1.1"
"viem": "^2.12.1"
},
"devDependencies": {
"@biomejs/biome": "^1.5.2",
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions src/abi/balancerBatchRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,26 @@ export const balancerBatchRouterAbi = [
name: 'weth',
type: 'address',
},
{
internalType: 'contract IPermit2',
name: 'permit2',
type: 'address',
},
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
inputs: [
{
internalType: 'address',
name: 'target',
type: 'address',
},
],
name: 'AddressEmptyCode',
type: 'error',
},
{
inputs: [
{
Expand Down Expand Up @@ -46,6 +62,17 @@ export const balancerBatchRouterAbi = [
name: 'ReentrancyGuardReentrantCall',
type: 'error',
},
{
inputs: [
{
internalType: 'address',
name: 'token',
type: 'address',
},
],
name: 'SafeERC20FailedOperation',
type: 'error',
},
{
inputs: [
{
Expand All @@ -57,6 +84,11 @@ export const balancerBatchRouterAbi = [
name: 'SenderIsNotVault',
type: 'error',
},
{
inputs: [],
name: 'SwapDeadline',
type: 'error',
},
{
inputs: [
{
Expand Down
Loading

0 comments on commit 7aece86

Please sign in to comment.