Skip to content

Commit

Permalink
Merge pull request #182 from maple-labs/sc-16603-feature-sdk-add-syru…
Browse files Browse the repository at this point in the history
…prouter-abi-to-maple-js

feat: [sc-16603] [sdk] Add SyrupRouter ABI to maple-js
  • Loading branch information
callum-hyland authored May 20, 2024
2 parents c6d3d5e + e979ee3 commit 5125663
Show file tree
Hide file tree
Showing 3 changed files with 307 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
"stakeLocker": {
"contracts": ["StakeLocker", "StakeLockerFactory"]
},
"syrupRouter": {
"contracts": ["SyrupRouter"]
},
"withdrawalManager": {
"contracts": ["WithdrawalManager"]
},
Expand Down
295 changes: 295 additions & 0 deletions src/abis/SyrupRouter.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "pool_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "asset",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "bitmap_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline_",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "auth_v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "auth_r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "auth_s",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "depositData_",
"type": "bytes32"
}
],
"name": "authorizeAndDeposit",
"outputs": [
{
"internalType": "uint256",
"name": "shares_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "bitmap_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "auth_deadline_",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "auth_v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "auth_r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "auth_s",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "depositData_",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "permit_deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "permit_v_",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "permit_r_",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "permit_s_",
"type": "bytes32"
}
],
"name": "authorizeAndDepositWithPermit",
"outputs": [
{
"internalType": "uint256",
"name": "shares_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "depositData_",
"type": "bytes32"
}
],
"name": "deposit",
"outputs": [
{
"internalType": "uint256",
"name": "shares_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline_",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v_",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r_",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s_",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "depositData_",
"type": "bytes32"
}
],
"name": "depositWithPermit",
"outputs": [
{
"internalType": "uint256",
"name": "shares_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "poolManager",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "poolPermissionManager",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "depositData",
"type": "bytes32"
}
],
"name": "DepositData",
"type": "event"
}
]
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as poolV2Imports from './typechain/poolV2'
import * as poolV201Imports from './typechain/poolV201'
import * as poolV3Imports from './typechain/poolV3'
import * as stakeLockerImports from './typechain/stakeLocker'
import * as syrupRouterImports from './typechain/syrupRouter'
import * as withdrawalManagerImports from './typechain/withdrawalManager'
import * as withdrawalManagerCyclicalImports from './typechain/withdrawalManagerCyclical'
import * as withdrawalManagerQueueImports from './typechain/withdrawalManagerQueue'
Expand Down Expand Up @@ -213,6 +214,10 @@ const stakeLocker = {
factory: stakeLockerImports.StakeLockerFactoryAbi__factory
}

const syrupRouter = {
core: syrupRouterImports.SyrupRouterAbi__factory
}

const withdrawalManager = {
core: withdrawalManagerImports.WithdrawalManagerAbi__factory
}
Expand Down Expand Up @@ -346,6 +351,9 @@ interface ContractTypes {
stakeLocker: stakeLockerImports.StakeLockerAbi
stakeLockerFactory: stakeLockerImports.StakeLockerFactoryAbi

// Syrup Router
syrupRouter: syrupRouterImports.SyrupRouterAbi

// withdrawalManager
withdrawalManager: withdrawalManagerImports.WithdrawalManagerAbi

Expand Down Expand Up @@ -403,6 +411,7 @@ export {
poolManagerV3,
poolPermissionManager,
stakeLocker,
syrupRouter,
withdrawalManager,
withdrawalManagerCyclical,
withdrawalManagerQueue,
Expand Down

0 comments on commit 5125663

Please sign in to comment.