From 1645d6359db888635ce014b0a95813424d056202 Mon Sep 17 00:00:00 2001 From: midas-myth Date: Fri, 26 Sep 2025 23:39:04 +0200 Subject: [PATCH 1/4] Migrate to typescript ABIs --- .yarn/patches/viem-npm-2.37.1-7013552341 | 39 + landing/tsconfig.json | 2 +- package.json | 3 +- sdk/.gitignore | 1 - sdk/package.json | 6 +- sdk/src/abis/ArbitrumNodeInterface.json | 105 - sdk/src/abis/ArbitrumNodeInterface.ts | 103 + sdk/src/abis/ClaimHandler.json | 424 -- sdk/src/abis/ClaimHandler.ts | 190 + sdk/src/abis/CustomErrors.json | 4432 --------------- sdk/src/abis/CustomErrors.ts | 1882 +++++++ sdk/src/abis/DataStore.json | 1459 ----- sdk/src/abis/DataStore.ts | 637 +++ sdk/src/abis/ERC20PermitInterface.json | 118 - sdk/src/abis/ERC20PermitInterface.ts | 52 + sdk/src/abis/ERC721.json | 442 -- sdk/src/abis/ERC721.ts | 194 + sdk/src/abis/EventEmitter.json | 2060 ------- sdk/src/abis/EventEmitter.ts | 1226 ++++ sdk/src/abis/ExchangeRouter.json | 1706 ------ sdk/src/abis/ExchangeRouter.ts | 758 +++ sdk/src/abis/GelatoRelayRouter.json | 1579 ------ sdk/src/abis/GelatoRelayRouter.ts | 627 +++ sdk/src/abis/GlpManager.json | 592 -- sdk/src/abis/GlpManager.ts | 244 + sdk/src/abis/GlvReader.json | 1471 ----- sdk/src/abis/GlvReader.ts | 641 +++ sdk/src/abis/GlvRouter.json | 764 --- sdk/src/abis/GlvRouter.ts | 351 ++ sdk/src/abis/GmxMigrator.json | 657 --- sdk/src/abis/GmxMigrator.ts | 267 + sdk/src/abis/GovToken.json | 768 --- sdk/src/abis/GovToken.ts | 323 ++ sdk/src/abis/LayerZeroProvider.json | 372 -- sdk/src/abis/LayerZeroProvider.ts | 159 + sdk/src/abis/MintableBaseToken.json | 696 --- sdk/src/abis/MintableBaseToken.ts | 321 ++ sdk/src/abis/Multicall.json | 429 -- sdk/src/abis/Multicall.ts | 229 + sdk/src/abis/MultichainClaimsRouter.json | 1266 ----- sdk/src/abis/MultichainClaimsRouter.ts | 514 ++ sdk/src/abis/MultichainGlvRouter.json | 1150 ---- sdk/src/abis/MultichainGlvRouter.ts | 474 ++ sdk/src/abis/MultichainGmRouter.json | 1449 ----- sdk/src/abis/MultichainGmRouter.ts | 597 ++ sdk/src/abis/MultichainOrderRouter.json | 1820 ------ sdk/src/abis/MultichainOrderRouter.ts | 724 +++ sdk/src/abis/MultichainSubaccountRouter.json | 2069 ------- sdk/src/abis/MultichainSubaccountRouter.ts | 795 +++ sdk/src/abis/MultichainTransferRouter.json | 915 --- sdk/src/abis/MultichainTransferRouter.ts | 404 ++ sdk/src/abis/MultichainUtils.json | 133 - sdk/src/abis/MultichainUtils.ts | 61 + sdk/src/abis/MultichainVault.json | 275 - sdk/src/abis/MultichainVault.ts | 122 + sdk/src/abis/Reader.json | 355 -- sdk/src/abis/Reader.ts | 138 + sdk/src/abis/ReaderV2.json | 630 --- sdk/src/abis/ReaderV2.ts | 257 + sdk/src/abis/ReferralStorage.json | 557 -- sdk/src/abis/ReferralStorage.ts | 259 + sdk/src/abis/RelayParams.json | 147 - sdk/src/abis/RelayParams.ts | 53 + sdk/src/abis/RewardReader.json | 86 - sdk/src/abis/RewardReader.ts | 33 + sdk/src/abis/RewardRouter.json | 1024 ---- sdk/src/abis/RewardRouter.ts | 458 ++ sdk/src/abis/RewardTracker.json | 918 --- sdk/src/abis/RewardTracker.ts | 413 ++ sdk/src/abis/SmartAccount.json | 28 - sdk/src/abis/SmartAccount.ts | 12 + sdk/src/abis/StBTC.json | 1225 ---- sdk/src/abis/StBTC.ts | 511 ++ sdk/src/abis/SubaccountApproval.json | 17 - sdk/src/abis/SubaccountApproval.ts | 15 + sdk/src/abis/SubaccountGelatoRelayRouter.json | 2019 ------- sdk/src/abis/SubaccountGelatoRelayRouter.ts | 775 +++ sdk/src/abis/SubaccountRouter.json | 602 -- sdk/src/abis/SubaccountRouter.ts | 257 + sdk/src/abis/SyntheticsReader.json | 4905 ----------------- sdk/src/abis/SyntheticsReader.ts | 2179 ++++++++ sdk/src/abis/SyntheticsRouter.json | 72 - sdk/src/abis/SyntheticsRouter.ts | 34 + sdk/src/abis/Timelock.json | 1737 ------ sdk/src/abis/Timelock.ts | 776 +++ sdk/src/abis/Token.json | 345 -- sdk/src/abis/Token.ts | 148 + sdk/src/abis/Treasury.json | 411 -- sdk/src/abis/Treasury.ts | 204 + sdk/src/abis/UniPool.json | 89 - sdk/src/abis/UniPool.ts | 34 + sdk/src/abis/UniswapV2.json | 287 - sdk/src/abis/UniswapV2.ts | 285 + sdk/src/abis/Vault.json | 3220 ----------- sdk/src/abis/Vault.ts | 1306 +++++ sdk/src/abis/VaultReader.json | 87 - sdk/src/abis/VaultReader.ts | 28 + sdk/src/abis/VaultV2.json | 3019 ---------- sdk/src/abis/VaultV2.ts | 1220 ++++ sdk/src/abis/VaultV2b.json | 3220 ----------- sdk/src/abis/VaultV2b.ts | 1306 +++++ sdk/src/abis/Vester.json | 1031 ---- sdk/src/abis/Vester.ts | 454 ++ sdk/src/abis/WETH.json | 320 -- sdk/src/abis/WETH.ts | 135 + sdk/src/abis/__tests__/abis.spec.ts | 46 - sdk/src/abis/index.ts | 281 +- sdk/src/utils/multicall.ts | 4 +- sdk/src/utils/orderTransactions.ts | 12 +- sdk/src/utils/swap/botanixStaking.ts | 6 +- sdk/tsconfig.json | 2 +- sdk/yarn.lock | 25 +- .../toastCustomOrStargateError.ts | 4 +- .../MarketFilterLongShort.tsx | 4 +- src/config/multichain.ts | 4 +- .../useMultichainDepositNetworkComposeGas.ts | 26 +- .../claimHistory/claimPriceImpactRebate.ts | 2 +- .../claims/createClaimTransaction.ts | 4 +- .../synthetics/express/expressOrderUtils.ts | 12 +- .../synthetics/express/relayParamsUtils.ts | 30 +- src/domain/synthetics/express/types.ts | 2 +- .../express/useL1ExpressGasReference.ts | 4 +- .../synthetics/markets/claimFundingFeesTxn.ts | 2 +- .../orders/createStakeOrUnStakeTxn.tsx | 10 +- .../synthetics/subaccount/removeSubaccount.ts | 33 +- src/domain/synthetics/subaccount/types.ts | 2 +- src/domain/synthetics/subaccount/utils.ts | 4 +- src/domain/tokens/approveTokens.tsx | 4 +- src/domain/tokens/permitUtils.ts | 35 +- src/lib/multicall/Multicall.ts | 5 +- src/lib/wallets/useAccountType.ts | 4 +- tsconfig.json | 2 +- viem-override.d.ts | 12 + yarn.lock | 21 + 134 files changed, 23510 insertions(+), 53830 deletions(-) create mode 100644 .yarn/patches/viem-npm-2.37.1-7013552341 delete mode 100644 sdk/src/abis/ArbitrumNodeInterface.json create mode 100644 sdk/src/abis/ArbitrumNodeInterface.ts delete mode 100644 sdk/src/abis/ClaimHandler.json create mode 100644 sdk/src/abis/ClaimHandler.ts delete mode 100644 sdk/src/abis/CustomErrors.json create mode 100644 sdk/src/abis/CustomErrors.ts delete mode 100644 sdk/src/abis/DataStore.json create mode 100644 sdk/src/abis/DataStore.ts delete mode 100644 sdk/src/abis/ERC20PermitInterface.json create mode 100644 sdk/src/abis/ERC20PermitInterface.ts delete mode 100644 sdk/src/abis/ERC721.json create mode 100644 sdk/src/abis/ERC721.ts delete mode 100644 sdk/src/abis/EventEmitter.json create mode 100644 sdk/src/abis/EventEmitter.ts delete mode 100644 sdk/src/abis/ExchangeRouter.json create mode 100644 sdk/src/abis/ExchangeRouter.ts delete mode 100644 sdk/src/abis/GelatoRelayRouter.json create mode 100644 sdk/src/abis/GelatoRelayRouter.ts delete mode 100644 sdk/src/abis/GlpManager.json create mode 100644 sdk/src/abis/GlpManager.ts delete mode 100644 sdk/src/abis/GlvReader.json create mode 100644 sdk/src/abis/GlvReader.ts delete mode 100644 sdk/src/abis/GlvRouter.json create mode 100644 sdk/src/abis/GlvRouter.ts delete mode 100644 sdk/src/abis/GmxMigrator.json create mode 100644 sdk/src/abis/GmxMigrator.ts delete mode 100644 sdk/src/abis/GovToken.json create mode 100644 sdk/src/abis/GovToken.ts delete mode 100644 sdk/src/abis/LayerZeroProvider.json create mode 100644 sdk/src/abis/LayerZeroProvider.ts delete mode 100644 sdk/src/abis/MintableBaseToken.json create mode 100644 sdk/src/abis/MintableBaseToken.ts delete mode 100644 sdk/src/abis/Multicall.json create mode 100644 sdk/src/abis/Multicall.ts delete mode 100644 sdk/src/abis/MultichainClaimsRouter.json create mode 100644 sdk/src/abis/MultichainClaimsRouter.ts delete mode 100644 sdk/src/abis/MultichainGlvRouter.json create mode 100644 sdk/src/abis/MultichainGlvRouter.ts delete mode 100644 sdk/src/abis/MultichainGmRouter.json create mode 100644 sdk/src/abis/MultichainGmRouter.ts delete mode 100644 sdk/src/abis/MultichainOrderRouter.json create mode 100644 sdk/src/abis/MultichainOrderRouter.ts delete mode 100644 sdk/src/abis/MultichainSubaccountRouter.json create mode 100644 sdk/src/abis/MultichainSubaccountRouter.ts delete mode 100644 sdk/src/abis/MultichainTransferRouter.json create mode 100644 sdk/src/abis/MultichainTransferRouter.ts delete mode 100644 sdk/src/abis/MultichainUtils.json create mode 100644 sdk/src/abis/MultichainUtils.ts delete mode 100644 sdk/src/abis/MultichainVault.json create mode 100644 sdk/src/abis/MultichainVault.ts delete mode 100644 sdk/src/abis/Reader.json create mode 100644 sdk/src/abis/Reader.ts delete mode 100644 sdk/src/abis/ReaderV2.json create mode 100644 sdk/src/abis/ReaderV2.ts delete mode 100644 sdk/src/abis/ReferralStorage.json create mode 100644 sdk/src/abis/ReferralStorage.ts delete mode 100644 sdk/src/abis/RelayParams.json create mode 100644 sdk/src/abis/RelayParams.ts delete mode 100644 sdk/src/abis/RewardReader.json create mode 100644 sdk/src/abis/RewardReader.ts delete mode 100644 sdk/src/abis/RewardRouter.json create mode 100644 sdk/src/abis/RewardRouter.ts delete mode 100644 sdk/src/abis/RewardTracker.json create mode 100644 sdk/src/abis/RewardTracker.ts delete mode 100644 sdk/src/abis/SmartAccount.json create mode 100644 sdk/src/abis/SmartAccount.ts delete mode 100644 sdk/src/abis/StBTC.json create mode 100644 sdk/src/abis/StBTC.ts delete mode 100644 sdk/src/abis/SubaccountApproval.json create mode 100644 sdk/src/abis/SubaccountApproval.ts delete mode 100644 sdk/src/abis/SubaccountGelatoRelayRouter.json create mode 100644 sdk/src/abis/SubaccountGelatoRelayRouter.ts delete mode 100644 sdk/src/abis/SubaccountRouter.json create mode 100644 sdk/src/abis/SubaccountRouter.ts delete mode 100644 sdk/src/abis/SyntheticsReader.json create mode 100644 sdk/src/abis/SyntheticsReader.ts delete mode 100644 sdk/src/abis/SyntheticsRouter.json create mode 100644 sdk/src/abis/SyntheticsRouter.ts delete mode 100644 sdk/src/abis/Timelock.json create mode 100644 sdk/src/abis/Timelock.ts delete mode 100644 sdk/src/abis/Token.json create mode 100644 sdk/src/abis/Token.ts delete mode 100644 sdk/src/abis/Treasury.json create mode 100644 sdk/src/abis/Treasury.ts delete mode 100644 sdk/src/abis/UniPool.json create mode 100644 sdk/src/abis/UniPool.ts delete mode 100644 sdk/src/abis/UniswapV2.json create mode 100644 sdk/src/abis/UniswapV2.ts delete mode 100644 sdk/src/abis/Vault.json create mode 100644 sdk/src/abis/Vault.ts delete mode 100644 sdk/src/abis/VaultReader.json create mode 100644 sdk/src/abis/VaultReader.ts delete mode 100644 sdk/src/abis/VaultV2.json create mode 100644 sdk/src/abis/VaultV2.ts delete mode 100644 sdk/src/abis/VaultV2b.json create mode 100644 sdk/src/abis/VaultV2b.ts delete mode 100644 sdk/src/abis/Vester.json create mode 100644 sdk/src/abis/Vester.ts delete mode 100644 sdk/src/abis/WETH.json create mode 100644 sdk/src/abis/WETH.ts delete mode 100644 sdk/src/abis/__tests__/abis.spec.ts create mode 100644 viem-override.d.ts diff --git a/.yarn/patches/viem-npm-2.37.1-7013552341 b/.yarn/patches/viem-npm-2.37.1-7013552341 new file mode 100644 index 0000000000..7c6ac59ba5 --- /dev/null +++ b/.yarn/patches/viem-npm-2.37.1-7013552341 @@ -0,0 +1,39 @@ +diff --git a/.vscode/settings.json b/.vscode/settings.json +new file mode 100644 +index 0000000000000000000000000000000000000000..070e604515969065ffd11b45b3e71784582e4933 +--- /dev/null ++++ b/.vscode/settings.json +@@ -0,0 +1,7 @@ ++{ ++ "workbench.colorCustomizations": { ++ "activityBar.background": "#4C2112", ++ "titleBar.activeBackground": "#6B2E19", ++ "titleBar.activeForeground": "#FDF9F7" ++ } ++} +\ No newline at end of file +diff --git a/_types/types/misc.d.ts b/_types/types/misc.d.ts +index 2fa2d166d6e708ad2adea724a2e20f40b0b9ac88..032498f54ab08dfba43dd125637f0c70b19a93ae 100644 +--- a/_types/types/misc.d.ts ++++ b/_types/types/misc.d.ts +@@ -1,6 +1,6 @@ + import type { OneOf } from './utils.js'; + export type ByteArray = Uint8Array; +-export type Hex = `0x${string}`; ++export type Hex = string + export type Hash = `0x${string}`; + export type LogTopic = Hex | Hex[] | null; + export type SignableMessage = string | { +diff --git a/types/misc.ts b/types/misc.ts +index 625ba085cc64d197faff2f981ff06e706c2898a0..59e49bec00ac4a7a2f351c1406a356760f4a7e47 100644 +--- a/types/misc.ts ++++ b/types/misc.ts +@@ -1,7 +1,7 @@ + import type { OneOf } from './utils.js' + + export type ByteArray = Uint8Array +-export type Hex = `0x${string}` ++export type Hex = string + export type Hash = `0x${string}` + export type LogTopic = Hex | Hex[] | null + export type SignableMessage = diff --git a/landing/tsconfig.json b/landing/tsconfig.json index d5fc9eb647..af35d14aa0 100644 --- a/landing/tsconfig.json +++ b/landing/tsconfig.json @@ -29,5 +29,5 @@ } }, "references": [{ "path": "../sdk" }], - "include": ["src", "../sdk", "../src"] + "include": ["src", "../sdk", "../src", "../viem-override.d.ts"] } diff --git a/package.json b/package.json index 66a192677d..d0a5bcdadf 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,8 @@ "react-error-overlay": "6.0.9", "@coinbase/wallet-sdk": "4.3.0", "ethers@6.12.1": "patch:ethers@npm:6.12.1#.yarn/patches/ethers-npm-6.12.1-7d4a09a25c", - "jest-runner": "patch:jest-runner@npm:27.5.1#.yarn/patches/jest-runner-npm-27.5.1-2ed2c1cda8" + "jest-runner": "patch:jest-runner@npm:27.5.1#.yarn/patches/jest-runner-npm-27.5.1-2ed2c1cda8", + "viem@2.37.1": "patch:viem@npm:2.37.1#.yarn/patches/viem-npm-2.37.1-7013552341" }, "eslintConfig": { "extends": [ diff --git a/sdk/.gitignore b/sdk/.gitignore index b5e9bc8ff5..524a80843e 100644 --- a/sdk/.gitignore +++ b/sdk/.gitignore @@ -5,7 +5,6 @@ /.pnp .pnp.js .vscode -.yarn # lingui /src/locales/**/*.js diff --git a/sdk/package.json b/sdk/package.json index 3af6000877..0464bb41c3 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -86,10 +86,14 @@ "ts-patch": "3.2.1", "tsx": "4.19.0", "typescript-transform-paths": "3.5.1", + "viem": "2.37.1", "vitest": "3.0.4" }, "files": [ "build" ], - "packageManager": "yarn@3.1.0" + "packageManager": "yarn@3.1.0", + "resolutions": { + "viem@2.37.1": "patch:viem@npm:2.37.1#../.yarn/patches/viem-npm-2.37.1-7013552341" + } } diff --git a/sdk/src/abis/ArbitrumNodeInterface.json b/sdk/src/abis/ArbitrumNodeInterface.json deleted file mode 100644 index a6ccbc188f..0000000000 --- a/sdk/src/abis/ArbitrumNodeInterface.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { "internalType": "uint64", "name": "size", "type": "uint64" }, - { "internalType": "uint64", "name": "leaf", "type": "uint64" } - ], - "name": "constructOutboxProof", - "outputs": [ - { "internalType": "bytes32", "name": "send", "type": "bytes32" }, - { "internalType": "bytes32", "name": "root", "type": "bytes32" }, - { "internalType": "bytes32[]", "name": "proof", "type": "bytes32[]" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sender", "type": "address" }, - { "internalType": "uint256", "name": "deposit", "type": "uint256" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "l2CallValue", "type": "uint256" }, - { "internalType": "address", "name": "excessFeeRefundAddress", "type": "address" }, - { "internalType": "address", "name": "callValueRefundAddress", "type": "address" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "estimateRetryableTicket", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint64", "name": "blockNum", "type": "uint64" }], - "name": "findBatchContainingBlock", - "outputs": [{ "internalType": "uint64", "name": "batch", "type": "uint64" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "bool", "name": "contractCreation", "type": "bool" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "gasEstimateComponents", - "outputs": [ - { "internalType": "uint64", "name": "gasEstimate", "type": "uint64" }, - { "internalType": "uint64", "name": "gasEstimateForL1", "type": "uint64" }, - { "internalType": "uint256", "name": "baseFee", "type": "uint256" }, - { "internalType": "uint256", "name": "l1BaseFeeEstimate", "type": "uint256" } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "bool", "name": "contractCreation", "type": "bool" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "gasEstimateL1Component", - "outputs": [ - { "internalType": "uint64", "name": "gasEstimateForL1", "type": "uint64" }, - { "internalType": "uint256", "name": "baseFee", "type": "uint256" }, - { "internalType": "uint256", "name": "l1BaseFeeEstimate", "type": "uint256" } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }], - "name": "getL1Confirmations", - "outputs": [{ "internalType": "uint64", "name": "confirmations", "type": "uint64" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "batchNum", "type": "uint256" }, - { "internalType": "uint64", "name": "index", "type": "uint64" } - ], - "name": "legacyLookupMessageBatchProof", - "outputs": [ - { "internalType": "bytes32[]", "name": "proof", "type": "bytes32[]" }, - { "internalType": "uint256", "name": "path", "type": "uint256" }, - { "internalType": "address", "name": "l2Sender", "type": "address" }, - { "internalType": "address", "name": "l1Dest", "type": "address" }, - { "internalType": "uint256", "name": "l2Block", "type": "uint256" }, - { "internalType": "uint256", "name": "l1Block", "type": "uint256" }, - { "internalType": "uint256", "name": "timestamp", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "bytes", "name": "calldataForL1", "type": "bytes" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nitroGenesisBlock", - "outputs": [{ "internalType": "uint256", "name": "number", "type": "uint256" }], - "stateMutability": "pure", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/ArbitrumNodeInterface.ts b/sdk/src/abis/ArbitrumNodeInterface.ts new file mode 100644 index 0000000000..0a46aa7228 --- /dev/null +++ b/sdk/src/abis/ArbitrumNodeInterface.ts @@ -0,0 +1,103 @@ +export default [ + { + inputs: [ + { internalType: "uint64", name: "size", type: "uint64" }, + { internalType: "uint64", name: "leaf", type: "uint64" }, + ], + name: "constructOutboxProof", + outputs: [ + { internalType: "bytes32", name: "send", type: "bytes32" }, + { internalType: "bytes32", name: "root", type: "bytes32" }, + { internalType: "bytes32[]", name: "proof", type: "bytes32[]" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "sender", type: "address" }, + { internalType: "uint256", name: "deposit", type: "uint256" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "l2CallValue", type: "uint256" }, + { internalType: "address", name: "excessFeeRefundAddress", type: "address" }, + { internalType: "address", name: "callValueRefundAddress", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "estimateRetryableTicket", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint64", name: "blockNum", type: "uint64" }], + name: "findBatchContainingBlock", + outputs: [{ internalType: "uint64", name: "batch", type: "uint64" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "bool", name: "contractCreation", type: "bool" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "gasEstimateComponents", + outputs: [ + { internalType: "uint64", name: "gasEstimate", type: "uint64" }, + { internalType: "uint64", name: "gasEstimateForL1", type: "uint64" }, + { internalType: "uint256", name: "baseFee", type: "uint256" }, + { internalType: "uint256", name: "l1BaseFeeEstimate", type: "uint256" }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "bool", name: "contractCreation", type: "bool" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "gasEstimateL1Component", + outputs: [ + { internalType: "uint64", name: "gasEstimateForL1", type: "uint64" }, + { internalType: "uint256", name: "baseFee", type: "uint256" }, + { internalType: "uint256", name: "l1BaseFeeEstimate", type: "uint256" }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + name: "getL1Confirmations", + outputs: [{ internalType: "uint64", name: "confirmations", type: "uint64" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "batchNum", type: "uint256" }, + { internalType: "uint64", name: "index", type: "uint64" }, + ], + name: "legacyLookupMessageBatchProof", + outputs: [ + { internalType: "bytes32[]", name: "proof", type: "bytes32[]" }, + { internalType: "uint256", name: "path", type: "uint256" }, + { internalType: "address", name: "l2Sender", type: "address" }, + { internalType: "address", name: "l1Dest", type: "address" }, + { internalType: "uint256", name: "l2Block", type: "uint256" }, + { internalType: "uint256", name: "l1Block", type: "uint256" }, + { internalType: "uint256", name: "timestamp", type: "uint256" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "bytes", name: "calldataForL1", type: "bytes" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "nitroGenesisBlock", + outputs: [{ internalType: "uint256", name: "number", type: "uint256" }], + stateMutability: "pure", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/ClaimHandler.json b/sdk/src/abis/ClaimHandler.json deleted file mode 100644 index b38721ec29..0000000000 --- a/sdk/src/abis/ClaimHandler.json +++ /dev/null @@ -1,424 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract ClaimVault", - "name": "_claimVault", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "existingDistributionId", - "type": "uint256" - } - ], - "name": "DuplicateClaimTerms", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyAccount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyClaimableAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InsufficientFunds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recoveredSigner", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSigner", - "type": "address" - } - ], - "name": "InvalidClaimTermsSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedSigner", - "type": "address" - } - ], - "name": "InvalidClaimTermsSignatureForContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParams", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "termsSignature", - "type": "bytes" - } - ], - "internalType": "struct ClaimHandler.ClaimParam[]", - "name": "params", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimVault", - "outputs": [ - { - "internalType": "contract ClaimVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct ClaimHandler.DepositParam[]", - "name": "params", - "type": "tuple[]" - } - ], - "name": "depositFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "distributionIds", - "type": "uint256[]" - } - ], - "name": "getClaimableAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getTotalClaimableAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - } - ], - "name": "removeTerms", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "terms", - "type": "string" - } - ], - "name": "setTerms", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "fromAccount", - "type": "address" - }, - { - "internalType": "address", - "name": "toAccount", - "type": "address" - } - ], - "internalType": "struct ClaimHandler.TransferClaimParam[]", - "name": "params", - "type": "tuple[]" - } - ], - "name": "transferClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "distributionId", - "type": "uint256" - } - ], - "internalType": "struct ClaimHandler.WithdrawParam[]", - "name": "params", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "withdrawFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/ClaimHandler.ts b/sdk/src/abis/ClaimHandler.ts new file mode 100644 index 0000000000..8cfc250eb1 --- /dev/null +++ b/sdk/src/abis/ClaimHandler.ts @@ -0,0 +1,190 @@ +export default [ + { + inputs: [ + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract ClaimVault", name: "_claimVault", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { + inputs: [{ internalType: "uint256", name: "existingDistributionId", type: "uint256" }], + name: "DuplicateClaimTerms", + type: "error", + }, + { inputs: [], name: "EmptyAccount", type: "error" }, + { inputs: [], name: "EmptyAmount", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyClaimableAmount", + type: "error", + }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { inputs: [], name: "EmptyToken", type: "error" }, + { inputs: [{ internalType: "address", name: "token", type: "address" }], name: "InsufficientFunds", type: "error" }, + { + inputs: [ + { internalType: "address", name: "recoveredSigner", type: "address" }, + { internalType: "address", name: "expectedSigner", type: "address" }, + ], + name: "InvalidClaimTermsSignature", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "expectedSigner", type: "address" }], + name: "InvalidClaimTermsSignatureForContract", + type: "error", + }, + { inputs: [{ internalType: "string", name: "reason", type: "string" }], name: "InvalidParams", type: "error" }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "distributionId", type: "uint256" }, + { internalType: "bytes", name: "termsSignature", type: "bytes" }, + ], + internalType: "struct ClaimHandler.ClaimParam[]", + name: "params", + type: "tuple[]", + }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "claimVault", + outputs: [{ internalType: "contract ClaimVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "distributionId", type: "uint256" }, + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + internalType: "struct ClaimHandler.DepositParam[]", + name: "params", + type: "tuple[]", + }, + ], + name: "depositFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256[]", name: "distributionIds", type: "uint256[]" }, + ], + name: "getClaimableAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "getTotalClaimableAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "distributionId", type: "uint256" }], + name: "removeTerms", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "distributionId", type: "uint256" }, + { internalType: "string", name: "terms", type: "string" }, + ], + name: "setTerms", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { + components: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "distributionId", type: "uint256" }, + { internalType: "address", name: "fromAccount", type: "address" }, + { internalType: "address", name: "toAccount", type: "address" }, + ], + internalType: "struct ClaimHandler.TransferClaimParam[]", + name: "params", + type: "tuple[]", + }, + ], + name: "transferClaim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "distributionId", type: "uint256" }, + ], + internalType: "struct ClaimHandler.WithdrawParam[]", + name: "params", + type: "tuple[]", + }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "withdrawFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/CustomErrors.json b/sdk/src/abis/CustomErrors.json deleted file mode 100644 index 0124d633c5..0000000000 --- a/sdk/src/abis/CustomErrors.json +++ /dev/null @@ -1,4432 +0,0 @@ -{ - "abi": [ - { - "inputs": [], - "name": "ActionAlreadySignalled", - "type": "error" - }, - { - "inputs": [], - "name": "ActionNotSignalled", - "type": "error" - }, - { - "inputs": [], - "name": "AdlNotEnabled", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "pnlToPoolFactor", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "maxPnlFactorForAdl", - "type": "uint256" - } - ], - "name": "AdlNotRequired", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "values", - "type": "bytes[]" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "string", - "name": "label", - "type": "string" - } - ], - "name": "ArrayOutOfBoundsBytes", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "string", - "name": "label", - "type": "string" - } - ], - "name": "ArrayOutOfBoundsUint256", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "buybackToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "AvailableFeeAmountIsZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minOracleBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "prevMinOracleBlockNumber", - "type": "uint256" - } - ], - "name": "BlockNumbersNotSorted", - "type": "error" - }, - { - "inputs": [], - "name": "BridgeOutNotSupportedDuringShift", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "buybackToken", - "type": "address" - } - ], - "name": "BuybackAndFeeTokenAreEqual", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "heartbeatDuration", - "type": "uint256" - } - ], - "name": "ChainlinkPriceFeedNotUpdated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "adjustedClaimableAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "name": "CollateralAlreadyClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "compactedValues", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "slotIndex", - "type": "uint256" - }, - { - "internalType": "string", - "name": "label", - "type": "string" - } - ], - "name": "CompactedArrayOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "baseKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "ConfigValueExceedsAllowedRange", - "type": "error" - }, - { - "inputs": [], - "name": "DataListLengthExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "DataStreamIdAlreadyExistsForToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DepositNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "DisabledMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "existingDistributionId", - "type": "uint256" - } - ], - "name": "DuplicateClaimTerms", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "string", - "name": "label", - "type": "string" - } - ], - "name": "DuplicatedIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "DuplicatedMarketInSwapPath", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EdgeDataStreamIdAlreadyExistsForToken", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyAddressInMarketTokenBalanceValidation", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyChainlinkPriceFeed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyChainlinkPriceFeedMultiplier", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyClaimFeesMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyClaimableAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyDataStreamFeedId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyDataStreamMultiplier", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDepositAmounts", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDepositAmountsAfterSwap", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyFundingAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - } - ], - "name": "EmptyGlv", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvDepositAmounts", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvMarketAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvTokenSupply", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvWithdrawal", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvWithdrawalAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "EmptyMarketPrice", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyMarketTokenSupply", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyMultichainTransferInAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyMultichainTransferOutAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyPosition", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyPositionImpactWithdrawalAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyPrimaryPrice", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReduceLentAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyRelayFeeAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyShift", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyShiftAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EmptySizeDeltaInTokens", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyTarget", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyValidatedPrices", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyWithdrawal", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyWithdrawalAmount", - "type": "error" - }, - { - "inputs": [], - "name": "EndOfOracleSimulation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "key", - "type": "string" - } - ], - "name": "EventItemNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "ExternalCallFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "FeeBatchNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - } - ], - "name": "GlvAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "GlvDepositNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvDisabledMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvEnabledMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "uint256", - "name": "marketTokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - } - ], - "name": "GlvInsufficientMarketTokenBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "provided", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "GlvInvalidLongToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "provided", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "GlvInvalidShortToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvMarketAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "uint256", - "name": "glvMaxMarketCount", - "type": "uint256" - } - ], - "name": "GlvMaxMarketCountExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxMarketTokenBalanceAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "marketTokenBalanceAmount", - "type": "uint256" - } - ], - "name": "GlvMaxMarketTokenBalanceAmountExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxMarketTokenBalanceUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "marketTokenBalanceUsd", - "type": "uint256" - } - ], - "name": "GlvMaxMarketTokenBalanceUsdExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "GlvNameTooLong", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvNegativeMarketPoolValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvNonZeroMarketBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "key", - "type": "address" - } - ], - "name": "GlvNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastGlvShiftExecutedAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "glvShiftMinInterval", - "type": "uint256" - } - ], - "name": "GlvShiftIntervalNotYetPassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "effectivePriceImpactFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "glvMaxShiftPriceImpactFactor", - "type": "uint256" - } - ], - "name": "GlvShiftMaxPriceImpactExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "GlvShiftNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "GlvSymbolTooLong", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvUnsupportedMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "GlvWithdrawalNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "signerIndex", - "type": "uint256" - } - ], - "name": "GmEmptySigner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minOracleBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentBlockNumber", - "type": "uint256" - } - ], - "name": "GmInvalidBlockNumber", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minOracleBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxOracleBlockNumber", - "type": "uint256" - } - ], - "name": "GmInvalidMinMaxBlockNumber", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "oracleSigners", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxOracleSigners", - "type": "uint256" - } - ], - "name": "GmMaxOracleSigners", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "prevPrice", - "type": "uint256" - } - ], - "name": "GmMaxPricesNotSorted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "signerIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSignerIndex", - "type": "uint256" - } - ], - "name": "GmMaxSignerIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "oracleSigners", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOracleSigners", - "type": "uint256" - } - ], - "name": "GmMinOracleSigners", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "prevPrice", - "type": "uint256" - } - ], - "name": "GmMinPricesNotSorted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "buybackToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "outputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - } - ], - "name": "InsufficientBuybackOutputAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "collateralDeltaAmount", - "type": "int256" - } - ], - "name": "InsufficientCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "remainingCollateralUsd", - "type": "int256" - } - ], - "name": "InsufficientCollateralUsd", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minExecutionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - } - ], - "name": "InsufficientExecutionFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "startingGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "estimatedGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAdditionalGasForExecution", - "type": "uint256" - } - ], - "name": "InsufficientExecutionGas", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "startingGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minHandleErrorGas", - "type": "uint256" - } - ], - "name": "InsufficientExecutionGasForErrorHandling", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeProvided", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeRequired", - "type": "uint256" - } - ], - "name": "InsufficientFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InsufficientFunds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "remainingCostUsd", - "type": "uint256" - }, - { - "internalType": "string", - "name": "step", - "type": "string" - } - ], - "name": "InsufficientFundsToPayForCosts", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minHandleExecutionErrorGas", - "type": "uint256" - } - ], - "name": "InsufficientGasForAutoCancellation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minHandleExecutionErrorGas", - "type": "uint256" - } - ], - "name": "InsufficientGasForCancellation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "estimatedGasLimit", - "type": "uint256" - } - ], - "name": "InsufficientGasLeft", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gasToBeForwarded", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "name": "InsufficientGasLeftForCallback", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minHandleExecutionErrorGas", - "type": "uint256" - } - ], - "name": "InsufficientHandleExecutionErrorGas", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "withdrawalAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "totalPendingImpactAmount", - "type": "int256" - } - ], - "name": "InsufficientImpactPoolValueForWithdrawal", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "InsufficientMarketTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientMultichainBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "outputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - } - ], - "name": "InsufficientOutputAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "poolAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientPoolAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "reservedUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxReservedUsd", - "type": "uint256" - } - ], - "name": "InsufficientReserve", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "reservedUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxReservedUsd", - "type": "uint256" - } - ], - "name": "InsufficientReserveForOpenInterest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "outputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - } - ], - "name": "InsufficientSwapOutputAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "wntAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - } - ], - "name": "InsufficientWntAmountForExecutionFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "nextPnlToPoolFactor", - "type": "int256" - }, - { - "internalType": "int256", - "name": "pnlToPoolFactor", - "type": "int256" - } - ], - "name": "InvalidAdl", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "remainingAmount", - "type": "uint256" - } - ], - "name": "InvalidAmountInForFeeBatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "baseKey", - "type": "bytes32" - } - ], - "name": "InvalidBaseKey", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "largestMinBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "smallestMaxBlockNumber", - "type": "uint256" - } - ], - "name": "InvalidBlockRangeSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidBridgeOutToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "buybackToken", - "type": "address" - } - ], - "name": "InvalidBuybackToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedCancellationReceiver", - "type": "address" - } - ], - "name": "InvalidCancellationReceiverForSubaccountOrder", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - } - ], - "name": "InvalidClaimAffiliateRewardsInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeKeysLength", - "type": "uint256" - } - ], - "name": "InvalidClaimCollateralInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - } - ], - "name": "InvalidClaimFundingFeesInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recoveredSigner", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSigner", - "type": "address" - } - ], - "name": "InvalidClaimTermsSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedSigner", - "type": "address" - } - ], - "name": "InvalidClaimTermsSignatureForContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - } - ], - "name": "InvalidClaimUiFeesInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "InvalidClaimableFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "InvalidClaimableReductionFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidCollateralTokenForMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidContributorToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "int192", - "name": "bid", - "type": "int192" - }, - { - "internalType": "int192", - "name": "ask", - "type": "int192" - } - ], - "name": "InvalidDataStreamBidAsk", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "expectedFeedId", - "type": "bytes32" - } - ], - "name": "InvalidDataStreamFeedId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "int192", - "name": "bid", - "type": "int192" - }, - { - "internalType": "int192", - "name": "ask", - "type": "int192" - } - ], - "name": "InvalidDataStreamPrices", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "spreadReductionFactor", - "type": "uint256" - } - ], - "name": "InvalidDataStreamSpreadReductionFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionSizeInUsd", - "type": "uint256" - } - ], - "name": "InvalidDecreaseOrderSize", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "decreasePositionSwapType", - "type": "uint256" - } - ], - "name": "InvalidDecreasePositionSwapType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "bid", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ask", - "type": "uint256" - } - ], - "name": "InvalidEdgeDataStreamBidAsk", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "expo", - "type": "int256" - } - ], - "name": "InvalidEdgeDataStreamExpo", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "bid", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ask", - "type": "uint256" - } - ], - "name": "InvalidEdgeDataStreamPrices", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "recoverError", - "type": "uint256" - } - ], - "name": "InvalidEdgeSignature", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidEdgeSigner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "eid", - "type": "uint256" - } - ], - "name": "InvalidEid", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minExecutionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxExecutionFee", - "type": "uint256" - } - ], - "name": "InvalidExecutionFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "totalExecutionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "msgValue", - "type": "uint256" - } - ], - "name": "InvalidExecutionFeeForMigration", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "targetsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dataListLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCallInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "InvalidExternalCallTarget", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "refundTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundReceiversLength", - "type": "uint256" - } - ], - "name": "InvalidExternalReceiversInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeBatchTokensLength", - "type": "uint256" - } - ], - "name": "InvalidFeeBatchTokenIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "InvalidFeeReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidFeedPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "totalGlpAmountToRedeem", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalGlpAmount", - "type": "uint256" - } - ], - "name": "InvalidGlpAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - } - ], - "name": "InvalidGlvDepositInitialLongToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - } - ], - "name": "InvalidGlvDepositInitialShortToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "longTokenSwapPathLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenSwapPathLength", - "type": "uint256" - } - ], - "name": "InvalidGlvDepositSwapPath", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "InvalidGmMedianMinMaxPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidGmOraclePrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recoveredSigner", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSigner", - "type": "address" - } - ], - "name": "InvalidGmSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "InvalidGmSignerMinMaxPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "InvalidHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitializer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "keeper", - "type": "address" - } - ], - "name": "InvalidKeeperForFrozenOrder", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedMinBalance", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableFundingFeeAmount", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalanceForClaimableFunding", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalanceForCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedMinGlvTokens", - "type": "uint256" - } - ], - "name": "InvalidMinGlvTokensForFirstGlvDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedMinMarketTokens", - "type": "uint256" - } - ], - "name": "InvalidMinMarketTokensForFirstDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "InvalidMinMaxForPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "InvalidMultichainEndpoint", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "InvalidMultichainProvider", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "InvalidNativeTokenSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "InvalidOracleProvider", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedProvider", - "type": "address" - } - ], - "name": "InvalidOracleProviderForToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dataLength", - "type": "uint256" - } - ], - "name": "InvalidOracleSetPricesDataParam", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "providersLength", - "type": "uint256" - } - ], - "name": "InvalidOracleSetPricesProvidersParam", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - } - ], - "name": "InvalidOracleSigner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "primaryPriceMin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "primaryPriceMax", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "orderType", - "type": "uint256" - } - ], - "name": "InvalidOrderPrices", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenOut", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedTokenOut", - "type": "address" - } - ], - "name": "InvalidOutputToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParams", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "poolValue", - "type": "int256" - } - ], - "name": "InvalidPoolValueForDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "poolValue", - "type": "int256" - } - ], - "name": "InvalidPoolValueForWithdrawal", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "distributionAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionImpactPoolAmount", - "type": "uint256" - } - ], - "name": "InvalidPositionImpactPoolDistributionRate", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "InvalidPositionMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sizeInTokens", - "type": "uint256" - } - ], - "name": "InvalidPositionSizeValues", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "primaryTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "primaryPricesLength", - "type": "uint256" - } - ], - "name": "InvalidPrimaryPricesForSimulation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "InvalidReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedReceiver", - "type": "address" - } - ], - "name": "InvalidReceiverForFirstDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedReceiver", - "type": "address" - } - ], - "name": "InvalidReceiverForFirstGlvDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedReceiver", - "type": "address" - } - ], - "name": "InvalidReceiverForSubaccountOrder", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "signatureType", - "type": "string" - }, - { - "internalType": "address", - "name": "recovered", - "type": "address" - }, - { - "internalType": "address", - "name": "recoveredFromMinified", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSigner", - "type": "address" - } - ], - "name": "InvalidRecoveredSigner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountsLength", - "type": "uint256" - } - ], - "name": "InvalidSetContributorPaymentInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountsLength", - "type": "uint256" - } - ], - "name": "InvalidSetMaxTotalContributorTokenAmountInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "signatureType", - "type": "string" - } - ], - "name": "InvalidSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionSizeInUsd", - "type": "uint256" - } - ], - "name": "InvalidSizeDeltaForAdl", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidSubaccountApprovalDesChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "storedNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "InvalidSubaccountApprovalNonce", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidSubaccountApprovalSubaccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "InvalidSwapMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "outputToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedOutputToken", - "type": "address" - } - ], - "name": "InvalidSwapOutputToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "path", - "type": "address[]" - }, - { - "internalType": "address", - "name": "bridgingToken", - "type": "address" - } - ], - "name": "InvalidSwapPathForV1", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timelockDelay", - "type": "uint256" - } - ], - "name": "InvalidTimelockDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "InvalidTokenIn", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidTransferRequestsLength", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidTrustedSignerAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "uiFeeFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxUiFeeFactor", - "type": "uint256" - } - ], - "name": "InvalidUiFeeFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "version", - "type": "uint256" - } - ], - "name": "InvalidVersion", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "internalType": "int256", - "name": "remainingCollateralUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "minCollateralUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "minCollateralUsdForLeverage", - "type": "int256" - } - ], - "name": "LiquidatablePosition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "fromMarketLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarketLongToken", - "type": "address" - } - ], - "name": "LongTokensAreNotEqual", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "existingMarketAddress", - "type": "address" - } - ], - "name": "MarketAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "key", - "type": "address" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "string", - "name": "label", - "type": "string" - } - ], - "name": "MaskIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAutoCancelOrders", - "type": "uint256" - } - ], - "name": "MaxAutoCancelOrdersExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "priceTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "buybackMaxPriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - } - ], - "name": "MaxBuybackPriceAgeExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxCallbackGasLimit", - "type": "uint256" - } - ], - "name": "MaxCallbackGasLimitExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "dataLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxDataLength", - "type": "uint256" - } - ], - "name": "MaxDataListLengthExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxFundingFactorPerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "limit", - "type": "uint256" - } - ], - "name": "MaxFundingFactorPerSecondLimitExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "poolUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLendableUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lentUsd", - "type": "uint256" - } - ], - "name": "MaxLendableFactorForWithdrawalsExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "openInterest", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxOpenInterest", - "type": "uint256" - } - ], - "name": "MaxOpenInterestExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "range", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxRange", - "type": "uint256" - } - ], - "name": "MaxOracleTimestampRangeExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "poolAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPoolAmount", - "type": "uint256" - } - ], - "name": "MaxPoolAmountExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "poolUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPoolUsdForDeposit", - "type": "uint256" - } - ], - "name": "MaxPoolUsdForDepositExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "oracleTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - } - ], - "name": "MaxPriceAgeExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxRefPriceDeviationFactor", - "type": "uint256" - } - ], - "name": "MaxRefPriceDeviationExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxCount", - "type": "uint256" - } - ], - "name": "MaxSubaccountActionCountExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "swapPathLengh", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSwapPathLength", - "type": "uint256" - } - ], - "name": "MaxSwapPathLengthExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timelockDelay", - "type": "uint256" - } - ], - "name": "MaxTimelockDelayExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "totalCallbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTotalCallbackGasLimit", - "type": "uint256" - } - ], - "name": "MaxTotalCallbackGasLimitForAutoCancelOrdersExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "totalAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTotalAmount", - "type": "uint256" - } - ], - "name": "MaxTotalContributorTokenAmountExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "interval", - "type": "uint256" - } - ], - "name": "MinContributorPaymentIntervalBelowAllowedRange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minPaymentInterval", - "type": "uint256" - } - ], - "name": "MinContributorPaymentIntervalNotYetPassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "received", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "MinGlvTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "received", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "MinLongTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "received", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "MinMarketTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "positionSizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minPositionSizeUsd", - "type": "uint256" - } - ], - "name": "MinPositionSize", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "received", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "MinShortTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "executionPrice", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionSizeInUsd", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "priceImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - } - ], - "name": "NegativeExecutionPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "NonAtomicOracleProvider", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokensWithPricesLength", - "type": "uint256" - } - ], - "name": "NonEmptyTokensWithPrices", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "OpenInterestCannotBeUpdatedForSwapOnlyMarket", - "type": "error" - }, - { - "inputs": [], - "name": "OraclePriceOutdated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracle", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "OracleProviderAlreadyExistsForToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "OracleProviderMinChangeDelayNotYetPassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxOracleTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requestTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requestExpirationTime", - "type": "uint256" - } - ], - "name": "OracleTimestampsAreLargerThanRequestExpirationTime", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minOracleTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedTimestamp", - "type": "uint256" - } - ], - "name": "OracleTimestampsAreSmallerThanRequired", - "type": "error" - }, - { - "inputs": [], - "name": "OrderAlreadyFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "OrderNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - } - ], - "name": "OrderNotFulfillableAtAcceptablePrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "orderType", - "type": "uint256" - } - ], - "name": "OrderNotUpdatable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "orderType", - "type": "uint256" - } - ], - "name": "OrderTypeCannotBeCreated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - } - ], - "name": "OrderValidFromTimeNotReached", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "pnlToPoolFactor", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "maxPnlFactor", - "type": "uint256" - } - ], - "name": "PnlFactorExceededForLongs", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "pnlToPoolFactor", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "maxPnlFactor", - "type": "uint256" - } - ], - "name": "PnlFactorExceededForShorts", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "nextPnlToPoolFactor", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "minPnlFactorForAdl", - "type": "uint256" - } - ], - "name": "PnlOvercorrected", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "PositionNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "internalType": "int256", - "name": "remainingCollateralUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "minCollateralUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "minCollateralUsdForLeverage", - "type": "int256" - } - ], - "name": "PositionShouldNotBeLiquidated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "PriceAlreadySet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "PriceFeedAlreadyExistsForToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "priceImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - } - ], - "name": "PriceImpactLargerThanOrderSize", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lentAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalReductionAmount", - "type": "uint256" - } - ], - "name": "ReductionExceedsLentAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "calldataLength", - "type": "uint256" - } - ], - "name": "RelayCalldataTooLong", - "type": "error" - }, - { - "inputs": [], - "name": "RelayEmptyBatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requestExpirationAge", - "type": "uint256" - }, - { - "internalType": "string", - "name": "requestType", - "type": "string" - } - ], - "name": "RequestNotYetCancellable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "SelfTransferNotSupported", - "type": "error" - }, - { - "inputs": [], - "name": "SequencerDown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timeSinceUp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sequencerGraceDuration", - "type": "uint256" - } - ], - "name": "SequencerGraceDurationNotYetPassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "ShiftFromAndToMarketAreEqual", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "ShiftNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "fromMarketLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarketLongToken", - "type": "address" - } - ], - "name": "ShortTokensAreNotEqual", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "signalTime", - "type": "uint256" - } - ], - "name": "SignalTimeNotYetPassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "SubaccountApprovalDeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - } - ], - "name": "SubaccountApprovalExpired", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - } - ], - "name": "SubaccountIntegrationIdDisabled", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - } - ], - "name": "SubaccountNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amountAfterFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "negativeImpactAmount", - "type": "int256" - } - ], - "name": "SwapPriceImpactExceedsAmountIn", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "longTokenSwapPathLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenSwapPathLength", - "type": "uint256" - } - ], - "name": "SwapsNotAllowedForAtomicWithdrawal", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "parametersLength", - "type": "uint256" - } - ], - "name": "SyncConfigInvalidInputLengths", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "marketFromData", - "type": "address" - } - ], - "name": "SyncConfigInvalidMarketFromData", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "SyncConfigUpdatesDisabledForMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "string", - "name": "parameter", - "type": "string" - } - ], - "name": "SyncConfigUpdatesDisabledForMarketParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - } - ], - "name": "SyncConfigUpdatesDisabledForParameter", - "type": "error" - }, - { - "inputs": [], - "name": "ThereMustBeAtLeastOneRoleAdmin", - "type": "error" - }, - { - "inputs": [], - "name": "ThereMustBeAtLeastOneTimelockMultiSig", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "Uint256AsBytesLengthExceeds32Bytes", - "type": "error" - }, - { - "inputs": [], - "name": "UnableToGetBorrowingFactorEmptyPoolUsd", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "UnableToGetCachedTokenPrice", - "type": "error" - }, - { - "inputs": [], - "name": "UnableToGetFundingFactorEmptyOpenInterest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "inputToken", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "UnableToGetOppositeToken", - "type": "error" - }, - { - "inputs": [], - "name": "UnableToPayOrderFee", - "type": "error" - }, - { - "inputs": [], - "name": "UnableToPayOrderFeeFromCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "estimatedRemainingCollateralUsd", - "type": "int256" - } - ], - "name": "UnableToWithdrawCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "positionBorrowingFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cumulativeBorrowingFactor", - "type": "uint256" - } - ], - "name": "UnexpectedBorrowingFactor", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "poolValue", - "type": "int256" - } - ], - "name": "UnexpectedPoolValue", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedPositionState", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeTokenAfterSwap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "UnexpectedTokenForVirtualInventory", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "orderType", - "type": "uint256" - } - ], - "name": "UnexpectedValidFromTime", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "orderType", - "type": "uint256" - } - ], - "name": "UnsupportedOrderType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "orderType", - "type": "uint256" - } - ], - "name": "UnsupportedOrderTypeForAutoCancellation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "usdDelta", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "longOpenInterest", - "type": "uint256" - } - ], - "name": "UsdDeltaExceedsLongOpenInterest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "usdDelta", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "poolUsd", - "type": "uint256" - } - ], - "name": "UsdDeltaExceedsPoolValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "usdDelta", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "shortOpenInterest", - "type": "uint256" - } - ], - "name": "UsdDeltaExceedsShortOpenInterest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "WithdrawalNotFound", - "type": "error" - } - ] -} diff --git a/sdk/src/abis/CustomErrors.ts b/sdk/src/abis/CustomErrors.ts new file mode 100644 index 0000000000..e3169dd54b --- /dev/null +++ b/sdk/src/abis/CustomErrors.ts @@ -0,0 +1,1882 @@ +export default [ + { inputs: [], name: "ActionAlreadySignalled", type: "error" }, + { inputs: [], name: "ActionNotSignalled", type: "error" }, + { inputs: [], name: "AdlNotEnabled", type: "error" }, + { + inputs: [ + { internalType: "int256", name: "pnlToPoolFactor", type: "int256" }, + { internalType: "uint256", name: "maxPnlFactorForAdl", type: "uint256" }, + ], + name: "AdlNotRequired", + type: "error", + }, + { + inputs: [ + { internalType: "bytes[]", name: "values", type: "bytes[]" }, + { internalType: "uint256", name: "index", type: "uint256" }, + { internalType: "string", name: "label", type: "string" }, + ], + name: "ArrayOutOfBoundsBytes", + type: "error", + }, + { + inputs: [ + { internalType: "uint256[]", name: "values", type: "uint256[]" }, + { internalType: "uint256", name: "index", type: "uint256" }, + { internalType: "string", name: "label", type: "string" }, + ], + name: "ArrayOutOfBoundsUint256", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "buybackToken", type: "address" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "AvailableFeeAmountIsZero", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minOracleBlockNumber", type: "uint256" }, + { internalType: "uint256", name: "prevMinOracleBlockNumber", type: "uint256" }, + ], + name: "BlockNumbersNotSorted", + type: "error", + }, + { inputs: [], name: "BridgeOutNotSupportedDuringShift", type: "error" }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "buybackToken", type: "address" }, + ], + name: "BuybackAndFeeTokenAreEqual", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "timestamp", type: "uint256" }, + { internalType: "uint256", name: "heartbeatDuration", type: "uint256" }, + ], + name: "ChainlinkPriceFeedNotUpdated", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "adjustedClaimableAmount", type: "uint256" }, + { internalType: "uint256", name: "claimedAmount", type: "uint256" }, + ], + name: "CollateralAlreadyClaimed", + type: "error", + }, + { + inputs: [ + { internalType: "uint256[]", name: "compactedValues", type: "uint256[]" }, + { internalType: "uint256", name: "index", type: "uint256" }, + { internalType: "uint256", name: "slotIndex", type: "uint256" }, + { internalType: "string", name: "label", type: "string" }, + ], + name: "CompactedArrayOutOfBounds", + type: "error", + }, + { + inputs: [ + { internalType: "bytes32", name: "baseKey", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "ConfigValueExceedsAllowedRange", + type: "error", + }, + { inputs: [], name: "DataListLengthExceeded", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "DataStreamIdAlreadyExistsForToken", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DepositNotFound", type: "error" }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [{ internalType: "address", name: "market", type: "address" }], name: "DisabledMarket", type: "error" }, + { + inputs: [{ internalType: "uint256", name: "existingDistributionId", type: "uint256" }], + name: "DuplicateClaimTerms", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "index", type: "uint256" }, + { internalType: "string", name: "label", type: "string" }, + ], + name: "DuplicatedIndex", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "market", type: "address" }], + name: "DuplicatedMarketInSwapPath", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EdgeDataStreamIdAlreadyExistsForToken", + type: "error", + }, + { inputs: [], name: "EmptyAccount", type: "error" }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "EmptyAddressInMarketTokenBalanceValidation", + type: "error", + }, + { inputs: [], name: "EmptyAmount", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyChainlinkPriceFeed", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyChainlinkPriceFeedMultiplier", + type: "error", + }, + { inputs: [], name: "EmptyClaimFeesMarket", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyClaimableAmount", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyDataStreamFeedId", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyDataStreamMultiplier", + type: "error", + }, + { inputs: [], name: "EmptyDeposit", type: "error" }, + { inputs: [], name: "EmptyDepositAmounts", type: "error" }, + { inputs: [], name: "EmptyDepositAmountsAfterSwap", type: "error" }, + { inputs: [], name: "EmptyFundingAccount", type: "error" }, + { inputs: [{ internalType: "address", name: "glv", type: "address" }], name: "EmptyGlv", type: "error" }, + { inputs: [], name: "EmptyGlvDeposit", type: "error" }, + { inputs: [], name: "EmptyGlvDepositAmounts", type: "error" }, + { inputs: [], name: "EmptyGlvMarketAmount", type: "error" }, + { inputs: [], name: "EmptyGlvTokenSupply", type: "error" }, + { inputs: [], name: "EmptyGlvWithdrawal", type: "error" }, + { inputs: [], name: "EmptyGlvWithdrawalAmount", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyMarket", type: "error" }, + { inputs: [{ internalType: "address", name: "market", type: "address" }], name: "EmptyMarketPrice", type: "error" }, + { inputs: [], name: "EmptyMarketTokenSupply", type: "error" }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "EmptyMultichainTransferInAmount", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "EmptyMultichainTransferOutAmount", + type: "error", + }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyPosition", type: "error" }, + { inputs: [], name: "EmptyPositionImpactWithdrawalAmount", type: "error" }, + { inputs: [{ internalType: "address", name: "token", type: "address" }], name: "EmptyPrimaryPrice", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { inputs: [], name: "EmptyReduceLentAmount", type: "error" }, + { inputs: [], name: "EmptyRelayFeeAddress", type: "error" }, + { inputs: [], name: "EmptyShift", type: "error" }, + { inputs: [], name: "EmptyShiftAmount", type: "error" }, + { inputs: [], name: "EmptySizeDeltaInTokens", type: "error" }, + { inputs: [], name: "EmptyTarget", type: "error" }, + { inputs: [], name: "EmptyToken", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { inputs: [], name: "EmptyValidatedPrices", type: "error" }, + { inputs: [], name: "EmptyWithdrawal", type: "error" }, + { inputs: [], name: "EmptyWithdrawalAmount", type: "error" }, + { inputs: [], name: "EndOfOracleSimulation", type: "error" }, + { inputs: [{ internalType: "string", name: "key", type: "string" }], name: "EventItemNotFound", type: "error" }, + { inputs: [{ internalType: "bytes", name: "data", type: "bytes" }], name: "ExternalCallFailed", type: "error" }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "FeeBatchNotFound", type: "error" }, + { + inputs: [ + { internalType: "bytes32", name: "salt", type: "bytes32" }, + { internalType: "address", name: "glv", type: "address" }, + ], + name: "GlvAlreadyExists", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "GlvDepositNotFound", type: "error" }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvDisabledMarket", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvEnabledMarket", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "uint256", name: "marketTokenBalance", type: "uint256" }, + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + ], + name: "GlvInsufficientMarketTokenBalance", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "provided", type: "address" }, + { internalType: "address", name: "expected", type: "address" }, + ], + name: "GlvInvalidLongToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "provided", type: "address" }, + { internalType: "address", name: "expected", type: "address" }, + ], + name: "GlvInvalidShortToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvMarketAlreadyExists", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "uint256", name: "glvMaxMarketCount", type: "uint256" }, + ], + name: "GlvMaxMarketCountExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "uint256", name: "maxMarketTokenBalanceAmount", type: "uint256" }, + { internalType: "uint256", name: "marketTokenBalanceAmount", type: "uint256" }, + ], + name: "GlvMaxMarketTokenBalanceAmountExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "uint256", name: "maxMarketTokenBalanceUsd", type: "uint256" }, + { internalType: "uint256", name: "marketTokenBalanceUsd", type: "uint256" }, + ], + name: "GlvMaxMarketTokenBalanceUsdExceeded", + type: "error", + }, + { inputs: [], name: "GlvNameTooLong", type: "error" }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvNegativeMarketPoolValue", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvNonZeroMarketBalance", + type: "error", + }, + { inputs: [{ internalType: "address", name: "key", type: "address" }], name: "GlvNotFound", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "lastGlvShiftExecutedAt", type: "uint256" }, + { internalType: "uint256", name: "glvShiftMinInterval", type: "uint256" }, + ], + name: "GlvShiftIntervalNotYetPassed", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "effectivePriceImpactFactor", type: "uint256" }, + { internalType: "uint256", name: "glvMaxShiftPriceImpactFactor", type: "uint256" }, + ], + name: "GlvShiftMaxPriceImpactExceeded", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "GlvShiftNotFound", type: "error" }, + { inputs: [], name: "GlvSymbolTooLong", type: "error" }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvUnsupportedMarket", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "GlvWithdrawalNotFound", type: "error" }, + { inputs: [{ internalType: "uint256", name: "signerIndex", type: "uint256" }], name: "GmEmptySigner", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "minOracleBlockNumber", type: "uint256" }, + { internalType: "uint256", name: "currentBlockNumber", type: "uint256" }, + ], + name: "GmInvalidBlockNumber", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minOracleBlockNumber", type: "uint256" }, + { internalType: "uint256", name: "maxOracleBlockNumber", type: "uint256" }, + ], + name: "GmInvalidMinMaxBlockNumber", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "oracleSigners", type: "uint256" }, + { internalType: "uint256", name: "maxOracleSigners", type: "uint256" }, + ], + name: "GmMaxOracleSigners", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "price", type: "uint256" }, + { internalType: "uint256", name: "prevPrice", type: "uint256" }, + ], + name: "GmMaxPricesNotSorted", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "signerIndex", type: "uint256" }, + { internalType: "uint256", name: "maxSignerIndex", type: "uint256" }, + ], + name: "GmMaxSignerIndex", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "oracleSigners", type: "uint256" }, + { internalType: "uint256", name: "minOracleSigners", type: "uint256" }, + ], + name: "GmMinOracleSigners", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "price", type: "uint256" }, + { internalType: "uint256", name: "prevPrice", type: "uint256" }, + ], + name: "GmMinPricesNotSorted", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "buybackToken", type: "address" }, + { internalType: "uint256", name: "outputAmount", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + ], + name: "InsufficientBuybackOutputAmount", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + { internalType: "int256", name: "collateralDeltaAmount", type: "int256" }, + ], + name: "InsufficientCollateralAmount", + type: "error", + }, + { + inputs: [{ internalType: "int256", name: "remainingCollateralUsd", type: "int256" }], + name: "InsufficientCollateralUsd", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minExecutionFee", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + ], + name: "InsufficientExecutionFee", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "startingGas", type: "uint256" }, + { internalType: "uint256", name: "estimatedGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minAdditionalGasForExecution", type: "uint256" }, + ], + name: "InsufficientExecutionGas", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "startingGas", type: "uint256" }, + { internalType: "uint256", name: "minHandleErrorGas", type: "uint256" }, + ], + name: "InsufficientExecutionGasForErrorHandling", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "feeProvided", type: "uint256" }, + { internalType: "uint256", name: "feeRequired", type: "uint256" }, + ], + name: "InsufficientFee", + type: "error", + }, + { inputs: [{ internalType: "address", name: "token", type: "address" }], name: "InsufficientFunds", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "remainingCostUsd", type: "uint256" }, + { internalType: "string", name: "step", type: "string" }, + ], + name: "InsufficientFundsToPayForCosts", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "gas", type: "uint256" }, + { internalType: "uint256", name: "minHandleExecutionErrorGas", type: "uint256" }, + ], + name: "InsufficientGasForAutoCancellation", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "gas", type: "uint256" }, + { internalType: "uint256", name: "minHandleExecutionErrorGas", type: "uint256" }, + ], + name: "InsufficientGasForCancellation", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "gas", type: "uint256" }, + { internalType: "uint256", name: "estimatedGasLimit", type: "uint256" }, + ], + name: "InsufficientGasLeft", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "gasToBeForwarded", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + ], + name: "InsufficientGasLeftForCallback", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "gas", type: "uint256" }, + { internalType: "uint256", name: "minHandleExecutionErrorGas", type: "uint256" }, + ], + name: "InsufficientHandleExecutionErrorGas", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "withdrawalAmount", type: "uint256" }, + { internalType: "uint256", name: "poolValue", type: "uint256" }, + { internalType: "int256", name: "totalPendingImpactAmount", type: "int256" }, + ], + name: "InsufficientImpactPoolValueForWithdrawal", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "expected", type: "uint256" }, + ], + name: "InsufficientMarketTokens", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "InsufficientMultichainBalance", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "outputAmount", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + ], + name: "InsufficientOutputAmount", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "poolAmount", type: "uint256" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "InsufficientPoolAmount", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "reservedUsd", type: "uint256" }, + { internalType: "uint256", name: "maxReservedUsd", type: "uint256" }, + ], + name: "InsufficientReserve", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "reservedUsd", type: "uint256" }, + { internalType: "uint256", name: "maxReservedUsd", type: "uint256" }, + ], + name: "InsufficientReserveForOpenInterest", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "outputAmount", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + ], + name: "InsufficientSwapOutputAmount", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "wntAmount", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + ], + name: "InsufficientWntAmountForExecutionFee", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "nextPnlToPoolFactor", type: "int256" }, + { internalType: "int256", name: "pnlToPoolFactor", type: "int256" }, + ], + name: "InvalidAdl", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "amountIn", type: "uint256" }, + { internalType: "uint256", name: "remainingAmount", type: "uint256" }, + ], + name: "InvalidAmountInForFeeBatch", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "baseKey", type: "bytes32" }], name: "InvalidBaseKey", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "largestMinBlockNumber", type: "uint256" }, + { internalType: "uint256", name: "smallestMaxBlockNumber", type: "uint256" }, + ], + name: "InvalidBlockRangeSet", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "InvalidBridgeOutToken", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "buybackToken", type: "address" }], + name: "InvalidBuybackToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "expectedCancellationReceiver", type: "address" }, + ], + name: "InvalidCancellationReceiverForSubaccountOrder", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + ], + name: "InvalidClaimAffiliateRewardsInput", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "timeKeysLength", type: "uint256" }, + ], + name: "InvalidClaimCollateralInput", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + ], + name: "InvalidClaimFundingFeesInput", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "recoveredSigner", type: "address" }, + { internalType: "address", name: "expectedSigner", type: "address" }, + ], + name: "InvalidClaimTermsSignature", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "expectedSigner", type: "address" }], + name: "InvalidClaimTermsSignatureForContract", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + ], + name: "InvalidClaimUiFeesInput", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "value", type: "uint256" }], + name: "InvalidClaimableFactor", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "value", type: "uint256" }], + name: "InvalidClaimableReductionFactor", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "InvalidCollateralTokenForMarket", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "InvalidContributorToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "int192", name: "bid", type: "int192" }, + { internalType: "int192", name: "ask", type: "int192" }, + ], + name: "InvalidDataStreamBidAsk", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "bytes32", name: "feedId", type: "bytes32" }, + { internalType: "bytes32", name: "expectedFeedId", type: "bytes32" }, + ], + name: "InvalidDataStreamFeedId", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "int192", name: "bid", type: "int192" }, + { internalType: "int192", name: "ask", type: "int192" }, + ], + name: "InvalidDataStreamPrices", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "spreadReductionFactor", type: "uint256" }, + ], + name: "InvalidDataStreamSpreadReductionFactor", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "positionSizeInUsd", type: "uint256" }, + ], + name: "InvalidDecreaseOrderSize", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "decreasePositionSwapType", type: "uint256" }], + name: "InvalidDecreasePositionSwapType", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "bid", type: "uint256" }, + { internalType: "uint256", name: "ask", type: "uint256" }, + ], + name: "InvalidEdgeDataStreamBidAsk", + type: "error", + }, + { + inputs: [{ internalType: "int256", name: "expo", type: "int256" }], + name: "InvalidEdgeDataStreamExpo", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "bid", type: "uint256" }, + { internalType: "uint256", name: "ask", type: "uint256" }, + ], + name: "InvalidEdgeDataStreamPrices", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "recoverError", type: "uint256" }], + name: "InvalidEdgeSignature", + type: "error", + }, + { inputs: [], name: "InvalidEdgeSigner", type: "error" }, + { inputs: [{ internalType: "uint256", name: "eid", type: "uint256" }], name: "InvalidEid", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "minExecutionFee", type: "uint256" }, + { internalType: "uint256", name: "maxExecutionFee", type: "uint256" }, + ], + name: "InvalidExecutionFee", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "totalExecutionFee", type: "uint256" }, + { internalType: "uint256", name: "msgValue", type: "uint256" }, + ], + name: "InvalidExecutionFeeForMigration", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "targetsLength", type: "uint256" }, + { internalType: "uint256", name: "dataListLength", type: "uint256" }, + ], + name: "InvalidExternalCallInput", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "target", type: "address" }], + name: "InvalidExternalCallTarget", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "refundTokensLength", type: "uint256" }, + { internalType: "uint256", name: "refundReceiversLength", type: "uint256" }, + ], + name: "InvalidExternalReceiversInput", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "tokenIndex", type: "uint256" }, + { internalType: "uint256", name: "feeBatchTokensLength", type: "uint256" }, + ], + name: "InvalidFeeBatchTokenIndex", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "receiver", type: "address" }], + name: "InvalidFeeReceiver", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "int256", name: "price", type: "int256" }, + ], + name: "InvalidFeedPrice", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "totalGlpAmountToRedeem", type: "uint256" }, + { internalType: "uint256", name: "totalGlpAmount", type: "uint256" }, + ], + name: "InvalidGlpAmount", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "initialLongToken", type: "address" }], + name: "InvalidGlvDepositInitialLongToken", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "initialShortToken", type: "address" }], + name: "InvalidGlvDepositInitialShortToken", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "longTokenSwapPathLength", type: "uint256" }, + { internalType: "uint256", name: "shortTokenSwapPathLength", type: "uint256" }, + ], + name: "InvalidGlvDepositSwapPath", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minPrice", type: "uint256" }, + { internalType: "uint256", name: "maxPrice", type: "uint256" }, + ], + name: "InvalidGmMedianMinMaxPrice", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "InvalidGmOraclePrice", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "recoveredSigner", type: "address" }, + { internalType: "address", name: "expectedSigner", type: "address" }, + ], + name: "InvalidGmSignature", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minPrice", type: "uint256" }, + { internalType: "uint256", name: "maxPrice", type: "uint256" }, + ], + name: "InvalidGmSignerMinMaxPrice", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "InvalidHoldingAddress", + type: "error", + }, + { inputs: [], name: "InvalidInitializer", type: "error" }, + { + inputs: [{ internalType: "address", name: "keeper", type: "address" }], + name: "InvalidKeeperForFrozenOrder", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "expectedMinBalance", type: "uint256" }, + ], + name: "InvalidMarketTokenBalance", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "claimableFundingFeeAmount", type: "uint256" }, + ], + name: "InvalidMarketTokenBalanceForClaimableFunding", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + ], + name: "InvalidMarketTokenBalanceForCollateralAmount", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minGlvTokens", type: "uint256" }, + { internalType: "uint256", name: "expectedMinGlvTokens", type: "uint256" }, + ], + name: "InvalidMinGlvTokensForFirstGlvDeposit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "expectedMinMarketTokens", type: "uint256" }, + ], + name: "InvalidMinMarketTokensForFirstDeposit", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + name: "InvalidMinMaxForPrice", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "endpoint", type: "address" }], + name: "InvalidMultichainEndpoint", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "provider", type: "address" }], + name: "InvalidMultichainProvider", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "msgSender", type: "address" }], + name: "InvalidNativeTokenSender", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "provider", type: "address" }], + name: "InvalidOracleProvider", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "provider", type: "address" }, + { internalType: "address", name: "expectedProvider", type: "address" }, + ], + name: "InvalidOracleProviderForToken", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "dataLength", type: "uint256" }, + ], + name: "InvalidOracleSetPricesDataParam", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "providersLength", type: "uint256" }, + ], + name: "InvalidOracleSetPricesProvidersParam", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "signer", type: "address" }], + name: "InvalidOracleSigner", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "primaryPriceMin", type: "uint256" }, + { internalType: "uint256", name: "primaryPriceMax", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "orderType", type: "uint256" }, + ], + name: "InvalidOrderPrices", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "tokenOut", type: "address" }, + { internalType: "address", name: "expectedTokenOut", type: "address" }, + ], + name: "InvalidOutputToken", + type: "error", + }, + { inputs: [{ internalType: "string", name: "reason", type: "string" }], name: "InvalidParams", type: "error" }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "int256", name: "poolValue", type: "int256" }], + name: "InvalidPoolValueForDeposit", + type: "error", + }, + { + inputs: [{ internalType: "int256", name: "poolValue", type: "int256" }], + name: "InvalidPoolValueForWithdrawal", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "distributionAmount", type: "uint256" }, + { internalType: "uint256", name: "positionImpactPoolAmount", type: "uint256" }, + ], + name: "InvalidPositionImpactPoolDistributionRate", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "market", type: "address" }], + name: "InvalidPositionMarket", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "sizeInTokens", type: "uint256" }, + ], + name: "InvalidPositionSizeValues", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "primaryTokensLength", type: "uint256" }, + { internalType: "uint256", name: "primaryPricesLength", type: "uint256" }, + ], + name: "InvalidPrimaryPricesForSimulation", + type: "error", + }, + { inputs: [{ internalType: "address", name: "receiver", type: "address" }], name: "InvalidReceiver", type: "error" }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "expectedReceiver", type: "address" }, + ], + name: "InvalidReceiverForFirstDeposit", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "expectedReceiver", type: "address" }, + ], + name: "InvalidReceiverForFirstGlvDeposit", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "expectedReceiver", type: "address" }, + ], + name: "InvalidReceiverForSubaccountOrder", + type: "error", + }, + { + inputs: [ + { internalType: "string", name: "signatureType", type: "string" }, + { internalType: "address", name: "recovered", type: "address" }, + { internalType: "address", name: "recoveredFromMinified", type: "address" }, + { internalType: "address", name: "expectedSigner", type: "address" }, + ], + name: "InvalidRecoveredSigner", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "amountsLength", type: "uint256" }, + ], + name: "InvalidSetContributorPaymentInput", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "amountsLength", type: "uint256" }, + ], + name: "InvalidSetMaxTotalContributorTokenAmountInput", + type: "error", + }, + { + inputs: [{ internalType: "string", name: "signatureType", type: "string" }], + name: "InvalidSignature", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "positionSizeInUsd", type: "uint256" }, + ], + name: "InvalidSizeDeltaForAdl", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidSubaccountApprovalDesChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "storedNonce", type: "uint256" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + ], + name: "InvalidSubaccountApprovalNonce", + type: "error", + }, + { inputs: [], name: "InvalidSubaccountApprovalSubaccount", type: "error" }, + { inputs: [{ internalType: "address", name: "market", type: "address" }], name: "InvalidSwapMarket", type: "error" }, + { + inputs: [ + { internalType: "address", name: "outputToken", type: "address" }, + { internalType: "address", name: "expectedOutputToken", type: "address" }, + ], + name: "InvalidSwapOutputToken", + type: "error", + }, + { + inputs: [ + { internalType: "address[]", name: "path", type: "address[]" }, + { internalType: "address", name: "bridgingToken", type: "address" }, + ], + name: "InvalidSwapPathForV1", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "timelockDelay", type: "uint256" }], + name: "InvalidTimelockDelay", + type: "error", + }, + { inputs: [{ internalType: "address", name: "token", type: "address" }], name: "InvalidToken", type: "error" }, + { + inputs: [ + { internalType: "address", name: "tokenIn", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "InvalidTokenIn", + type: "error", + }, + { inputs: [], name: "InvalidTransferRequestsLength", type: "error" }, + { inputs: [], name: "InvalidTrustedSignerAddress", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "uiFeeFactor", type: "uint256" }, + { internalType: "uint256", name: "maxUiFeeFactor", type: "uint256" }, + ], + name: "InvalidUiFeeFactor", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { inputs: [{ internalType: "uint256", name: "version", type: "uint256" }], name: "InvalidVersion", type: "error" }, + { + inputs: [ + { internalType: "string", name: "reason", type: "string" }, + { internalType: "int256", name: "remainingCollateralUsd", type: "int256" }, + { internalType: "int256", name: "minCollateralUsd", type: "int256" }, + { internalType: "int256", name: "minCollateralUsdForLeverage", type: "int256" }, + ], + name: "LiquidatablePosition", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "fromMarketLongToken", type: "address" }, + { internalType: "address", name: "toMarketLongToken", type: "address" }, + ], + name: "LongTokensAreNotEqual", + type: "error", + }, + { + inputs: [ + { internalType: "bytes32", name: "salt", type: "bytes32" }, + { internalType: "address", name: "existingMarketAddress", type: "address" }, + ], + name: "MarketAlreadyExists", + type: "error", + }, + { inputs: [{ internalType: "address", name: "key", type: "address" }], name: "MarketNotFound", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "index", type: "uint256" }, + { internalType: "string", name: "label", type: "string" }, + ], + name: "MaskIndexOutOfBounds", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "count", type: "uint256" }, + { internalType: "uint256", name: "maxAutoCancelOrders", type: "uint256" }, + ], + name: "MaxAutoCancelOrdersExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "priceTimestamp", type: "uint256" }, + { internalType: "uint256", name: "buybackMaxPriceAge", type: "uint256" }, + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + ], + name: "MaxBuybackPriceAgeExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "maxCallbackGasLimit", type: "uint256" }, + ], + name: "MaxCallbackGasLimitExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "dataLength", type: "uint256" }, + { internalType: "uint256", name: "maxDataLength", type: "uint256" }, + ], + name: "MaxDataListLengthExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "maxFundingFactorPerSecond", type: "uint256" }, + { internalType: "uint256", name: "limit", type: "uint256" }, + ], + name: "MaxFundingFactorPerSecondLimitExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "poolUsd", type: "uint256" }, + { internalType: "uint256", name: "maxLendableUsd", type: "uint256" }, + { internalType: "uint256", name: "lentUsd", type: "uint256" }, + ], + name: "MaxLendableFactorForWithdrawalsExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "openInterest", type: "uint256" }, + { internalType: "uint256", name: "maxOpenInterest", type: "uint256" }, + ], + name: "MaxOpenInterestExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "range", type: "uint256" }, + { internalType: "uint256", name: "maxRange", type: "uint256" }, + ], + name: "MaxOracleTimestampRangeExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "poolAmount", type: "uint256" }, + { internalType: "uint256", name: "maxPoolAmount", type: "uint256" }, + ], + name: "MaxPoolAmountExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "poolUsd", type: "uint256" }, + { internalType: "uint256", name: "maxPoolUsdForDeposit", type: "uint256" }, + ], + name: "MaxPoolUsdForDepositExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "oracleTimestamp", type: "uint256" }, + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + ], + name: "MaxPriceAgeExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "price", type: "uint256" }, + { internalType: "uint256", name: "refPrice", type: "uint256" }, + { internalType: "uint256", name: "maxRefPriceDeviationFactor", type: "uint256" }, + ], + name: "MaxRefPriceDeviationExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "uint256", name: "count", type: "uint256" }, + { internalType: "uint256", name: "maxCount", type: "uint256" }, + ], + name: "MaxSubaccountActionCountExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "swapPathLengh", type: "uint256" }, + { internalType: "uint256", name: "maxSwapPathLength", type: "uint256" }, + ], + name: "MaxSwapPathLengthExceeded", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "timelockDelay", type: "uint256" }], + name: "MaxTimelockDelayExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "totalCallbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "maxTotalCallbackGasLimit", type: "uint256" }, + ], + name: "MaxTotalCallbackGasLimitForAutoCancelOrdersExceeded", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "totalAmount", type: "uint256" }, + { internalType: "uint256", name: "maxTotalAmount", type: "uint256" }, + ], + name: "MaxTotalContributorTokenAmountExceeded", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "interval", type: "uint256" }], + name: "MinContributorPaymentIntervalBelowAllowedRange", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "minPaymentInterval", type: "uint256" }], + name: "MinContributorPaymentIntervalNotYetPassed", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "received", type: "uint256" }, + { internalType: "uint256", name: "expected", type: "uint256" }, + ], + name: "MinGlvTokens", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "received", type: "uint256" }, + { internalType: "uint256", name: "expected", type: "uint256" }, + ], + name: "MinLongTokens", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "received", type: "uint256" }, + { internalType: "uint256", name: "expected", type: "uint256" }, + ], + name: "MinMarketTokens", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "positionSizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "minPositionSizeUsd", type: "uint256" }, + ], + name: "MinPositionSize", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "received", type: "uint256" }, + { internalType: "uint256", name: "expected", type: "uint256" }, + ], + name: "MinShortTokens", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "executionPrice", type: "int256" }, + { internalType: "uint256", name: "price", type: "uint256" }, + { internalType: "uint256", name: "positionSizeInUsd", type: "uint256" }, + { internalType: "int256", name: "priceImpactUsd", type: "int256" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + ], + name: "NegativeExecutionPrice", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "provider", type: "address" }], + name: "NonAtomicOracleProvider", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { + inputs: [{ internalType: "uint256", name: "tokensWithPricesLength", type: "uint256" }], + name: "NonEmptyTokensWithPrices", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "market", type: "address" }], + name: "OpenInterestCannotBeUpdatedForSwapOnlyMarket", + type: "error", + }, + { inputs: [], name: "OraclePriceOutdated", type: "error" }, + { + inputs: [ + { internalType: "address", name: "oracle", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "OracleProviderAlreadyExistsForToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "provider", type: "address" }, + ], + name: "OracleProviderMinChangeDelayNotYetPassed", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "maxOracleTimestamp", type: "uint256" }, + { internalType: "uint256", name: "requestTimestamp", type: "uint256" }, + { internalType: "uint256", name: "requestExpirationTime", type: "uint256" }, + ], + name: "OracleTimestampsAreLargerThanRequestExpirationTime", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "minOracleTimestamp", type: "uint256" }, + { internalType: "uint256", name: "expectedTimestamp", type: "uint256" }, + ], + name: "OracleTimestampsAreSmallerThanRequired", + type: "error", + }, + { inputs: [], name: "OrderAlreadyFrozen", type: "error" }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "OrderNotFound", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "price", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + ], + name: "OrderNotFulfillableAtAcceptablePrice", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "orderType", type: "uint256" }], + name: "OrderNotUpdatable", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "orderType", type: "uint256" }], + name: "OrderTypeCannotBeCreated", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + ], + name: "OrderValidFromTimeNotReached", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "pnlToPoolFactor", type: "int256" }, + { internalType: "uint256", name: "maxPnlFactor", type: "uint256" }, + ], + name: "PnlFactorExceededForLongs", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "pnlToPoolFactor", type: "int256" }, + { internalType: "uint256", name: "maxPnlFactor", type: "uint256" }, + ], + name: "PnlFactorExceededForShorts", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "nextPnlToPoolFactor", type: "int256" }, + { internalType: "uint256", name: "minPnlFactorForAdl", type: "uint256" }, + ], + name: "PnlOvercorrected", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "PositionNotFound", type: "error" }, + { + inputs: [ + { internalType: "string", name: "reason", type: "string" }, + { internalType: "int256", name: "remainingCollateralUsd", type: "int256" }, + { internalType: "int256", name: "minCollateralUsd", type: "int256" }, + { internalType: "int256", name: "minCollateralUsdForLeverage", type: "int256" }, + ], + name: "PositionShouldNotBeLiquidated", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "minPrice", type: "uint256" }, + { internalType: "uint256", name: "maxPrice", type: "uint256" }, + ], + name: "PriceAlreadySet", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "PriceFeedAlreadyExistsForToken", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "priceImpactUsd", type: "int256" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + ], + name: "PriceImpactLargerThanOrderSize", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "lentAmount", type: "uint256" }, + { internalType: "uint256", name: "totalReductionAmount", type: "uint256" }, + ], + name: "ReductionExceedsLentAmount", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "calldataLength", type: "uint256" }], + name: "RelayCalldataTooLong", + type: "error", + }, + { inputs: [], name: "RelayEmptyBatch", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "requestAge", type: "uint256" }, + { internalType: "uint256", name: "requestExpirationAge", type: "uint256" }, + { internalType: "string", name: "requestType", type: "string" }, + ], + name: "RequestNotYetCancellable", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "receiver", type: "address" }], + name: "SelfTransferNotSupported", + type: "error", + }, + { inputs: [], name: "SequencerDown", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "timeSinceUp", type: "uint256" }, + { internalType: "uint256", name: "sequencerGraceDuration", type: "uint256" }, + ], + name: "SequencerGraceDurationNotYetPassed", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "market", type: "address" }], + name: "ShiftFromAndToMarketAreEqual", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "ShiftNotFound", type: "error" }, + { + inputs: [ + { internalType: "address", name: "fromMarketLongToken", type: "address" }, + { internalType: "address", name: "toMarketLongToken", type: "address" }, + ], + name: "ShortTokensAreNotEqual", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "signalTime", type: "uint256" }], + name: "SignalTimeNotYetPassed", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "SubaccountApprovalDeadlinePassed", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + ], + name: "SubaccountApprovalExpired", + type: "error", + }, + { + inputs: [{ internalType: "bytes32", name: "integrationId", type: "bytes32" }], + name: "SubaccountIntegrationIdDisabled", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + ], + name: "SubaccountNotAuthorized", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "amountAfterFees", type: "uint256" }, + { internalType: "int256", name: "negativeImpactAmount", type: "int256" }, + ], + name: "SwapPriceImpactExceedsAmountIn", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "longTokenSwapPathLength", type: "uint256" }, + { internalType: "uint256", name: "shortTokenSwapPathLength", type: "uint256" }, + ], + name: "SwapsNotAllowedForAtomicWithdrawal", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "parametersLength", type: "uint256" }, + ], + name: "SyncConfigInvalidInputLengths", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "marketFromData", type: "address" }, + ], + name: "SyncConfigInvalidMarketFromData", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "market", type: "address" }], + name: "SyncConfigUpdatesDisabledForMarket", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "string", name: "parameter", type: "string" }, + ], + name: "SyncConfigUpdatesDisabledForMarketParameter", + type: "error", + }, + { + inputs: [{ internalType: "string", name: "parameter", type: "string" }], + name: "SyncConfigUpdatesDisabledForParameter", + type: "error", + }, + { inputs: [], name: "ThereMustBeAtLeastOneRoleAdmin", type: "error" }, + { inputs: [], name: "ThereMustBeAtLeastOneTimelockMultiSig", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "length", type: "uint256" }], + name: "Uint256AsBytesLengthExceeds32Bytes", + type: "error", + }, + { inputs: [], name: "UnableToGetBorrowingFactorEmptyPoolUsd", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "UnableToGetCachedTokenPrice", + type: "error", + }, + { inputs: [], name: "UnableToGetFundingFactorEmptyOpenInterest", type: "error" }, + { + inputs: [ + { internalType: "address", name: "inputToken", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "UnableToGetOppositeToken", + type: "error", + }, + { inputs: [], name: "UnableToPayOrderFee", type: "error" }, + { inputs: [], name: "UnableToPayOrderFeeFromCollateral", type: "error" }, + { + inputs: [{ internalType: "int256", name: "estimatedRemainingCollateralUsd", type: "int256" }], + name: "UnableToWithdrawCollateral", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "positionBorrowingFactor", type: "uint256" }, + { internalType: "uint256", name: "cumulativeBorrowingFactor", type: "uint256" }, + ], + name: "UnexpectedBorrowingFactor", + type: "error", + }, + { inputs: [], name: "UnexpectedMarket", type: "error" }, + { + inputs: [{ internalType: "int256", name: "poolValue", type: "int256" }], + name: "UnexpectedPoolValue", + type: "error", + }, + { inputs: [], name: "UnexpectedPositionState", type: "error" }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeTokenAfterSwap", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "UnexpectedTokenForVirtualInventory", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "orderType", type: "uint256" }], + name: "UnexpectedValidFromTime", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "orderType", type: "uint256" }], + name: "UnsupportedOrderType", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "orderType", type: "uint256" }], + name: "UnsupportedOrderTypeForAutoCancellation", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "usdDelta", type: "int256" }, + { internalType: "uint256", name: "longOpenInterest", type: "uint256" }, + ], + name: "UsdDeltaExceedsLongOpenInterest", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "usdDelta", type: "int256" }, + { internalType: "uint256", name: "poolUsd", type: "uint256" }, + ], + name: "UsdDeltaExceedsPoolValue", + type: "error", + }, + { + inputs: [ + { internalType: "int256", name: "usdDelta", type: "int256" }, + { internalType: "uint256", name: "shortOpenInterest", type: "uint256" }, + ], + name: "UsdDeltaExceedsShortOpenInterest", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "WithdrawalNotFound", type: "error" }, +] as const; diff --git a/sdk/src/abis/DataStore.json b/sdk/src/abis/DataStore.json deleted file mode 100644 index af4759dd50..0000000000 --- a/sdk/src/abis/DataStore.json +++ /dev/null @@ -1,1459 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "addAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "addBytes32", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "addUint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "addressArrayValues", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "addressValues", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "applyBoundedDeltaToUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "applyDeltaToInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - }, - { - "internalType": "string", - "name": "errorMessage", - "type": "string" - } - ], - "name": "applyDeltaToUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "applyDeltaToUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "boolArrayValues", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "boolValues", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "bytes32ArrayValues", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "bytes32Values", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "containsAddress", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "containsBytes32", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "containsUint", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "decrementInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "decrementUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getAddressArray", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - } - ], - "name": "getAddressCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAddressValuesAt", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getBool", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getBoolArray", - "outputs": [ - { - "internalType": "bool[]", - "name": "", - "type": "bool[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getBytes32Array", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - } - ], - "name": "getBytes32Count", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getBytes32ValuesAt", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getIntArray", - "outputs": [ - { - "internalType": "int256[]", - "name": "", - "type": "int256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getString", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getStringArray", - "outputs": [ - { - "internalType": "string[]", - "name": "", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getUintArray", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - } - ], - "name": "getUintCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getUintValuesAt", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "incrementInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "incrementUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "intArrayValues", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "intValues", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "removeAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeAddressArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeBool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeBoolArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "removeBytes32", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeBytes32", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeBytes32Array", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeInt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeIntArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeString", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeStringArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeUint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "setKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "removeUint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "removeUintArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "setAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "name": "setAddressArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "name": "setBool", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "name": "setBoolArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "setBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "name": "setBytes32Array", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "setInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "name": "setIntArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "name": "setString", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "name": "setStringArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "setUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "name": "setUintArray", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "stringArrayValues", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "stringValues", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uintArrayValues", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "uintValues", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/DataStore.ts b/sdk/src/abis/DataStore.ts new file mode 100644 index 0000000000..606d07fb6b --- /dev/null +++ b/sdk/src/abis/DataStore.ts @@ -0,0 +1,637 @@ +export default [ + { + inputs: [{ internalType: "contract RoleStore", name: "_roleStore", type: "address" }], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "address", name: "value", type: "address" }, + ], + name: "addAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + name: "addBytes32", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "addUint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "addressArrayValues", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "addressValues", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + name: "applyBoundedDeltaToUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + name: "applyDeltaToInt", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256", name: "value", type: "int256" }, + { internalType: "string", name: "errorMessage", type: "string" }, + ], + name: "applyDeltaToUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "applyDeltaToUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "boolArrayValues", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "boolValues", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "bytes32ArrayValues", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "bytes32Values", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "address", name: "value", type: "address" }, + ], + name: "containsAddress", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + name: "containsBytes32", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "containsUint", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + name: "decrementInt", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "decrementUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getAddress", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getAddressArray", + outputs: [{ internalType: "address[]", name: "", type: "address[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "setKey", type: "bytes32" }], + name: "getAddressCount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getAddressValuesAt", + outputs: [{ internalType: "address[]", name: "", type: "address[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getBool", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getBoolArray", + outputs: [{ internalType: "bool[]", name: "", type: "bool[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getBytes32", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getBytes32Array", + outputs: [{ internalType: "bytes32[]", name: "", type: "bytes32[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "setKey", type: "bytes32" }], + name: "getBytes32Count", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getBytes32ValuesAt", + outputs: [{ internalType: "bytes32[]", name: "", type: "bytes32[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getInt", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getIntArray", + outputs: [{ internalType: "int256[]", name: "", type: "int256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getString", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getStringArray", + outputs: [{ internalType: "string[]", name: "", type: "string[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "getUintArray", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "setKey", type: "bytes32" }], + name: "getUintCount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getUintValuesAt", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + name: "incrementInt", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "incrementUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "intArrayValues", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "intValues", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "address", name: "value", type: "address" }, + ], + name: "removeAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeAddressArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeBool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeBoolArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + name: "removeBytes32", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeBytes32", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeBytes32Array", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeInt", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeIntArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeString", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeStringArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeUint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "setKey", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "removeUint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "removeUintArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "address", name: "value", type: "address" }, + ], + name: "setAddress", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + name: "setAddressArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + name: "setBool", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + name: "setBoolArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + name: "setBytes32", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + name: "setBytes32Array", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + name: "setInt", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + name: "setIntArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "string", name: "value", type: "string" }, + ], + name: "setString", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + name: "setStringArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "setUint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + name: "setUintArray", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "stringArrayValues", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "stringValues", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "uintArrayValues", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "uintValues", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/ERC20PermitInterface.json b/sdk/src/abis/ERC20PermitInterface.json deleted file mode 100644 index d7396d024f..0000000000 --- a/sdk/src/abis/ERC20PermitInterface.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "abi": [ - { - "inputs": [], - "name": "PERMIT_TYPEHASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/ERC20PermitInterface.ts b/sdk/src/abis/ERC20PermitInterface.ts new file mode 100644 index 0000000000..66212bf5ee --- /dev/null +++ b/sdk/src/abis/ERC20PermitInterface.ts @@ -0,0 +1,52 @@ +export default [ + { + inputs: [], + name: "PERMIT_TYPEHASH", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "nonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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" }, + ], + name: "permit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "version", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/ERC721.json b/sdk/src/abis/ERC721.json deleted file mode 100644 index 77a715e376..0000000000 --- a/sdk/src/abis/ERC721.json +++ /dev/null @@ -1,442 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "ERC721", - "sourceName": "contracts/libraries/token/ERC721/ERC721.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "baseURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/ERC721.ts b/sdk/src/abis/ERC721.ts new file mode 100644 index 0000000000..d2a2b3ab27 --- /dev/null +++ b/sdk/src/abis/ERC721.ts @@ -0,0 +1,194 @@ +export default [ + { + inputs: [ + { internalType: "string", name: "name", type: "string" }, + { internalType: "string", name: "symbol", type: "string" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "approved", type: "address" }, + { indexed: true, internalType: "uint256", name: "tokenId", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "operator", type: "address" }, + { indexed: false, internalType: "bool", name: "approved", type: "bool" }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: true, internalType: "uint256", name: "tokenId", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "tokenId", type: "uint256" }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "baseURI", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], + name: "getApproved", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "operator", type: "address" }, + ], + name: "isApprovedForAll", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "tokenId", type: "uint256" }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], + name: "ownerOf", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "tokenId", type: "uint256" }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "tokenId", type: "uint256" }, + { internalType: "bytes", name: "_data", type: "bytes" }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "operator", type: "address" }, + { internalType: "bool", name: "approved", type: "bool" }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "index", type: "uint256" }], + name: "tokenByIndex", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "uint256", name: "index", type: "uint256" }, + ], + name: "tokenOfOwnerByIndex", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], + name: "tokenURI", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "tokenId", type: "uint256" }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/EventEmitter.json b/sdk/src/abis/EventEmitter.json deleted file mode 100644 index db462aed3f..0000000000 --- a/sdk/src/abis/EventEmitter.json +++ /dev/null @@ -1,2060 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "eventName", - "type": "string" - }, - { - "indexed": true, - "internalType": "string", - "name": "eventNameHash", - "type": "string" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "internalType": "struct EventUtils.AddressKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "internalType": "struct EventUtils.AddressArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.AddressItems", - "name": "addressItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct EventUtils.UintKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "internalType": "struct EventUtils.UintArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.UintItems", - "name": "uintItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "internalType": "struct EventUtils.IntKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "internalType": "struct EventUtils.IntArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.IntItems", - "name": "intItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "internalType": "struct EventUtils.BoolKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "internalType": "struct EventUtils.BoolArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BoolItems", - "name": "boolItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "internalType": "struct EventUtils.Bytes32KeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.Bytes32Items", - "name": "bytes32Items", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "internalType": "struct EventUtils.BytesKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "internalType": "struct EventUtils.BytesArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BytesItems", - "name": "bytesItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "internalType": "struct EventUtils.StringKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "internalType": "struct EventUtils.StringArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.StringItems", - "name": "stringItems", - "type": "tuple" - } - ], - "indexed": false, - "internalType": "struct EventUtils.EventLogData", - "name": "eventData", - "type": "tuple" - } - ], - "name": "EventLog", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "eventName", - "type": "string" - }, - { - "indexed": true, - "internalType": "string", - "name": "eventNameHash", - "type": "string" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "internalType": "struct EventUtils.AddressKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "internalType": "struct EventUtils.AddressArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.AddressItems", - "name": "addressItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct EventUtils.UintKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "internalType": "struct EventUtils.UintArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.UintItems", - "name": "uintItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "internalType": "struct EventUtils.IntKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "internalType": "struct EventUtils.IntArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.IntItems", - "name": "intItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "internalType": "struct EventUtils.BoolKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "internalType": "struct EventUtils.BoolArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BoolItems", - "name": "boolItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "internalType": "struct EventUtils.Bytes32KeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.Bytes32Items", - "name": "bytes32Items", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "internalType": "struct EventUtils.BytesKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "internalType": "struct EventUtils.BytesArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BytesItems", - "name": "bytesItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "internalType": "struct EventUtils.StringKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "internalType": "struct EventUtils.StringArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.StringItems", - "name": "stringItems", - "type": "tuple" - } - ], - "indexed": false, - "internalType": "struct EventUtils.EventLogData", - "name": "eventData", - "type": "tuple" - } - ], - "name": "EventLog1", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "eventName", - "type": "string" - }, - { - "indexed": true, - "internalType": "string", - "name": "eventNameHash", - "type": "string" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "topic2", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "internalType": "struct EventUtils.AddressKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "internalType": "struct EventUtils.AddressArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.AddressItems", - "name": "addressItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct EventUtils.UintKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "internalType": "struct EventUtils.UintArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.UintItems", - "name": "uintItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "internalType": "struct EventUtils.IntKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "internalType": "struct EventUtils.IntArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.IntItems", - "name": "intItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "internalType": "struct EventUtils.BoolKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "internalType": "struct EventUtils.BoolArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BoolItems", - "name": "boolItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "internalType": "struct EventUtils.Bytes32KeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.Bytes32Items", - "name": "bytes32Items", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "internalType": "struct EventUtils.BytesKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "internalType": "struct EventUtils.BytesArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BytesItems", - "name": "bytesItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "internalType": "struct EventUtils.StringKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "internalType": "struct EventUtils.StringArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.StringItems", - "name": "stringItems", - "type": "tuple" - } - ], - "indexed": false, - "internalType": "struct EventUtils.EventLogData", - "name": "eventData", - "type": "tuple" - } - ], - "name": "EventLog2", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "emitDataLog1", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic2", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "emitDataLog2", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic2", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic3", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "emitDataLog3", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic2", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic3", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic4", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "emitDataLog4", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "eventName", - "type": "string" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "internalType": "struct EventUtils.AddressKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "internalType": "struct EventUtils.AddressArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.AddressItems", - "name": "addressItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct EventUtils.UintKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "internalType": "struct EventUtils.UintArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.UintItems", - "name": "uintItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "internalType": "struct EventUtils.IntKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "internalType": "struct EventUtils.IntArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.IntItems", - "name": "intItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "internalType": "struct EventUtils.BoolKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "internalType": "struct EventUtils.BoolArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BoolItems", - "name": "boolItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "internalType": "struct EventUtils.Bytes32KeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.Bytes32Items", - "name": "bytes32Items", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "internalType": "struct EventUtils.BytesKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "internalType": "struct EventUtils.BytesArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BytesItems", - "name": "bytesItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "internalType": "struct EventUtils.StringKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "internalType": "struct EventUtils.StringArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.StringItems", - "name": "stringItems", - "type": "tuple" - } - ], - "internalType": "struct EventUtils.EventLogData", - "name": "eventData", - "type": "tuple" - } - ], - "name": "emitEventLog", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "eventName", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "internalType": "struct EventUtils.AddressKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "internalType": "struct EventUtils.AddressArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.AddressItems", - "name": "addressItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct EventUtils.UintKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "internalType": "struct EventUtils.UintArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.UintItems", - "name": "uintItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "internalType": "struct EventUtils.IntKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "internalType": "struct EventUtils.IntArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.IntItems", - "name": "intItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "internalType": "struct EventUtils.BoolKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "internalType": "struct EventUtils.BoolArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BoolItems", - "name": "boolItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "internalType": "struct EventUtils.Bytes32KeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.Bytes32Items", - "name": "bytes32Items", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "internalType": "struct EventUtils.BytesKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "internalType": "struct EventUtils.BytesArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BytesItems", - "name": "bytesItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "internalType": "struct EventUtils.StringKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "internalType": "struct EventUtils.StringArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.StringItems", - "name": "stringItems", - "type": "tuple" - } - ], - "internalType": "struct EventUtils.EventLogData", - "name": "eventData", - "type": "tuple" - } - ], - "name": "emitEventLog1", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "eventName", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "topic1", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "topic2", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "internalType": "struct EventUtils.AddressKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "internalType": "struct EventUtils.AddressArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.AddressItems", - "name": "addressItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct EventUtils.UintKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "internalType": "struct EventUtils.UintArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.UintItems", - "name": "uintItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "internalType": "struct EventUtils.IntKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "internalType": "struct EventUtils.IntArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.IntItems", - "name": "intItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "internalType": "struct EventUtils.BoolKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "internalType": "struct EventUtils.BoolArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BoolItems", - "name": "boolItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "internalType": "struct EventUtils.Bytes32KeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.Bytes32Items", - "name": "bytes32Items", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "internalType": "struct EventUtils.BytesKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "internalType": "struct EventUtils.BytesArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.BytesItems", - "name": "bytesItems", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "internalType": "struct EventUtils.StringKeyValue[]", - "name": "items", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "internalType": "struct EventUtils.StringArrayKeyValue[]", - "name": "arrayItems", - "type": "tuple[]" - } - ], - "internalType": "struct EventUtils.StringItems", - "name": "stringItems", - "type": "tuple" - } - ], - "internalType": "struct EventUtils.EventLogData", - "name": "eventData", - "type": "tuple" - } - ], - "name": "emitEventLog2", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/EventEmitter.ts b/sdk/src/abis/EventEmitter.ts new file mode 100644 index 0000000000..0fc380002d --- /dev/null +++ b/sdk/src/abis/EventEmitter.ts @@ -0,0 +1,1226 @@ +export default [ + { + inputs: [{ internalType: "contract RoleStore", name: "_roleStore", type: "address" }], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "msgSender", type: "address" }, + { indexed: false, internalType: "string", name: "eventName", type: "string" }, + { indexed: true, internalType: "string", name: "eventNameHash", type: "string" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address", name: "value", type: "address" }, + ], + internalType: "struct EventUtils.AddressKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + internalType: "struct EventUtils.AddressArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.AddressItems", + name: "addressItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + internalType: "struct EventUtils.UintKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + internalType: "struct EventUtils.UintArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.UintItems", + name: "uintItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + internalType: "struct EventUtils.IntKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + internalType: "struct EventUtils.IntArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.IntItems", + name: "intItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + internalType: "struct EventUtils.BoolKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + internalType: "struct EventUtils.BoolArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BoolItems", + name: "boolItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + internalType: "struct EventUtils.Bytes32KeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + internalType: "struct EventUtils.Bytes32ArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.Bytes32Items", + name: "bytes32Items", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes", name: "value", type: "bytes" }, + ], + internalType: "struct EventUtils.BytesKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes[]", name: "value", type: "bytes[]" }, + ], + internalType: "struct EventUtils.BytesArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BytesItems", + name: "bytesItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string", name: "value", type: "string" }, + ], + internalType: "struct EventUtils.StringKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + internalType: "struct EventUtils.StringArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.StringItems", + name: "stringItems", + type: "tuple", + }, + ], + indexed: false, + internalType: "struct EventUtils.EventLogData", + name: "eventData", + type: "tuple", + }, + ], + name: "EventLog", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "msgSender", type: "address" }, + { indexed: false, internalType: "string", name: "eventName", type: "string" }, + { indexed: true, internalType: "string", name: "eventNameHash", type: "string" }, + { indexed: true, internalType: "bytes32", name: "topic1", type: "bytes32" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address", name: "value", type: "address" }, + ], + internalType: "struct EventUtils.AddressKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + internalType: "struct EventUtils.AddressArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.AddressItems", + name: "addressItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + internalType: "struct EventUtils.UintKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + internalType: "struct EventUtils.UintArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.UintItems", + name: "uintItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + internalType: "struct EventUtils.IntKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + internalType: "struct EventUtils.IntArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.IntItems", + name: "intItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + internalType: "struct EventUtils.BoolKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + internalType: "struct EventUtils.BoolArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BoolItems", + name: "boolItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + internalType: "struct EventUtils.Bytes32KeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + internalType: "struct EventUtils.Bytes32ArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.Bytes32Items", + name: "bytes32Items", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes", name: "value", type: "bytes" }, + ], + internalType: "struct EventUtils.BytesKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes[]", name: "value", type: "bytes[]" }, + ], + internalType: "struct EventUtils.BytesArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BytesItems", + name: "bytesItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string", name: "value", type: "string" }, + ], + internalType: "struct EventUtils.StringKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + internalType: "struct EventUtils.StringArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.StringItems", + name: "stringItems", + type: "tuple", + }, + ], + indexed: false, + internalType: "struct EventUtils.EventLogData", + name: "eventData", + type: "tuple", + }, + ], + name: "EventLog1", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "msgSender", type: "address" }, + { indexed: false, internalType: "string", name: "eventName", type: "string" }, + { indexed: true, internalType: "string", name: "eventNameHash", type: "string" }, + { indexed: true, internalType: "bytes32", name: "topic1", type: "bytes32" }, + { indexed: true, internalType: "bytes32", name: "topic2", type: "bytes32" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address", name: "value", type: "address" }, + ], + internalType: "struct EventUtils.AddressKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + internalType: "struct EventUtils.AddressArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.AddressItems", + name: "addressItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + internalType: "struct EventUtils.UintKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + internalType: "struct EventUtils.UintArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.UintItems", + name: "uintItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + internalType: "struct EventUtils.IntKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + internalType: "struct EventUtils.IntArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.IntItems", + name: "intItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + internalType: "struct EventUtils.BoolKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + internalType: "struct EventUtils.BoolArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BoolItems", + name: "boolItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + internalType: "struct EventUtils.Bytes32KeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + internalType: "struct EventUtils.Bytes32ArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.Bytes32Items", + name: "bytes32Items", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes", name: "value", type: "bytes" }, + ], + internalType: "struct EventUtils.BytesKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes[]", name: "value", type: "bytes[]" }, + ], + internalType: "struct EventUtils.BytesArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BytesItems", + name: "bytesItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string", name: "value", type: "string" }, + ], + internalType: "struct EventUtils.StringKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + internalType: "struct EventUtils.StringArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.StringItems", + name: "stringItems", + type: "tuple", + }, + ], + indexed: false, + internalType: "struct EventUtils.EventLogData", + name: "eventData", + type: "tuple", + }, + ], + name: "EventLog2", + type: "event", + }, + { + inputs: [ + { internalType: "bytes32", name: "topic1", type: "bytes32" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "emitDataLog1", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "topic1", type: "bytes32" }, + { internalType: "bytes32", name: "topic2", type: "bytes32" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "emitDataLog2", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "topic1", type: "bytes32" }, + { internalType: "bytes32", name: "topic2", type: "bytes32" }, + { internalType: "bytes32", name: "topic3", type: "bytes32" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "emitDataLog3", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "topic1", type: "bytes32" }, + { internalType: "bytes32", name: "topic2", type: "bytes32" }, + { internalType: "bytes32", name: "topic3", type: "bytes32" }, + { internalType: "bytes32", name: "topic4", type: "bytes32" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "emitDataLog4", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "string", name: "eventName", type: "string" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address", name: "value", type: "address" }, + ], + internalType: "struct EventUtils.AddressKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + internalType: "struct EventUtils.AddressArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.AddressItems", + name: "addressItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + internalType: "struct EventUtils.UintKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + internalType: "struct EventUtils.UintArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.UintItems", + name: "uintItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + internalType: "struct EventUtils.IntKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + internalType: "struct EventUtils.IntArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.IntItems", + name: "intItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + internalType: "struct EventUtils.BoolKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + internalType: "struct EventUtils.BoolArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BoolItems", + name: "boolItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + internalType: "struct EventUtils.Bytes32KeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + internalType: "struct EventUtils.Bytes32ArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.Bytes32Items", + name: "bytes32Items", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes", name: "value", type: "bytes" }, + ], + internalType: "struct EventUtils.BytesKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes[]", name: "value", type: "bytes[]" }, + ], + internalType: "struct EventUtils.BytesArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BytesItems", + name: "bytesItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string", name: "value", type: "string" }, + ], + internalType: "struct EventUtils.StringKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + internalType: "struct EventUtils.StringArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.StringItems", + name: "stringItems", + type: "tuple", + }, + ], + internalType: "struct EventUtils.EventLogData", + name: "eventData", + type: "tuple", + }, + ], + name: "emitEventLog", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "string", name: "eventName", type: "string" }, + { internalType: "bytes32", name: "topic1", type: "bytes32" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address", name: "value", type: "address" }, + ], + internalType: "struct EventUtils.AddressKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + internalType: "struct EventUtils.AddressArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.AddressItems", + name: "addressItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + internalType: "struct EventUtils.UintKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + internalType: "struct EventUtils.UintArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.UintItems", + name: "uintItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + internalType: "struct EventUtils.IntKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + internalType: "struct EventUtils.IntArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.IntItems", + name: "intItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + internalType: "struct EventUtils.BoolKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + internalType: "struct EventUtils.BoolArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BoolItems", + name: "boolItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + internalType: "struct EventUtils.Bytes32KeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + internalType: "struct EventUtils.Bytes32ArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.Bytes32Items", + name: "bytes32Items", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes", name: "value", type: "bytes" }, + ], + internalType: "struct EventUtils.BytesKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes[]", name: "value", type: "bytes[]" }, + ], + internalType: "struct EventUtils.BytesArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BytesItems", + name: "bytesItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string", name: "value", type: "string" }, + ], + internalType: "struct EventUtils.StringKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + internalType: "struct EventUtils.StringArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.StringItems", + name: "stringItems", + type: "tuple", + }, + ], + internalType: "struct EventUtils.EventLogData", + name: "eventData", + type: "tuple", + }, + ], + name: "emitEventLog1", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "string", name: "eventName", type: "string" }, + { internalType: "bytes32", name: "topic1", type: "bytes32" }, + { internalType: "bytes32", name: "topic2", type: "bytes32" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address", name: "value", type: "address" }, + ], + internalType: "struct EventUtils.AddressKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "address[]", name: "value", type: "address[]" }, + ], + internalType: "struct EventUtils.AddressArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.AddressItems", + name: "addressItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + internalType: "struct EventUtils.UintKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "uint256[]", name: "value", type: "uint256[]" }, + ], + internalType: "struct EventUtils.UintArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.UintItems", + name: "uintItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256", name: "value", type: "int256" }, + ], + internalType: "struct EventUtils.IntKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "int256[]", name: "value", type: "int256[]" }, + ], + internalType: "struct EventUtils.IntArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.IntItems", + name: "intItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool", name: "value", type: "bool" }, + ], + internalType: "struct EventUtils.BoolKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bool[]", name: "value", type: "bool[]" }, + ], + internalType: "struct EventUtils.BoolArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BoolItems", + name: "boolItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32", name: "value", type: "bytes32" }, + ], + internalType: "struct EventUtils.Bytes32KeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes32[]", name: "value", type: "bytes32[]" }, + ], + internalType: "struct EventUtils.Bytes32ArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.Bytes32Items", + name: "bytes32Items", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes", name: "value", type: "bytes" }, + ], + internalType: "struct EventUtils.BytesKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "bytes[]", name: "value", type: "bytes[]" }, + ], + internalType: "struct EventUtils.BytesArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.BytesItems", + name: "bytesItems", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string", name: "value", type: "string" }, + ], + internalType: "struct EventUtils.StringKeyValue[]", + name: "items", + type: "tuple[]", + }, + { + components: [ + { internalType: "string", name: "key", type: "string" }, + { internalType: "string[]", name: "value", type: "string[]" }, + ], + internalType: "struct EventUtils.StringArrayKeyValue[]", + name: "arrayItems", + type: "tuple[]", + }, + ], + internalType: "struct EventUtils.StringItems", + name: "stringItems", + type: "tuple", + }, + ], + internalType: "struct EventUtils.EventLogData", + name: "eventData", + type: "tuple", + }, + ], + name: "emitEventLog2", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/ExchangeRouter.json b/sdk/src/abis/ExchangeRouter.json deleted file mode 100644 index c1f7703a6d..0000000000 --- a/sdk/src/abis/ExchangeRouter.json +++ /dev/null @@ -1,1706 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract Router", - "name": "_router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract IDepositHandler", - "name": "_depositHandler", - "type": "address" - }, - { - "internalType": "contract IWithdrawalHandler", - "name": "_withdrawalHandler", - "type": "address" - }, - { - "internalType": "contract IShiftHandler", - "name": "_shiftHandler", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "_orderHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "_externalHandler", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "adjustedClaimableAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "name": "CollateralAlreadyClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "DisabledMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyAddressInMarketTokenBalanceValidation", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyMarket", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeKeysLength", - "type": "uint256" - } - ], - "name": "InvalidClaimCollateralInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "InvalidClaimableFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedMinBalance", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableFundingFeeAmount", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalanceForClaimableFunding", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalanceForCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "uiFeeFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxUiFeeFactor", - "type": "uint256" - } - ], - "name": "InvalidUiFeeFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelShift", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimAffiliateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "timeKeys", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimCollateral", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimFundingFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimUiFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IDepositUtils.CreateDepositParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IDepositUtils.CreateDepositParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createDeposit", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createOrder", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct IShiftUtils.CreateShiftParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IShiftUtils.CreateShiftParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createShift", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IWithdrawalUtils.CreateWithdrawalParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createWithdrawal", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositHandler", - "outputs": [ - { - "internalType": "contract IDepositHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IWithdrawalUtils.CreateWithdrawalParams", - "name": "params", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - } - ], - "name": "executeAtomicWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "name": "makeExternalCalls", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - } - ], - "name": "setSavedCallbackContract", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "uiFeeFactor", - "type": "uint256" - } - ], - "name": "setUiFeeFactor", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "shiftHandler", - "outputs": [ - { - "internalType": "contract IShiftHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestShift", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - }, - { - "internalType": "enum ISwapPricingUtils.SwapPricingType", - "name": "swapPricingType", - "type": "uint8" - } - ], - "name": "simulateExecuteLatestWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteShift", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - }, - { - "internalType": "enum ISwapPricingUtils.SwapPricingType", - "name": "swapPricingType", - "type": "uint8" - } - ], - "name": "simulateExecuteWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - } - ], - "name": "updateOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalHandler", - "outputs": [ - { - "internalType": "contract IWithdrawalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/ExchangeRouter.ts b/sdk/src/abis/ExchangeRouter.ts new file mode 100644 index 0000000000..6afd49d03d --- /dev/null +++ b/sdk/src/abis/ExchangeRouter.ts @@ -0,0 +1,758 @@ +export default [ + { + inputs: [ + { internalType: "contract Router", name: "_router", type: "address" }, + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract IDepositHandler", name: "_depositHandler", type: "address" }, + { internalType: "contract IWithdrawalHandler", name: "_withdrawalHandler", type: "address" }, + { internalType: "contract IShiftHandler", name: "_shiftHandler", type: "address" }, + { internalType: "contract IOrderHandler", name: "_orderHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "_externalHandler", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "adjustedClaimableAmount", type: "uint256" }, + { internalType: "uint256", name: "claimedAmount", type: "uint256" }, + ], + name: "CollateralAlreadyClaimed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [{ internalType: "address", name: "market", type: "address" }], name: "DisabledMarket", type: "error" }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "EmptyAddressInMarketTokenBalanceValidation", + type: "error", + }, + { inputs: [], name: "EmptyDeposit", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyMarket", type: "error" }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "timeKeysLength", type: "uint256" }, + ], + name: "InvalidClaimCollateralInput", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "value", type: "uint256" }], + name: "InvalidClaimableFactor", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "expectedMinBalance", type: "uint256" }, + ], + name: "InvalidMarketTokenBalance", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "claimableFundingFeeAmount", type: "uint256" }, + ], + name: "InvalidMarketTokenBalanceForClaimableFunding", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + ], + name: "InvalidMarketTokenBalanceForCollateralAmount", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "uiFeeFactor", type: "uint256" }, + { internalType: "uint256", name: "maxUiFeeFactor", type: "uint256" }, + ], + name: "InvalidUiFeeFactor", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelDeposit", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelShift", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelWithdrawal", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimAffiliateRewards", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "uint256[]", name: "timeKeys", type: "uint256[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimCollateral", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimFundingFees", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimUiFees", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IDepositUtils.CreateDepositParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IDepositUtils.CreateDepositParams", + name: "params", + type: "tuple", + }, + ], + name: "createDeposit", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "fromMarket", type: "address" }, + { internalType: "address", name: "toMarket", type: "address" }, + ], + internalType: "struct IShiftUtils.CreateShiftParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IShiftUtils.CreateShiftParams", + name: "params", + type: "tuple", + }, + ], + name: "createShift", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParams", + name: "params", + type: "tuple", + }, + ], + name: "createWithdrawal", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "depositHandler", + outputs: [{ internalType: "contract IDepositHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParams", + name: "params", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + ], + name: "executeAtomicWithdrawal", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + name: "makeExternalCalls", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + ], + name: "setSavedCallbackContract", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "uiFeeFactor", type: "uint256" }], + name: "setUiFeeFactor", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "shiftHandler", + outputs: [{ internalType: "contract IShiftHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteDeposit", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteLatestDeposit", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteLatestOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteLatestShift", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + { internalType: "enum ISwapPricingUtils.SwapPricingType", name: "swapPricingType", type: "uint8" }, + ], + name: "simulateExecuteLatestWithdrawal", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteShift", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + { internalType: "enum ISwapPricingUtils.SwapPricingType", name: "swapPricingType", type: "uint8" }, + ], + name: "simulateExecuteWithdrawal", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "withdrawalHandler", + outputs: [{ internalType: "contract IWithdrawalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/GelatoRelayRouter.json b/sdk/src/abis/GelatoRelayRouter.json deleted file mode 100644 index 0aacebef81..0000000000 --- a/sdk/src/abis/GelatoRelayRouter.json +++ /dev/null @@ -1,1579 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract Router", - "name": "_router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "_oracle", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "_orderHandler", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "_orderVault", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "_swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "_externalHandler", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "RelayEmptyBatch", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", - "name": "createOrderParamsList", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams[]", - "name": "updateOrderParamsList", - "type": "tuple[]" - }, - { - "internalType": "bytes32[]", - "name": "cancelOrderKeys", - "type": "bytes32[]" - } - ], - "internalType": "struct IRelayUtils.BatchParams", - "name": "params", - "type": "tuple" - } - ], - "name": "batch", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createOrder", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "updateOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/GelatoRelayRouter.ts b/sdk/src/abis/GelatoRelayRouter.ts new file mode 100644 index 0000000000..6bddc590cf --- /dev/null +++ b/sdk/src/abis/GelatoRelayRouter.ts @@ -0,0 +1,627 @@ +export default [ + { + inputs: [ + { internalType: "contract Router", name: "_router", type: "address" }, + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "_oracle", type: "address" }, + { internalType: "contract IOrderHandler", name: "_orderHandler", type: "address" }, + { internalType: "contract OrderVault", name: "_orderVault", type: "address" }, + { internalType: "contract ISwapHandler", name: "_swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "_externalHandler", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "RelayEmptyBatch", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams[]", + name: "createOrderParamsList", + type: "tuple[]", + }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams[]", + name: "updateOrderParamsList", + type: "tuple[]", + }, + { internalType: "bytes32[]", name: "cancelOrderKeys", type: "bytes32[]" }, + ], + internalType: "struct IRelayUtils.BatchParams", + name: "params", + type: "tuple", + }, + ], + name: "batch", + outputs: [{ internalType: "bytes32[]", name: "", type: "bytes32[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "cancelOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/GlpManager.json b/sdk/src/abis/GlpManager.json deleted file mode 100644 index 487a2fc670..0000000000 --- a/sdk/src/abis/GlpManager.json +++ /dev/null @@ -1,592 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "GlpManager", - "sourceName": "contracts/core/GlpManager.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_usdg", - "type": "address" - }, - { - "internalType": "address", - "name": "_glp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_cooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "aumInUsdg", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "glpSupply", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "name": "AddLiquidity", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "glpAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "aumInUsdg", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "glpSupply", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - } - ], - "name": "RemoveLiquidity", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRICE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USDG_DECIMALS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minUsdg", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minGlp", - "type": "uint256" - } - ], - "name": "addLiquidity", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_fundingAccount", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minUsdg", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minGlp", - "type": "uint256" - } - ], - "name": "addLiquidityForAccount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "aumAddition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "aumDeduction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "cooldownDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "maximise", - "type": "bool" - } - ], - "name": "getAum", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "maximise", - "type": "bool" - } - ], - "name": "getAumInUsdg", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAums", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glp", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isHandler", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastAddedAt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_glpAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "removeLiquidity", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_glpAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "removeLiquidityForAccount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_aumAddition", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_aumDeduction", - "type": "uint256" - } - ], - "name": "setAumAdjustment", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_cooldownDuration", - "type": "uint256" - } - ], - "name": "setCooldownDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateMode", - "type": "bool" - } - ], - "name": "setInPrivateMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "usdg", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "vault", - "outputs": [ - { - "internalType": "contract IVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/GlpManager.ts b/sdk/src/abis/GlpManager.ts new file mode 100644 index 0000000000..0a27f37c44 --- /dev/null +++ b/sdk/src/abis/GlpManager.ts @@ -0,0 +1,244 @@ +export default [ + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_usdg", type: "address" }, + { internalType: "address", name: "_glp", type: "address" }, + { internalType: "uint256", name: "_cooldownDuration", type: "uint256" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "aumInUsdg", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "glpSupply", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "mintAmount", type: "uint256" }, + ], + name: "AddLiquidity", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "glpAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "aumInUsdg", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "glpSupply", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOut", type: "uint256" }, + ], + name: "RemoveLiquidity", + type: "event", + }, + { + inputs: [], + name: "MAX_COOLDOWN_DURATION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "USDG_DECIMALS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "uint256", name: "_minUsdg", type: "uint256" }, + { internalType: "uint256", name: "_minGlp", type: "uint256" }, + ], + name: "addLiquidity", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_fundingAccount", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "uint256", name: "_minUsdg", type: "uint256" }, + { internalType: "uint256", name: "_minGlp", type: "uint256" }, + ], + name: "addLiquidityForAccount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "aumAddition", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "aumDeduction", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "cooldownDuration", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "maximise", type: "bool" }], + name: "getAum", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "maximise", type: "bool" }], + name: "getAumInUsdg", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAums", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glp", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isHandler", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lastAddedAt", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "uint256", name: "_glpAmount", type: "uint256" }, + { internalType: "uint256", name: "_minOut", type: "uint256" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "removeLiquidity", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "uint256", name: "_glpAmount", type: "uint256" }, + { internalType: "uint256", name: "_minOut", type: "uint256" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "removeLiquidityForAccount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_aumAddition", type: "uint256" }, + { internalType: "uint256", name: "_aumDeduction", type: "uint256" }, + ], + name: "setAumAdjustment", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_cooldownDuration", type: "uint256" }], + name: "setCooldownDuration", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateMode", type: "bool" }], + name: "setInPrivateMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "usdg", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "vault", + outputs: [{ internalType: "contract IVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/GlvReader.json b/sdk/src/abis/GlvReader.json deleted file mode 100644 index 3bc53bb885..0000000000 --- a/sdk/src/abis/GlvReader.json +++ /dev/null @@ -1,1471 +0,0 @@ -{ - "abi": [ - { - "inputs": [], - "name": "EmptyMarketTokenSupply", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvNegativeMarketPoolValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountGlvDeposits", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvDeposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct GlvDeposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDeposit.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct GlvDeposit.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountGlvWithdrawals", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvWithdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "glvTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct GlvWithdrawal.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct GlvWithdrawal.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - } - ], - "name": "getGlv", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - } - ], - "name": "getGlvBySalt", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getGlvDeposit", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvDeposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct GlvDeposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDeposit.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct GlvDeposit.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvDeposits", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvDeposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct GlvDeposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDeposit.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct GlvDeposit.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - } - ], - "name": "getGlvInfo", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "glv", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "internalType": "struct GlvReader.GlvInfo", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvInfoList", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "glv", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "internalType": "struct GlvReader.GlvInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getGlvShift", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct GlvShift.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - } - ], - "internalType": "struct GlvShift.Numbers", - "name": "numbers", - "type": "tuple" - } - ], - "internalType": "struct GlvShift.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvShifts", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct GlvShift.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - } - ], - "internalType": "struct GlvShift.Numbers", - "name": "numbers", - "type": "tuple" - } - ], - "internalType": "struct GlvShift.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address[]", - "name": "marketAddresses", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "indexTokenPrices", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getGlvTokenPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address[]", - "name": "marketAddresses", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "indexTokenPrices", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getGlvValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getGlvWithdrawal", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvWithdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "glvTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct GlvWithdrawal.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct GlvWithdrawal.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvWithdrawals", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvWithdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "glvTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct GlvWithdrawal.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct GlvWithdrawal.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvs", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/GlvReader.ts b/sdk/src/abis/GlvReader.ts new file mode 100644 index 0000000000..fda6acfd62 --- /dev/null +++ b/sdk/src/abis/GlvReader.ts @@ -0,0 +1,641 @@ +export default [ + { inputs: [], name: "EmptyMarketTokenSupply", type: "error" }, + { + inputs: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "GlvNegativeMarketPoolValue", + type: "error", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getAccountGlvDeposits", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct GlvDeposit.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minGlvTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct GlvDeposit.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isMarketTokenDeposit", type: "bool" }, + ], + internalType: "struct GlvDeposit.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct GlvDeposit.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getAccountGlvWithdrawals", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct GlvWithdrawal.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "glvTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct GlvWithdrawal.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }], + internalType: "struct GlvWithdrawal.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct GlvWithdrawal.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "glv", type: "address" }, + ], + name: "getGlv", + outputs: [ + { + components: [ + { internalType: "address", name: "glvToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Glv.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "salt", type: "bytes32" }, + ], + name: "getGlvBySalt", + outputs: [ + { + components: [ + { internalType: "address", name: "glvToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Glv.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getGlvDeposit", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct GlvDeposit.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minGlvTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct GlvDeposit.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isMarketTokenDeposit", type: "bool" }, + ], + internalType: "struct GlvDeposit.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct GlvDeposit.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getGlvDeposits", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct GlvDeposit.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minGlvTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct GlvDeposit.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isMarketTokenDeposit", type: "bool" }, + ], + internalType: "struct GlvDeposit.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct GlvDeposit.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "glv", type: "address" }, + ], + name: "getGlvInfo", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glvToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Glv.Props", + name: "glv", + type: "tuple", + }, + { internalType: "address[]", name: "markets", type: "address[]" }, + ], + internalType: "struct GlvReader.GlvInfo", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getGlvInfoList", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glvToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Glv.Props", + name: "glv", + type: "tuple", + }, + { internalType: "address[]", name: "markets", type: "address[]" }, + ], + internalType: "struct GlvReader.GlvInfo[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getGlvShift", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "fromMarket", type: "address" }, + { internalType: "address", name: "toMarket", type: "address" }, + ], + internalType: "struct GlvShift.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + ], + internalType: "struct GlvShift.Numbers", + name: "numbers", + type: "tuple", + }, + ], + internalType: "struct GlvShift.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getGlvShifts", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "fromMarket", type: "address" }, + { internalType: "address", name: "toMarket", type: "address" }, + ], + internalType: "struct GlvShift.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + ], + internalType: "struct GlvShift.Numbers", + name: "numbers", + type: "tuple", + }, + ], + internalType: "struct GlvShift.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address[]", name: "marketAddresses", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "indexTokenPrices", + type: "tuple[]", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + { internalType: "address", name: "glv", type: "address" }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getGlvTokenPrice", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address[]", name: "marketAddresses", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "indexTokenPrices", + type: "tuple[]", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + { internalType: "address", name: "glv", type: "address" }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getGlvValue", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getGlvWithdrawal", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct GlvWithdrawal.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "glvTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct GlvWithdrawal.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }], + internalType: "struct GlvWithdrawal.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct GlvWithdrawal.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getGlvWithdrawals", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct GlvWithdrawal.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "glvTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct GlvWithdrawal.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }], + internalType: "struct GlvWithdrawal.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct GlvWithdrawal.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getGlvs", + outputs: [ + { + components: [ + { internalType: "address", name: "glvToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Glv.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/GlvRouter.json b/sdk/src/abis/GlvRouter.json deleted file mode 100644 index 18b56776b1..0000000000 --- a/sdk/src/abis/GlvRouter.json +++ /dev/null @@ -1,764 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract Router", - "name": "_router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract IGlvDepositHandler", - "name": "_glvDepositHandler", - "type": "address" - }, - { - "internalType": "contract IGlvWithdrawalHandler", - "name": "_glvWithdrawalHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "_externalHandler", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "EmptyGlvDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvWithdrawal", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "InvalidNativeTokenSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelGlvDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelGlvWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IGlvDepositUtils.CreateGlvDepositParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createGlvDeposit", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createGlvWithdrawal", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glvDepositHandler", - "outputs": [ - { - "internalType": "contract IGlvDepositHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glvWithdrawalHandler", - "outputs": [ - { - "internalType": "contract IGlvWithdrawalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "name": "makeExternalCalls", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteGlvDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteGlvWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestGlvDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestGlvWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} diff --git a/sdk/src/abis/GlvRouter.ts b/sdk/src/abis/GlvRouter.ts new file mode 100644 index 0000000000..d3712aed41 --- /dev/null +++ b/sdk/src/abis/GlvRouter.ts @@ -0,0 +1,351 @@ +export default [ + { + inputs: [ + { internalType: "contract Router", name: "_router", type: "address" }, + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract IGlvDepositHandler", name: "_glvDepositHandler", type: "address" }, + { internalType: "contract IGlvWithdrawalHandler", name: "_glvWithdrawalHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "_externalHandler", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { inputs: [], name: "EmptyGlvDeposit", type: "error" }, + { inputs: [], name: "EmptyGlvWithdrawal", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "msgSender", type: "address" }], + name: "InvalidNativeTokenSender", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelGlvDeposit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelGlvWithdrawal", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minGlvTokens", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isMarketTokenDeposit", type: "bool" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParams", + name: "params", + type: "tuple", + }, + ], + name: "createGlvDeposit", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", + name: "params", + type: "tuple", + }, + ], + name: "createGlvWithdrawal", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvDepositHandler", + outputs: [{ internalType: "contract IGlvDepositHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvWithdrawalHandler", + outputs: [{ internalType: "contract IGlvWithdrawalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + name: "makeExternalCalls", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteGlvDeposit", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteGlvWithdrawal", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteLatestGlvDeposit", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address[]", name: "primaryTokens", type: "address[]" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props[]", + name: "primaryPrices", + type: "tuple[]", + }, + { internalType: "uint256", name: "minTimestamp", type: "uint256" }, + { internalType: "uint256", name: "maxTimestamp", type: "uint256" }, + ], + internalType: "struct OracleUtils.SimulatePricesParams", + name: "simulatedOracleParams", + type: "tuple", + }, + ], + name: "simulateExecuteLatestGlvWithdrawal", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { stateMutability: "payable", type: "receive" }, +] as const; diff --git a/sdk/src/abis/GmxMigrator.json b/sdk/src/abis/GmxMigrator.json deleted file mode 100644 index 3db58dc1fc..0000000000 --- a/sdk/src/abis/GmxMigrator.json +++ /dev/null @@ -1,657 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "GmxMigrator", - "sourceName": "contracts/gmx/GmxMigrator.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "_minAuthorizations", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "ClearAction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignAction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignalApprove", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignalPendingAction", - "type": "event" - }, - { - "inputs": [], - "name": "actionsNonce", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "ammRouter", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "caps", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "endMigration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getIouToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getTokenAmounts", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getTokenPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmxPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_ammRouter", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_gmxPrice", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_signers", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_whitelistedTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_iouTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_prices", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "_caps", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "_lpTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_lpTokenAs", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_lpTokenBs", - "type": "address[]" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "iouTokens", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isMigrationActive", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isSigner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lpTokenAs", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lpTokenBs", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lpTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenAmount", - "type": "uint256" - } - ], - "name": "migrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "minAuthorizations", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "pendingActions", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "prices", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "signApprove", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "signalApprove", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "signedActions", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "signers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "whitelistedTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/GmxMigrator.ts b/sdk/src/abis/GmxMigrator.ts new file mode 100644 index 0000000000..b38d1df6f6 --- /dev/null +++ b/sdk/src/abis/GmxMigrator.ts @@ -0,0 +1,267 @@ +export default [ + { + inputs: [{ internalType: "uint256", name: "_minAuthorizations", type: "uint256" }], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" }, + ], + name: "ClearAction", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" }, + ], + name: "SignAction", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" }, + ], + name: "SignalApprove", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" }, + ], + name: "SignalPendingAction", + type: "event", + }, + { + inputs: [], + name: "actionsNonce", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "admin", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "ammRouter", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "uint256", name: "_nonce", type: "uint256" }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "caps", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "endMigration", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getIouToken", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_tokens", type: "address[]" }], + name: "getTokenAmounts", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getTokenPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gmxPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_ammRouter", type: "address" }, + { internalType: "uint256", name: "_gmxPrice", type: "uint256" }, + { internalType: "address[]", name: "_signers", type: "address[]" }, + { internalType: "address[]", name: "_whitelistedTokens", type: "address[]" }, + { internalType: "address[]", name: "_iouTokens", type: "address[]" }, + { internalType: "uint256[]", name: "_prices", type: "uint256[]" }, + { internalType: "uint256[]", name: "_caps", type: "uint256[]" }, + { internalType: "address[]", name: "_lpTokens", type: "address[]" }, + { internalType: "address[]", name: "_lpTokenAs", type: "address[]" }, + { internalType: "address[]", name: "_lpTokenBs", type: "address[]" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "iouTokens", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isMigrationActive", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isSigner", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lpTokenAs", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lpTokenBs", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lpTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenAmount", type: "uint256" }, + ], + name: "migrate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "minAuthorizations", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "pendingActions", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "prices", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "uint256", name: "_nonce", type: "uint256" }, + ], + name: "signApprove", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "signalApprove", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "bytes32", name: "", type: "bytes32" }, + ], + name: "signedActions", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "signers", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "whitelistedTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/GovToken.json b/sdk/src/abis/GovToken.json deleted file mode 100644 index 88796b1360..0000000000 --- a/sdk/src/abis/GovToken.json +++ /dev/null @@ -1,768 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract RoleStore", - "name": "roleStore_", - "type": "address" - }, - { - "internalType": "string", - "name": "name_", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol_", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals_", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidShortString", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "str", - "type": "string" - } - ], - "name": "StringTooLong", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "fromDelegate", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "toDelegate", - "type": "address" - } - ], - "name": "DelegateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "delegate", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousBalance", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" - } - ], - "name": "DelegateVotesChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "EIP712DomainChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "CLOCK_MODE", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint32", - "name": "pos", - "type": "uint32" - } - ], - "name": "checkpoints", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "fromBlock", - "type": "uint32" - }, - { - "internalType": "uint224", - "name": "votes", - "type": "uint224" - } - ], - "internalType": "struct ERC20Votes.Checkpoint", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "clock", - "outputs": [ - { - "internalType": "uint48", - "name": "", - "type": "uint48" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - } - ], - "name": "delegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "delegateBySig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "delegates", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eip712Domain", - "outputs": [ - { - "internalType": "bytes1", - "name": "fields", - "type": "bytes1" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "version", - "type": "string" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "verifyingContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "uint256[]", - "name": "extensions", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - } - ], - "name": "getPastTotalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - } - ], - "name": "getPastVotes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getVotes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "numCheckpoints", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/GovToken.ts b/sdk/src/abis/GovToken.ts new file mode 100644 index 0000000000..a029dd7ba9 --- /dev/null +++ b/sdk/src/abis/GovToken.ts @@ -0,0 +1,323 @@ +export default [ + { + inputs: [ + { internalType: "contract RoleStore", name: "roleStore_", type: "address" }, + { internalType: "string", name: "name_", type: "string" }, + { internalType: "string", name: "symbol_", type: "string" }, + { internalType: "uint8", name: "decimals_", type: "uint8" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { inputs: [], name: "InvalidShortString", type: "error" }, + { inputs: [{ internalType: "string", name: "str", type: "string" }], name: "StringTooLong", type: "error" }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "delegator", type: "address" }, + { indexed: true, internalType: "address", name: "fromDelegate", type: "address" }, + { indexed: true, internalType: "address", name: "toDelegate", type: "address" }, + ], + name: "DelegateChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "delegate", type: "address" }, + { indexed: false, internalType: "uint256", name: "previousBalance", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "newBalance", type: "uint256" }, + ], + name: "DelegateVotesChanged", + type: "event", + }, + { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event" }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "CLOCK_MODE", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint32", name: "pos", type: "uint32" }, + ], + name: "checkpoints", + outputs: [ + { + components: [ + { internalType: "uint32", name: "fromBlock", type: "uint32" }, + { internalType: "uint224", name: "votes", type: "uint224" }, + ], + internalType: "struct ERC20Votes.Checkpoint", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "clock", + outputs: [{ internalType: "uint48", name: "", type: "uint48" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "subtractedValue", type: "uint256" }, + ], + name: "decreaseAllowance", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "delegatee", type: "address" }], + name: "delegate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "delegatee", type: "address" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "expiry", type: "uint256" }, + { internalType: "uint8", name: "v", type: "uint8" }, + { internalType: "bytes32", name: "r", type: "bytes32" }, + { internalType: "bytes32", name: "s", type: "bytes32" }, + ], + name: "delegateBySig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "delegates", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eip712Domain", + outputs: [ + { internalType: "bytes1", name: "fields", type: "bytes1" }, + { internalType: "string", name: "name", type: "string" }, + { internalType: "string", name: "version", type: "string" }, + { internalType: "uint256", name: "chainId", type: "uint256" }, + { internalType: "address", name: "verifyingContract", type: "address" }, + { internalType: "bytes32", name: "salt", type: "bytes32" }, + { internalType: "uint256[]", name: "extensions", type: "uint256[]" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "timepoint", type: "uint256" }], + name: "getPastTotalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "timepoint", type: "uint256" }, + ], + name: "getPastVotes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "getVotes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "addedValue", type: "uint256" }, + ], + name: "increaseAllowance", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "nonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "numCheckpoints", + outputs: [{ internalType: "uint32", name: "", type: "uint32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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" }, + ], + name: "permit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/LayerZeroProvider.json b/sdk/src/abis/LayerZeroProvider.json deleted file mode 100644 index 32c9841a0d..0000000000 --- a/sdk/src/abis/LayerZeroProvider.json +++ /dev/null @@ -1,372 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "_multichainVault", - "type": "address" - }, - { - "internalType": "contract IMultichainGmRouter", - "name": "_multichainGmRouter", - "type": "address" - }, - { - "internalType": "contract IMultichainGlvRouter", - "name": "_multichainGlvRouter", - "type": "address" - }, - { - "internalType": "contract IMultichainOrderRouter", - "name": "_multichainOrderRouter", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyWithdrawalAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "estimatedGasLimit", - "type": "uint256" - } - ], - "name": "InsufficientGasLeft", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidBridgeOutToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "eid", - "type": "uint256" - } - ], - "name": "InvalidEid", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IRelayUtils.BridgeOutParams", - "name": "params", - "type": "tuple" - } - ], - "name": "bridgeOut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "message", - "type": "bytes" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "lzCompose", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainGlvRouter", - "outputs": [ - { - "internalType": "contract IMultichainGlvRouter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "multichainGmRouter", - "outputs": [ - { - "internalType": "contract IMultichainGmRouter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "multichainOrderRouter", - "outputs": [ - { - "internalType": "contract IMultichainOrderRouter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} diff --git a/sdk/src/abis/LayerZeroProvider.ts b/sdk/src/abis/LayerZeroProvider.ts new file mode 100644 index 0000000000..0d576608e3 --- /dev/null +++ b/sdk/src/abis/LayerZeroProvider.ts @@ -0,0 +1,159 @@ +export default [ + { + inputs: [ + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract MultichainVault", name: "_multichainVault", type: "address" }, + { internalType: "contract IMultichainGmRouter", name: "_multichainGmRouter", type: "address" }, + { internalType: "contract IMultichainGlvRouter", name: "_multichainGlvRouter", type: "address" }, + { internalType: "contract IMultichainOrderRouter", name: "_multichainOrderRouter", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { inputs: [], name: "EmptyWithdrawalAmount", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "gas", type: "uint256" }, + { internalType: "uint256", name: "estimatedGasLimit", type: "uint256" }, + ], + name: "InsufficientGasLeft", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "InvalidBridgeOutToken", + type: "error", + }, + { inputs: [{ internalType: "uint256", name: "eid", type: "uint256" }], name: "InvalidEid", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "uint256", name: "minAmountOut", type: "uint256" }, + { internalType: "address", name: "provider", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "bridgeOut", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "bytes", name: "message", type: "bytes" }, + { internalType: "address", name: "", type: "address" }, + { internalType: "bytes", name: "", type: "bytes" }, + ], + name: "lzCompose", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainGlvRouter", + outputs: [{ internalType: "contract IMultichainGlvRouter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainGmRouter", + outputs: [{ internalType: "contract IMultichainGmRouter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainOrderRouter", + outputs: [{ internalType: "contract IMultichainOrderRouter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "withdrawTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { stateMutability: "payable", type: "receive" }, +] as const; diff --git a/sdk/src/abis/MintableBaseToken.json b/sdk/src/abis/MintableBaseToken.json deleted file mode 100644 index a9542d5d3e..0000000000 --- a/sdk/src/abis/MintableBaseToken.json +++ /dev/null @@ -1,696 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "MintableBaseToken", - "sourceName": "contracts/tokens/MintableBaseToken.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "uint256", - "name": "_initialSupply", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "addAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "addNonStakingAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "admins", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "allowances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "balances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateTransferMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isHandler", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isMinter", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "nonStakingAccounts", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nonStakingSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "recoverClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "removeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "removeNonStakingAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateTransferMode", - "type": "bool" - } - ], - "name": "setInPrivateTransferMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - } - ], - "name": "setInfo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_minter", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_yieldTrackers", - "type": "address[]" - } - ], - "name": "setYieldTrackers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "stakedBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalStaked", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "yieldTrackers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/MintableBaseToken.ts b/sdk/src/abis/MintableBaseToken.ts new file mode 100644 index 0000000000..ada792d53b --- /dev/null +++ b/sdk/src/abis/MintableBaseToken.ts @@ -0,0 +1,321 @@ +export default [ + { + inputs: [ + { internalType: "string", name: "_name", type: "string" }, + { internalType: "string", name: "_symbol", type: "string" }, + { internalType: "uint256", name: "_initialSupply", type: "uint256" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "addAdmin", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "addNonStakingAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "admins", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_owner", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "allowances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "balances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_receiver", type: "address" }], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateTransferMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isHandler", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isMinter", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "nonStakingAccounts", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "nonStakingSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "recoverClaim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "removeAdmin", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "removeNonStakingAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateTransferMode", type: "bool" }], + name: "setInPrivateTransferMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "string", name: "_name", type: "string" }, + { internalType: "string", name: "_symbol", type: "string" }, + ], + name: "setInfo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_minter", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setMinter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_yieldTrackers", type: "address[]" }], + name: "setYieldTrackers", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "stakedBalance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalStaked", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_recipient", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_sender", type: "address" }, + { internalType: "address", name: "_recipient", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "yieldTrackers", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/Multicall.json b/sdk/src/abis/Multicall.json deleted file mode 100644 index 2f892a241e..0000000000 --- a/sdk/src/abis/Multicall.json +++ /dev/null @@ -1,429 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes[]", - "name": "returnData", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowFailure", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call3[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate3", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowFailure", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call3Value[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate3Value", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "blockAndAggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getBasefee", - "outputs": [ - { - "internalType": "uint256", - "name": "basefee", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "getBlockHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "chainid", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockCoinbase", - "outputs": [ - { - "internalType": "address", - "name": "coinbase", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockGasLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "gaslimit", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "getEthBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getLastBlockHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "requireSuccess", - "type": "bool" - }, - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "tryAggregate", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "requireSuccess", - "type": "bool" - }, - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "tryBlockAndAggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/Multicall.ts b/sdk/src/abis/Multicall.ts new file mode 100644 index 0000000000..8c940ac397 --- /dev/null +++ b/sdk/src/abis/Multicall.ts @@ -0,0 +1,229 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes[]", name: "returnData", type: "bytes[]" }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bool", name: "allowFailure", type: "bool" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call3[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate3", + outputs: [ + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bool", name: "allowFailure", type: "bool" }, + { internalType: "uint256", name: "value", type: "uint256" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call3Value[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate3Value", + outputs: [ + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "blockAndAggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes32", name: "blockHash", type: "bytes32" }, + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "getBasefee", + outputs: [{ internalType: "uint256", name: "basefee", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], + name: "getBlockHash", + outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBlockNumber", + outputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getChainId", + outputs: [{ internalType: "uint256", name: "chainid", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockCoinbase", + outputs: [{ internalType: "address", name: "coinbase", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockGasLimit", + outputs: [{ internalType: "uint256", name: "gaslimit", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockTimestamp", + outputs: [{ internalType: "uint256", name: "timestamp", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "addr", type: "address" }], + name: "getEthBalance", + outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getLastBlockHash", + outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bool", name: "requireSuccess", type: "bool" }, + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "tryAggregate", + outputs: [ + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bool", name: "requireSuccess", type: "bool" }, + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "tryBlockAndAggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes32", name: "blockHash", type: "bytes32" }, + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainClaimsRouter.json b/sdk/src/abis/MultichainClaimsRouter.json deleted file mode 100644 index 36a153ae8f..0000000000 --- a/sdk/src/abis/MultichainClaimsRouter.json +++ /dev/null @@ -1,1266 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "contract Router", - "name": "router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "oracle", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "orderVault", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "orderHandler", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "multichainVault", - "type": "address" - } - ], - "internalType": "struct MultichainRouter.BaseConstructorParams", - "name": "params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "adjustedClaimableAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "name": "CollateralAlreadyClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "DisabledMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyAddressInMarketTokenBalanceValidation", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyMarket", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeKeysLength", - "type": "uint256" - } - ], - "name": "InvalidClaimCollateralInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "InvalidClaimableFactor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedMinBalance", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableFundingFeeAmount", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalanceForClaimableFunding", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "InvalidMarketTokenBalanceForCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimAffiliateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "timeKeys", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimCollateral", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimFundingFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainClaimsRouter.ts b/sdk/src/abis/MultichainClaimsRouter.ts new file mode 100644 index 0000000000..c15f1bdfa0 --- /dev/null +++ b/sdk/src/abis/MultichainClaimsRouter.ts @@ -0,0 +1,514 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "contract Router", name: "router", type: "address" }, + { internalType: "contract RoleStore", name: "roleStore", type: "address" }, + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "oracle", type: "address" }, + { internalType: "contract OrderVault", name: "orderVault", type: "address" }, + { internalType: "contract IOrderHandler", name: "orderHandler", type: "address" }, + { internalType: "contract ISwapHandler", name: "swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "externalHandler", type: "address" }, + { internalType: "contract MultichainVault", name: "multichainVault", type: "address" }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "adjustedClaimableAmount", type: "uint256" }, + { internalType: "uint256", name: "claimedAmount", type: "uint256" }, + ], + name: "CollateralAlreadyClaimed", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [{ internalType: "address", name: "market", type: "address" }], name: "DisabledMarket", type: "error" }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "EmptyAddressInMarketTokenBalanceValidation", + type: "error", + }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyMarket", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "marketsLength", type: "uint256" }, + { internalType: "uint256", name: "tokensLength", type: "uint256" }, + { internalType: "uint256", name: "timeKeysLength", type: "uint256" }, + ], + name: "InvalidClaimCollateralInput", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "value", type: "uint256" }], + name: "InvalidClaimableFactor", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "expectedMinBalance", type: "uint256" }, + ], + name: "InvalidMarketTokenBalance", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "claimableFundingFeeAmount", type: "uint256" }, + ], + name: "InvalidMarketTokenBalanceForClaimableFunding", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + ], + name: "InvalidMarketTokenBalanceForCollateralAmount", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimAffiliateRewards", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "uint256[]", name: "timeKeys", type: "uint256[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimCollateral", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address[]", name: "markets", type: "address[]" }, + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "claimFundingFees", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainGlvRouter.json b/sdk/src/abis/MultichainGlvRouter.json deleted file mode 100644 index 27765a600d..0000000000 --- a/sdk/src/abis/MultichainGlvRouter.json +++ /dev/null @@ -1,1150 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "contract Router", - "name": "router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "oracle", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "orderVault", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "orderHandler", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "multichainVault", - "type": "address" - } - ], - "internalType": "struct MultichainRouter.BaseConstructorParams", - "name": "params", - "type": "tuple" - }, - { - "internalType": "contract IGlvDepositHandler", - "name": "_glvDepositHandler", - "type": "address" - }, - { - "internalType": "contract IGlvWithdrawalHandler", - "name": "_glvWithdrawalHandler", - "type": "address" - }, - { - "internalType": "contract GlvVault", - "name": "_glvVault", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidTransferRequestsLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "receivers", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "internalType": "struct IRelayUtils.TransferRequests", - "name": "transferRequests", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IGlvDepositUtils.CreateGlvDepositParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createGlvDeposit", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "receivers", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "internalType": "struct IRelayUtils.TransferRequests", - "name": "transferRequests", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createGlvWithdrawal", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glvDepositHandler", - "outputs": [ - { - "internalType": "contract IGlvDepositHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glvVault", - "outputs": [ - { - "internalType": "contract GlvVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glvWithdrawalHandler", - "outputs": [ - { - "internalType": "contract IGlvWithdrawalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainGlvRouter.ts b/sdk/src/abis/MultichainGlvRouter.ts new file mode 100644 index 0000000000..0921146a0c --- /dev/null +++ b/sdk/src/abis/MultichainGlvRouter.ts @@ -0,0 +1,474 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "contract Router", name: "router", type: "address" }, + { internalType: "contract RoleStore", name: "roleStore", type: "address" }, + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "oracle", type: "address" }, + { internalType: "contract OrderVault", name: "orderVault", type: "address" }, + { internalType: "contract IOrderHandler", name: "orderHandler", type: "address" }, + { internalType: "contract ISwapHandler", name: "swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "externalHandler", type: "address" }, + { internalType: "contract MultichainVault", name: "multichainVault", type: "address" }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + { internalType: "contract IGlvDepositHandler", name: "_glvDepositHandler", type: "address" }, + { internalType: "contract IGlvWithdrawalHandler", name: "_glvWithdrawalHandler", type: "address" }, + { internalType: "contract GlvVault", name: "_glvVault", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [], name: "InvalidTransferRequestsLength", type: "error" }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "receivers", type: "address[]" }, + { internalType: "uint256[]", name: "amounts", type: "uint256[]" }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minGlvTokens", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isMarketTokenDeposit", type: "bool" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParams", + name: "params", + type: "tuple", + }, + ], + name: "createGlvDeposit", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "receivers", type: "address[]" }, + { internalType: "uint256[]", name: "amounts", type: "uint256[]" }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "glv", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", + name: "params", + type: "tuple", + }, + ], + name: "createGlvWithdrawal", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvDepositHandler", + outputs: [{ internalType: "contract IGlvDepositHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvVault", + outputs: [{ internalType: "contract GlvVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvWithdrawalHandler", + outputs: [{ internalType: "contract IGlvWithdrawalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainGmRouter.json b/sdk/src/abis/MultichainGmRouter.json deleted file mode 100644 index bbe4f182ec..0000000000 --- a/sdk/src/abis/MultichainGmRouter.json +++ /dev/null @@ -1,1449 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "contract Router", - "name": "router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "oracle", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "orderVault", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "orderHandler", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "multichainVault", - "type": "address" - } - ], - "internalType": "struct MultichainRouter.BaseConstructorParams", - "name": "params", - "type": "tuple" - }, - { - "internalType": "contract DepositVault", - "name": "_depositVault", - "type": "address" - }, - { - "internalType": "contract IDepositHandler", - "name": "_depositHandler", - "type": "address" - }, - { - "internalType": "contract WithdrawalVault", - "name": "_withdrawalVault", - "type": "address" - }, - { - "internalType": "contract IWithdrawalHandler", - "name": "_withdrawalHandler", - "type": "address" - }, - { - "internalType": "contract ShiftVault", - "name": "_shiftVault", - "type": "address" - }, - { - "internalType": "contract IShiftHandler", - "name": "_shiftHandler", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidTransferRequestsLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "receivers", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "internalType": "struct IRelayUtils.TransferRequests", - "name": "transferRequests", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IDepositUtils.CreateDepositParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IDepositUtils.CreateDepositParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createDeposit", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "receivers", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "internalType": "struct IRelayUtils.TransferRequests", - "name": "transferRequests", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct IShiftUtils.CreateShiftParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IShiftUtils.CreateShiftParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createShift", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "receivers", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "internalType": "struct IRelayUtils.TransferRequests", - "name": "transferRequests", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IWithdrawalUtils.CreateWithdrawalParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createWithdrawal", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositHandler", - "outputs": [ - { - "internalType": "contract IDepositHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositVault", - "outputs": [ - { - "internalType": "contract DepositVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "shiftHandler", - "outputs": [ - { - "internalType": "contract IShiftHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "shiftVault", - "outputs": [ - { - "internalType": "contract ShiftVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalHandler", - "outputs": [ - { - "internalType": "contract IWithdrawalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalVault", - "outputs": [ - { - "internalType": "contract WithdrawalVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainGmRouter.ts b/sdk/src/abis/MultichainGmRouter.ts new file mode 100644 index 0000000000..5d34ccf5e4 --- /dev/null +++ b/sdk/src/abis/MultichainGmRouter.ts @@ -0,0 +1,597 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "contract Router", name: "router", type: "address" }, + { internalType: "contract RoleStore", name: "roleStore", type: "address" }, + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "oracle", type: "address" }, + { internalType: "contract OrderVault", name: "orderVault", type: "address" }, + { internalType: "contract IOrderHandler", name: "orderHandler", type: "address" }, + { internalType: "contract ISwapHandler", name: "swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "externalHandler", type: "address" }, + { internalType: "contract MultichainVault", name: "multichainVault", type: "address" }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + { internalType: "contract DepositVault", name: "_depositVault", type: "address" }, + { internalType: "contract IDepositHandler", name: "_depositHandler", type: "address" }, + { internalType: "contract WithdrawalVault", name: "_withdrawalVault", type: "address" }, + { internalType: "contract IWithdrawalHandler", name: "_withdrawalHandler", type: "address" }, + { internalType: "contract ShiftVault", name: "_shiftVault", type: "address" }, + { internalType: "contract IShiftHandler", name: "_shiftHandler", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [], name: "InvalidTransferRequestsLength", type: "error" }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "receivers", type: "address[]" }, + { internalType: "uint256[]", name: "amounts", type: "uint256[]" }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IDepositUtils.CreateDepositParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IDepositUtils.CreateDepositParams", + name: "params", + type: "tuple", + }, + ], + name: "createDeposit", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "receivers", type: "address[]" }, + { internalType: "uint256[]", name: "amounts", type: "uint256[]" }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "fromMarket", type: "address" }, + { internalType: "address", name: "toMarket", type: "address" }, + ], + internalType: "struct IShiftUtils.CreateShiftParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IShiftUtils.CreateShiftParams", + name: "params", + type: "tuple", + }, + ], + name: "createShift", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "receivers", type: "address[]" }, + { internalType: "uint256[]", name: "amounts", type: "uint256[]" }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParams", + name: "params", + type: "tuple", + }, + ], + name: "createWithdrawal", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "depositHandler", + outputs: [{ internalType: "contract IDepositHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "depositVault", + outputs: [{ internalType: "contract DepositVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "shiftHandler", + outputs: [{ internalType: "contract IShiftHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "shiftVault", + outputs: [{ internalType: "contract ShiftVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdrawalHandler", + outputs: [{ internalType: "contract IWithdrawalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdrawalVault", + outputs: [{ internalType: "contract WithdrawalVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainOrderRouter.json b/sdk/src/abis/MultichainOrderRouter.json deleted file mode 100644 index 2d61d313e0..0000000000 --- a/sdk/src/abis/MultichainOrderRouter.json +++ /dev/null @@ -1,1820 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "contract Router", - "name": "router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "oracle", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "orderVault", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "orderHandler", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "multichainVault", - "type": "address" - } - ], - "internalType": "struct MultichainRouter.BaseConstructorParams", - "name": "params", - "type": "tuple" - }, - { - "internalType": "contract IReferralStorage", - "name": "_referralStorage", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "RelayEmptyBatch", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", - "name": "createOrderParamsList", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams[]", - "name": "updateOrderParamsList", - "type": "tuple[]" - }, - { - "internalType": "bytes32[]", - "name": "cancelOrderKeys", - "type": "bytes32[]" - } - ], - "internalType": "struct IRelayUtils.BatchParams", - "name": "params", - "type": "tuple" - } - ], - "name": "batch", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createOrder", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "referralStorage", - "outputs": [ - { - "internalType": "contract IReferralStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - } - ], - "name": "setTraderReferralCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "updateOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainOrderRouter.ts b/sdk/src/abis/MultichainOrderRouter.ts new file mode 100644 index 0000000000..3631cc0d03 --- /dev/null +++ b/sdk/src/abis/MultichainOrderRouter.ts @@ -0,0 +1,724 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "contract Router", name: "router", type: "address" }, + { internalType: "contract RoleStore", name: "roleStore", type: "address" }, + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "oracle", type: "address" }, + { internalType: "contract OrderVault", name: "orderVault", type: "address" }, + { internalType: "contract IOrderHandler", name: "orderHandler", type: "address" }, + { internalType: "contract ISwapHandler", name: "swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "externalHandler", type: "address" }, + { internalType: "contract MultichainVault", name: "multichainVault", type: "address" }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + { internalType: "contract IReferralStorage", name: "_referralStorage", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "RelayEmptyBatch", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams[]", + name: "createOrderParamsList", + type: "tuple[]", + }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams[]", + name: "updateOrderParamsList", + type: "tuple[]", + }, + { internalType: "bytes32[]", name: "cancelOrderKeys", type: "bytes32[]" }, + ], + internalType: "struct IRelayUtils.BatchParams", + name: "params", + type: "tuple", + }, + ], + name: "batch", + outputs: [{ internalType: "bytes32[]", name: "", type: "bytes32[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "cancelOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "referralStorage", + outputs: [{ internalType: "contract IReferralStorage", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + ], + name: "setTraderReferralCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainSubaccountRouter.json b/sdk/src/abis/MultichainSubaccountRouter.json deleted file mode 100644 index 6f827b1350..0000000000 --- a/sdk/src/abis/MultichainSubaccountRouter.json +++ /dev/null @@ -1,2069 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "contract Router", - "name": "router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "oracle", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "orderVault", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "orderHandler", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "multichainVault", - "type": "address" - } - ], - "internalType": "struct MultichainRouter.BaseConstructorParams", - "name": "params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "RelayEmptyBatch", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", - "name": "createOrderParamsList", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams[]", - "name": "updateOrderParamsList", - "type": "tuple[]" - }, - { - "internalType": "bytes32[]", - "name": "cancelOrderKeys", - "type": "bytes32[]" - } - ], - "internalType": "struct IRelayUtils.BatchParams", - "name": "params", - "type": "tuple" - } - ], - "name": "batch", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createOrder", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - } - ], - "name": "removeSubaccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "subaccountApprovalNonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "updateOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainSubaccountRouter.ts b/sdk/src/abis/MultichainSubaccountRouter.ts new file mode 100644 index 0000000000..60669e3c01 --- /dev/null +++ b/sdk/src/abis/MultichainSubaccountRouter.ts @@ -0,0 +1,795 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "contract Router", name: "router", type: "address" }, + { internalType: "contract RoleStore", name: "roleStore", type: "address" }, + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "oracle", type: "address" }, + { internalType: "contract OrderVault", name: "orderVault", type: "address" }, + { internalType: "contract IOrderHandler", name: "orderHandler", type: "address" }, + { internalType: "contract ISwapHandler", name: "swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "externalHandler", type: "address" }, + { internalType: "contract MultichainVault", name: "multichainVault", type: "address" }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "RelayEmptyBatch", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address", name: "subaccount", type: "address" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams[]", + name: "createOrderParamsList", + type: "tuple[]", + }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams[]", + name: "updateOrderParamsList", + type: "tuple[]", + }, + { internalType: "bytes32[]", name: "cancelOrderKeys", type: "bytes32[]" }, + ], + internalType: "struct IRelayUtils.BatchParams", + name: "params", + type: "tuple", + }, + ], + name: "batch", + outputs: [{ internalType: "bytes32[]", name: "", type: "bytes32[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "cancelOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address", name: "subaccount", type: "address" }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address", name: "subaccount", type: "address" }, + ], + name: "removeSubaccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "subaccountApprovalNonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "address", name: "subaccount", type: "address" }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainTransferRouter.json b/sdk/src/abis/MultichainTransferRouter.json deleted file mode 100644 index ccc2d3ba91..0000000000 --- a/sdk/src/abis/MultichainTransferRouter.json +++ /dev/null @@ -1,915 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "components": [ - { - "internalType": "contract Router", - "name": "router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "oracle", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "orderVault", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "orderHandler", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "contract MultichainVault", - "name": "multichainVault", - "type": "address" - } - ], - "internalType": "struct MultichainRouter.BaseConstructorParams", - "name": "params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitializer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "InvalidMultichainProvider", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "bridgeIn", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IRelayUtils.BridgeOutParams", - "name": "params", - "type": "tuple" - } - ], - "name": "bridgeOut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IRelayUtils.BridgeOutParams", - "name": "params", - "type": "tuple" - } - ], - "name": "bridgeOutFromController", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_multichainProvider", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "multichainProvider", - "outputs": [ - { - "internalType": "contract IMultichainProvider", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "multichainVault", - "outputs": [ - { - "internalType": "contract MultichainVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IRelayUtils.BridgeOutParams", - "name": "params", - "type": "tuple" - } - ], - "name": "transferOut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainTransferRouter.ts b/sdk/src/abis/MultichainTransferRouter.ts new file mode 100644 index 0000000000..b9ec75fcb5 --- /dev/null +++ b/sdk/src/abis/MultichainTransferRouter.ts @@ -0,0 +1,404 @@ +export default [ + { + inputs: [ + { + components: [ + { internalType: "contract Router", name: "router", type: "address" }, + { internalType: "contract RoleStore", name: "roleStore", type: "address" }, + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "oracle", type: "address" }, + { internalType: "contract OrderVault", name: "orderVault", type: "address" }, + { internalType: "contract IOrderHandler", name: "orderHandler", type: "address" }, + { internalType: "contract ISwapHandler", name: "swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "externalHandler", type: "address" }, + { internalType: "contract MultichainVault", name: "multichainVault", type: "address" }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { inputs: [], name: "InvalidInitializer", type: "error" }, + { + inputs: [{ internalType: "address", name: "provider", type: "address" }], + name: "InvalidMultichainProvider", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: "uint8", name: "version", type: "uint8" }], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "bridgeIn", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { + components: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "uint256", name: "minAmountOut", type: "uint256" }, + { internalType: "address", name: "provider", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "bridgeOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { + components: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "uint256", name: "minAmountOut", type: "uint256" }, + { internalType: "address", name: "provider", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "bridgeOutFromController", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_multichainProvider", type: "address" }], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainProvider", + outputs: [{ internalType: "contract IMultichainProvider", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "uint256", name: "minAmountOut", type: "uint256" }, + { internalType: "address", name: "provider", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "transferOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainUtils.json b/sdk/src/abis/MultichainUtils.json deleted file mode 100644 index 26b9247d50..0000000000 --- a/sdk/src/abis/MultichainUtils.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyMultichainTransferInAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientMultichainBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "InvalidMultichainEndpoint", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "InvalidMultichainProvider", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "DataStore" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getMultichainBalanceAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "DataStore" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "validateMultichainEndpoint", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "DataStore" - }, - { - "internalType": "address", - "name": "provider", - "type": "address" - } - ], - "name": "validateMultichainProvider", - "outputs": [], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/MultichainUtils.ts b/sdk/src/abis/MultichainUtils.ts new file mode 100644 index 0000000000..e71c1ef6b8 --- /dev/null +++ b/sdk/src/abis/MultichainUtils.ts @@ -0,0 +1,61 @@ +export default [ + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "EmptyMultichainTransferInAmount", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "InsufficientMultichainBalance", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "endpoint", type: "address" }], + name: "InvalidMultichainEndpoint", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "provider", type: "address" }], + name: "InvalidMultichainProvider", + type: "error", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "DataStore" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "token", type: "address" }, + ], + name: "getMultichainBalanceAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "DataStore" }, + { internalType: "address", name: "endpoint", type: "address" }, + ], + name: "validateMultichainEndpoint", + outputs: [], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "DataStore" }, + { internalType: "address", name: "provider", type: "address" }, + ], + name: "validateMultichainProvider", + outputs: [], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/MultichainVault.json b/sdk/src/abis/MultichainVault.json deleted file mode 100644 index aec87386dd..0000000000 --- a/sdk/src/abis/MultichainVault.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "InvalidNativeTokenSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "SelfTransferNotSupported", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "recordTransferIn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "syncTokenBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferOut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "name": "transferOut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferOutNativeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} diff --git a/sdk/src/abis/MultichainVault.ts b/sdk/src/abis/MultichainVault.ts new file mode 100644 index 0000000000..cba19e9e48 --- /dev/null +++ b/sdk/src/abis/MultichainVault.ts @@ -0,0 +1,122 @@ +export default [ + { + inputs: [ + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "msgSender", type: "address" }], + name: "InvalidNativeTokenSender", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "receiver", type: "address" }], + name: "SelfTransferNotSupported", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "recordTransferIn", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "syncTokenBalance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenBalances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transferOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + ], + name: "transferOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transferOutNativeToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { stateMutability: "payable", type: "receive" }, +] as const; diff --git a/sdk/src/abis/Reader.json b/sdk/src/abis/Reader.json deleted file mode 100644 index 113526b301..0000000000 --- a/sdk/src/abis/Reader.json +++ /dev/null @@ -1,355 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Reader", - "sourceName": "contracts/peripherals/Reader.sol", - "abi": [ - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVault", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amountIn", - "type": "uint256" - } - ], - "name": "getAmountOut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getFundingRates", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVault", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - } - ], - "name": "getMaxAmountIn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_factory", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getPairInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_collateralTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_indexTokens", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "_isLong", - "type": "bool[]" - } - ], - "name": "getPositions", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_yieldTrackers", - "type": "address[]" - } - ], - "name": "getStakingInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getTokenBalances", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getTokenBalancesWithSupplies", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_excludedAccounts", - "type": "address[]" - } - ], - "name": "getTokenSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_yieldTokens", - "type": "address[]" - } - ], - "name": "getTotalStaked", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getVaultTokenInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/Reader.ts b/sdk/src/abis/Reader.ts new file mode 100644 index 0000000000..c17b3b4de8 --- /dev/null +++ b/sdk/src/abis/Reader.ts @@ -0,0 +1,138 @@ +export default [ + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IVault", name: "_vault", type: "address" }, + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "uint256", name: "_amountIn", type: "uint256" }, + ], + name: "getAmountOut", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getFees", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getFundingRates", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IVault", name: "_vault", type: "address" }, + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + ], + name: "getMaxAmountIn", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_factory", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getPairInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_collateralTokens", type: "address[]" }, + { internalType: "address[]", name: "_indexTokens", type: "address[]" }, + { internalType: "bool[]", name: "_isLong", type: "bool[]" }, + ], + name: "getPositions", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_yieldTrackers", type: "address[]" }, + ], + name: "getStakingInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getTokenBalances", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getTokenBalancesWithSupplies", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IERC20", name: "_token", type: "address" }, + { internalType: "address[]", name: "_excludedAccounts", type: "address[]" }, + ], + name: "getTokenSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_yieldTokens", type: "address[]" }], + name: "getTotalStaked", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getVaultTokenInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/ReaderV2.json b/sdk/src/abis/ReaderV2.json deleted file mode 100644 index bc9c809e66..0000000000 --- a/sdk/src/abis/ReaderV2.json +++ /dev/null @@ -1,630 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Reader", - "sourceName": "contracts/peripherals/Reader.sol", - "abi": [ - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "POSITION_PROPS_LENGTH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRICE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USDG_DECIMALS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVault", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amountIn", - "type": "uint256" - } - ], - "name": "getAmountOut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVault", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amountIn", - "type": "uint256" - } - ], - "name": "getFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getFullVaultTokenInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getFundingRates", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVault", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - } - ], - "name": "getMaxAmountIn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_factory", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getPairInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_collateralTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_indexTokens", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "_isLong", - "type": "bool[]" - } - ], - "name": "getPositions", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVaultPriceFeed", - "name": "_priceFeed", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getPrices", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_yieldTrackers", - "type": "address[]" - } - ], - "name": "getStakingInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getTokenBalances", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getTokenBalancesWithSupplies", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_excludedAccounts", - "type": "address[]" - } - ], - "name": "getTokenSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - } - ], - "name": "getTotalBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_yieldTokens", - "type": "address[]" - } - ], - "name": "getTotalStaked", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getVaultTokenInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getVaultTokenInfoV2", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_vesters", - "type": "address[]" - } - ], - "name": "getVestingInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasMaxGlobalShortSizes", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_hasMaxGlobalShortSizes", - "type": "bool" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/ReaderV2.ts b/sdk/src/abis/ReaderV2.ts new file mode 100644 index 0000000000..4b81c1c697 --- /dev/null +++ b/sdk/src/abis/ReaderV2.ts @@ -0,0 +1,257 @@ +export default [ + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "POSITION_PROPS_LENGTH", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "USDG_DECIMALS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IVault", name: "_vault", type: "address" }, + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "uint256", name: "_amountIn", type: "uint256" }, + ], + name: "getAmountOut", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IVault", name: "_vault", type: "address" }, + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "uint256", name: "_amountIn", type: "uint256" }, + ], + name: "getFeeBasisPoints", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getFees", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getFullVaultTokenInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getFundingRates", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IVault", name: "_vault", type: "address" }, + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + ], + name: "getMaxAmountIn", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_factory", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getPairInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_collateralTokens", type: "address[]" }, + { internalType: "address[]", name: "_indexTokens", type: "address[]" }, + { internalType: "bool[]", name: "_isLong", type: "bool[]" }, + ], + name: "getPositions", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IVaultPriceFeed", name: "_priceFeed", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getPrices", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_yieldTrackers", type: "address[]" }, + ], + name: "getStakingInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getTokenBalances", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getTokenBalancesWithSupplies", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IERC20", name: "_token", type: "address" }, + { internalType: "address[]", name: "_excludedAccounts", type: "address[]" }, + ], + name: "getTokenSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract IERC20", name: "_token", type: "address" }, + { internalType: "address[]", name: "_accounts", type: "address[]" }, + ], + name: "getTotalBalance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_yieldTokens", type: "address[]" }], + name: "getTotalStaked", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getVaultTokenInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getVaultTokenInfoV2", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_vesters", type: "address[]" }, + ], + name: "getVestingInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasMaxGlobalShortSizes", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_hasMaxGlobalShortSizes", type: "bool" }], + name: "setConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/ReferralStorage.json b/sdk/src/abis/ReferralStorage.json deleted file mode 100644 index edfad6e67a..0000000000 --- a/sdk/src/abis/ReferralStorage.json +++ /dev/null @@ -1,557 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "code", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAccount", - "type": "address" - } - ], - "name": "GovSetCodeOwner", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "code", - "type": "bytes32" - } - ], - "name": "RegisterCode", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAccount", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "code", - "type": "bytes32" - } - ], - "name": "SetCodeOwner", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "prevGov", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "nextGov", - "type": "address" - } - ], - "name": "SetGov", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "handler", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isActive", - "type": "bool" - } - ], - "name": "SetHandler", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "discountShare", - "type": "uint256" - } - ], - "name": "SetReferrerDiscountShare", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tierId", - "type": "uint256" - } - ], - "name": "SetReferrerTier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tierId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalRebate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "discountShare", - "type": "uint256" - } - ], - "name": "SetTier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "code", - "type": "bytes32" - } - ], - "name": "SetTraderReferralCode", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "codeOwners", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "getTraderReferralInfo", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_code", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_newAccount", - "type": "address" - } - ], - "name": "govSetCodeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isHandler", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingGov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "referrerDiscountShares", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "referrerTiers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_code", - "type": "bytes32" - } - ], - "name": "registerCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_code", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_newAccount", - "type": "address" - } - ], - "name": "setCodeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_discountShare", - "type": "uint256" - } - ], - "name": "setReferrerDiscountShare", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_referrer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tierId", - "type": "uint256" - } - ], - "name": "setReferrerTier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tierId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_totalRebate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_discountShare", - "type": "uint256" - } - ], - "name": "setTier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_code", - "type": "bytes32" - } - ], - "name": "setTraderReferralCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_code", - "type": "bytes32" - } - ], - "name": "setTraderReferralCodeByUser", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "tiers", - "outputs": [ - { - "internalType": "uint256", - "name": "totalRebate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "discountShare", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "traderReferralCodes", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newGov", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/ReferralStorage.ts b/sdk/src/abis/ReferralStorage.ts new file mode 100644 index 0000000000..e996694135 --- /dev/null +++ b/sdk/src/abis/ReferralStorage.ts @@ -0,0 +1,259 @@ +export default [ + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "code", type: "bytes32" }, + { indexed: false, internalType: "address", name: "newAccount", type: "address" }, + ], + name: "GovSetCodeOwner", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "bytes32", name: "code", type: "bytes32" }, + ], + name: "RegisterCode", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "newAccount", type: "address" }, + { indexed: false, internalType: "bytes32", name: "code", type: "bytes32" }, + ], + name: "SetCodeOwner", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "prevGov", type: "address" }, + { indexed: false, internalType: "address", name: "nextGov", type: "address" }, + ], + name: "SetGov", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "handler", type: "address" }, + { indexed: false, internalType: "bool", name: "isActive", type: "bool" }, + ], + name: "SetHandler", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "referrer", type: "address" }, + { indexed: false, internalType: "uint256", name: "discountShare", type: "uint256" }, + ], + name: "SetReferrerDiscountShare", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "referrer", type: "address" }, + { indexed: false, internalType: "uint256", name: "tierId", type: "uint256" }, + ], + name: "SetReferrerTier", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "uint256", name: "tierId", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "totalRebate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "discountShare", type: "uint256" }, + ], + name: "SetTier", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "bytes32", name: "code", type: "bytes32" }, + ], + name: "SetTraderReferralCode", + type: "event", + }, + { + inputs: [], + name: "BASIS_POINTS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "acceptOwnership", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "codeOwners", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "getTraderReferralInfo", + outputs: [ + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "address", name: "", type: "address" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_code", type: "bytes32" }, + { internalType: "address", name: "_newAccount", type: "address" }, + ], + name: "govSetCodeOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isHandler", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingGov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "referrerDiscountShares", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "referrerTiers", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "_code", type: "bytes32" }], + name: "registerCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_code", type: "bytes32" }, + { internalType: "address", name: "_newAccount", type: "address" }, + ], + name: "setCodeOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_discountShare", type: "uint256" }], + name: "setReferrerDiscountShare", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_referrer", type: "address" }, + { internalType: "uint256", name: "_tierId", type: "uint256" }, + ], + name: "setReferrerTier", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_tierId", type: "uint256" }, + { internalType: "uint256", name: "_totalRebate", type: "uint256" }, + { internalType: "uint256", name: "_discountShare", type: "uint256" }, + ], + name: "setTier", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "bytes32", name: "_code", type: "bytes32" }, + ], + name: "setTraderReferralCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "_code", type: "bytes32" }], + name: "setTraderReferralCodeByUser", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "tiers", + outputs: [ + { internalType: "uint256", name: "totalRebate", type: "uint256" }, + { internalType: "uint256", name: "discountShare", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "traderReferralCodes", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_newGov", type: "address" }], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/RelayParams.json b/sdk/src/abis/RelayParams.json deleted file mode 100644 index 56922f895f..0000000000 --- a/sdk/src/abis/RelayParams.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "abi": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ] -} diff --git a/sdk/src/abis/RelayParams.ts b/sdk/src/abis/RelayParams.ts new file mode 100644 index 0000000000..f51eb62044 --- /dev/null +++ b/sdk/src/abis/RelayParams.ts @@ -0,0 +1,53 @@ +export default [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, +] as const; diff --git a/sdk/src/abis/RewardReader.json b/sdk/src/abis/RewardReader.json deleted file mode 100644 index f1c11d8808..0000000000 --- a/sdk/src/abis/RewardReader.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "RewardReader", - "sourceName": "contracts/peripherals/RewardReader.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_depositTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "_rewardTrackers", - "type": "address[]" - } - ], - "name": "getDepositBalances", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_rewardTrackers", - "type": "address[]" - } - ], - "name": "getStakingInfo", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_vesters", - "type": "address[]" - } - ], - "name": "getVestingInfoV2", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/RewardReader.ts b/sdk/src/abis/RewardReader.ts new file mode 100644 index 0000000000..acd99583f5 --- /dev/null +++ b/sdk/src/abis/RewardReader.ts @@ -0,0 +1,33 @@ +export default [ + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_depositTokens", type: "address[]" }, + { internalType: "address[]", name: "_rewardTrackers", type: "address[]" }, + ], + name: "getDepositBalances", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_rewardTrackers", type: "address[]" }, + ], + name: "getStakingInfo", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address[]", name: "_vesters", type: "address[]" }, + ], + name: "getVestingInfoV2", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/RewardRouter.json b/sdk/src/abis/RewardRouter.json deleted file mode 100644 index 02c6e6606d..0000000000 --- a/sdk/src/abis/RewardRouter.json +++ /dev/null @@ -1,1024 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "RewardRouterV2", - "sourceName": "contracts/staking/RewardRouterV2.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "StakeGlp", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "StakeGmx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "UnstakeGlp", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "UnstakeGmx", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - } - ], - "name": "acceptTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - } - ], - "name": "batchCompoundForAccounts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - } - ], - "name": "batchRestakeForAccounts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_amounts", - "type": "uint256[]" - } - ], - "name": "batchStakeGmxForAccounts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "bnGmx", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "bonusGmxTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimEsGmx", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "compound", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "esGmx", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "extendedGmxTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "feeGlpTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "feeGmxTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glp", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glpManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glpVester", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmx", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmxVester", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "govToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_shouldClaimGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldStakeGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldClaimEsGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldStakeEsGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldStakeMultiplierPoints", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldClaimWeth", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldConvertWethToEth", - "type": "bool" - } - ], - "name": "handleRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gmxReceiver", - "type": "address" - }, - { - "internalType": "bool", - "name": "_shouldClaimGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldStakeGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldClaimEsGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldStakeEsGmx", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldStakeMultiplierPoints", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldClaimWeth", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_shouldConvertWethToEth", - "type": "bool" - } - ], - "name": "handleRewardsV2", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "inRestakingMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inStrictTransferMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "weth", - "type": "address" - }, - { - "internalType": "address", - "name": "gmx", - "type": "address" - }, - { - "internalType": "address", - "name": "esGmx", - "type": "address" - }, - { - "internalType": "address", - "name": "bnGmx", - "type": "address" - }, - { - "internalType": "address", - "name": "glp", - "type": "address" - }, - { - "internalType": "address", - "name": "stakedGmxTracker", - "type": "address" - }, - { - "internalType": "address", - "name": "bonusGmxTracker", - "type": "address" - }, - { - "internalType": "address", - "name": "extendedGmxTracker", - "type": "address" - }, - { - "internalType": "address", - "name": "feeGmxTracker", - "type": "address" - }, - { - "internalType": "address", - "name": "feeGlpTracker", - "type": "address" - }, - { - "internalType": "address", - "name": "stakedGlpTracker", - "type": "address" - }, - { - "internalType": "address", - "name": "glpManager", - "type": "address" - }, - { - "internalType": "address", - "name": "gmxVester", - "type": "address" - }, - { - "internalType": "address", - "name": "glpVester", - "type": "address" - }, - { - "internalType": "address", - "name": "externalHandler", - "type": "address" - }, - { - "internalType": "address", - "name": "govToken", - "type": "address" - } - ], - "internalType": "struct RewardRouterV2.InitializeParams", - "name": "_initializeParams", - "type": "tuple" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "name": "makeExternalCalls", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "maxBoostBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minUsdg", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minGlp", - "type": "uint256" - } - ], - "name": "mintAndStakeGlp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_minUsdg", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minGlp", - "type": "uint256" - } - ], - "name": "mintAndStakeGlpETH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "pendingReceivers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_govToken", - "type": "address" - } - ], - "name": "setGovToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inRestakingMode", - "type": "bool" - } - ], - "name": "setInRestakingMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inStrictTransferMode", - "type": "bool" - } - ], - "name": "setInStrictTransferMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxBoostBasisPoints", - "type": "uint256" - } - ], - "name": "setMaxBoostBasisPoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum RewardRouterV2.VotingPowerType", - "name": "_votingPowerType", - "type": "uint8" - } - ], - "name": "setVotingPowerType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "signalTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "stakeEsGmx", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "stakeGmx", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakedGlpTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakedGmxTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_glpAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "unstakeAndRedeemGlp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_glpAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minOut", - "type": "uint256" - }, - { - "internalType": "address payable", - "name": "_receiver", - "type": "address" - } - ], - "name": "unstakeAndRedeemGlpETH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "unstakeEsGmx", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "unstakeGmx", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "votingPowerType", - "outputs": [ - { - "internalType": "enum RewardRouterV2.VotingPowerType", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "weth", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/RewardRouter.ts b/sdk/src/abis/RewardRouter.ts new file mode 100644 index 0000000000..c4eee74383 --- /dev/null +++ b/sdk/src/abis/RewardRouter.ts @@ -0,0 +1,458 @@ +export default [ + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "StakeGlp", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "StakeGmx", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "UnstakeGlp", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "UnstakeGmx", + type: "event", + }, + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_sender", type: "address" }], + name: "acceptTransfer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_accounts", type: "address[]" }], + name: "batchCompoundForAccounts", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_accounts", type: "address[]" }], + name: "batchRestakeForAccounts", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "_accounts", type: "address[]" }, + { internalType: "uint256[]", name: "_amounts", type: "uint256[]" }, + ], + name: "batchStakeGmxForAccounts", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "bnGmx", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "bonusGmxTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "claim", outputs: [], stateMutability: "nonpayable", type: "function" }, + { inputs: [], name: "claimEsGmx", outputs: [], stateMutability: "nonpayable", type: "function" }, + { inputs: [], name: "claimFees", outputs: [], stateMutability: "nonpayable", type: "function" }, + { inputs: [], name: "compound", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [], + name: "esGmx", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "extendedGmxTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "feeGlpTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "feeGmxTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glp", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glpManager", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glpVester", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gmx", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gmxVester", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "govToken", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bool", name: "_shouldClaimGmx", type: "bool" }, + { internalType: "bool", name: "_shouldStakeGmx", type: "bool" }, + { internalType: "bool", name: "_shouldClaimEsGmx", type: "bool" }, + { internalType: "bool", name: "_shouldStakeEsGmx", type: "bool" }, + { internalType: "bool", name: "_shouldStakeMultiplierPoints", type: "bool" }, + { internalType: "bool", name: "_shouldClaimWeth", type: "bool" }, + { internalType: "bool", name: "_shouldConvertWethToEth", type: "bool" }, + ], + name: "handleRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_gmxReceiver", type: "address" }, + { internalType: "bool", name: "_shouldClaimGmx", type: "bool" }, + { internalType: "bool", name: "_shouldStakeGmx", type: "bool" }, + { internalType: "bool", name: "_shouldClaimEsGmx", type: "bool" }, + { internalType: "bool", name: "_shouldStakeEsGmx", type: "bool" }, + { internalType: "bool", name: "_shouldStakeMultiplierPoints", type: "bool" }, + { internalType: "bool", name: "_shouldClaimWeth", type: "bool" }, + { internalType: "bool", name: "_shouldConvertWethToEth", type: "bool" }, + ], + name: "handleRewardsV2", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "inRestakingMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inStrictTransferMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "weth", type: "address" }, + { internalType: "address", name: "gmx", type: "address" }, + { internalType: "address", name: "esGmx", type: "address" }, + { internalType: "address", name: "bnGmx", type: "address" }, + { internalType: "address", name: "glp", type: "address" }, + { internalType: "address", name: "stakedGmxTracker", type: "address" }, + { internalType: "address", name: "bonusGmxTracker", type: "address" }, + { internalType: "address", name: "extendedGmxTracker", type: "address" }, + { internalType: "address", name: "feeGmxTracker", type: "address" }, + { internalType: "address", name: "feeGlpTracker", type: "address" }, + { internalType: "address", name: "stakedGlpTracker", type: "address" }, + { internalType: "address", name: "glpManager", type: "address" }, + { internalType: "address", name: "gmxVester", type: "address" }, + { internalType: "address", name: "glpVester", type: "address" }, + { internalType: "address", name: "externalHandler", type: "address" }, + { internalType: "address", name: "govToken", type: "address" }, + ], + internalType: "struct RewardRouterV2.InitializeParams", + name: "_initializeParams", + type: "tuple", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + name: "makeExternalCalls", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "maxBoostBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "uint256", name: "_minUsdg", type: "uint256" }, + { internalType: "uint256", name: "_minGlp", type: "uint256" }, + ], + name: "mintAndStakeGlp", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_minUsdg", type: "uint256" }, + { internalType: "uint256", name: "_minGlp", type: "uint256" }, + ], + name: "mintAndStakeGlpETH", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "pendingReceivers", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_govToken", type: "address" }], + name: "setGovToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inRestakingMode", type: "bool" }], + name: "setInRestakingMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inStrictTransferMode", type: "bool" }], + name: "setInStrictTransferMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxBoostBasisPoints", type: "uint256" }], + name: "setMaxBoostBasisPoints", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "enum RewardRouterV2.VotingPowerType", name: "_votingPowerType", type: "uint8" }], + name: "setVotingPowerType", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_receiver", type: "address" }], + name: "signalTransfer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }], + name: "stakeEsGmx", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }], + name: "stakeGmx", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "stakedGlpTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stakedGmxTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "uint256", name: "_glpAmount", type: "uint256" }, + { internalType: "uint256", name: "_minOut", type: "uint256" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "unstakeAndRedeemGlp", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_glpAmount", type: "uint256" }, + { internalType: "uint256", name: "_minOut", type: "uint256" }, + { internalType: "address payable", name: "_receiver", type: "address" }, + ], + name: "unstakeAndRedeemGlpETH", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }], + name: "unstakeEsGmx", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }], + name: "unstakeGmx", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "votingPowerType", + outputs: [{ internalType: "enum RewardRouterV2.VotingPowerType", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "weth", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { stateMutability: "payable", type: "receive" }, +] as const; diff --git a/sdk/src/abis/RewardTracker.json b/sdk/src/abis/RewardTracker.json deleted file mode 100644 index e8ba86491d..0000000000 --- a/sdk/src/abis/RewardTracker.json +++ /dev/null @@ -1,918 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "RewardTracker", - "sourceName": "contracts/staking/RewardTracker.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Claim", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "allowances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "averageStakedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "balances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "claimForAccount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "claimable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "claimableReward", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "cumulativeRewardPerToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "cumulativeRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "depositBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "distributor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateClaimingMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateStakingMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateTransferMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_depositTokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "_distributor", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isDepositToken", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isHandler", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "previousCumulatedRewardPerToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_depositToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isDepositToken", - "type": "bool" - } - ], - "name": "setDepositToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateClaimingMode", - "type": "bool" - } - ], - "name": "setInPrivateClaimingMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateStakingMode", - "type": "bool" - } - ], - "name": "setInPrivateStakingMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateTransferMode", - "type": "bool" - } - ], - "name": "setInPrivateTransferMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_depositToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_fundingAccount", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_depositToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "stakeForAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "stakedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokensPerInterval", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "totalDepositSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_depositToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "unstake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_depositToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "unstakeForAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "updateRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/RewardTracker.ts b/sdk/src/abis/RewardTracker.ts new file mode 100644 index 0000000000..b7c62b7935 --- /dev/null +++ b/sdk/src/abis/RewardTracker.ts @@ -0,0 +1,413 @@ +export default [ + { + inputs: [ + { internalType: "string", name: "_name", type: "string" }, + { internalType: "string", name: "_symbol", type: "string" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "receiver", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "Claim", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_owner", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "allowances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "averageStakedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "balances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_receiver", type: "address" }], + name: "claim", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "claimForAccount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "claimable", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "claimableReward", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "cumulativeRewardPerToken", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "cumulativeRewards", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "depositBalances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "distributor", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateClaimingMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateStakingMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateTransferMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "_depositTokens", type: "address[]" }, + { internalType: "address", name: "_distributor", type: "address" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isDepositToken", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isHandler", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "previousCumulatedRewardPerToken", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardToken", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_depositToken", type: "address" }, + { internalType: "bool", name: "_isDepositToken", type: "bool" }, + ], + name: "setDepositToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateClaimingMode", type: "bool" }], + name: "setInPrivateClaimingMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateStakingMode", type: "bool" }], + name: "setInPrivateStakingMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateTransferMode", type: "bool" }], + name: "setInPrivateTransferMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_depositToken", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "stake", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_fundingAccount", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_depositToken", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "stakeForAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "stakedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "tokensPerInterval", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "totalDepositSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_recipient", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_sender", type: "address" }, + { internalType: "address", name: "_recipient", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_depositToken", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "unstake", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_depositToken", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "unstakeForAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { inputs: [], name: "updateRewards", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/SmartAccount.json b/sdk/src/abis/SmartAccount.json deleted file mode 100644 index bc707d8deb..0000000000 --- a/sdk/src/abis/SmartAccount.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "abi": [ - { - "name": "isValidSignature", - "inputs": [ - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "_signature", - "type": "bytes" - } - ], - "outputs": [ - { - "internalType": "bytes4", - "name": "magicValue", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/SmartAccount.ts b/sdk/src/abis/SmartAccount.ts new file mode 100644 index 0000000000..8b3798639a --- /dev/null +++ b/sdk/src/abis/SmartAccount.ts @@ -0,0 +1,12 @@ +export default [ + { + name: "isValidSignature", + inputs: [ + { internalType: "bytes32", name: "_hash", type: "bytes32" }, + { internalType: "bytes", name: "_signature", type: "bytes" }, + ], + outputs: [{ internalType: "bytes4", name: "magicValue", type: "bytes4" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/StBTC.json b/sdk/src/abis/StBTC.json deleted file mode 100644 index 326271bd23..0000000000 --- a/sdk/src/abis/StBTC.json +++ /dev/null @@ -1,1225 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "StBTC", - "sourceName": "contracts/stBTC.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "allowance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "needed", - "type": "uint256" - } - ], - "name": "ERC20InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "needed", - "type": "uint256" - } - ], - "name": "ERC20InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "approver", - "type": "address" - } - ], - "name": "ERC20InvalidApprover", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "ERC20InvalidReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "ERC20InvalidSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "ERC20InvalidSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxMint", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxRedeem", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxWithdraw", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NoRewards", - "type": "error" - }, - { - "inputs": [], - "name": "NotFeeReceiver", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "inputs": [], - "name": "ValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroShares", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Harvest", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "reward", - "type": "uint256" - } - ], - "name": "RewardAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "asset", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "assetsPerShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "convertToAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "convertToShares", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "directDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "earned", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "feeReceiver", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "harvest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_asset", - "type": "address" - }, - { - "internalType": "address", - "name": "_initialOwner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lastTimeRewardApplicable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastUpdateTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxMint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "maxRedeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "maxWithdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "notifyRewardAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "periodFinish", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "previewDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "previewMint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "previewRedeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "previewWithdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "redeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "rewardPerToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardPerTokenPaid", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardPerTokenStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newFeeReceiver", - "type": "address" - } - ], - "name": "setFeeReceiver", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalStaked", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "withdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/StBTC.ts b/sdk/src/abis/StBTC.ts new file mode 100644 index 0000000000..a1041c6443 --- /dev/null +++ b/sdk/src/abis/StBTC.ts @@ -0,0 +1,511 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "allowance", type: "uint256" }, + { internalType: "uint256", name: "needed", type: "uint256" }, + ], + name: "ERC20InsufficientAllowance", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "sender", type: "address" }, + { internalType: "uint256", name: "balance", type: "uint256" }, + { internalType: "uint256", name: "needed", type: "uint256" }, + ], + name: "ERC20InsufficientBalance", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "approver", type: "address" }], + name: "ERC20InvalidApprover", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "receiver", type: "address" }], + name: "ERC20InvalidReceiver", + type: "error", + }, + { inputs: [{ internalType: "address", name: "sender", type: "address" }], name: "ERC20InvalidSender", type: "error" }, + { + inputs: [{ internalType: "address", name: "spender", type: "address" }], + name: "ERC20InvalidSpender", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "assets", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + name: "ERC4626ExceededMaxDeposit", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "shares", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + name: "ERC4626ExceededMaxMint", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "uint256", name: "shares", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + name: "ERC4626ExceededMaxRedeem", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "uint256", name: "assets", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + name: "ERC4626ExceededMaxWithdraw", + type: "error", + }, + { inputs: [], name: "InvalidInitialization", type: "error" }, + { inputs: [], name: "NoRewards", type: "error" }, + { inputs: [], name: "NotFeeReceiver", type: "error" }, + { inputs: [], name: "NotInitializing", type: "error" }, + { inputs: [{ internalType: "address", name: "owner", type: "address" }], name: "OwnableInvalidOwner", type: "error" }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "OwnableUnauthorizedAccount", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "SafeERC20FailedOperation", + type: "error", + }, + { inputs: [], name: "ValueMismatch", type: "error" }, + { inputs: [], name: "ZeroAddress", type: "error" }, + { inputs: [], name: "ZeroShares", type: "error" }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: false, internalType: "uint256", name: "assets", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "shares", type: "uint256" }, + ], + name: "Deposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "caller", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Harvest", + type: "event", + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "previousOwner", type: "address" }, + { indexed: true, internalType: "address", name: "newOwner", type: "address" }, + ], + name: "OwnershipTransferStarted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "previousOwner", type: "address" }, + { indexed: true, internalType: "address", name: "newOwner", type: "address" }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: "uint256", name: "reward", type: "uint256" }], + name: "RewardAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: true, internalType: "address", name: "receiver", type: "address" }, + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: false, internalType: "uint256", name: "assets", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "shares", type: "uint256" }, + ], + name: "Withdraw", + type: "event", + }, + { inputs: [], name: "acceptOwnership", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "asset", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "assetsPerShare", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }], + name: "convertToAssets", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }], + name: "convertToShares", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "assets", type: "uint256" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "deposit", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "assets", type: "uint256" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "directDeposit", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "earned", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "feeReceiver", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "harvest", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [ + { internalType: "contract IERC20", name: "_asset", type: "address" }, + { internalType: "address", name: "_initialOwner", type: "address" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "lastTimeRewardApplicable", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastUpdateTime", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxDeposit", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxMint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "maxRedeem", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "maxWithdraw", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "shares", type: "uint256" }, + { internalType: "address", name: "receiver", type: "address" }, + ], + name: "mint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "notifyRewardAmount", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [], + name: "owner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingOwner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "periodFinish", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }], + name: "previewDeposit", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }], + name: "previewMint", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }], + name: "previewRedeem", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }], + name: "previewWithdraw", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "shares", type: "uint256" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "owner", type: "address" }, + ], + name: "redeem", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [], + name: "rewardPerToken", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardPerTokenPaid", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardPerTokenStored", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardRate", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewards", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_newFeeReceiver", type: "address" }], + name: "setFeeReceiver", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalAssets", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalStaked", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "newOwner", type: "address" }], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "assets", type: "uint256" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "owner", type: "address" }, + ], + name: "withdraw", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/SubaccountApproval.json b/sdk/src/abis/SubaccountApproval.json deleted file mode 100644 index 13bbad2fae..0000000000 --- a/sdk/src/abis/SubaccountApproval.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "abi": [ - { - "type": "tuple", - "components": [ - { "name": "subaccount", "type": "address" }, - { "name": "shouldAdd", "type": "bool" }, - { "name": "expiresAt", "type": "uint256" }, - { "name": "maxAllowedCount", "type": "uint256" }, - { "name": "actionType", "type": "bytes32" }, - { "name": "nonce", "type": "uint256" }, - { "name": "deadline", "type": "uint256" }, - { "name": "signature", "type": "bytes" } - ] - } - ] -} diff --git a/sdk/src/abis/SubaccountApproval.ts b/sdk/src/abis/SubaccountApproval.ts new file mode 100644 index 0000000000..df5b96ad44 --- /dev/null +++ b/sdk/src/abis/SubaccountApproval.ts @@ -0,0 +1,15 @@ +export default [ + { + type: "tuple", + components: [ + { name: "subaccount", type: "address" }, + { name: "shouldAdd", type: "bool" }, + { name: "expiresAt", type: "uint256" }, + { name: "maxAllowedCount", type: "uint256" }, + { name: "actionType", type: "bytes32" }, + { name: "nonce", type: "uint256" }, + { name: "deadline", type: "uint256" }, + { name: "signature", type: "bytes" }, + ], + }, +] as const; diff --git a/sdk/src/abis/SubaccountGelatoRelayRouter.json b/sdk/src/abis/SubaccountGelatoRelayRouter.json deleted file mode 100644 index a1ed16bf23..0000000000 --- a/sdk/src/abis/SubaccountGelatoRelayRouter.json +++ /dev/null @@ -1,2019 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract Router", - "name": "_router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOracle", - "name": "_oracle", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "_orderHandler", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "_orderVault", - "type": "address" - }, - { - "internalType": "contract ISwapHandler", - "name": "_swapHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "_externalHandler", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "DeadlinePassed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requiredRelayFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "availableFeeAmount", - "type": "uint256" - } - ], - "name": "InsufficientRelayFee", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "name": "InvalidDestinationChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sendTokensLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sendAmountsLength", - "type": "uint256" - } - ], - "name": "InvalidExternalCalls", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedSpender", - "type": "address" - } - ], - "name": "InvalidPermitSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "name": "InvalidSrcChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "InvalidUserDigest", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeeUsd", - "type": "uint256" - } - ], - "name": "MaxRelayFeeSwapForSubaccountExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NonEmptyExternalCallsForSubaccountOrder", - "type": "error" - }, - { - "inputs": [], - "name": "RelayEmptyBatch", - "type": "error" - }, - { - "inputs": [], - "name": "TokenPermitsNotAllowedForMultichain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnexpectedRelayFeeToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedFeeToken", - "type": "address" - } - ], - "name": "UnsupportedRelayFeeToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", - "name": "createOrderParamsList", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams[]", - "name": "updateOrderParamsList", - "type": "tuple[]" - }, - { - "internalType": "bytes32[]", - "name": "cancelOrderKeys", - "type": "bytes32[]" - } - ], - "internalType": "struct IRelayUtils.BatchParams", - "name": "params", - "type": "tuple" - } - ], - "name": "batch", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createOrder", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "digests", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ - { - "internalType": "contract IOracle", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - } - ], - "name": "removeSubaccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "subaccountApprovalNonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "swapHandler", - "outputs": [ - { - "internalType": "contract ISwapHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "providers", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "internalType": "struct OracleUtils.SetPricesParams", - "name": "oracleParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "sendTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "sendAmounts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.ExternalCalls", - "name": "externalCalls", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "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": "address", - "name": "token", - "type": "address" - } - ], - "internalType": "struct IRelayUtils.TokenPermit[]", - "name": "tokenPermits", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "feeSwapPath", - "type": "address[]" - } - ], - "internalType": "struct IRelayUtils.FeeParams", - "name": "fee", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.RelayParams", - "name": "relayParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bool", - "name": "shouldAdd", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "desChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct SubaccountApproval", - "name": "subaccountApproval", - "type": "tuple" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFeeIncrease", - "type": "uint256" - } - ], - "internalType": "struct IRelayUtils.UpdateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "updateOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/SubaccountGelatoRelayRouter.ts b/sdk/src/abis/SubaccountGelatoRelayRouter.ts new file mode 100644 index 0000000000..1ec42aecc5 --- /dev/null +++ b/sdk/src/abis/SubaccountGelatoRelayRouter.ts @@ -0,0 +1,775 @@ +export default [ + { + inputs: [ + { internalType: "contract Router", name: "_router", type: "address" }, + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract IOracle", name: "_oracle", type: "address" }, + { internalType: "contract IOrderHandler", name: "_orderHandler", type: "address" }, + { internalType: "contract OrderVault", name: "_orderVault", type: "address" }, + { internalType: "contract ISwapHandler", name: "_swapHandler", type: "address" }, + { internalType: "contract IExternalHandler", name: "_externalHandler", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "uint256", name: "currentTimestamp", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + ], + name: "DeadlinePassed", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "requiredRelayFee", type: "uint256" }, + { internalType: "uint256", name: "availableFeeAmount", type: "uint256" }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "desChainId", type: "uint256" }], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { internalType: "uint256", name: "sendTokensLength", type: "uint256" }, + { internalType: "uint256", name: "sendAmountsLength", type: "uint256" }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "address", name: "expectedSpender", type: "address" }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [{ internalType: "uint256", name: "srcChainId", type: "uint256" }], + name: "InvalidSrcChainId", + type: "error", + }, + { inputs: [{ internalType: "bytes32", name: "digest", type: "bytes32" }], name: "InvalidUserDigest", type: "error" }, + { + inputs: [ + { internalType: "uint256", name: "feeUsd", type: "uint256" }, + { internalType: "uint256", name: "maxFeeUsd", type: "uint256" }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { inputs: [], name: "NonEmptyExternalCallsForSubaccountOrder", type: "error" }, + { inputs: [], name: "RelayEmptyBatch", type: "error" }, + { inputs: [], name: "TokenPermitsNotAllowedForMultichain", type: "error" }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "address", name: "expectedFeeToken", type: "address" }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams[]", + name: "createOrderParamsList", + type: "tuple[]", + }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams[]", + name: "updateOrderParamsList", + type: "tuple[]", + }, + { internalType: "bytes32[]", name: "cancelOrderKeys", type: "bytes32[]" }, + ], + internalType: "struct IRelayUtils.BatchParams", + name: "params", + type: "tuple", + }, + ], + name: "batch", + outputs: [{ internalType: "bytes32[]", name: "", type: "bytes32[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "cancelOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "digests", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [{ internalType: "contract IExternalHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [{ internalType: "contract IOracle", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + ], + name: "removeSubaccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "subaccountApprovalNonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [{ internalType: "contract ISwapHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { internalType: "address[]", name: "tokens", type: "address[]" }, + { internalType: "address[]", name: "providers", type: "address[]" }, + { internalType: "bytes[]", name: "data", type: "bytes[]" }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { internalType: "address[]", name: "sendTokens", type: "address[]" }, + { internalType: "uint256[]", name: "sendAmounts", type: "uint256[]" }, + { internalType: "address[]", name: "externalCallTargets", type: "address[]" }, + { internalType: "bytes[]", name: "externalCallDataList", type: "bytes[]" }, + { internalType: "address[]", name: "refundTokens", type: "address[]" }, + { internalType: "address[]", name: "refundReceivers", type: "address[]" }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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: "address", name: "token", type: "address" }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { internalType: "address", name: "feeToken", type: "address" }, + { internalType: "uint256", name: "feeAmount", type: "uint256" }, + { internalType: "address[]", name: "feeSwapPath", type: "address[]" }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { internalType: "uint256", name: "userNonce", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bool", name: "shouldAdd", type: "bool" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "uint256", name: "desChainId", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + { internalType: "bytes", name: "signature", type: "bytes" }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "subaccount", type: "address" }, + { + components: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "uint256", name: "executionFeeIncrease", type: "uint256" }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/SubaccountRouter.json b/sdk/src/abis/SubaccountRouter.json deleted file mode 100644 index 8f55ca8aef..0000000000 --- a/sdk/src/abis/SubaccountRouter.json +++ /dev/null @@ -1,602 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract Router", - "name": "_router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract IOrderHandler", - "name": "_orderHandler", - "type": "address" - }, - { - "internalType": "contract OrderVault", - "name": "_orderVault", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "DisabledFeature", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyOrder", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "InvalidNativeTokenSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "name": "TokenTransferReverted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - } - ], - "name": "addSubaccount", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct IBaseOrderUtils.CreateOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createOrder", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "orderHandler", - "outputs": [ - { - "internalType": "contract IOrderHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "orderVault", - "outputs": [ - { - "internalType": "contract OrderVault", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - } - ], - "name": "removeSubaccount", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "integrationId", - "type": "bytes32" - } - ], - "name": "setIntegrationId", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "maxAllowedCount", - "type": "uint256" - } - ], - "name": "setMaxAllowedSubaccountActionCount", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setSubaccountAutoTopUpAmount", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "subaccount", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "actionType", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "expiresAt", - "type": "uint256" - } - ], - "name": "setSubaccountExpiresAt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - } - ], - "name": "updateOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} diff --git a/sdk/src/abis/SubaccountRouter.ts b/sdk/src/abis/SubaccountRouter.ts new file mode 100644 index 0000000000..a8bdd21c6b --- /dev/null +++ b/sdk/src/abis/SubaccountRouter.ts @@ -0,0 +1,257 @@ +export default [ + { + inputs: [ + { internalType: "contract Router", name: "_router", type: "address" }, + { internalType: "contract RoleStore", name: "_roleStore", type: "address" }, + { internalType: "contract DataStore", name: "_dataStore", type: "address" }, + { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" }, + { internalType: "contract IOrderHandler", name: "_orderHandler", type: "address" }, + { internalType: "contract OrderVault", name: "_orderVault", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], name: "DisabledFeature", type: "error" }, + { inputs: [], name: "EmptyHoldingAddress", type: "error" }, + { inputs: [], name: "EmptyOrder", type: "error" }, + { inputs: [], name: "EmptyReceiver", type: "error" }, + { + inputs: [{ internalType: "address", name: "token", type: "address" }], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [{ internalType: "address", name: "msgSender", type: "address" }], + name: "InvalidNativeTokenSender", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "TokenTransferError", + type: "error", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "reason", type: "string" }, + { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [{ internalType: "address", name: "subaccount", type: "address" }], + name: "addSubaccount", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "key", type: "bytes32" }], + name: "cancelOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { + components: [ + { + components: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "bytes32[]", name: "dataList", type: "bytes32[]" }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [{ internalType: "contract DataStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [{ internalType: "contract IOrderHandler", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [{ internalType: "contract OrderVault", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "subaccount", type: "address" }], + name: "removeSubaccount", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "contract Router", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bytes32", name: "integrationId", type: "bytes32" }, + ], + name: "setIntegrationId", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "maxAllowedCount", type: "uint256" }, + ], + name: "setMaxAllowedSubaccountActionCount", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "setSubaccountAutoTopUpAmount", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "subaccount", type: "address" }, + { internalType: "bytes32", name: "actionType", type: "bytes32" }, + { internalType: "uint256", name: "expiresAt", type: "uint256" }, + ], + name: "setSubaccountExpiresAt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "key", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { stateMutability: "payable", type: "receive" }, +] as const; diff --git a/sdk/src/abis/SyntheticsReader.json b/sdk/src/abis/SyntheticsReader.json deleted file mode 100644 index 762bafb2cc..0000000000 --- a/sdk/src/abis/SyntheticsReader.json +++ /dev/null @@ -1,4905 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountOrders", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "orderKey", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct Order.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct Order.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isFrozen", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - } - ], - "internalType": "struct Order.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct Order.Props", - "name": "order", - "type": "tuple" - } - ], - "internalType": "struct ReaderUtils.OrderInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract IReferralStorage", - "name": "referralStorage", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices[]", - "name": "marketPrices", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountPositionInfoList", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "positionKey", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - } - ], - "internalType": "struct Position.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sizeInTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "pendingImpactAmount", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "borrowingFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "longTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "increasedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "decreasedAtTime", - "type": "uint256" - } - ], - "internalType": "struct Position.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - } - ], - "internalType": "struct Position.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct Position.Props", - "name": "position", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "affiliate", - "type": "address" - }, - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "uint256", - "name": "totalRebateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "affiliateRewardFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "adjustedAffiliateRewardFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalRebateAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "affiliateRewardAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionReferralFees", - "name": "referral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "traderTier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionProFees", - "name": "pro", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fundingFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestFundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestLongTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestShortTokenClaimableFundingAmountPerSize", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionFundingFees", - "name": "funding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "borrowingFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeAmountForFeeReceiver", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionBorrowingFees", - "name": "borrowing", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "uiFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "uiFeeAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionUiFees", - "name": "ui", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeAmountForFeeReceiver", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionLiquidationFees", - "name": "liquidation", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "collateralTokenPrice", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "positionFeeFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeReceiverAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCostAmountExcludingFunding", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCostAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalDiscountAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionFees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "int256", - "name": "priceImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "executionPrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "balanceWasImproved", - "type": "bool" - }, - { - "internalType": "int256", - "name": "proportionalPendingImpactUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "totalImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "priceImpactDiffUsd", - "type": "uint256" - } - ], - "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", - "name": "executionPriceResult", - "type": "tuple" - }, - { - "internalType": "int256", - "name": "basePnlUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "uncappedBasePnlUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "pnlAfterPriceImpactUsd", - "type": "int256" - } - ], - "internalType": "struct ReaderPositionUtils.PositionInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountPositions", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - } - ], - "internalType": "struct Position.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sizeInTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "pendingImpactAmount", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "borrowingFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "longTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "increasedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "decreasedAtTime", - "type": "uint256" - } - ], - "internalType": "struct Position.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - } - ], - "internalType": "struct Position.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct Position.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - } - ], - "name": "getAdlState", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getDeposit", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct Deposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct Deposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct Deposit.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct Deposit.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "longTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "enum ISwapPricingUtils.SwapPricingType", - "name": "swapPricingType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "includeVirtualInventoryImpact", - "type": "bool" - } - ], - "name": "getDepositAmountOut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "marketKey", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "positionSizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionSizeInTokens", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "sizeDeltaUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "pendingImpactAmount", - "type": "int256" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - } - ], - "name": "getExecutionPrice", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "priceImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "executionPrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "balanceWasImproved", - "type": "bool" - }, - { - "internalType": "int256", - "name": "proportionalPendingImpactUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "totalImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "priceImpactDiffUsd", - "type": "uint256" - } - ], - "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "key", - "type": "address" - } - ], - "name": "getMarket", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - } - ], - "name": "getMarketBySalt", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "address", - "name": "marketKey", - "type": "address" - } - ], - "name": "getMarketInfo", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "borrowingFactorPerSecondForLongs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFactorPerSecondForShorts", - "type": "uint256" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "fundingFeeAmountPerSize", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "claimableFundingAmountPerSize", - "type": "tuple" - } - ], - "internalType": "struct ReaderUtils.BaseFundingValues", - "name": "baseFunding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "longsPayShorts", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "fundingFactorPerSecond", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "nextSavedFundingFactorPerSecond", - "type": "int256" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "fundingFeeAmountPerSizeDelta", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "claimableFundingAmountPerSizeDelta", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.GetNextFundingAmountPerSizeResult", - "name": "nextFunding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "virtualPoolAmountForLongToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "virtualPoolAmountForShortToken", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "virtualInventoryForPositions", - "type": "int256" - } - ], - "internalType": "struct ReaderUtils.VirtualInventory", - "name": "virtualInventory", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "isDisabled", - "type": "bool" - } - ], - "internalType": "struct ReaderUtils.MarketInfo", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices[]", - "name": "marketPricesList", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getMarketInfoList", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "borrowingFactorPerSecondForLongs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFactorPerSecondForShorts", - "type": "uint256" - }, - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "fundingFeeAmountPerSize", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "claimableFundingAmountPerSize", - "type": "tuple" - } - ], - "internalType": "struct ReaderUtils.BaseFundingValues", - "name": "baseFunding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "longsPayShorts", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "fundingFactorPerSecond", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "nextSavedFundingFactorPerSecond", - "type": "int256" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "fundingFeeAmountPerSizeDelta", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "long", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "longToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortToken", - "type": "uint256" - } - ], - "internalType": "struct MarketUtils.CollateralType", - "name": "short", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.PositionType", - "name": "claimableFundingAmountPerSizeDelta", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.GetNextFundingAmountPerSizeResult", - "name": "nextFunding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "virtualPoolAmountForLongToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "virtualPoolAmountForShortToken", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "virtualInventoryForPositions", - "type": "int256" - } - ], - "internalType": "struct ReaderUtils.VirtualInventory", - "name": "virtualInventory", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "isDisabled", - "type": "bool" - } - ], - "internalType": "struct ReaderUtils.MarketInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "pnlFactorType", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getMarketTokenPrice", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "components": [ - { - "internalType": "int256", - "name": "poolValue", - "type": "int256" - }, - { - "internalType": "int256", - "name": "longPnl", - "type": "int256" - }, - { - "internalType": "int256", - "name": "shortPnl", - "type": "int256" - }, - { - "internalType": "int256", - "name": "netPnl", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "longTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "longTokenUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalBorrowingFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeePoolFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "impactPoolAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lentImpactPoolAmount", - "type": "uint256" - } - ], - "internalType": "struct MarketPoolValueInfo.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getMarkets", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getNetPnl", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getOpenInterestWithPnl", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getOrder", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct Order.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct Order.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isFrozen", - "type": "bool" - }, - { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" - } - ], - "internalType": "struct Order.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct Order.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "getPendingPositionImpactPoolDistributionAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getPnl", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "marketAddress", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getPnlToPoolFactor", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getPosition", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - } - ], - "internalType": "struct Position.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sizeInTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "pendingImpactAmount", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "borrowingFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "longTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "increasedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "decreasedAtTime", - "type": "uint256" - } - ], - "internalType": "struct Position.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - } - ], - "internalType": "struct Position.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct Position.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract IReferralStorage", - "name": "referralStorage", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "positionKey", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "bool", - "name": "usePositionSizeAsSizeDeltaUsd", - "type": "bool" - } - ], - "name": "getPositionInfo", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "positionKey", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - } - ], - "internalType": "struct Position.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sizeInTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "pendingImpactAmount", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "borrowingFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "longTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "increasedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "decreasedAtTime", - "type": "uint256" - } - ], - "internalType": "struct Position.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - } - ], - "internalType": "struct Position.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct Position.Props", - "name": "position", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "affiliate", - "type": "address" - }, - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "uint256", - "name": "totalRebateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "affiliateRewardFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "adjustedAffiliateRewardFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalRebateAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "affiliateRewardAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionReferralFees", - "name": "referral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "traderTier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionProFees", - "name": "pro", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fundingFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestFundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestLongTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestShortTokenClaimableFundingAmountPerSize", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionFundingFees", - "name": "funding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "borrowingFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeAmountForFeeReceiver", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionBorrowingFees", - "name": "borrowing", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "uiFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "uiFeeAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionUiFees", - "name": "ui", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeAmountForFeeReceiver", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionLiquidationFees", - "name": "liquidation", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "collateralTokenPrice", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "positionFeeFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeReceiverAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCostAmountExcludingFunding", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCostAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalDiscountAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionFees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "int256", - "name": "priceImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "executionPrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "balanceWasImproved", - "type": "bool" - }, - { - "internalType": "int256", - "name": "proportionalPendingImpactUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "totalImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "priceImpactDiffUsd", - "type": "uint256" - } - ], - "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", - "name": "executionPriceResult", - "type": "tuple" - }, - { - "internalType": "int256", - "name": "basePnlUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "uncappedBasePnlUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "pnlAfterPriceImpactUsd", - "type": "int256" - } - ], - "internalType": "struct ReaderPositionUtils.PositionInfo", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract IReferralStorage", - "name": "referralStorage", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "positionKeys", - "type": "bytes32[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices[]", - "name": "prices", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - } - ], - "name": "getPositionInfoList", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "positionKey", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - } - ], - "internalType": "struct Position.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "sizeInUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sizeInTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "pendingImpactAmount", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "borrowingFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "longTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "increasedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "decreasedAtTime", - "type": "uint256" - } - ], - "internalType": "struct Position.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isLong", - "type": "bool" - } - ], - "internalType": "struct Position.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct Position.Props", - "name": "position", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "referralCode", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "affiliate", - "type": "address" - }, - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "uint256", - "name": "totalRebateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "affiliateRewardFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "adjustedAffiliateRewardFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalRebateAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "affiliateRewardAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionReferralFees", - "name": "referral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "traderTier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "traderDiscountAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionProFees", - "name": "pro", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fundingFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimableShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestFundingFeeAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestLongTokenClaimableFundingAmountPerSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "latestShortTokenClaimableFundingAmountPerSize", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionFundingFees", - "name": "funding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "borrowingFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowingFeeAmountForFeeReceiver", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionBorrowingFees", - "name": "borrowing", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "uiFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "uiFeeAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionUiFees", - "name": "ui", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationFeeAmountForFeeReceiver", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionLiquidationFees", - "name": "liquidation", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "collateralTokenPrice", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "positionFeeFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeReceiverAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCostAmountExcludingFunding", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCostAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalDiscountAmount", - "type": "uint256" - } - ], - "internalType": "struct PositionPricingUtils.PositionFees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "int256", - "name": "priceImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "executionPrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "balanceWasImproved", - "type": "bool" - }, - { - "internalType": "int256", - "name": "proportionalPendingImpactUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "totalImpactUsd", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "priceImpactDiffUsd", - "type": "uint256" - } - ], - "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", - "name": "executionPriceResult", - "type": "tuple" - }, - { - "internalType": "int256", - "name": "basePnlUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "uncappedBasePnlUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "pnlAfterPriceImpactUsd", - "type": "int256" - } - ], - "internalType": "struct ReaderPositionUtils.PositionInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "positionKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - } - ], - "name": "getPositionPnlUsd", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getShift", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct Shift.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct Shift.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct Shift.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "address", - "name": "tokenIn", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - } - ], - "name": "getSwapAmountOut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "feeReceiverAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeAmountForPool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountAfterFees", - "type": "uint256" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "uiFeeReceiverFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "uiFeeAmount", - "type": "uint256" - } - ], - "internalType": "struct SwapPricingUtils.SwapFees", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "marketKey", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "tokenInPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "tokenOutPrice", - "type": "tuple" - } - ], - "name": "getSwapPriceImpact", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getWithdrawal", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct Withdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "srcChainId", - "type": "uint256" - } - ], - "internalType": "struct Withdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct Withdrawal.Flags", - "name": "flags", - "type": "tuple" - }, - { - "internalType": "bytes32[]", - "name": "_dataList", - "type": "bytes32[]" - } - ], - "internalType": "struct Withdrawal.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "enum ISwapPricingUtils.SwapPricingType", - "name": "swapPricingType", - "type": "uint8" - } - ], - "name": "getWithdrawalAmountOut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "contract IReferralStorage", - "name": "referralStorage", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "positionKey", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address", - "name": "marketToken", - "type": "address" - }, - { - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Market.Props", - "name": "market", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - } - ], - "internalType": "struct MarketUtils.MarketPrices", - "name": "prices", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "shouldValidateMinCollateralUsd", - "type": "bool" - }, - { - "internalType": "bool", - "name": "forLiquidation", - "type": "bool" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "components": [ - { - "internalType": "int256", - "name": "remainingCollateralUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "minCollateralUsd", - "type": "int256" - }, - { - "internalType": "int256", - "name": "minCollateralUsdForLeverage", - "type": "int256" - } - ], - "internalType": "struct PositionUtils.IsPositionLiquidatableInfo", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/SyntheticsReader.ts b/sdk/src/abis/SyntheticsReader.ts new file mode 100644 index 0000000000..ba99d18a16 --- /dev/null +++ b/sdk/src/abis/SyntheticsReader.ts @@ -0,0 +1,2179 @@ +export default [ + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getAccountOrders", + outputs: [ + { + components: [ + { internalType: "bytes32", name: "orderKey", type: "bytes32" }, + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct Order.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { + internalType: "enum Order.DecreasePositionSwapType", + name: "decreasePositionSwapType", + type: "uint8", + }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct Order.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isFrozen", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + ], + internalType: "struct Order.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct Order.Props", + name: "order", + type: "tuple", + }, + ], + internalType: "struct ReaderUtils.OrderInfo[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract IReferralStorage", name: "referralStorage", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address[]", name: "markets", type: "address[]" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices[]", + name: "marketPrices", + type: "tuple[]", + }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getAccountPositionInfoList", + outputs: [ + { + components: [ + { internalType: "bytes32", name: "positionKey", type: "bytes32" }, + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "collateralToken", type: "address" }, + ], + internalType: "struct Position.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "sizeInTokens", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + { internalType: "int256", name: "pendingImpactAmount", type: "int256" }, + { internalType: "uint256", name: "borrowingFactor", type: "uint256" }, + { internalType: "uint256", name: "fundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "longTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "shortTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "increasedAtTime", type: "uint256" }, + { internalType: "uint256", name: "decreasedAtTime", type: "uint256" }, + ], + internalType: "struct Position.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "isLong", type: "bool" }], + internalType: "struct Position.Flags", + name: "flags", + type: "tuple", + }, + ], + internalType: "struct Position.Props", + name: "position", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "address", name: "affiliate", type: "address" }, + { internalType: "address", name: "trader", type: "address" }, + { internalType: "uint256", name: "totalRebateFactor", type: "uint256" }, + { internalType: "uint256", name: "affiliateRewardFactor", type: "uint256" }, + { internalType: "uint256", name: "adjustedAffiliateRewardFactor", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountFactor", type: "uint256" }, + { internalType: "uint256", name: "totalRebateAmount", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountAmount", type: "uint256" }, + { internalType: "uint256", name: "affiliateRewardAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionReferralFees", + name: "referral", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "traderTier", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountFactor", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionProFees", + name: "pro", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "fundingFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "claimableLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "claimableShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "latestFundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "latestLongTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "latestShortTokenClaimableFundingAmountPerSize", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionFundingFees", + name: "funding", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "borrowingFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeAmountForFeeReceiver", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionBorrowingFees", + name: "borrowing", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "uint256", name: "uiFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "uiFeeAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionUiFees", + name: "ui", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeAmountForFeeReceiver", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionLiquidationFees", + name: "liquidation", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "collateralTokenPrice", + type: "tuple", + }, + { internalType: "uint256", name: "positionFeeFactor", type: "uint256" }, + { internalType: "uint256", name: "protocolFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "positionFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "feeReceiverAmount", type: "uint256" }, + { internalType: "uint256", name: "feeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "positionFeeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "positionFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "totalCostAmountExcludingFunding", type: "uint256" }, + { internalType: "uint256", name: "totalCostAmount", type: "uint256" }, + { internalType: "uint256", name: "totalDiscountAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionFees", + name: "fees", + type: "tuple", + }, + { + components: [ + { internalType: "int256", name: "priceImpactUsd", type: "int256" }, + { internalType: "uint256", name: "executionPrice", type: "uint256" }, + { internalType: "bool", name: "balanceWasImproved", type: "bool" }, + { internalType: "int256", name: "proportionalPendingImpactUsd", type: "int256" }, + { internalType: "int256", name: "totalImpactUsd", type: "int256" }, + { internalType: "uint256", name: "priceImpactDiffUsd", type: "uint256" }, + ], + internalType: "struct ReaderPricingUtils.ExecutionPriceResult", + name: "executionPriceResult", + type: "tuple", + }, + { internalType: "int256", name: "basePnlUsd", type: "int256" }, + { internalType: "int256", name: "uncappedBasePnlUsd", type: "int256" }, + { internalType: "int256", name: "pnlAfterPriceImpactUsd", type: "int256" }, + ], + internalType: "struct ReaderPositionUtils.PositionInfo[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getAccountPositions", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "collateralToken", type: "address" }, + ], + internalType: "struct Position.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "sizeInTokens", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + { internalType: "int256", name: "pendingImpactAmount", type: "int256" }, + { internalType: "uint256", name: "borrowingFactor", type: "uint256" }, + { internalType: "uint256", name: "fundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "longTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "shortTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "increasedAtTime", type: "uint256" }, + { internalType: "uint256", name: "decreasedAtTime", type: "uint256" }, + ], + internalType: "struct Position.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "isLong", type: "bool" }], + internalType: "struct Position.Flags", + name: "flags", + type: "tuple", + }, + ], + internalType: "struct Position.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "bool", name: "isLong", type: "bool" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + ], + name: "getAdlState", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "bool", name: "", type: "bool" }, + { internalType: "int256", name: "", type: "int256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getDeposit", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialLongToken", type: "address" }, + { internalType: "address", name: "initialShortToken", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct Deposit.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "initialLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "initialShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct Deposit.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }], + internalType: "struct Deposit.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct Deposit.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "uint256", name: "longTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "shortTokenAmount", type: "uint256" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "enum ISwapPricingUtils.SwapPricingType", name: "swapPricingType", type: "uint8" }, + { internalType: "bool", name: "includeVirtualInventoryImpact", type: "bool" }, + ], + name: "getDepositAmountOut", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "marketKey", type: "address" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "uint256", name: "positionSizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "positionSizeInTokens", type: "uint256" }, + { internalType: "int256", name: "sizeDeltaUsd", type: "int256" }, + { internalType: "int256", name: "pendingImpactAmount", type: "int256" }, + { internalType: "bool", name: "isLong", type: "bool" }, + ], + name: "getExecutionPrice", + outputs: [ + { + components: [ + { internalType: "int256", name: "priceImpactUsd", type: "int256" }, + { internalType: "uint256", name: "executionPrice", type: "uint256" }, + { internalType: "bool", name: "balanceWasImproved", type: "bool" }, + { internalType: "int256", name: "proportionalPendingImpactUsd", type: "int256" }, + { internalType: "int256", name: "totalImpactUsd", type: "int256" }, + { internalType: "uint256", name: "priceImpactDiffUsd", type: "uint256" }, + ], + internalType: "struct ReaderPricingUtils.ExecutionPriceResult", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "key", type: "address" }, + ], + name: "getMarket", + outputs: [ + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "salt", type: "bytes32" }, + ], + name: "getMarketBySalt", + outputs: [ + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "address", name: "marketKey", type: "address" }, + ], + name: "getMarketInfo", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { internalType: "uint256", name: "borrowingFactorPerSecondForLongs", type: "uint256" }, + { internalType: "uint256", name: "borrowingFactorPerSecondForShorts", type: "uint256" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "fundingFeeAmountPerSize", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "claimableFundingAmountPerSize", + type: "tuple", + }, + ], + internalType: "struct ReaderUtils.BaseFundingValues", + name: "baseFunding", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "longsPayShorts", type: "bool" }, + { internalType: "uint256", name: "fundingFactorPerSecond", type: "uint256" }, + { internalType: "int256", name: "nextSavedFundingFactorPerSecond", type: "int256" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "fundingFeeAmountPerSizeDelta", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "claimableFundingAmountPerSizeDelta", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.GetNextFundingAmountPerSizeResult", + name: "nextFunding", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "virtualPoolAmountForLongToken", type: "uint256" }, + { internalType: "uint256", name: "virtualPoolAmountForShortToken", type: "uint256" }, + { internalType: "int256", name: "virtualInventoryForPositions", type: "int256" }, + ], + internalType: "struct ReaderUtils.VirtualInventory", + name: "virtualInventory", + type: "tuple", + }, + { internalType: "bool", name: "isDisabled", type: "bool" }, + ], + internalType: "struct ReaderUtils.MarketInfo", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices[]", + name: "marketPricesList", + type: "tuple[]", + }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getMarketInfoList", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { internalType: "uint256", name: "borrowingFactorPerSecondForLongs", type: "uint256" }, + { internalType: "uint256", name: "borrowingFactorPerSecondForShorts", type: "uint256" }, + { + components: [ + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "fundingFeeAmountPerSize", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "claimableFundingAmountPerSize", + type: "tuple", + }, + ], + internalType: "struct ReaderUtils.BaseFundingValues", + name: "baseFunding", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "longsPayShorts", type: "bool" }, + { internalType: "uint256", name: "fundingFactorPerSecond", type: "uint256" }, + { internalType: "int256", name: "nextSavedFundingFactorPerSecond", type: "int256" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "fundingFeeAmountPerSizeDelta", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "long", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "longToken", type: "uint256" }, + { internalType: "uint256", name: "shortToken", type: "uint256" }, + ], + internalType: "struct MarketUtils.CollateralType", + name: "short", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.PositionType", + name: "claimableFundingAmountPerSizeDelta", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.GetNextFundingAmountPerSizeResult", + name: "nextFunding", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "virtualPoolAmountForLongToken", type: "uint256" }, + { internalType: "uint256", name: "virtualPoolAmountForShortToken", type: "uint256" }, + { internalType: "int256", name: "virtualInventoryForPositions", type: "int256" }, + ], + internalType: "struct ReaderUtils.VirtualInventory", + name: "virtualInventory", + type: "tuple", + }, + { internalType: "bool", name: "isDisabled", type: "bool" }, + ], + internalType: "struct ReaderUtils.MarketInfo[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + { internalType: "bytes32", name: "pnlFactorType", type: "bytes32" }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getMarketTokenPrice", + outputs: [ + { internalType: "int256", name: "", type: "int256" }, + { + components: [ + { internalType: "int256", name: "poolValue", type: "int256" }, + { internalType: "int256", name: "longPnl", type: "int256" }, + { internalType: "int256", name: "shortPnl", type: "int256" }, + { internalType: "int256", name: "netPnl", type: "int256" }, + { internalType: "uint256", name: "longTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "shortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "longTokenUsd", type: "uint256" }, + { internalType: "uint256", name: "shortTokenUsd", type: "uint256" }, + { internalType: "uint256", name: "totalBorrowingFees", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeePoolFactor", type: "uint256" }, + { internalType: "uint256", name: "impactPoolAmount", type: "uint256" }, + { internalType: "uint256", name: "lentImpactPoolAmount", type: "uint256" }, + ], + internalType: "struct MarketPoolValueInfo.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "uint256", name: "start", type: "uint256" }, + { internalType: "uint256", name: "end", type: "uint256" }, + ], + name: "getMarkets", + outputs: [ + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getNetPnl", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getOpenInterestWithPnl", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getOrder", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "cancellationReceiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "initialCollateralToken", type: "address" }, + { internalType: "address[]", name: "swapPath", type: "address[]" }, + ], + internalType: "struct Order.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "enum Order.OrderType", name: "orderType", type: "uint8" }, + { internalType: "enum Order.DecreasePositionSwapType", name: "decreasePositionSwapType", type: "uint8" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "uint256", name: "initialCollateralDeltaAmount", type: "uint256" }, + { internalType: "uint256", name: "triggerPrice", type: "uint256" }, + { internalType: "uint256", name: "acceptablePrice", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "minOutputAmount", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "validFromTime", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct Order.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [ + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }, + { internalType: "bool", name: "isFrozen", type: "bool" }, + { internalType: "bool", name: "autoCancel", type: "bool" }, + ], + internalType: "struct Order.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct Order.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + ], + name: "getPendingPositionImpactPoolDistributionAmount", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getPnl", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "marketAddress", type: "address" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "bool", name: "isLong", type: "bool" }, + { internalType: "bool", name: "maximize", type: "bool" }, + ], + name: "getPnlToPoolFactor", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getPosition", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "collateralToken", type: "address" }, + ], + internalType: "struct Position.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "sizeInTokens", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + { internalType: "int256", name: "pendingImpactAmount", type: "int256" }, + { internalType: "uint256", name: "borrowingFactor", type: "uint256" }, + { internalType: "uint256", name: "fundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "longTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "shortTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "increasedAtTime", type: "uint256" }, + { internalType: "uint256", name: "decreasedAtTime", type: "uint256" }, + ], + internalType: "struct Position.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "isLong", type: "bool" }], + internalType: "struct Position.Flags", + name: "flags", + type: "tuple", + }, + ], + internalType: "struct Position.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract IReferralStorage", name: "referralStorage", type: "address" }, + { internalType: "bytes32", name: "positionKey", type: "bytes32" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "bool", name: "usePositionSizeAsSizeDeltaUsd", type: "bool" }, + ], + name: "getPositionInfo", + outputs: [ + { + components: [ + { internalType: "bytes32", name: "positionKey", type: "bytes32" }, + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "collateralToken", type: "address" }, + ], + internalType: "struct Position.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "sizeInTokens", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + { internalType: "int256", name: "pendingImpactAmount", type: "int256" }, + { internalType: "uint256", name: "borrowingFactor", type: "uint256" }, + { internalType: "uint256", name: "fundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "longTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "shortTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "increasedAtTime", type: "uint256" }, + { internalType: "uint256", name: "decreasedAtTime", type: "uint256" }, + ], + internalType: "struct Position.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "isLong", type: "bool" }], + internalType: "struct Position.Flags", + name: "flags", + type: "tuple", + }, + ], + internalType: "struct Position.Props", + name: "position", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "address", name: "affiliate", type: "address" }, + { internalType: "address", name: "trader", type: "address" }, + { internalType: "uint256", name: "totalRebateFactor", type: "uint256" }, + { internalType: "uint256", name: "affiliateRewardFactor", type: "uint256" }, + { internalType: "uint256", name: "adjustedAffiliateRewardFactor", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountFactor", type: "uint256" }, + { internalType: "uint256", name: "totalRebateAmount", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountAmount", type: "uint256" }, + { internalType: "uint256", name: "affiliateRewardAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionReferralFees", + name: "referral", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "traderTier", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountFactor", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionProFees", + name: "pro", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "fundingFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "claimableLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "claimableShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "latestFundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "latestLongTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "latestShortTokenClaimableFundingAmountPerSize", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionFundingFees", + name: "funding", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "borrowingFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeAmountForFeeReceiver", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionBorrowingFees", + name: "borrowing", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "uint256", name: "uiFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "uiFeeAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionUiFees", + name: "ui", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeAmountForFeeReceiver", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionLiquidationFees", + name: "liquidation", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "collateralTokenPrice", + type: "tuple", + }, + { internalType: "uint256", name: "positionFeeFactor", type: "uint256" }, + { internalType: "uint256", name: "protocolFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "positionFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "feeReceiverAmount", type: "uint256" }, + { internalType: "uint256", name: "feeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "positionFeeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "positionFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "totalCostAmountExcludingFunding", type: "uint256" }, + { internalType: "uint256", name: "totalCostAmount", type: "uint256" }, + { internalType: "uint256", name: "totalDiscountAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionFees", + name: "fees", + type: "tuple", + }, + { + components: [ + { internalType: "int256", name: "priceImpactUsd", type: "int256" }, + { internalType: "uint256", name: "executionPrice", type: "uint256" }, + { internalType: "bool", name: "balanceWasImproved", type: "bool" }, + { internalType: "int256", name: "proportionalPendingImpactUsd", type: "int256" }, + { internalType: "int256", name: "totalImpactUsd", type: "int256" }, + { internalType: "uint256", name: "priceImpactDiffUsd", type: "uint256" }, + ], + internalType: "struct ReaderPricingUtils.ExecutionPriceResult", + name: "executionPriceResult", + type: "tuple", + }, + { internalType: "int256", name: "basePnlUsd", type: "int256" }, + { internalType: "int256", name: "uncappedBasePnlUsd", type: "int256" }, + { internalType: "int256", name: "pnlAfterPriceImpactUsd", type: "int256" }, + ], + internalType: "struct ReaderPositionUtils.PositionInfo", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract IReferralStorage", name: "referralStorage", type: "address" }, + { internalType: "bytes32[]", name: "positionKeys", type: "bytes32[]" }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices[]", + name: "prices", + type: "tuple[]", + }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + ], + name: "getPositionInfoList", + outputs: [ + { + components: [ + { internalType: "bytes32", name: "positionKey", type: "bytes32" }, + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address", name: "collateralToken", type: "address" }, + ], + internalType: "struct Position.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "sizeInUsd", type: "uint256" }, + { internalType: "uint256", name: "sizeInTokens", type: "uint256" }, + { internalType: "uint256", name: "collateralAmount", type: "uint256" }, + { internalType: "int256", name: "pendingImpactAmount", type: "int256" }, + { internalType: "uint256", name: "borrowingFactor", type: "uint256" }, + { internalType: "uint256", name: "fundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "longTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "shortTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "increasedAtTime", type: "uint256" }, + { internalType: "uint256", name: "decreasedAtTime", type: "uint256" }, + ], + internalType: "struct Position.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "isLong", type: "bool" }], + internalType: "struct Position.Flags", + name: "flags", + type: "tuple", + }, + ], + internalType: "struct Position.Props", + name: "position", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "bytes32", name: "referralCode", type: "bytes32" }, + { internalType: "address", name: "affiliate", type: "address" }, + { internalType: "address", name: "trader", type: "address" }, + { internalType: "uint256", name: "totalRebateFactor", type: "uint256" }, + { internalType: "uint256", name: "affiliateRewardFactor", type: "uint256" }, + { internalType: "uint256", name: "adjustedAffiliateRewardFactor", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountFactor", type: "uint256" }, + { internalType: "uint256", name: "totalRebateAmount", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountAmount", type: "uint256" }, + { internalType: "uint256", name: "affiliateRewardAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionReferralFees", + name: "referral", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "traderTier", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountFactor", type: "uint256" }, + { internalType: "uint256", name: "traderDiscountAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionProFees", + name: "pro", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "fundingFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "claimableLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "claimableShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "latestFundingFeeAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "latestLongTokenClaimableFundingAmountPerSize", type: "uint256" }, + { internalType: "uint256", name: "latestShortTokenClaimableFundingAmountPerSize", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionFundingFees", + name: "funding", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "borrowingFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "borrowingFeeAmountForFeeReceiver", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionBorrowingFees", + name: "borrowing", + type: "tuple", + }, + { + components: [ + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "uint256", name: "uiFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "uiFeeAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionUiFees", + name: "ui", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "liquidationFeeAmountForFeeReceiver", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionLiquidationFees", + name: "liquidation", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "collateralTokenPrice", + type: "tuple", + }, + { internalType: "uint256", name: "positionFeeFactor", type: "uint256" }, + { internalType: "uint256", name: "protocolFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "positionFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "feeReceiverAmount", type: "uint256" }, + { internalType: "uint256", name: "feeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "positionFeeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "positionFeeAmount", type: "uint256" }, + { internalType: "uint256", name: "totalCostAmountExcludingFunding", type: "uint256" }, + { internalType: "uint256", name: "totalCostAmount", type: "uint256" }, + { internalType: "uint256", name: "totalDiscountAmount", type: "uint256" }, + ], + internalType: "struct PositionPricingUtils.PositionFees", + name: "fees", + type: "tuple", + }, + { + components: [ + { internalType: "int256", name: "priceImpactUsd", type: "int256" }, + { internalType: "uint256", name: "executionPrice", type: "uint256" }, + { internalType: "bool", name: "balanceWasImproved", type: "bool" }, + { internalType: "int256", name: "proportionalPendingImpactUsd", type: "int256" }, + { internalType: "int256", name: "totalImpactUsd", type: "int256" }, + { internalType: "uint256", name: "priceImpactDiffUsd", type: "uint256" }, + ], + internalType: "struct ReaderPricingUtils.ExecutionPriceResult", + name: "executionPriceResult", + type: "tuple", + }, + { internalType: "int256", name: "basePnlUsd", type: "int256" }, + { internalType: "int256", name: "uncappedBasePnlUsd", type: "int256" }, + { internalType: "int256", name: "pnlAfterPriceImpactUsd", type: "int256" }, + ], + internalType: "struct ReaderPositionUtils.PositionInfo[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "bytes32", name: "positionKey", type: "bytes32" }, + { internalType: "uint256", name: "sizeDeltaUsd", type: "uint256" }, + ], + name: "getPositionPnlUsd", + outputs: [ + { internalType: "int256", name: "", type: "int256" }, + { internalType: "int256", name: "", type: "int256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getShift", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "fromMarket", type: "address" }, + { internalType: "address", name: "toMarket", type: "address" }, + ], + internalType: "struct Shift.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minMarketTokens", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct Shift.Numbers", + name: "numbers", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct Shift.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "address", name: "tokenIn", type: "address" }, + { internalType: "uint256", name: "amountIn", type: "uint256" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + ], + name: "getSwapAmountOut", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "int256", name: "", type: "int256" }, + { + components: [ + { internalType: "uint256", name: "feeReceiverAmount", type: "uint256" }, + { internalType: "uint256", name: "feeAmountForPool", type: "uint256" }, + { internalType: "uint256", name: "amountAfterFees", type: "uint256" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "uint256", name: "uiFeeReceiverFactor", type: "uint256" }, + { internalType: "uint256", name: "uiFeeAmount", type: "uint256" }, + ], + internalType: "struct SwapPricingUtils.SwapFees", + name: "fees", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "address", name: "marketKey", type: "address" }, + { internalType: "address", name: "tokenIn", type: "address" }, + { internalType: "address", name: "tokenOut", type: "address" }, + { internalType: "uint256", name: "amountIn", type: "uint256" }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "tokenInPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "tokenOutPrice", + type: "tuple", + }, + ], + name: "getSwapPriceImpact", + outputs: [ + { internalType: "int256", name: "", type: "int256" }, + { internalType: "int256", name: "", type: "int256" }, + { internalType: "int256", name: "", type: "int256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "bytes32", name: "key", type: "bytes32" }, + ], + name: "getWithdrawal", + outputs: [ + { + components: [ + { + components: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "address", name: "callbackContract", type: "address" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "address", name: "market", type: "address" }, + { internalType: "address[]", name: "longTokenSwapPath", type: "address[]" }, + { internalType: "address[]", name: "shortTokenSwapPath", type: "address[]" }, + ], + internalType: "struct Withdrawal.Addresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minLongTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "minShortTokenAmount", type: "uint256" }, + { internalType: "uint256", name: "updatedAtTime", type: "uint256" }, + { internalType: "uint256", name: "executionFee", type: "uint256" }, + { internalType: "uint256", name: "callbackGasLimit", type: "uint256" }, + { internalType: "uint256", name: "srcChainId", type: "uint256" }, + ], + internalType: "struct Withdrawal.Numbers", + name: "numbers", + type: "tuple", + }, + { + components: [{ internalType: "bool", name: "shouldUnwrapNativeToken", type: "bool" }], + internalType: "struct Withdrawal.Flags", + name: "flags", + type: "tuple", + }, + { internalType: "bytes32[]", name: "_dataList", type: "bytes32[]" }, + ], + internalType: "struct Withdrawal.Props", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "uint256", name: "marketTokenAmount", type: "uint256" }, + { internalType: "address", name: "uiFeeReceiver", type: "address" }, + { internalType: "enum ISwapPricingUtils.SwapPricingType", name: "swapPricingType", type: "uint8" }, + ], + name: "getWithdrawalAmountOut", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "contract DataStore", name: "dataStore", type: "address" }, + { internalType: "contract IReferralStorage", name: "referralStorage", type: "address" }, + { internalType: "bytes32", name: "positionKey", type: "bytes32" }, + { + components: [ + { internalType: "address", name: "marketToken", type: "address" }, + { internalType: "address", name: "indexToken", type: "address" }, + { internalType: "address", name: "longToken", type: "address" }, + { internalType: "address", name: "shortToken", type: "address" }, + ], + internalType: "struct Market.Props", + name: "market", + type: "tuple", + }, + { + components: [ + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { internalType: "uint256", name: "min", type: "uint256" }, + { internalType: "uint256", name: "max", type: "uint256" }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", + }, + ], + internalType: "struct MarketUtils.MarketPrices", + name: "prices", + type: "tuple", + }, + { internalType: "bool", name: "shouldValidateMinCollateralUsd", type: "bool" }, + { internalType: "bool", name: "forLiquidation", type: "bool" }, + ], + name: "isPositionLiquidatable", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "string", name: "", type: "string" }, + { + components: [ + { internalType: "int256", name: "remainingCollateralUsd", type: "int256" }, + { internalType: "int256", name: "minCollateralUsd", type: "int256" }, + { internalType: "int256", name: "minCollateralUsdForLeverage", type: "int256" }, + ], + internalType: "struct PositionUtils.IsPositionLiquidatableInfo", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/SyntheticsRouter.json b/sdk/src/abis/SyntheticsRouter.json deleted file mode 100644 index 612b779bd3..0000000000 --- a/sdk/src/abis/SyntheticsRouter.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "pluginTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/SyntheticsRouter.ts b/sdk/src/abis/SyntheticsRouter.ts new file mode 100644 index 0000000000..d48b9d58af --- /dev/null +++ b/sdk/src/abis/SyntheticsRouter.ts @@ -0,0 +1,34 @@ +export default [ + { + inputs: [{ internalType: "contract RoleStore", name: "_roleStore", type: "address" }], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "string", name: "role", type: "string" }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "address", name: "receiver", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "pluginTransfer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/Timelock.json b/sdk/src/abis/Timelock.json deleted file mode 100644 index b16cde8017..0000000000 --- a/sdk/src/abis/Timelock.json +++ /dev/null @@ -1,1737 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Timelock", - "sourceName": "contracts/peripherals/Timelock.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_admin", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_buffer", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_tokenManager", - "type": "address" - }, - { - "internalType": "address", - "name": "_mintReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "_glpManager", - "type": "address" - }, - { - "internalType": "address", - "name": "_rewardRouter", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxTokenSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_marginFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxMarginFeeBasisPoints", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "ClearAction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalApprove", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalMint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalPendingAction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "vault", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "SignalRedeemUsdg", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "gov", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalSetGov", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "handler", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isActive", - "type": "bool" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalSetHandler", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "vault", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "priceFeed", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalSetPriceFeed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "vault", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDecimals", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenWeight", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minProfitBps", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxUsdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isStable", - "type": "bool" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isShortable", - "type": "bool" - } - ], - "name": "SignalVaultSetTokenConfig", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "action", - "type": "bytes32" - } - ], - "name": "SignalWithdrawToken", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_BUFFER", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FUNDING_RATE_FACTOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_LEVERAGE_VALIDATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRICE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vester", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_amounts", - "type": "uint256[]" - } - ], - "name": "batchSetBonusRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "batchWithdrawFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "buffer", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_action", - "type": "bytes32" - } - ], - "name": "cancelAction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - } - ], - "name": "disableLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - } - ], - "name": "enableLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "glpManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_referralStorage", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_code", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_newAccount", - "type": "address" - } - ], - "name": "govSetCodeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "initGlpManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "initRewardRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isHandler", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isKeeper", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "marginFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxMarginFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxTokenSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mintReceiver", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "pendingActions", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "processMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "redeemUsdg", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "removeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "rewardRouter", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_admin", - "type": "address" - } - ], - "name": "setAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_buffer", - "type": "uint256" - } - ], - "name": "setBuffer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setContractHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_admin", - "type": "address" - } - ], - "name": "setExternalAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableTaxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_mintBurnFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_swapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableSwapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_marginFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_hasDynamicFees", - "type": "bool" - } - ], - "name": "setFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fundingInterval", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "setFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_cooldownDuration", - "type": "uint256" - } - ], - "name": "setGlpCooldownDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "bool", - "name": "_inPrivateLiquidationMode", - "type": "bool" - } - ], - "name": "setInPrivateLiquidationMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "bool", - "name": "_inPrivateTransferMode", - "type": "bool" - } - ], - "name": "setInPrivateTransferMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLeverageEnabled", - "type": "bool" - } - ], - "name": "setIsLeverageEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isSwapEnabled", - "type": "bool" - } - ], - "name": "setIsSwapEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_keeper", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setKeeper", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_liquidator", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setLiquidator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_marginFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxMarginFeeBasisPoints", - "type": "uint256" - } - ], - "name": "setMarginFeeBasisPoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxGasPrice", - "type": "uint256" - } - ], - "name": "setMaxGasPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setMaxGlobalShortSize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxLeverage", - "type": "uint256" - } - ], - "name": "setMaxLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - } - ], - "name": "setPriceFeed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_referralStorage", - "type": "address" - }, - { - "internalType": "address", - "name": "_referrer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tierId", - "type": "uint256" - } - ], - "name": "setReferrerTier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_shortsTrackerAveragePriceWeight", - "type": "uint256" - } - ], - "name": "setShortsTrackerAveragePriceWeight", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_shouldToggleIsLeverageEnabled", - "type": "bool" - } - ], - "name": "setShouldToggleIsLeverageEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableTaxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_mintBurnFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_swapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableSwapFeeBasisPoints", - "type": "uint256" - } - ], - "name": "setSwapFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_referralStorage", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tierId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_totalRebate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_discountShare", - "type": "uint256" - } - ], - "name": "setTier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitBps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxUsdgAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_bufferAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - } - ], - "name": "setTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_usdgAmounts", - "type": "uint256[]" - } - ], - "name": "setUsdgAmounts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "contract IVaultUtils", - "name": "_vaultUtils", - "type": "address" - } - ], - "name": "setVaultUtils", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "shouldToggleIsLeverageEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "signalApprove", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "signalMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "signalRedeemUsdg", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "signalSetGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "signalSetHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - } - ], - "name": "signalSetPriceFeed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_tokenWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitBps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxUsdgAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isStable", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_isShortable", - "type": "bool" - } - ], - "name": "signalVaultSetTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "signalWithdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "transferIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - } - ], - "name": "updateUsdgSupply", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_tokenWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitBps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxUsdgAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isStable", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_isShortable", - "type": "bool" - } - ], - "name": "vaultSetTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "withdrawFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_target", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/Timelock.ts b/sdk/src/abis/Timelock.ts new file mode 100644 index 0000000000..f1097beaaf --- /dev/null +++ b/sdk/src/abis/Timelock.ts @@ -0,0 +1,776 @@ +export default [ + { + inputs: [ + { internalType: "address", name: "_admin", type: "address" }, + { internalType: "uint256", name: "_buffer", type: "uint256" }, + { internalType: "address", name: "_tokenManager", type: "address" }, + { internalType: "address", name: "_mintReceiver", type: "address" }, + { internalType: "address", name: "_glpManager", type: "address" }, + { internalType: "address", name: "_rewardRouter", type: "address" }, + { internalType: "uint256", name: "_maxTokenSupply", type: "uint256" }, + { internalType: "uint256", name: "_marginFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_maxMarginFeeBasisPoints", type: "uint256" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }], + name: "ClearAction", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + ], + name: "SignalApprove", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "address", name: "receiver", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + ], + name: "SignalMint", + type: "event", + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }], + name: "SignalPendingAction", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "vault", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "SignalRedeemUsdg", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "target", type: "address" }, + { indexed: false, internalType: "address", name: "gov", type: "address" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + ], + name: "SignalSetGov", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "target", type: "address" }, + { indexed: false, internalType: "address", name: "handler", type: "address" }, + { indexed: false, internalType: "bool", name: "isActive", type: "bool" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + ], + name: "SignalSetHandler", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "vault", type: "address" }, + { indexed: false, internalType: "address", name: "priceFeed", type: "address" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + ], + name: "SignalSetPriceFeed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "vault", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "tokenDecimals", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "tokenWeight", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "minProfitBps", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "maxUsdgAmount", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isStable", type: "bool" }, + { indexed: false, internalType: "bool", name: "isShortable", type: "bool" }, + ], + name: "SignalVaultSetTokenConfig", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "target", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "address", name: "receiver", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + { indexed: false, internalType: "bytes32", name: "action", type: "bytes32" }, + ], + name: "SignalWithdrawToken", + type: "event", + }, + { + inputs: [], + name: "MAX_BUFFER", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FUNDING_RATE_FACTOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_LEVERAGE_VALIDATION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "admin", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vester", type: "address" }, + { internalType: "address[]", name: "_accounts", type: "address[]" }, + { internalType: "uint256[]", name: "_amounts", type: "uint256[]" }, + ], + name: "batchSetBonusRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "batchWithdrawFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "buffer", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "_action", type: "bytes32" }], + name: "cancelAction", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_vault", type: "address" }], + name: "disableLeverage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_vault", type: "address" }], + name: "enableLeverage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "glpManager", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_referralStorage", type: "address" }, + { internalType: "bytes32", name: "_code", type: "bytes32" }, + { internalType: "address", name: "_newAccount", type: "address" }, + ], + name: "govSetCodeOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { inputs: [], name: "initGlpManager", outputs: [], stateMutability: "nonpayable", type: "function" }, + { inputs: [], name: "initRewardRouter", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isHandler", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isKeeper", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "marginFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxMarginFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxTokenSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "mintReceiver", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "pendingActions", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "processMint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "redeemUsdg", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + ], + name: "removeAdmin", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "rewardRouter", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_admin", type: "address" }], + name: "setAdmin", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_buffer", type: "uint256" }], + name: "setBuffer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setContractHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_admin", type: "address" }, + ], + name: "setExternalAdmin", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableTaxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_mintBurnFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_swapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableSwapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_marginFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_minProfitTime", type: "uint256" }, + { internalType: "bool", name: "_hasDynamicFees", type: "bool" }, + ], + name: "setFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "uint256", name: "_fundingInterval", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "setFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_cooldownDuration", type: "uint256" }], + name: "setGlpCooldownDuration", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_gov", type: "address" }, + ], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "bool", name: "_inPrivateLiquidationMode", type: "bool" }, + ], + name: "setInPrivateLiquidationMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "bool", name: "_inPrivateTransferMode", type: "bool" }, + ], + name: "setInPrivateTransferMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "bool", name: "_isLeverageEnabled", type: "bool" }, + ], + name: "setIsLeverageEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "bool", name: "_isSwapEnabled", type: "bool" }, + ], + name: "setIsSwapEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_keeper", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setKeeper", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_liquidator", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setLiquidator", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_marginFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_maxMarginFeeBasisPoints", type: "uint256" }, + ], + name: "setMarginFeeBasisPoints", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "uint256", name: "_maxGasPrice", type: "uint256" }, + ], + name: "setMaxGasPrice", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setMaxGlobalShortSize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "uint256", name: "_maxLeverage", type: "uint256" }, + ], + name: "setMaxLeverage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_priceFeed", type: "address" }, + ], + name: "setPriceFeed", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_referralStorage", type: "address" }, + { internalType: "address", name: "_referrer", type: "address" }, + { internalType: "uint256", name: "_tierId", type: "uint256" }, + ], + name: "setReferrerTier", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_shortsTrackerAveragePriceWeight", type: "uint256" }], + name: "setShortsTrackerAveragePriceWeight", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_shouldToggleIsLeverageEnabled", type: "bool" }], + name: "setShouldToggleIsLeverageEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableTaxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_mintBurnFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_swapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableSwapFeeBasisPoints", type: "uint256" }, + ], + name: "setSwapFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_referralStorage", type: "address" }, + { internalType: "uint256", name: "_tierId", type: "uint256" }, + { internalType: "uint256", name: "_totalRebate", type: "uint256" }, + { internalType: "uint256", name: "_discountShare", type: "uint256" }, + ], + name: "setTier", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenWeight", type: "uint256" }, + { internalType: "uint256", name: "_minProfitBps", type: "uint256" }, + { internalType: "uint256", name: "_maxUsdgAmount", type: "uint256" }, + { internalType: "uint256", name: "_bufferAmount", type: "uint256" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + ], + name: "setTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + { internalType: "uint256[]", name: "_usdgAmounts", type: "uint256[]" }, + ], + name: "setUsdgAmounts", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "contract IVaultUtils", name: "_vaultUtils", type: "address" }, + ], + name: "setVaultUtils", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "shouldToggleIsLeverageEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_spender", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "signalApprove", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "signalMint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "signalRedeemUsdg", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_gov", type: "address" }, + ], + name: "signalSetGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "signalSetHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_priceFeed", type: "address" }, + ], + name: "signalSetPriceFeed", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenDecimals", type: "uint256" }, + { internalType: "uint256", name: "_tokenWeight", type: "uint256" }, + { internalType: "uint256", name: "_minProfitBps", type: "uint256" }, + { internalType: "uint256", name: "_maxUsdgAmount", type: "uint256" }, + { internalType: "bool", name: "_isStable", type: "bool" }, + { internalType: "bool", name: "_isShortable", type: "bool" }, + ], + name: "signalVaultSetTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "signalWithdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "tokenManager", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_sender", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "transferIn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "usdgAmount", type: "uint256" }], + name: "updateUsdgSupply", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenDecimals", type: "uint256" }, + { internalType: "uint256", name: "_tokenWeight", type: "uint256" }, + { internalType: "uint256", name: "_minProfitBps", type: "uint256" }, + { internalType: "uint256", name: "_maxUsdgAmount", type: "uint256" }, + { internalType: "bool", name: "_isStable", type: "bool" }, + { internalType: "bool", name: "_isShortable", type: "bool" }, + ], + name: "vaultSetTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "withdrawFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/Token.json b/sdk/src/abis/Token.json deleted file mode 100644 index bf997056aa..0000000000 --- a/sdk/src/abis/Token.json +++ /dev/null @@ -1,345 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Token", - "sourceName": "contracts/tokens/Token.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/Token.ts b/sdk/src/abis/Token.ts new file mode 100644 index 0000000000..bff07840fe --- /dev/null +++ b/sdk/src/abis/Token.ts @@ -0,0 +1,148 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "subtractedValue", type: "uint256" }, + ], + name: "decreaseAllowance", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { inputs: [], name: "deposit", outputs: [], stateMutability: "payable", type: "function" }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "addedValue", type: "uint256" }, + ], + name: "increaseAllowance", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "recipient", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "sender", type: "address" }, + { internalType: "address", name: "recipient", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "token", type: "address" }, + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/Treasury.json b/sdk/src/abis/Treasury.json deleted file mode 100644 index dfb36b749e..0000000000 --- a/sdk/src/abis/Treasury.json +++ /dev/null @@ -1,411 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Treasury", - "sourceName": "contracts/gambit-token/Treasury.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "addLiquidity", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - } - ], - "name": "addWhitelists", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "busd", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "busdBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "busdHardCap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "busdReceived", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "busdSlotCap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "endSwap", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_unlockTime", - "type": "uint256" - } - ], - "name": "extendUnlockTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "fund", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmt", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmtListingPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmtPresalePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_busdBasisPoints", - "type": "uint256" - } - ], - "name": "increaseBusdBasisPoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_addresses", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_values", - "type": "uint256[]" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isLiquidityAdded", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isSwapActive", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_accounts", - "type": "address[]" - } - ], - "name": "removeWhitelists", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_fund", - "type": "address" - } - ], - "name": "setFund", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_busdAmount", - "type": "uint256" - } - ], - "name": "swap", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "swapAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "swapWhitelist", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "unlockTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "prevAccount", - "type": "address" - }, - { - "internalType": "address", - "name": "nextAccount", - "type": "address" - } - ], - "name": "updateWhitelist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/Treasury.ts b/sdk/src/abis/Treasury.ts new file mode 100644 index 0000000000..d83f1b7c7d --- /dev/null +++ b/sdk/src/abis/Treasury.ts @@ -0,0 +1,204 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { inputs: [], name: "addLiquidity", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [{ internalType: "address[]", name: "_accounts", type: "address[]" }], + name: "addWhitelists", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "busd", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "busdBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "busdHardCap", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "busdReceived", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "busdSlotCap", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "endSwap", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [{ internalType: "uint256", name: "_unlockTime", type: "uint256" }], + name: "extendUnlockTime", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "fund", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gmt", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gmtListingPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gmtPresalePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_busdBasisPoints", type: "uint256" }], + name: "increaseBusdBasisPoints", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "_addresses", type: "address[]" }, + { internalType: "uint256[]", name: "_values", type: "uint256[]" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isLiquidityAdded", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isSwapActive", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address[]", name: "_accounts", type: "address[]" }], + name: "removeWhitelists", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_fund", type: "address" }], + name: "setFund", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_busdAmount", type: "uint256" }], + name: "swap", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "swapAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "swapWhitelist", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "unlockTime", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "prevAccount", type: "address" }, + { internalType: "address", name: "nextAccount", type: "address" }, + ], + name: "updateWhitelist", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/UniPool.json b/sdk/src/abis/UniPool.json deleted file mode 100644 index f03081271a..0000000000 --- a/sdk/src/abis/UniPool.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "UniPool", - "sourceName": "contracts/amm/UniPool.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "uint32[]", - "name": "", - "type": "uint32[]" - } - ], - "name": "observe", - "outputs": [ - { - "internalType": "int56[]", - "name": "tickCumulatives", - "type": "int56[]" - }, - { - "internalType": "uint160[]", - "name": "secondsPerLiquidityCumulativeX128s", - "type": "uint160[]" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "slot0", - "outputs": [ - { - "internalType": "uint160", - "name": "sqrtPriceX96", - "type": "uint160" - }, - { - "internalType": "int24", - "name": "tick", - "type": "int24" - }, - { - "internalType": "uint16", - "name": "observationIndex", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "observationCardinality", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "observationCardinalityNext", - "type": "uint16" - }, - { - "internalType": "uint8", - "name": "feeProtocol", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "unlocked", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tickSpacing", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "pure", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/UniPool.ts b/sdk/src/abis/UniPool.ts new file mode 100644 index 0000000000..7adfac77ff --- /dev/null +++ b/sdk/src/abis/UniPool.ts @@ -0,0 +1,34 @@ +export default [ + { + inputs: [{ internalType: "uint32[]", name: "", type: "uint32[]" }], + name: "observe", + outputs: [ + { internalType: "int56[]", name: "tickCumulatives", type: "int56[]" }, + { internalType: "uint160[]", name: "secondsPerLiquidityCumulativeX128s", type: "uint160[]" }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "slot0", + outputs: [ + { internalType: "uint160", name: "sqrtPriceX96", type: "uint160" }, + { internalType: "int24", name: "tick", type: "int24" }, + { internalType: "uint16", name: "observationIndex", type: "uint16" }, + { internalType: "uint16", name: "observationCardinality", type: "uint16" }, + { internalType: "uint16", name: "observationCardinalityNext", type: "uint16" }, + { internalType: "uint8", name: "feeProtocol", type: "uint8" }, + { internalType: "bool", name: "unlocked", type: "bool" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "tickSpacing", + outputs: [{ internalType: "int24", name: "", type: "int24" }], + stateMutability: "pure", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/UniswapV2.json b/sdk/src/abis/UniswapV2.json deleted file mode 100644 index 0473efb8ad..0000000000 --- a/sdk/src/abis/UniswapV2.json +++ /dev/null @@ -1,287 +0,0 @@ -{ - "abi": [ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" } - ], - "name": "Burn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "name": "Mint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount0In", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1In", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount0Out", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1Out", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" } - ], - "name": "Swap", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint112", "name": "reserve0", "type": "uint112" }, - { "indexed": false, "internalType": "uint112", "name": "reserve1", "type": "uint112" } - ], - "name": "Sync", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINIMUM_LIQUIDITY", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PERMIT_TYPEHASH", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "to", "type": "address" }], - "name": "burn", - "outputs": [ - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getReserves", - "outputs": [ - { "internalType": "uint112", "name": "_reserve0", "type": "uint112" }, - { "internalType": "uint112", "name": "_reserve1", "type": "uint112" }, - { "internalType": "uint32", "name": "_blockTimestampLast", "type": "uint32" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_token0", "type": "address" }, - { "internalType": "address", "name": "_token1", "type": "address" } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "kLast", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "to", "type": "address" }], - "name": "mint", - "outputs": [{ "internalType": "uint256", "name": "liquidity", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "value", "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" } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "price0CumulativeLast", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "price1CumulativeLast", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "to", "type": "address" }], - "name": "skim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amount0Out", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1Out", "type": "uint256" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "swap", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "sync", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "token0", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} diff --git a/sdk/src/abis/UniswapV2.ts b/sdk/src/abis/UniswapV2.ts new file mode 100644 index 0000000000..d2a192775c --- /dev/null +++ b/sdk/src/abis/UniswapV2.ts @@ -0,0 +1,285 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount0", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1", type: "uint256" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + ], + name: "Burn", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount0", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1", type: "uint256" }, + ], + name: "Mint", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount0In", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1In", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount0Out", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1Out", type: "uint256" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "uint112", name: "reserve0", type: "uint112" }, + { indexed: false, internalType: "uint112", name: "reserve1", type: "uint112" }, + ], + name: "Sync", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MINIMUM_LIQUIDITY", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PERMIT_TYPEHASH", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "to", type: "address" }], + name: "burn", + outputs: [ + { internalType: "uint256", name: "amount0", type: "uint256" }, + { internalType: "uint256", name: "amount1", type: "uint256" }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "factory", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getReserves", + outputs: [ + { internalType: "uint112", name: "_reserve0", type: "uint112" }, + { internalType: "uint112", name: "_reserve1", type: "uint112" }, + { internalType: "uint32", name: "_blockTimestampLast", type: "uint32" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token0", type: "address" }, + { internalType: "address", name: "_token1", type: "address" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "kLast", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "to", type: "address" }], + name: "mint", + outputs: [{ internalType: "uint256", name: "liquidity", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "nonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", 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" }, + ], + name: "permit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "price0CumulativeLast", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "price1CumulativeLast", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "to", type: "address" }], + name: "skim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "amount0Out", type: "uint256" }, + { internalType: "uint256", name: "amount1Out", type: "uint256" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "swap", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "sync", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [], + name: "token0", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "token1", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/Vault.json b/sdk/src/abis/Vault.json deleted file mode 100644 index a787d83959..0000000000 --- a/sdk/src/abis/Vault.json +++ /dev/null @@ -1,3220 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Vault", - "sourceName": "contracts/core/Vault.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "BuyUSDG", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - } - ], - "name": "ClosePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeTokens", - "type": "uint256" - } - ], - "name": "CollectMarginFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeTokens", - "type": "uint256" - } - ], - "name": "CollectSwapFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseGuaranteedUsd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreasePoolAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sizeDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "DecreasePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseReservedAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseUsdgAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DirectPoolDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseGuaranteedUsd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreasePoolAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sizeDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "IncreasePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseReservedAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseUsdgAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "markPrice", - "type": "uint256" - } - ], - "name": "LiquidatePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "SellUSDG", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenIn", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenOut", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOutAfterFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "Swap", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fundingRate", - "type": "uint256" - } - ], - "name": "UpdateFundingRate", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "hasProfit", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "UpdatePnl", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "markPrice", - "type": "uint256" - } - ], - "name": "UpdatePosition", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FUNDING_RATE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FEE_BASIS_POINTS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FUNDING_RATE_FACTOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_LIQUIDATION_FEE_USD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_FUNDING_RATE_INTERVAL", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_LEVERAGE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRICE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USDG_DECIMALS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - } - ], - "name": "addRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_tokenDiv", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenMul", - "type": "address" - } - ], - "name": "adjustForDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "allWhitelistedTokens", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "allWhitelistedTokensLength", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "approvedRouters", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "bufferAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "buyUSDG", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "clearTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "cumulativeFundingRates", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_collateralDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "decreasePosition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "directPoolDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "errorController", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "errors", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "feeReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fundingInterval", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fundingRateFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_averagePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_lastIncreasedTime", - "type": "uint256" - } - ], - "name": "getDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getEntryFundingRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_feeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_increment", - "type": "bool" - } - ], - "name": "getFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_entryFundingRate", - "type": "uint256" - } - ], - "name": "getFundingFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getGlobalShortDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getMaxPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getMinPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_averagePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_nextPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_lastIncreasedTime", - "type": "uint256" - } - ], - "name": "getNextAveragePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getNextFundingRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_nextPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - } - ], - "name": "getNextGlobalShortAveragePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - } - ], - "name": "getPositionFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionKey", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - } - ], - "name": "getRedemptionAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getRedemptionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getRedemptionCollateralUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getTargetUsdgAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getUtilisation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "globalShortAveragePrices", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "globalShortSizes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "guaranteedUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasDynamicFees", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inManagerMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateLiquidationMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "includeAmmPrice", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "increasePosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - }, - { - "internalType": "address", - "name": "_usdg", - "type": "address" - }, - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isLeverageEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isLiquidator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isSwapEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastFundingTimes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "address", - "name": "_feeReceiver", - "type": "address" - } - ], - "name": "liquidatePosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "liquidationFeeUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "marginFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxGasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxGlobalShortSizes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxUsdgAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "minProfitBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minProfitTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mintBurnFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "poolAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "positions", - "outputs": [ - { - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "lastIncreasedTime", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "priceFeed", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - } - ], - "name": "removeRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "reservedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "sellUSDG", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setBufferAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_errorCode", - "type": "uint256" - }, - { - "internalType": "string", - "name": "_error", - "type": "string" - } - ], - "name": "setError", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_errorController", - "type": "address" - } - ], - "name": "setErrorController", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableTaxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_mintBurnFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_swapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableSwapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_marginFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_hasDynamicFees", - "type": "bool" - } - ], - "name": "setFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_fundingInterval", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "setFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inManagerMode", - "type": "bool" - } - ], - "name": "setInManagerMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateLiquidationMode", - "type": "bool" - } - ], - "name": "setInPrivateLiquidationMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isLeverageEnabled", - "type": "bool" - } - ], - "name": "setIsLeverageEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isSwapEnabled", - "type": "bool" - } - ], - "name": "setIsSwapEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_liquidator", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setLiquidator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_manager", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isManager", - "type": "bool" - } - ], - "name": "setManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxGasPrice", - "type": "uint256" - } - ], - "name": "setMaxGasPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setMaxGlobalShortSize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxLeverage", - "type": "uint256" - } - ], - "name": "setMaxLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - } - ], - "name": "setPriceFeed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_tokenWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitBps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxUsdgAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isStable", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_isShortable", - "type": "bool" - } - ], - "name": "setTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setUsdgAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVaultUtils", - "name": "_vaultUtils", - "type": "address" - } - ], - "name": "setVaultUtils", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "shortableTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableFundingRateFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableSwapFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableTaxBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "stableTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "swap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "swapFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "taxBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenAmount", - "type": "uint256" - } - ], - "name": "tokenToUsdMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalTokenWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - } - ], - "name": "updateCumulativeFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newVault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "upgradeVault", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_price", - "type": "uint256" - } - ], - "name": "usdToToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - } - ], - "name": "usdToTokenMax", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - } - ], - "name": "usdToTokenMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "usdg", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "usdgAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "useSwapPricing", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_raise", - "type": "bool" - } - ], - "name": "validateLiquidation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "vaultUtils", - "outputs": [ - { - "internalType": "contract IVaultUtils", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "whitelistedTokenCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "whitelistedTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "withdrawFees", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/Vault.ts b/sdk/src/abis/Vault.ts new file mode 100644 index 0000000000..975f548582 --- /dev/null +++ b/sdk/src/abis/Vault.ts @@ -0,0 +1,1306 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "tokenAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "BuyUSDG", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "averagePrice", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + ], + name: "ClosePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "feeUsd", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeTokens", type: "uint256" }, + ], + name: "CollectMarginFees", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "feeUsd", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeTokens", type: "uint256" }, + ], + name: "CollectSwapFees", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseGuaranteedUsd", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreasePoolAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "uint256", name: "collateralDelta", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "sizeDelta", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "price", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "fee", type: "uint256" }, + ], + name: "DecreasePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseReservedAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseUsdgAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DirectPoolDeposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseGuaranteedUsd", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreasePoolAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "uint256", name: "collateralDelta", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "sizeDelta", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "price", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "fee", type: "uint256" }, + ], + name: "IncreasePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseReservedAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseUsdgAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + { indexed: false, internalType: "uint256", name: "markPrice", type: "uint256" }, + ], + name: "LiquidatePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "tokenAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "SellUSDG", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "tokenIn", type: "address" }, + { indexed: false, internalType: "address", name: "tokenOut", type: "address" }, + { indexed: false, internalType: "uint256", name: "amountIn", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOut", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOutAfterFees", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "fundingRate", type: "uint256" }, + ], + name: "UpdateFundingRate", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "bool", name: "hasProfit", type: "bool" }, + { indexed: false, internalType: "uint256", name: "delta", type: "uint256" }, + ], + name: "UpdatePnl", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "averagePrice", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + { indexed: false, internalType: "uint256", name: "markPrice", type: "uint256" }, + ], + name: "UpdatePosition", + type: "event", + }, + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "FUNDING_RATE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FEE_BASIS_POINTS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FUNDING_RATE_FACTOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_LIQUIDATION_FEE_USD", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_FUNDING_RATE_INTERVAL", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_LEVERAGE", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "USDG_DECIMALS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_router", type: "address" }], + name: "addRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "address", name: "_tokenDiv", type: "address" }, + { internalType: "address", name: "_tokenMul", type: "address" }, + ], + name: "adjustForDecimals", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "allWhitelistedTokens", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allWhitelistedTokensLength", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "approvedRouters", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "bufferAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "buyUSDG", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "clearTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "cumulativeFundingRates", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_collateralDelta", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "decreasePosition", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "directPoolDeposit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "errorController", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "errors", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "feeReserves", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "fundingInterval", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "fundingRateFactor", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_averagePrice", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_lastIncreasedTime", type: "uint256" }, + ], + name: "getDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getEntryFundingRate", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdgDelta", type: "uint256" }, + { internalType: "uint256", name: "_feeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "bool", name: "_increment", type: "bool" }, + ], + name: "getFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_entryFundingRate", type: "uint256" }, + ], + name: "getFundingFee", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getGlobalShortDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getMaxPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getMinPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_averagePrice", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_nextPrice", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "uint256", name: "_lastIncreasedTime", type: "uint256" }, + ], + name: "getNextAveragePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getNextFundingRate", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_nextPrice", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + ], + name: "getNextGlobalShortAveragePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPosition", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + ], + name: "getPositionFee", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionKey", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionLeverage", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + ], + name: "getRedemptionAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getRedemptionCollateral", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getRedemptionCollateralUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getTargetUsdgAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getUtilisation", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "globalShortAveragePrices", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "globalShortSizes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "guaranteedUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasDynamicFees", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inManagerMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateLiquidationMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "includeAmmPrice", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "increasePosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_router", type: "address" }, + { internalType: "address", name: "_usdg", type: "address" }, + { internalType: "address", name: "_priceFeed", type: "address" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isLeverageEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isLiquidator", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isManager", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isSwapEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lastFundingTimes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "address", name: "_feeReceiver", type: "address" }, + ], + name: "liquidatePosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "liquidationFeeUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "marginFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxGasPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxGlobalShortSizes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxLeverage", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxUsdgAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "minProfitBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minProfitTime", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "mintBurnFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "poolAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "positions", + outputs: [ + { internalType: "uint256", name: "size", type: "uint256" }, + { internalType: "uint256", name: "collateral", type: "uint256" }, + { internalType: "uint256", name: "averagePrice", type: "uint256" }, + { internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { internalType: "int256", name: "realisedPnl", type: "int256" }, + { internalType: "uint256", name: "lastIncreasedTime", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "priceFeed", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_router", type: "address" }], + name: "removeRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "reservedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "sellUSDG", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setBufferAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_errorCode", type: "uint256" }, + { internalType: "string", name: "_error", type: "string" }, + ], + name: "setError", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_errorController", type: "address" }], + name: "setErrorController", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableTaxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_mintBurnFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_swapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableSwapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_marginFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_minProfitTime", type: "uint256" }, + { internalType: "bool", name: "_hasDynamicFees", type: "bool" }, + ], + name: "setFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_fundingInterval", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "setFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inManagerMode", type: "bool" }], + name: "setInManagerMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateLiquidationMode", type: "bool" }], + name: "setInPrivateLiquidationMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_isLeverageEnabled", type: "bool" }], + name: "setIsLeverageEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_isSwapEnabled", type: "bool" }], + name: "setIsSwapEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_liquidator", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setLiquidator", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_manager", type: "address" }, + { internalType: "bool", name: "_isManager", type: "bool" }, + ], + name: "setManager", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxGasPrice", type: "uint256" }], + name: "setMaxGasPrice", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setMaxGlobalShortSize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxLeverage", type: "uint256" }], + name: "setMaxLeverage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_priceFeed", type: "address" }], + name: "setPriceFeed", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenDecimals", type: "uint256" }, + { internalType: "uint256", name: "_tokenWeight", type: "uint256" }, + { internalType: "uint256", name: "_minProfitBps", type: "uint256" }, + { internalType: "uint256", name: "_maxUsdgAmount", type: "uint256" }, + { internalType: "bool", name: "_isStable", type: "bool" }, + { internalType: "bool", name: "_isShortable", type: "bool" }, + ], + name: "setTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setUsdgAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "contract IVaultUtils", name: "_vaultUtils", type: "address" }], + name: "setVaultUtils", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "shortableTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableFundingRateFactor", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableSwapFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableTaxBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "stableTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "swap", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "taxBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenBalances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenDecimals", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenAmount", type: "uint256" }, + ], + name: "tokenToUsdMin", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenWeights", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalTokenWeights", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + ], + name: "updateCumulativeFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_newVault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "upgradeVault", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + { internalType: "uint256", name: "_price", type: "uint256" }, + ], + name: "usdToToken", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + ], + name: "usdToTokenMax", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + ], + name: "usdToTokenMin", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "usdg", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "usdgAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "useSwapPricing", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "bool", name: "_raise", type: "bool" }, + ], + name: "validateLiquidation", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "vaultUtils", + outputs: [{ internalType: "contract IVaultUtils", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "whitelistedTokenCount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "whitelistedTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "withdrawFees", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/VaultReader.json b/sdk/src/abis/VaultReader.json deleted file mode 100644 index feafdca1f9..0000000000 --- a/sdk/src/abis/VaultReader.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "VaultReader", - "sourceName": "contracts/peripherals/VaultReader.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_positionManager", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getVaultTokenInfoV3", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_vault", - "type": "address" - }, - { - "internalType": "address", - "name": "_positionManager", - "type": "address" - }, - { - "internalType": "address", - "name": "_weth", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_tokens", - "type": "address[]" - } - ], - "name": "getVaultTokenInfoV4", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/VaultReader.ts b/sdk/src/abis/VaultReader.ts new file mode 100644 index 0000000000..0436870abc --- /dev/null +++ b/sdk/src/abis/VaultReader.ts @@ -0,0 +1,28 @@ +export default [ + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_positionManager", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getVaultTokenInfoV3", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_vault", type: "address" }, + { internalType: "address", name: "_positionManager", type: "address" }, + { internalType: "address", name: "_weth", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + { internalType: "address[]", name: "_tokens", type: "address[]" }, + ], + name: "getVaultTokenInfoV4", + outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/VaultV2.json b/sdk/src/abis/VaultV2.json deleted file mode 100644 index 35882f8342..0000000000 --- a/sdk/src/abis/VaultV2.json +++ /dev/null @@ -1,3019 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Vault", - "sourceName": "contracts/core/Vault.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "BuyUSDG", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - } - ], - "name": "ClosePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeTokens", - "type": "uint256" - } - ], - "name": "CollectMarginFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeTokens", - "type": "uint256" - } - ], - "name": "CollectSwapFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseGuaranteedUsd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreasePoolAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sizeDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "DecreasePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseReservedAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseUsdgAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DirectPoolDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseGuaranteedUsd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreasePoolAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sizeDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "IncreasePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseReservedAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseUsdgAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "markPrice", - "type": "uint256" - } - ], - "name": "LiquidatePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "SellUSDG", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenIn", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenOut", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOutAfterFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "Swap", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fundingRate", - "type": "uint256" - } - ], - "name": "UpdateFundingRate", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "hasProfit", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "UpdatePnl", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - } - ], - "name": "UpdatePosition", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FUNDING_RATE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FEE_BASIS_POINTS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FUNDING_RATE_FACTOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_LIQUIDATION_FEE_USD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_FUNDING_RATE_INTERVAL", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_LEVERAGE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRICE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USDG_DECIMALS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - } - ], - "name": "addRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_tokenDiv", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenMul", - "type": "address" - } - ], - "name": "adjustForDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "allWhitelistedTokens", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "allWhitelistedTokensLength", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "approvedRouters", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "bufferAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "buyUSDG", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "clearTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "cumulativeFundingRates", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_collateralDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "decreasePosition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "directPoolDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "feeReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fundingInterval", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fundingRateFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_averagePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_lastIncreasedTime", - "type": "uint256" - } - ], - "name": "getDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_feeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_increment", - "type": "bool" - } - ], - "name": "getFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_entryFundingRate", - "type": "uint256" - } - ], - "name": "getFundingFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getGlobalShortDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getMaxPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getMinPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_averagePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_nextPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_lastIncreasedTime", - "type": "uint256" - } - ], - "name": "getNextAveragePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getNextFundingRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_nextPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - } - ], - "name": "getNextGlobalShortAveragePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - } - ], - "name": "getPositionFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionKey", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - } - ], - "name": "getRedemptionAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getRedemptionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getRedemptionCollateralUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getTargetUsdgAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getUtilisation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "globalShortAveragePrices", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "globalShortSizes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "guaranteedUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasDynamicFees", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inManagerMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateLiquidationMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "includeAmmPrice", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "increasePosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - }, - { - "internalType": "address", - "name": "_usdg", - "type": "address" - }, - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isLeverageEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isLiquidator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isSwapEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastFundingTimes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "address", - "name": "_feeReceiver", - "type": "address" - } - ], - "name": "liquidatePosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "liquidationFeeUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "marginFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxGasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxUsdgAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "minProfitBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minProfitTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mintBurnFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "poolAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "positions", - "outputs": [ - { - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "lastIncreasedTime", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "priceFeed", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - } - ], - "name": "removeRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "reservedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "sellUSDG", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setBufferAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableTaxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_mintBurnFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_swapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableSwapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_marginFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_hasDynamicFees", - "type": "bool" - } - ], - "name": "setFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_fundingInterval", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "setFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inManagerMode", - "type": "bool" - } - ], - "name": "setInManagerMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateLiquidationMode", - "type": "bool" - } - ], - "name": "setInPrivateLiquidationMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isLeverageEnabled", - "type": "bool" - } - ], - "name": "setIsLeverageEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isSwapEnabled", - "type": "bool" - } - ], - "name": "setIsSwapEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_liquidator", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setLiquidator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_manager", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isManager", - "type": "bool" - } - ], - "name": "setManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxGasPrice", - "type": "uint256" - } - ], - "name": "setMaxGasPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxLeverage", - "type": "uint256" - } - ], - "name": "setMaxLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - } - ], - "name": "setPriceFeed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_tokenWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitBps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxUsdgAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isStable", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_isShortable", - "type": "bool" - } - ], - "name": "setTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setUsdgAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "shortableTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableFundingRateFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableSwapFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableTaxBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "stableTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "swap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "swapFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "taxBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenAmount", - "type": "uint256" - } - ], - "name": "tokenToUsdMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalTokenWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "updateCumulativeFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newVault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "upgradeVault", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_price", - "type": "uint256" - } - ], - "name": "usdToToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - } - ], - "name": "usdToTokenMax", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - } - ], - "name": "usdToTokenMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "usdg", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "usdgAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "useSwapPricing", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_raise", - "type": "bool" - } - ], - "name": "validateLiquidation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "whitelistedTokenCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "whitelistedTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "withdrawFees", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/VaultV2.ts b/sdk/src/abis/VaultV2.ts new file mode 100644 index 0000000000..0ab0fe3fa1 --- /dev/null +++ b/sdk/src/abis/VaultV2.ts @@ -0,0 +1,1220 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "tokenAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "BuyUSDG", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "averagePrice", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + ], + name: "ClosePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "feeUsd", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeTokens", type: "uint256" }, + ], + name: "CollectMarginFees", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "feeUsd", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeTokens", type: "uint256" }, + ], + name: "CollectSwapFees", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseGuaranteedUsd", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreasePoolAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "uint256", name: "collateralDelta", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "sizeDelta", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "price", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "fee", type: "uint256" }, + ], + name: "DecreasePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseReservedAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseUsdgAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DirectPoolDeposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseGuaranteedUsd", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreasePoolAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "uint256", name: "collateralDelta", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "sizeDelta", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "price", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "fee", type: "uint256" }, + ], + name: "IncreasePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseReservedAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseUsdgAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + { indexed: false, internalType: "uint256", name: "markPrice", type: "uint256" }, + ], + name: "LiquidatePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "tokenAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "SellUSDG", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "tokenIn", type: "address" }, + { indexed: false, internalType: "address", name: "tokenOut", type: "address" }, + { indexed: false, internalType: "uint256", name: "amountIn", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOut", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOutAfterFees", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "fundingRate", type: "uint256" }, + ], + name: "UpdateFundingRate", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "bool", name: "hasProfit", type: "bool" }, + { indexed: false, internalType: "uint256", name: "delta", type: "uint256" }, + ], + name: "UpdatePnl", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "averagePrice", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + ], + name: "UpdatePosition", + type: "event", + }, + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "FUNDING_RATE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FEE_BASIS_POINTS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FUNDING_RATE_FACTOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_LIQUIDATION_FEE_USD", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_FUNDING_RATE_INTERVAL", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_LEVERAGE", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "USDG_DECIMALS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_router", type: "address" }], + name: "addRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "address", name: "_tokenDiv", type: "address" }, + { internalType: "address", name: "_tokenMul", type: "address" }, + ], + name: "adjustForDecimals", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "allWhitelistedTokens", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allWhitelistedTokensLength", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "approvedRouters", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "bufferAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "buyUSDG", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "clearTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "cumulativeFundingRates", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_collateralDelta", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "decreasePosition", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "directPoolDeposit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "feeReserves", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "fundingInterval", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "fundingRateFactor", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_averagePrice", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_lastIncreasedTime", type: "uint256" }, + ], + name: "getDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdgDelta", type: "uint256" }, + { internalType: "uint256", name: "_feeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "bool", name: "_increment", type: "bool" }, + ], + name: "getFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_entryFundingRate", type: "uint256" }, + ], + name: "getFundingFee", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getGlobalShortDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getMaxPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getMinPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_averagePrice", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_nextPrice", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "uint256", name: "_lastIncreasedTime", type: "uint256" }, + ], + name: "getNextAveragePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getNextFundingRate", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_nextPrice", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + ], + name: "getNextGlobalShortAveragePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPosition", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_sizeDelta", type: "uint256" }], + name: "getPositionFee", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionKey", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionLeverage", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + ], + name: "getRedemptionAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getRedemptionCollateral", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getRedemptionCollateralUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getTargetUsdgAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getUtilisation", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "globalShortAveragePrices", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "globalShortSizes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "guaranteedUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasDynamicFees", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inManagerMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateLiquidationMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "includeAmmPrice", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "increasePosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_router", type: "address" }, + { internalType: "address", name: "_usdg", type: "address" }, + { internalType: "address", name: "_priceFeed", type: "address" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isLeverageEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isLiquidator", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isManager", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isSwapEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lastFundingTimes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "address", name: "_feeReceiver", type: "address" }, + ], + name: "liquidatePosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "liquidationFeeUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "marginFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxGasPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxLeverage", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxUsdgAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "minProfitBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minProfitTime", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "mintBurnFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "poolAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "positions", + outputs: [ + { internalType: "uint256", name: "size", type: "uint256" }, + { internalType: "uint256", name: "collateral", type: "uint256" }, + { internalType: "uint256", name: "averagePrice", type: "uint256" }, + { internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { internalType: "int256", name: "realisedPnl", type: "int256" }, + { internalType: "uint256", name: "lastIncreasedTime", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "priceFeed", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_router", type: "address" }], + name: "removeRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "reservedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "sellUSDG", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setBufferAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableTaxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_mintBurnFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_swapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableSwapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_marginFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_minProfitTime", type: "uint256" }, + { internalType: "bool", name: "_hasDynamicFees", type: "bool" }, + ], + name: "setFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_fundingInterval", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "setFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inManagerMode", type: "bool" }], + name: "setInManagerMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateLiquidationMode", type: "bool" }], + name: "setInPrivateLiquidationMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_isLeverageEnabled", type: "bool" }], + name: "setIsLeverageEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_isSwapEnabled", type: "bool" }], + name: "setIsSwapEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_liquidator", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setLiquidator", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_manager", type: "address" }, + { internalType: "bool", name: "_isManager", type: "bool" }, + ], + name: "setManager", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxGasPrice", type: "uint256" }], + name: "setMaxGasPrice", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxLeverage", type: "uint256" }], + name: "setMaxLeverage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_priceFeed", type: "address" }], + name: "setPriceFeed", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenDecimals", type: "uint256" }, + { internalType: "uint256", name: "_tokenWeight", type: "uint256" }, + { internalType: "uint256", name: "_minProfitBps", type: "uint256" }, + { internalType: "uint256", name: "_maxUsdgAmount", type: "uint256" }, + { internalType: "bool", name: "_isStable", type: "bool" }, + { internalType: "bool", name: "_isShortable", type: "bool" }, + ], + name: "setTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setUsdgAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "shortableTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableFundingRateFactor", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableSwapFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableTaxBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "stableTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "swap", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "taxBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenBalances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenDecimals", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenAmount", type: "uint256" }, + ], + name: "tokenToUsdMin", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenWeights", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalTokenWeights", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "updateCumulativeFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_newVault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "upgradeVault", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + { internalType: "uint256", name: "_price", type: "uint256" }, + ], + name: "usdToToken", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + ], + name: "usdToTokenMax", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + ], + name: "usdToTokenMin", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "usdg", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "usdgAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "useSwapPricing", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "bool", name: "_raise", type: "bool" }, + ], + name: "validateLiquidation", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "whitelistedTokenCount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "whitelistedTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "withdrawFees", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/VaultV2b.json b/sdk/src/abis/VaultV2b.json deleted file mode 100644 index a787d83959..0000000000 --- a/sdk/src/abis/VaultV2b.json +++ /dev/null @@ -1,3220 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Vault", - "sourceName": "contracts/core/Vault.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "BuyUSDG", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - } - ], - "name": "ClosePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeTokens", - "type": "uint256" - } - ], - "name": "CollectMarginFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeUsd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeTokens", - "type": "uint256" - } - ], - "name": "CollectSwapFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseGuaranteedUsd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreasePoolAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sizeDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "DecreasePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseReservedAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DecreaseUsdgAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DirectPoolDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseGuaranteedUsd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreasePoolAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sizeDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "IncreasePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseReservedAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "IncreaseUsdgAmount", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "indexToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLong", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "markPrice", - "type": "uint256" - } - ], - "name": "LiquidatePosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "usdgAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "SellUSDG", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenIn", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenOut", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountOutAfterFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeBasisPoints", - "type": "uint256" - } - ], - "name": "Swap", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fundingRate", - "type": "uint256" - } - ], - "name": "UpdateFundingRate", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "hasProfit", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "UpdatePnl", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "markPrice", - "type": "uint256" - } - ], - "name": "UpdatePosition", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS_DIVISOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FUNDING_RATE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FEE_BASIS_POINTS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_FUNDING_RATE_FACTOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_LIQUIDATION_FEE_USD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_FUNDING_RATE_INTERVAL", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_LEVERAGE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PRICE_PRECISION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USDG_DECIMALS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - } - ], - "name": "addRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_tokenDiv", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenMul", - "type": "address" - } - ], - "name": "adjustForDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "allWhitelistedTokens", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "allWhitelistedTokensLength", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "approvedRouters", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "bufferAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "buyUSDG", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "clearTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "cumulativeFundingRates", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_collateralDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "decreasePosition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "directPoolDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "errorController", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "errors", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "feeReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fundingInterval", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fundingRateFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_averagePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_lastIncreasedTime", - "type": "uint256" - } - ], - "name": "getDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getEntryFundingRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_feeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_increment", - "type": "bool" - } - ], - "name": "getFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_entryFundingRate", - "type": "uint256" - } - ], - "name": "getFundingFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getGlobalShortDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getMaxPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getMinPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_averagePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_nextPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_lastIncreasedTime", - "type": "uint256" - } - ], - "name": "getNextAveragePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getNextFundingRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_nextPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - } - ], - "name": "getNextGlobalShortAveragePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionDelta", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - } - ], - "name": "getPositionFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionKey", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "getPositionLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdgAmount", - "type": "uint256" - } - ], - "name": "getRedemptionAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getRedemptionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getRedemptionCollateralUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getTargetUsdgAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "name": "getUtilisation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "globalShortAveragePrices", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "globalShortSizes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "guaranteedUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasDynamicFees", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inManagerMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inPrivateLiquidationMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "includeAmmPrice", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_sizeDelta", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - } - ], - "name": "increasePosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - }, - { - "internalType": "address", - "name": "_usdg", - "type": "address" - }, - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isLeverageEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isLiquidator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isSwapEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastFundingTimes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "address", - "name": "_feeReceiver", - "type": "address" - } - ], - "name": "liquidatePosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "liquidationFeeUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "marginFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxGasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxGlobalShortSizes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxUsdgAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "minProfitBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minProfitTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mintBurnFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "poolAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "positions", - "outputs": [ - { - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "averagePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "entryFundingRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveAmount", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "realisedPnl", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "lastIncreasedTime", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "priceFeed", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_router", - "type": "address" - } - ], - "name": "removeRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "reservedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "sellUSDG", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setBufferAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_errorCode", - "type": "uint256" - }, - { - "internalType": "string", - "name": "_error", - "type": "string" - } - ], - "name": "setError", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_errorController", - "type": "address" - } - ], - "name": "setErrorController", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_taxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableTaxBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_mintBurnFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_swapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableSwapFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_marginFeeBasisPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_liquidationFeeUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_hasDynamicFees", - "type": "bool" - } - ], - "name": "setFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_fundingInterval", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_fundingRateFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_stableFundingRateFactor", - "type": "uint256" - } - ], - "name": "setFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inManagerMode", - "type": "bool" - } - ], - "name": "setInManagerMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_inPrivateLiquidationMode", - "type": "bool" - } - ], - "name": "setInPrivateLiquidationMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isLeverageEnabled", - "type": "bool" - } - ], - "name": "setIsLeverageEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isSwapEnabled", - "type": "bool" - } - ], - "name": "setIsSwapEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_liquidator", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setLiquidator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_manager", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isManager", - "type": "bool" - } - ], - "name": "setManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxGasPrice", - "type": "uint256" - } - ], - "name": "setMaxGasPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setMaxGlobalShortSize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxLeverage", - "type": "uint256" - } - ], - "name": "setMaxLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_priceFeed", - "type": "address" - } - ], - "name": "setPriceFeed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_tokenWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minProfitBps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxUsdgAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isStable", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_isShortable", - "type": "bool" - } - ], - "name": "setTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setUsdgAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IVaultUtils", - "name": "_vaultUtils", - "type": "address" - } - ], - "name": "setVaultUtils", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "shortableTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableFundingRateFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableSwapFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableTaxBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "stableTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenIn", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenOut", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "swap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "swapFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "taxBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenAmount", - "type": "uint256" - } - ], - "name": "tokenToUsdMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tokenWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalTokenWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - } - ], - "name": "updateCumulativeFundingRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newVault", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "upgradeVault", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_price", - "type": "uint256" - } - ], - "name": "usdToToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - } - ], - "name": "usdToTokenMax", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_usdAmount", - "type": "uint256" - } - ], - "name": "usdToTokenMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "usdg", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "usdgAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "useSwapPricing", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_collateralToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_indexToken", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isLong", - "type": "bool" - }, - { - "internalType": "bool", - "name": "_raise", - "type": "bool" - } - ], - "name": "validateLiquidation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "vaultUtils", - "outputs": [ - { - "internalType": "contract IVaultUtils", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "whitelistedTokenCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "whitelistedTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "withdrawFees", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/VaultV2b.ts b/sdk/src/abis/VaultV2b.ts new file mode 100644 index 0000000000..975f548582 --- /dev/null +++ b/sdk/src/abis/VaultV2b.ts @@ -0,0 +1,1306 @@ +export default [ + { inputs: [], stateMutability: "nonpayable", type: "constructor" }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "tokenAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "BuyUSDG", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "averagePrice", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + ], + name: "ClosePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "feeUsd", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeTokens", type: "uint256" }, + ], + name: "CollectMarginFees", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "feeUsd", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeTokens", type: "uint256" }, + ], + name: "CollectSwapFees", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseGuaranteedUsd", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreasePoolAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "uint256", name: "collateralDelta", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "sizeDelta", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "price", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "fee", type: "uint256" }, + ], + name: "DecreasePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseReservedAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DecreaseUsdgAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "DirectPoolDeposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseGuaranteedUsd", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreasePoolAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "uint256", name: "collateralDelta", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "sizeDelta", type: "uint256" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "price", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "fee", type: "uint256" }, + ], + name: "IncreasePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseReservedAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "IncreaseUsdgAmount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "collateralToken", type: "address" }, + { indexed: false, internalType: "address", name: "indexToken", type: "address" }, + { indexed: false, internalType: "bool", name: "isLong", type: "bool" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + { indexed: false, internalType: "uint256", name: "markPrice", type: "uint256" }, + ], + name: "LiquidatePosition", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "usdgAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "tokenAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "SellUSDG", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "address", name: "tokenIn", type: "address" }, + { indexed: false, internalType: "address", name: "tokenOut", type: "address" }, + { indexed: false, internalType: "uint256", name: "amountIn", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOut", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountOutAfterFees", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "feeBasisPoints", type: "uint256" }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "token", type: "address" }, + { indexed: false, internalType: "uint256", name: "fundingRate", type: "uint256" }, + ], + name: "UpdateFundingRate", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "bool", name: "hasProfit", type: "bool" }, + { indexed: false, internalType: "uint256", name: "delta", type: "uint256" }, + ], + name: "UpdatePnl", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "bytes32", name: "key", type: "bytes32" }, + { indexed: false, internalType: "uint256", name: "size", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "collateral", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "averagePrice", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { indexed: false, internalType: "int256", name: "realisedPnl", type: "int256" }, + { indexed: false, internalType: "uint256", name: "markPrice", type: "uint256" }, + ], + name: "UpdatePosition", + type: "event", + }, + { + inputs: [], + name: "BASIS_POINTS_DIVISOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "FUNDING_RATE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FEE_BASIS_POINTS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_FUNDING_RATE_FACTOR", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_LIQUIDATION_FEE_USD", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_FUNDING_RATE_INTERVAL", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_LEVERAGE", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_PRECISION", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "USDG_DECIMALS", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_router", type: "address" }], + name: "addRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_amount", type: "uint256" }, + { internalType: "address", name: "_tokenDiv", type: "address" }, + { internalType: "address", name: "_tokenMul", type: "address" }, + ], + name: "adjustForDecimals", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "allWhitelistedTokens", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allWhitelistedTokensLength", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "approvedRouters", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "bufferAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "buyUSDG", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "clearTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "cumulativeFundingRates", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_collateralDelta", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "decreasePosition", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "directPoolDeposit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "errorController", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "", type: "uint256" }], + name: "errors", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "feeReserves", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "fundingInterval", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "fundingRateFactor", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_averagePrice", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_lastIncreasedTime", type: "uint256" }, + ], + name: "getDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getEntryFundingRate", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdgDelta", type: "uint256" }, + { internalType: "uint256", name: "_feeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "bool", name: "_increment", type: "bool" }, + ], + name: "getFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_entryFundingRate", type: "uint256" }, + ], + name: "getFundingFee", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getGlobalShortDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getMaxPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getMinPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_size", type: "uint256" }, + { internalType: "uint256", name: "_averagePrice", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_nextPrice", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "uint256", name: "_lastIncreasedTime", type: "uint256" }, + ], + name: "getNextAveragePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getNextFundingRate", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_nextPrice", type: "uint256" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + ], + name: "getNextGlobalShortAveragePrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPosition", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionDelta", + outputs: [ + { internalType: "bool", name: "", type: "bool" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + ], + name: "getPositionFee", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionKey", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "getPositionLeverage", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdgAmount", type: "uint256" }, + ], + name: "getRedemptionAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getRedemptionCollateral", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getRedemptionCollateralUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getTargetUsdgAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_token", type: "address" }], + name: "getUtilisation", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "globalShortAveragePrices", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "globalShortSizes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "guaranteedUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasDynamicFees", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inManagerMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inPrivateLiquidationMode", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "includeAmmPrice", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "uint256", name: "_sizeDelta", type: "uint256" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + ], + name: "increasePosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_router", type: "address" }, + { internalType: "address", name: "_usdg", type: "address" }, + { internalType: "address", name: "_priceFeed", type: "address" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isLeverageEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isLiquidator", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isManager", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isSwapEnabled", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lastFundingTimes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "address", name: "_feeReceiver", type: "address" }, + ], + name: "liquidatePosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "liquidationFeeUsd", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "marginFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxGasPrice", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxGlobalShortSizes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "maxLeverage", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "maxUsdgAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "minProfitBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minProfitTime", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "mintBurnFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "poolAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "positions", + outputs: [ + { internalType: "uint256", name: "size", type: "uint256" }, + { internalType: "uint256", name: "collateral", type: "uint256" }, + { internalType: "uint256", name: "averagePrice", type: "uint256" }, + { internalType: "uint256", name: "entryFundingRate", type: "uint256" }, + { internalType: "uint256", name: "reserveAmount", type: "uint256" }, + { internalType: "int256", name: "realisedPnl", type: "int256" }, + { internalType: "uint256", name: "lastIncreasedTime", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "priceFeed", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_router", type: "address" }], + name: "removeRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "reservedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "sellUSDG", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setBufferAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_errorCode", type: "uint256" }, + { internalType: "string", name: "_error", type: "string" }, + ], + name: "setError", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_errorController", type: "address" }], + name: "setErrorController", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_taxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableTaxBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_mintBurnFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_swapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_stableSwapFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_marginFeeBasisPoints", type: "uint256" }, + { internalType: "uint256", name: "_liquidationFeeUsd", type: "uint256" }, + { internalType: "uint256", name: "_minProfitTime", type: "uint256" }, + { internalType: "bool", name: "_hasDynamicFees", type: "bool" }, + ], + name: "setFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_fundingInterval", type: "uint256" }, + { internalType: "uint256", name: "_fundingRateFactor", type: "uint256" }, + { internalType: "uint256", name: "_stableFundingRateFactor", type: "uint256" }, + ], + name: "setFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inManagerMode", type: "bool" }], + name: "setInManagerMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_inPrivateLiquidationMode", type: "bool" }], + name: "setInPrivateLiquidationMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_isLeverageEnabled", type: "bool" }], + name: "setIsLeverageEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_isSwapEnabled", type: "bool" }], + name: "setIsSwapEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_liquidator", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setLiquidator", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_manager", type: "address" }, + { internalType: "bool", name: "_isManager", type: "bool" }, + ], + name: "setManager", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxGasPrice", type: "uint256" }], + name: "setMaxGasPrice", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setMaxGlobalShortSize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_maxLeverage", type: "uint256" }], + name: "setMaxLeverage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_priceFeed", type: "address" }], + name: "setPriceFeed", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenDecimals", type: "uint256" }, + { internalType: "uint256", name: "_tokenWeight", type: "uint256" }, + { internalType: "uint256", name: "_minProfitBps", type: "uint256" }, + { internalType: "uint256", name: "_maxUsdgAmount", type: "uint256" }, + { internalType: "bool", name: "_isStable", type: "bool" }, + { internalType: "bool", name: "_isShortable", type: "bool" }, + ], + name: "setTokenConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setUsdgAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "contract IVaultUtils", name: "_vaultUtils", type: "address" }], + name: "setVaultUtils", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "shortableTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableFundingRateFactor", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableSwapFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stableTaxBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "stableTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_tokenIn", type: "address" }, + { internalType: "address", name: "_tokenOut", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "swap", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapFeeBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "taxBasisPoints", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenBalances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenDecimals", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_tokenAmount", type: "uint256" }, + ], + name: "tokenToUsdMin", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "tokenWeights", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalTokenWeights", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + ], + name: "updateCumulativeFundingRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_newVault", type: "address" }, + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "upgradeVault", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + { internalType: "uint256", name: "_price", type: "uint256" }, + ], + name: "usdToToken", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + ], + name: "usdToTokenMax", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "uint256", name: "_usdAmount", type: "uint256" }, + ], + name: "usdToTokenMin", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "usdg", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "usdgAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "useSwapPricing", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_collateralToken", type: "address" }, + { internalType: "address", name: "_indexToken", type: "address" }, + { internalType: "bool", name: "_isLong", type: "bool" }, + { internalType: "bool", name: "_raise", type: "bool" }, + ], + name: "validateLiquidation", + outputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "vaultUtils", + outputs: [{ internalType: "contract IVaultUtils", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "whitelistedTokenCount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "whitelistedTokens", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "withdrawFees", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/Vester.json b/sdk/src/abis/Vester.json deleted file mode 100644 index 6630ef8ac5..0000000000 --- a/sdk/src/abis/Vester.json +++ /dev/null @@ -1,1031 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "Vester", - "sourceName": "contracts/staking/Vester.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "uint256", - "name": "_vestingDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_esToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_pairToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_claimableToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_rewardTracker", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Claim", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "PairTransfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "balances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "bonusRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "claimForAccount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "claimable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "claimableToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "claimedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "cumulativeClaimAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "cumulativeRewardDeductions", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "depositForAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "esToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "getCombinedAverageStakedAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "getMaxVestableAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_esAmount", - "type": "uint256" - } - ], - "name": "getPairAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "getTotalVested", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "getVestedAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gov", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasMaxVestableAmount", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasPairToken", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasRewardTracker", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isHandler", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastVestingTimes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "pairAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pairSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pairToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardTracker", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setBonusRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setCumulativeRewardDeductions", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_handler", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isActive", - "type": "bool" - } - ], - "name": "setHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_hasMaxVestableAmount", - "type": "bool" - } - ], - "name": "setHasMaxVestableAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setTransferredAverageStakedAmounts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "setTransferredCumulativeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "transferStakeValues", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "transferredAverageStakedAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "transferredCumulativeRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "vestingDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/Vester.ts b/sdk/src/abis/Vester.ts new file mode 100644 index 0000000000..ce1f0919dd --- /dev/null +++ b/sdk/src/abis/Vester.ts @@ -0,0 +1,454 @@ +export default [ + { + inputs: [ + { internalType: "string", name: "_name", type: "string" }, + { internalType: "string", name: "_symbol", type: "string" }, + { internalType: "uint256", name: "_vestingDuration", type: "uint256" }, + { internalType: "address", name: "_esToken", type: "address" }, + { internalType: "address", name: "_pairToken", type: "address" }, + { internalType: "address", name: "_claimableToken", type: "address" }, + { internalType: "address", name: "_rewardTracker", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "receiver", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "Claim", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "Deposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "PairTransfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "address", name: "account", type: "address" }, + { indexed: false, internalType: "uint256", name: "claimedAmount", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "balance", type: "uint256" }, + ], + name: "Withdraw", + type: "event", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "balances", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "bonusRewards", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "claim", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "claimForAccount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "claimable", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "claimableToken", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "claimedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "cumulativeClaimAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "cumulativeRewardDeductions", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }], + name: "deposit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "depositForAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "esToken", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "getCombinedAverageStakedAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "getMaxVestableAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_esAmount", type: "uint256" }, + ], + name: "getPairAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "getTotalVested", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_account", type: "address" }], + name: "getVestedAmount", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gov", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasMaxVestableAmount", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasPairToken", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hasRewardTracker", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "isHandler", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "lastVestingTimes", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "pairAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pairSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pairToken", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardTracker", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setBonusRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setCumulativeRewardDeductions", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_gov", type: "address" }], + name: "setGov", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_handler", type: "address" }, + { internalType: "bool", name: "_isActive", type: "bool" }, + ], + name: "setHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bool", name: "_hasMaxVestableAmount", type: "bool" }], + name: "setHasMaxVestableAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setTransferredAverageStakedAmounts", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "setTransferredCumulativeRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + { internalType: "uint256", name: "", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_sender", type: "address" }, + { internalType: "address", name: "_receiver", type: "address" }, + ], + name: "transferStakeValues", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "transferredAverageStakedAmounts", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "transferredCumulativeRewards", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "vestingDuration", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { inputs: [], name: "withdraw", outputs: [], stateMutability: "nonpayable", type: "function" }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_account", type: "address" }, + { internalType: "uint256", name: "_amount", type: "uint256" }, + ], + name: "withdrawToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/WETH.json b/sdk/src/abis/WETH.json deleted file mode 100644 index 8925271e3a..0000000000 --- a/sdk/src/abis/WETH.json +++ /dev/null @@ -1,320 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "WETH", - "sourceName": "contracts/tokens/WETH.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/abis/WETH.ts b/sdk/src/abis/WETH.ts new file mode 100644 index 0000000000..99eb96ffcc --- /dev/null +++ b/sdk/src/abis/WETH.ts @@ -0,0 +1,135 @@ +export default [ + { + inputs: [ + { internalType: "string", name: "name", type: "string" }, + { internalType: "string", name: "symbol", type: "string" }, + { internalType: "uint8", name: "decimals", type: "uint8" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "subtractedValue", type: "uint256" }, + ], + name: "decreaseAllowance", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { inputs: [], name: "deposit", outputs: [], stateMutability: "payable", type: "function" }, + { + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "addedValue", type: "uint256" }, + ], + name: "increaseAllowance", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "recipient", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "sender", type: "address" }, + { internalType: "address", name: "recipient", type: "address" }, + { internalType: "uint256", name: "amount", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/sdk/src/abis/__tests__/abis.spec.ts b/sdk/src/abis/__tests__/abis.spec.ts deleted file mode 100644 index fc73105bfb..0000000000 --- a/sdk/src/abis/__tests__/abis.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import fs from "fs"; -import path from "path"; -import { describe, expect, it } from "vitest"; - -function isEmptyValue(value: any): boolean { - if ( - !value || - (Array.isArray(value) && value.length === 0) || - (typeof value === "object" && Object.keys(value).length === 0) - ) { - return true; - } - - return false; -} - -describe("ABI files validation", () => { - const abiDir = path.join(__dirname, ".."); - const abiFiles = fs.readdirSync(abiDir).filter((file) => file.endsWith(".json")); - - it.each(abiFiles)("validates %s doesn't contain metadata or bytecode", (fileName) => { - const filePath = path.join(abiDir, fileName); - const fileContent = JSON.parse(fs.readFileSync(filePath, "utf-8")); - - const abiContent = Array.isArray(fileContent) ? fileContent : fileContent.abi; - - expect(abiContent).toBeDefined(); - expect(Array.isArray(abiContent)).toBe(true); - - const unnecessaryFields = [ - "metadata", - "bytecode", - "deployedBytecode", - "sourceMap", - "deployedSourceMap", - "source", - "ast", - "schemaVersion", - "updatedAt", - ]; - - const foundFields = unnecessaryFields.filter((field) => !isEmptyValue(fileContent[field])); - - expect(foundFields).toHaveLength(0); - }); -}); diff --git a/sdk/src/abis/index.ts b/sdk/src/abis/index.ts index dd205ef8f0..c7bbbdb235 100644 --- a/sdk/src/abis/index.ts +++ b/sdk/src/abis/index.ts @@ -1,131 +1,54 @@ -import { Abi, erc20Abi } from "viem"; +import { erc20Abi } from "viem"; -import ArbitrumNodeInterface from "./ArbitrumNodeInterface.json"; -import ClaimHandler from "./ClaimHandler.json"; -import CustomErrors from "./CustomErrors.json"; -import DataStore from "./DataStore.json"; -import ERC20PermitInterface from "./ERC20PermitInterface.json"; -import ERC721 from "./ERC721.json"; -import EventEmitter from "./EventEmitter.json"; -import ExchangeRouter from "./ExchangeRouter.json"; -import GelatoRelayRouter from "./GelatoRelayRouter.json"; -import GlpManager from "./GlpManager.json"; -import GlvReader from "./GlvReader.json"; -import GlvRouter from "./GlvRouter.json"; -import GmxMigrator from "./GmxMigrator.json"; -import GovToken from "./GovToken.json"; -import LayerZeroProvider from "./LayerZeroProvider.json"; -import MintableBaseToken from "./MintableBaseToken.json"; -import Multicall from "./Multicall.json"; -import MultichainClaimsRouter from "./MultichainClaimsRouter.json"; -import MultichainGlvRouter from "./MultichainGlvRouter.json"; -import MultichainGmRouter from "./MultichainGmRouter.json"; -import MultichainOrderRouter from "./MultichainOrderRouter.json"; -import MultichainSubaccountRouter from "./MultichainSubaccountRouter.json"; -import MultichainTransferRouter from "./MultichainTransferRouter.json"; -import MultichainUtils from "./MultichainUtils.json"; -import MultichainVault from "./MultichainVault.json"; -import Reader from "./Reader.json"; -import ReaderV2 from "./ReaderV2.json"; -import ReferralStorage from "./ReferralStorage.json"; -import RelayParams from "./RelayParams.json"; -import RewardReader from "./RewardReader.json"; -import RewardRouter from "./RewardRouter.json"; -import RewardTracker from "./RewardTracker.json"; -import SmartAccount from "./SmartAccount.json"; -import StBTC from "./StBTC.json"; -import SubaccountGelatoRelayRouter from "./SubaccountGelatoRelayRouter.json"; -import SubaccountRouter from "./SubaccountRouter.json"; -import SyntheticsReader from "./SyntheticsReader.json"; -import SyntheticsRouter from "./SyntheticsRouter.json"; -import Timelock from "./Timelock.json"; -import Token from "./Token.json"; -import Treasury from "./Treasury.json"; -import UniPool from "./UniPool.json"; -import UniswapV2 from "./UniswapV2.json"; -import Vault from "./Vault.json"; -import VaultReader from "./VaultReader.json"; -import VaultV2 from "./VaultV2.json"; -import VaultV2b from "./VaultV2b.json"; -import Vester from "./Vester.json"; -import WETH from "./WETH.json"; - -export type AbiId = - | "AbstractSubaccountApprovalNonceable" - | "ArbitrumNodeInterface" - | "ClaimHandler" - | "CustomErrors" - | "DataStore" - | "ERC20" - | "ERC20PermitInterface" - | "ERC20PermitInterface" - | "ERC721" - | "EventEmitter" - | "ExchangeRouter" - | "GelatoRelayRouter" - | "GelatoRelayRouter" - | "GlpManager" - | "GlvReader" - | "GlvRouter" - | "GmxMigrator" - | "GovToken" - | "LayerZeroProvider" - | "MintableBaseToken" - | "Multicall" - | "MultichainClaimsRouter" - | "MultichainGlvRouter" - | "MultichainGmRouter" - | "MultichainOrderRouter" - | "MultichainSubaccountRouter" - | "MultichainTransferRouter" - | "MultichainUtils" - | "MultichainVault" - | "ReferralStorage" - | "RelayParams" - | "RewardReader" - | "RewardRouter" - | "RewardTracker" - | "SmartAccount" - | "StBTC" - | "SubaccountGelatoRelayRouter" - | "SubaccountGelatoRelayRouter" - | "SubaccountRouter" - | "SyntheticsReader" - | "SyntheticsRouter" - | "Timelock" - | "Token" - | "Reader" - | "ReaderV2" - | "Treasury" - | "UniPool" - | "UniswapV2" - | "Vault" - | "VaultReader" - | "VaultV2" - | "VaultV2b" - | "Vester" - | "WETH"; - -/** Copied from ethers to enable compatibility with GMX UI */ -interface JsonFragmentType { - readonly name?: string; - readonly indexed?: boolean; - readonly type?: string; - readonly internalType?: string; - readonly components?: ReadonlyArray; -} - -interface JsonFragment { - readonly name?: string; - readonly type?: string; - readonly anonymous?: boolean; - readonly payable?: boolean; - readonly constant?: boolean; - readonly stateMutability?: string; - readonly inputs?: ReadonlyArray; - readonly outputs?: ReadonlyArray; - readonly gas?: string; -} +import ArbitrumNodeInterface from "./ArbitrumNodeInterface"; +import ClaimHandler from "./ClaimHandler"; +import CustomErrors from "./CustomErrors"; +import DataStore from "./DataStore"; +import ERC20PermitInterface from "./ERC20PermitInterface"; +import ERC721 from "./ERC721"; +import EventEmitter from "./EventEmitter"; +import ExchangeRouter from "./ExchangeRouter"; +import GelatoRelayRouter from "./GelatoRelayRouter"; +import GlpManager from "./GlpManager"; +import GlvReader from "./GlvReader"; +import GlvRouter from "./GlvRouter"; +import GmxMigrator from "./GmxMigrator"; +import GovToken from "./GovToken"; +import LayerZeroProvider from "./LayerZeroProvider"; +import MintableBaseToken from "./MintableBaseToken"; +import Multicall from "./Multicall"; +import MultichainClaimsRouter from "./MultichainClaimsRouter"; +import MultichainGlvRouter from "./MultichainGlvRouter"; +import MultichainGmRouter from "./MultichainGmRouter"; +import MultichainOrderRouter from "./MultichainOrderRouter"; +import MultichainSubaccountRouter from "./MultichainSubaccountRouter"; +import MultichainTransferRouter from "./MultichainTransferRouter"; +import MultichainUtils from "./MultichainUtils"; +import MultichainVault from "./MultichainVault"; +import Reader from "./Reader"; +import ReaderV2 from "./ReaderV2"; +import ReferralStorage from "./ReferralStorage"; +import RelayParams from "./RelayParams"; +import RewardReader from "./RewardReader"; +import RewardRouter from "./RewardRouter"; +import RewardTracker from "./RewardTracker"; +import SmartAccount from "./SmartAccount"; +import StBTC from "./StBTC"; +import SubaccountGelatoRelayRouter from "./SubaccountGelatoRelayRouter"; +import SubaccountRouter from "./SubaccountRouter"; +import SyntheticsReader from "./SyntheticsReader"; +import SyntheticsRouter from "./SyntheticsRouter"; +import Timelock from "./Timelock"; +import Token from "./Token"; +import Treasury from "./Treasury"; +import UniPool from "./UniPool"; +import UniswapV2 from "./UniswapV2"; +import Vault from "./Vault"; +import VaultReader from "./VaultReader"; +import VaultV2 from "./VaultV2"; +import VaultV2b from "./VaultV2b"; +import Vester from "./Vester"; +import WETH from "./WETH"; const AbstractSubaccountApprovalNonceable = [ { @@ -149,56 +72,58 @@ const AbstractSubaccountApprovalNonceable = [ }, ] as const; -export const abis: Record = { +export const abis = { AbstractSubaccountApprovalNonceable, - ArbitrumNodeInterface: ArbitrumNodeInterface.abi, - ClaimHandler: ClaimHandler.abi, - CustomErrors: CustomErrors.abi, - DataStore: DataStore.abi, + ArbitrumNodeInterface, + ClaimHandler, + CustomErrors, + DataStore, ERC20: erc20Abi, - ERC20PermitInterface: ERC20PermitInterface.abi, - ERC721: ERC721.abi, - EventEmitter: EventEmitter.abi, - ExchangeRouter: ExchangeRouter.abi, - GelatoRelayRouter: GelatoRelayRouter.abi, - GlpManager: GlpManager.abi, - GlvReader: GlvReader.abi, - GlvRouter: GlvRouter.abi, - GmxMigrator: GmxMigrator.abi, - GovToken: GovToken.abi, - LayerZeroProvider: LayerZeroProvider.abi, - MintableBaseToken: MintableBaseToken.abi, - Multicall: Multicall.abi, - MultichainClaimsRouter: MultichainClaimsRouter.abi, - MultichainGlvRouter: MultichainGlvRouter.abi, - MultichainGmRouter: MultichainGmRouter.abi, - MultichainOrderRouter: MultichainOrderRouter.abi, - MultichainSubaccountRouter: MultichainSubaccountRouter.abi, - MultichainTransferRouter: MultichainTransferRouter.abi, - MultichainUtils: MultichainUtils.abi, - MultichainVault: MultichainVault.abi, - ReferralStorage: ReferralStorage.abi, - RelayParams: RelayParams.abi, - RewardReader: RewardReader.abi, - RewardRouter: RewardRouter.abi, - RewardTracker: RewardTracker.abi, - SmartAccount: SmartAccount.abi, - StBTC: StBTC.abi, - SubaccountGelatoRelayRouter: SubaccountGelatoRelayRouter.abi, - SubaccountRouter: SubaccountRouter.abi, - SyntheticsReader: SyntheticsReader.abi, - SyntheticsRouter: SyntheticsRouter.abi, - Timelock: Timelock.abi, - Token: Token.abi, - Reader: Reader.abi, - ReaderV2: ReaderV2.abi, - Treasury: Treasury.abi, - UniPool: UniPool.abi, - UniswapV2: UniswapV2.abi, - Vault: Vault.abi, - VaultReader: VaultReader.abi, - VaultV2: VaultV2.abi, - VaultV2b: VaultV2b.abi, - Vester: Vester.abi, - WETH: WETH.abi, -} satisfies Record as any; + ERC20PermitInterface, + ERC721: ERC721, + EventEmitter, + ExchangeRouter, + GelatoRelayRouter, + GlpManager, + GlvReader, + GlvRouter, + GmxMigrator, + GovToken, + LayerZeroProvider, + MintableBaseToken, + Multicall, + MultichainClaimsRouter, + MultichainGlvRouter, + MultichainGmRouter, + MultichainOrderRouter, + MultichainSubaccountRouter, + MultichainTransferRouter, + MultichainUtils, + MultichainVault, + ReferralStorage, + RelayParams, + RewardReader, + RewardRouter, + RewardTracker, + SmartAccount, + StBTC, + SubaccountGelatoRelayRouter, + SubaccountRouter, + SyntheticsReader, + SyntheticsRouter, + Timelock, + Token, + Reader, + ReaderV2, + Treasury, + UniPool, + UniswapV2, + Vault, + VaultReader, + VaultV2, + VaultV2b, + Vester, + WETH, +} satisfies Record; + +export type AbiId = keyof typeof abis; diff --git a/sdk/src/utils/multicall.ts b/sdk/src/utils/multicall.ts index cbde25caf6..12db66a4d6 100644 --- a/sdk/src/utils/multicall.ts +++ b/sdk/src/utils/multicall.ts @@ -68,8 +68,8 @@ export class Multicall { // Add Errors ABI to each contract ABI to correctly parse errors abis[contractCallConfig.contractAddress] = abis[contractCallConfig.contractAddress] || [ - ...allAbis[contractCallConfig.abiId], - ...allAbis.CustomErrors, + ...(allAbis[contractCallConfig.abiId] as any), + ...(allAbis.CustomErrors as any), ]; const abi = abis[contractCallConfig.contractAddress]; diff --git a/sdk/src/utils/orderTransactions.ts b/sdk/src/utils/orderTransactions.ts index 8c2febd5f3..c875fecc4e 100644 --- a/sdk/src/utils/orderTransactions.ts +++ b/sdk/src/utils/orderTransactions.ts @@ -1,9 +1,9 @@ import uniq from "lodash/uniq"; import { encodeFunctionData, zeroAddress, zeroHash } from "viem"; -import ExchangeRouterAbi from "abis/ExchangeRouter.json"; +import ExchangeRouterAbi from "abis/ExchangeRouter"; import { abis } from "abis/index"; -import ERC20ABI from "abis/Token.json"; +import ERC20ABI from "abis/Token"; import { ContractsChainId, getExcessiveExecutionFee, getHighExecutionFee } from "configs/chains"; import { getContract } from "configs/contracts"; import { convertTokenAddress, getToken, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "configs/tokens"; @@ -759,7 +759,7 @@ export function getExternalCallsPayload({ payload.externalCallTargets.push(inTokenAddress); payload.externalCallDataList.push( encodeFunctionData({ - abi: ERC20ABI.abi, + abi: ERC20ABI, functionName: "approve", args: [quote.txnData.to, MaxUint256], }) @@ -909,13 +909,13 @@ export function encodeExchangeRouterMulticall(multicall: ExchangeRouterCall[]) { const encodedMulticall = multicall.map((call) => encodeFunctionData({ abi: abis.ExchangeRouter, - functionName: call.method, - args: call.params, + functionName: call.method as any, + args: call.params as any, }) ); const callData = encodeFunctionData({ - abi: ExchangeRouterAbi.abi, + abi: ExchangeRouterAbi, functionName: "multicall", args: [encodedMulticall], }); diff --git a/sdk/src/utils/swap/botanixStaking.ts b/sdk/src/utils/swap/botanixStaking.ts index 10cbe477d4..3aa8bc484f 100644 --- a/sdk/src/utils/swap/botanixStaking.ts +++ b/sdk/src/utils/swap/botanixStaking.ts @@ -1,6 +1,6 @@ import { encodeFunctionData } from "viem"; -import StBTCABI from "abis/StBTC.json"; +import StBTCABI from "abis/StBTC"; import { BOTANIX } from "configs/chains"; import { getContract } from "configs/contracts"; import { TokensData } from "types/tokens"; @@ -62,7 +62,7 @@ export const getBotanixStakingExternalSwapQuote = ({ txnData: { to: getContract(BOTANIX, "StBTC"), data: encodeFunctionData({ - abi: StBTCABI.abi, + abi: StBTCABI, functionName: "deposit", args: [amountIn, receiverAddress], }), @@ -97,7 +97,7 @@ export const getBotanixStakingExternalSwapQuote = ({ txnData: { to: getContract(BOTANIX, "StBTC"), data: encodeFunctionData({ - abi: StBTCABI.abi, + abi: StBTCABI, functionName: "withdraw", args: [amountIn, receiverAddress, getContract(BOTANIX, "ExternalHandler")], }), diff --git a/sdk/tsconfig.json b/sdk/tsconfig.json index ed98e673c5..560292a723 100644 --- a/sdk/tsconfig.json +++ b/sdk/tsconfig.json @@ -38,5 +38,5 @@ { "transform": "typescript-transform-paths", "afterDeclarations": true } ] }, - "include": ["./src", "./src/**/*.json", "./scripts"] + "include": ["./src", "./src/**/*.json", "./scripts", "../viem-override.d.ts"] } diff --git a/sdk/yarn.lock b/sdk/yarn.lock index f07a04d125..33c0cca928 100644 --- a/sdk/yarn.lock +++ b/sdk/yarn.lock @@ -755,7 +755,7 @@ __metadata: typescript: 5.4.2 typescript-transform-paths: 3.5.1 universal-perf-hooks: 1.0.1 - viem: ^2.37.1 + viem: 2.37.1 vitest: 3.0.4 languageName: unknown linkType: soft @@ -5497,7 +5497,7 @@ __metadata: languageName: node linkType: hard -"viem@npm:^2.37.1": +"viem@npm:2.37.1": version: 2.37.1 resolution: "viem@npm:2.37.1" dependencies: @@ -5518,6 +5518,27 @@ __metadata: languageName: node linkType: hard +"viem@patch:viem@npm:2.37.1#../.yarn/patches/viem-npm-2.37.1-7013552341::locator=%40gmx-io%2Fsdk%40workspace%3A.": + version: 2.37.1 + resolution: "viem@patch:viem@npm%3A2.37.1#../.yarn/patches/viem-npm-2.37.1-7013552341::version=2.37.1&hash=775d28&locator=%40gmx-io%2Fsdk%40workspace%3A." + dependencies: + "@noble/curves": 1.9.1 + "@noble/hashes": 1.8.0 + "@scure/bip32": 1.7.0 + "@scure/bip39": 1.6.0 + abitype: 1.0.8 + isows: 1.0.7 + ox: 0.9.3 + ws: 8.18.3 + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: d40647c06fca3c6e9c8d684cbfbff9b16c38cd0409e98ed988fc1540bd17ad563fe4384f6aae89084e9bac1be3a3f14671a3dde244eb3f15bafb92626938d250 + languageName: node + linkType: hard + "vite-node@npm:3.0.4": version: 3.0.4 resolution: "vite-node@npm:3.0.4" diff --git a/src/components/GmxAccountModal/toastCustomOrStargateError.ts b/src/components/GmxAccountModal/toastCustomOrStargateError.ts index 6713a69943..4155953e5d 100644 --- a/src/components/GmxAccountModal/toastCustomOrStargateError.ts +++ b/src/components/GmxAccountModal/toastCustomOrStargateError.ts @@ -1,4 +1,4 @@ -import { decodeErrorResult } from "viem"; +import { Abi, decodeErrorResult } from "viem"; import type { AnyChainId } from "config/chains"; import { StargateErrorsAbi } from "config/multichain"; @@ -15,7 +15,7 @@ export function toastCustomOrStargateError(chainId: AnyChainId, error: Error) { if (data) { try { const parsedError = decodeErrorResult({ - abi: abis.CustomErrors.concat(StargateErrorsAbi), + abi: (abis.CustomErrors as Abi).concat(StargateErrorsAbi), data, }); diff --git a/src/components/TableMarketFilter/MarketFilterLongShort.tsx b/src/components/TableMarketFilter/MarketFilterLongShort.tsx index 67da0700c3..25e8eb26e2 100644 --- a/src/components/TableMarketFilter/MarketFilterLongShort.tsx +++ b/src/components/TableMarketFilter/MarketFilterLongShort.tsx @@ -166,7 +166,9 @@ export function MarketFilterLongShort({ value, onChange, withPositions, asButton ? getNormalizedTokenSymbol(market.longToken.symbol) + getNormalizedTokenSymbol(market.shortToken.symbol) : market.indexToken.symbol; - const collateralToken = props.item.collateralAddress && getToken(chainId, props.item.collateralAddress); + const collateralToken = props.item.collateralAddress + ? getToken(chainId, props.item.collateralAddress) + : undefined; const collateralSymbol = collateralToken?.symbol; if (props.item.direction === "long" || props.item.direction === "short") { diff --git a/src/config/multichain.ts b/src/config/multichain.ts index c5fb0a4fec..bb3a7aacc0 100644 --- a/src/config/multichain.ts +++ b/src/config/multichain.ts @@ -11,7 +11,7 @@ import { address as ethPoolOptimismSepolia } from "@stargatefinance/stg-evm-sdk- import { address as usdcSgPoolOptimismSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/optsep-testnet/StargatePoolUSDC.json"; import { address as ethPoolSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/sepolia-testnet/StargatePoolNative.json"; import { address as usdcSgPoolSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/sepolia-testnet/StargatePoolUSDC.json"; -import { Wallet, type JsonFragment } from "ethers"; +import { Wallet } from "ethers"; import invert from "lodash/invert"; import mapValues from "lodash/mapValues"; import uniq from "lodash/uniq"; @@ -338,7 +338,7 @@ export const CHAIN_ID_PREFERRED_DEPOSIT_TOKEN: Record export const MULTICHAIN_FUNDING_SLIPPAGE_BPS = 50; -export const StargateErrorsAbi = _StargateErrorsAbi as readonly (Abi[number] & JsonFragment)[]; +export const StargateErrorsAbi = _StargateErrorsAbi as Abi; export const CHAIN_ID_TO_ENDPOINT_ID: Record = { [ARBITRUM_SEPOLIA]: 40231, diff --git a/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts b/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts index eb46d014e5..a2f07deba4 100644 --- a/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts +++ b/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts @@ -142,24 +142,22 @@ export async function estimateMultichainDepositNetworkComposeGas({ stateOverride.push(stateOverrideForNative); } - const args = [ - // From - stargatePool, - // Guid - toHex(0, { size: 32 }), - // Message - message, - // Executor - zeroAddress, - // Extra Data - "0x", - ]; - const gas = await settlementChainPublicClient.estimateContractGas({ address, abi: abis.LayerZeroProvider, functionName: "lzCompose", - args, + args: [ + // From + stargatePool, + // Guid + toHex(0, { size: 32 }), + // Message + message, + // Executor + zeroAddress, + // Extra Data + "0x", + ], account: CodecUiHelper.getLzEndpoint(chainId), stateOverride, }); diff --git a/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts b/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts index 7524f047c1..436b95f273 100644 --- a/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts +++ b/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts @@ -99,7 +99,7 @@ export async function buildAndSignClaimPositionPriceImpactFeesTxn({ const claimCollateralCallData = encodeFunctionData({ abi: abis.MultichainClaimsRouter, functionName: "claimCollateral", - args: [{ ...relayParams, signature }, account, srcChainId, markets, tokens, timeKeys, receiver], + args: [{ ...relayParams, signature }, account, BigInt(srcChainId), markets, tokens, timeKeys, receiver], }); return { diff --git a/src/domain/synthetics/claims/createClaimTransaction.ts b/src/domain/synthetics/claims/createClaimTransaction.ts index 547a74e9f9..c1b8d063e6 100644 --- a/src/domain/synthetics/claims/createClaimTransaction.ts +++ b/src/domain/synthetics/claims/createClaimTransaction.ts @@ -3,7 +3,7 @@ import { encodeFunctionData } from "viem"; import { getContract } from "config/contracts"; import { sendWalletTransaction, TxnCallback, WalletTxnCtx } from "lib/transactions"; import type { WalletSigner } from "lib/wallets"; -import ClaimHandlerAbi from "sdk/abis/ClaimHandler.json"; +import ClaimHandlerAbi from "sdk/abis/ClaimHandler"; import type { ContractsChainId } from "sdk/configs/chains"; export function getClaimTransactionCallData( @@ -19,7 +19,7 @@ export function getClaimTransactionCallData( })); return encodeFunctionData({ - abi: ClaimHandlerAbi.abi, + abi: ClaimHandlerAbi, functionName: "claimFunds", args: [params, account], }); diff --git a/src/domain/synthetics/express/expressOrderUtils.ts b/src/domain/synthetics/express/expressOrderUtils.ts index d87d0e67c7..8716ad2fbd 100644 --- a/src/domain/synthetics/express/expressOrderUtils.ts +++ b/src/domain/synthetics/express/expressOrderUtils.ts @@ -56,8 +56,6 @@ import { } from "sdk/utils/orderTransactions"; import { nowInSeconds } from "sdk/utils/time"; import { setUiFeeReceiverIsExpress } from "sdk/utils/twap/uiFeeReceiver"; -import { GelatoRelayRouter, MultichainSubaccountRouter, SubaccountGelatoRelayRouter } from "typechain-types"; -import { MultichainOrderRouter } from "typechain-types/MultichainOrderRouter"; import { approximateL1GasBuffer, estimateBatchGasLimit, estimateRelayerGasLimit, GasLimitsConfig } from "../fees"; import { getNeedTokenApprove } from "../tokens"; @@ -533,7 +531,7 @@ export async function buildAndSignExpressBatchOrderTxn({ relayPayload: { ...(relayParamsPayload as RelayParamsPayload), deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), - userNonce: nowInSeconds(), + userNonce: BigInt(nowInSeconds()), } satisfies RelayParamsPayload, subaccountApproval: subaccount?.signedApproval, paramsLists: getBatchParamsLists(batchParams), @@ -578,7 +576,7 @@ export async function buildAndSignExpressBatchOrderTxn({ BigInt(srcChainId), subaccount.signedApproval?.subaccount, params.paramsLists, - ] satisfies Parameters, + ], }); } else { batchCalldata = encodeFunctionData({ @@ -592,7 +590,7 @@ export async function buildAndSignExpressBatchOrderTxn({ params.account, BigInt(srcChainId), params.paramsLists, - ] satisfies Parameters, + ], }); } } else { @@ -609,7 +607,7 @@ export async function buildAndSignExpressBatchOrderTxn({ params.account, subaccount.signedApproval?.subaccount, params.paramsLists, - ] satisfies Parameters, + ], }); } else { batchCalldata = encodeFunctionData({ @@ -622,7 +620,7 @@ export async function buildAndSignExpressBatchOrderTxn({ }, params.account, params.paramsLists, - ] satisfies Parameters, + ], }); } } diff --git a/src/domain/synthetics/express/relayParamsUtils.ts b/src/domain/synthetics/express/relayParamsUtils.ts index c5151c88f3..afa16df8be 100644 --- a/src/domain/synthetics/express/relayParamsUtils.ts +++ b/src/domain/synthetics/express/relayParamsUtils.ts @@ -222,7 +222,7 @@ export function getRawRelayerParams({ externalCalls, fee: feeParams, desChainId: BigInt(chainId), - userNonce: nowInSeconds(), + userNonce: BigInt(nowInSeconds()), }; return relayParamsPayload; @@ -230,17 +230,25 @@ export function getRawRelayerParams({ export function hashRelayParams(relayParams: RelayParamsPayload) { const encoded = encodeAbiParameters(abis.RelayParams, [ - [relayParams.oracleParams.tokens, relayParams.oracleParams.providers, relayParams.oracleParams.data], - [ - relayParams.externalCalls.sendTokens, - relayParams.externalCalls.sendAmounts, - relayParams.externalCalls.externalCallTargets, - relayParams.externalCalls.externalCallDataList, - relayParams.externalCalls.refundTokens, - relayParams.externalCalls.refundReceivers, - ], + { + tokens: relayParams.oracleParams.tokens, + providers: relayParams.oracleParams.providers, + data: relayParams.oracleParams.data, + }, + { + sendTokens: relayParams.externalCalls.sendTokens, + sendAmounts: relayParams.externalCalls.sendAmounts, + externalCallTargets: relayParams.externalCalls.externalCallTargets, + externalCallDataList: relayParams.externalCalls.externalCallDataList, + refundTokens: relayParams.externalCalls.refundTokens, + refundReceivers: relayParams.externalCalls.refundReceivers, + }, relayParams.tokenPermits, - [relayParams.fee.feeToken, relayParams.fee.feeAmount, relayParams.fee.feeSwapPath], + { + feeToken: relayParams.fee.feeToken, + feeAmount: relayParams.fee.feeAmount, + feeSwapPath: relayParams.fee.feeSwapPath, + }, relayParams.userNonce, relayParams.deadline, relayParams.desChainId, diff --git a/src/domain/synthetics/express/types.ts b/src/domain/synthetics/express/types.ts index 263fb4a4a7..6c0c809b54 100644 --- a/src/domain/synthetics/express/types.ts +++ b/src/domain/synthetics/express/types.ts @@ -83,7 +83,7 @@ export type RelayParamsPayload = { fee: RelayFeePayload; deadline: bigint; desChainId: bigint; - userNonce: bigint | number; + userNonce: bigint; }; export type RelayParamsPayloadWithSignature = RelayParamsPayload & { diff --git a/src/domain/synthetics/express/useL1ExpressGasReference.ts b/src/domain/synthetics/express/useL1ExpressGasReference.ts index 20fb9bc0f9..1aea5515c7 100644 --- a/src/domain/synthetics/express/useL1ExpressGasReference.ts +++ b/src/domain/synthetics/express/useL1ExpressGasReference.ts @@ -38,8 +38,8 @@ export function useL1ExpressOrderGasReference() { const referenceDecoded = decodeFunctionResult({ abi: abis.ArbitrumNodeInterface, functionName: "gasEstimateL1Component", - data: referenceResult as `0x${string}`, - }) as [bigint]; + data: referenceResult, + }); return { gasLimit: referenceDecoded[0], diff --git a/src/domain/synthetics/markets/claimFundingFeesTxn.ts b/src/domain/synthetics/markets/claimFundingFeesTxn.ts index a16b8777af..0340ce0597 100644 --- a/src/domain/synthetics/markets/claimFundingFeesTxn.ts +++ b/src/domain/synthetics/markets/claimFundingFeesTxn.ts @@ -93,7 +93,7 @@ export async function buildAndSignClaimFundingFeesTxn({ const claimFundingFeesCallData = encodeFunctionData({ abi: abis.MultichainClaimsRouter, functionName: "claimFundingFees", - args: [{ ...relayParams, signature }, account, srcChainId, markets, tokens, receiver], + args: [{ ...relayParams, signature }, account, BigInt(srcChainId), markets, tokens, receiver], }); return { diff --git a/src/domain/synthetics/orders/createStakeOrUnStakeTxn.tsx b/src/domain/synthetics/orders/createStakeOrUnStakeTxn.tsx index ca34c70d48..7ba2a4d2c4 100644 --- a/src/domain/synthetics/orders/createStakeOrUnStakeTxn.tsx +++ b/src/domain/synthetics/orders/createStakeOrUnStakeTxn.tsx @@ -7,8 +7,8 @@ import { getContract } from "config/contracts"; import { helperToast } from "lib/helperToast"; import { sleep } from "lib/sleep"; import { sendWalletTransaction, TxnEventName } from "lib/transactions"; -import StBTCABI from "sdk/abis/StBTC.json"; -import ERC20ABI from "sdk/abis/Token.json"; +import StBTCABI from "sdk/abis/StBTC"; +import ERC20ABI from "sdk/abis/Token"; import { encodeExchangeRouterMulticall, ExchangeRouterCall, ExternalCallsPayload } from "sdk/utils/orderTransactions"; import { StakeNotification } from "components/StatusNotification/StakeNotification"; @@ -57,12 +57,12 @@ export async function createStakeOrUnstakeTxn(chainId: number, signer: Signer, p externalCalls.externalCallTargets.push(getContract(chainId, "PBTC"), getContract(chainId, "StBTC")); externalCalls.externalCallDataList.push( encodeFunctionData({ - abi: ERC20ABI.abi, + abi: ERC20ABI, functionName: "approve", args: [getContract(chainId, "StBTC"), p.amount], }), encodeFunctionData({ - abi: StBTCABI.abi, + abi: StBTCABI, functionName: "deposit", args: [p.amount, address], }) @@ -73,7 +73,7 @@ export async function createStakeOrUnstakeTxn(chainId: number, signer: Signer, p throw new Error("Unwrapping not implemented"); } - const stBTC = new ethers.Contract(getContract(chainId, "StBTC"), StBTCABI.abi, signer); + const stBTC = new ethers.Contract(getContract(chainId, "StBTC"), StBTCABI, signer); const tx = await stBTC.withdraw(p.amount, address, address); await signer.provider?.waitForTransaction(tx.hash, 0); diff --git a/src/domain/synthetics/subaccount/removeSubaccount.ts b/src/domain/synthetics/subaccount/removeSubaccount.ts index 23a4a348b5..af988abf5c 100644 --- a/src/domain/synthetics/subaccount/removeSubaccount.ts +++ b/src/domain/synthetics/subaccount/removeSubaccount.ts @@ -12,11 +12,10 @@ import { ExpressTxnData, sendExpressTransaction } from "lib/transactions"; import type { WalletSigner } from "lib/wallets"; import { signTypedData } from "lib/wallets/signing"; import { abis } from "sdk/abis"; -import SubaccountRouter from "sdk/abis/SubaccountRouter.json"; +import SubaccountRouterAbi from "sdk/abis/SubaccountRouter"; import { getContract } from "sdk/configs/contracts"; import { DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION } from "sdk/configs/express"; import { nowInSeconds } from "sdk/utils/time"; -import { MultichainSubaccountRouter, SubaccountGelatoRelayRouter } from "typechain-types"; import { ExpressTransactionBuilder, @@ -34,7 +33,7 @@ export async function removeSubaccountWalletTxn( signer: Signer, subaccountAddress: string ): Promise { - const subaccountRouter = new ethers.Contract(getContract(chainId, "SubaccountRouter"), SubaccountRouter.abi, signer); + const subaccountRouter = new ethers.Contract(getContract(chainId, "SubaccountRouter"), SubaccountRouterAbi, signer); return callContract(chainId, subaccountRouter, "removeSubaccount", [subaccountAddress], { value: 0n, @@ -84,20 +83,20 @@ export async function buildAndSignRemoveSubaccountTxn({ }); } - const removeSubaccountCallData = encodeFunctionData({ - abi: isMultichain ? abis.MultichainSubaccountRouter : abis.SubaccountGelatoRelayRouter, - functionName: "removeSubaccount", - args: isMultichain - ? ([ - { ...relayParamsPayload, signature }, - signer.address, - srcChainId ?? chainId, - subaccount.address, - ] satisfies Parameters) - : ([{ ...relayParamsPayload, signature }, signer.address, subaccount.address] satisfies Parameters< - SubaccountGelatoRelayRouter["removeSubaccount"] - >), - }); + let removeSubaccountCallData: string; + if (isMultichain) { + removeSubaccountCallData = encodeFunctionData({ + abi: abis.MultichainSubaccountRouter, + functionName: "removeSubaccount", + args: [{ ...relayParamsPayload, signature }, signer.address, BigInt(srcChainId ?? chainId), subaccount.address], + }); + } else { + removeSubaccountCallData = encodeFunctionData({ + abi: abis.SubaccountGelatoRelayRouter, + functionName: "removeSubaccount", + args: [{ ...relayParamsPayload, signature }, signer.address, subaccount.address], + }); + } return { callData: removeSubaccountCallData, diff --git a/src/domain/synthetics/subaccount/types.ts b/src/domain/synthetics/subaccount/types.ts index c9355e4ce0..1dc1dd37af 100644 --- a/src/domain/synthetics/subaccount/types.ts +++ b/src/domain/synthetics/subaccount/types.ts @@ -26,7 +26,7 @@ export type SubaccountApproval = { expiresAt: bigint; maxAllowedCount: bigint; actionType: string; - desChainId: ContractsChainId; + desChainId: bigint; deadline: bigint; integrationId: string; }; diff --git a/src/domain/synthetics/subaccount/utils.ts b/src/domain/synthetics/subaccount/utils.ts index 833bfd0581..10f09c2876 100644 --- a/src/domain/synthetics/subaccount/utils.ts +++ b/src/domain/synthetics/subaccount/utils.ts @@ -301,7 +301,7 @@ export function getEmptySubaccountApproval( actionType: SUBACCOUNT_ORDER_ACTION, nonce: 0n, deadline: maxUint256, - desChainId: chainId, + desChainId: BigInt(chainId), signature: ZERO_DATA, signedAt: 0, integrationId: zeroHash, @@ -499,7 +499,7 @@ export async function createAndSignSubaccountApproval( shouldAdd: params.shouldAdd, expiresAt: params.expiresAt, maxAllowedCount: params.maxAllowedCount, - desChainId: chainId, + desChainId: BigInt(chainId), actionType: SUBACCOUNT_ORDER_ACTION, nonce, integrationId: zeroHash, diff --git a/src/domain/tokens/approveTokens.tsx b/src/domain/tokens/approveTokens.tsx index b212b4873f..6d218ec2bd 100644 --- a/src/domain/tokens/approveTokens.tsx +++ b/src/domain/tokens/approveTokens.tsx @@ -7,7 +7,7 @@ import { AddTokenPermitFn } from "context/TokenPermitsContext/TokenPermitsContex import { INVALID_PERMIT_SIGNATURE_ERROR } from "lib/errors/customErrors"; import { helperToast } from "lib/helperToast"; import { metrics } from "lib/metrics"; -import Token from "sdk/abis/Token.json"; +import TokenAbi from "sdk/abis/Token"; import { getNativeToken, getToken } from "sdk/configs/tokens"; import { InfoTokens, TokenInfo } from "sdk/types/tokens"; @@ -112,7 +112,7 @@ export async function approveTokens({ }); } - const contract = new ethers.Contract(tokenAddress, Token.abi, signer); + const contract = new ethers.Contract(tokenAddress, TokenAbi, signer); const nativeToken = getNativeToken(chainId); const networkName = getChainName(chainId); return await contract diff --git a/src/domain/tokens/permitUtils.ts b/src/domain/tokens/permitUtils.ts index b25c291207..fcc222327d 100644 --- a/src/domain/tokens/permitUtils.ts +++ b/src/domain/tokens/permitUtils.ts @@ -1,12 +1,18 @@ import { ethers } from "ethers"; -import { decodeFunctionResult, encodeFunctionData, recoverTypedDataAddress } from "viem"; +import { + Abi, + decodeFunctionResult, + encodeFunctionData, + EncodeFunctionDataParameters, + recoverTypedDataAddress, +} from "viem"; import { parseError } from "lib/errors"; import { defined } from "lib/guards"; import { WalletSigner } from "lib/wallets"; import { signTypedData, splitSignature } from "lib/wallets/signing"; import { abis } from "sdk/abis"; -import ERC20PermitInterfaceAbi from "sdk/abis/ERC20PermitInterface.json"; +import ERC20PermitInterfaceAbi from "sdk/abis/ERC20PermitInterface"; import type { ContractsChainId } from "sdk/configs/chains"; import { getContract } from "sdk/configs/contracts"; import { DEFAULT_PERMIT_DEADLINE_DURATION } from "sdk/configs/express"; @@ -87,26 +93,33 @@ export async function getTokenPermitParams( }> { const token = getToken(chainId, tokenAddress); - const calls = [ + const calls: { + contractAddress: string; + abi: Abi; + functionName: string; + args: any[]; + }[] = [ { contractAddress: tokenAddress, abi: abis.ERC20PermitInterface, functionName: "name", args: [], - }, + } satisfies EncodeFunctionDataParameters & { contractAddress: string }, { contractAddress: tokenAddress, abi: abis.ERC20PermitInterface, functionName: "nonces", args: [owner], - }, + } satisfies EncodeFunctionDataParameters & { contractAddress: string }, !token.contractVersion - ? { + ? ({ contractAddress: tokenAddress, abi: abis.ERC20PermitInterface, functionName: "version", args: [], - } + } satisfies EncodeFunctionDataParameters & { + contractAddress: string; + }) : undefined, ].filter(defined); @@ -133,21 +146,21 @@ export async function getTokenPermitParams( }) as [bigint, string[]]; const name = decodeFunctionResult({ - abi: ERC20PermitInterfaceAbi.abi, + abi: ERC20PermitInterfaceAbi, functionName: "name", data: decodedMulticallResults[0] as `0x${string}`, }) as string; const nonce = decodeFunctionResult({ - abi: ERC20PermitInterfaceAbi.abi, + abi: ERC20PermitInterfaceAbi, functionName: "nonces", - data: decodedMulticallResults[1] as `0x${string}`, + data: decodedMulticallResults[1], }) as bigint; const version = token.contractVersion ?? (decodeFunctionResult({ - abi: ERC20PermitInterfaceAbi.abi, + abi: ERC20PermitInterfaceAbi, functionName: "version", data: decodedMulticallResults[2] as `0x${string}`, }) as string); diff --git a/src/lib/multicall/Multicall.ts b/src/lib/multicall/Multicall.ts index f724139241..34b1bfbd34 100644 --- a/src/lib/multicall/Multicall.ts +++ b/src/lib/multicall/Multicall.ts @@ -121,7 +121,10 @@ export class Multicall { // Add Errors ABI to each contract ABI to correctly parse errors if (!abiWithErrorsMap[contractCallConfig.abiId]) { - abiWithErrorsMap[contractCallConfig.abiId] = [...allAbis[contractCallConfig.abiId], ...allAbis.CustomErrors]; + abiWithErrorsMap[contractCallConfig.abiId] = [ + ...(allAbis[contractCallConfig.abiId] as any), + ...(allAbis.CustomErrors as any), + ]; } const abi = abiWithErrorsMap[contractCallConfig.abiId]; diff --git a/src/lib/wallets/useAccountType.ts b/src/lib/wallets/useAccountType.ts index 13e5a970b3..50fd803f47 100644 --- a/src/lib/wallets/useAccountType.ts +++ b/src/lib/wallets/useAccountType.ts @@ -9,7 +9,7 @@ export enum AccountType { EOA, } -async function isSafeAccount(address: `0x${string}`, client: PublicClient): Promise { +async function isSafeAccount(address: string, client: PublicClient): Promise { const bytecode = await client.getBytecode({ address }); if (!bytecode || bytecode === "0x") { return false; @@ -33,7 +33,7 @@ async function isSafeAccount(address: `0x${string}`, client: PublicClient): Prom return knownSafeSingletons.includes(masterCopy); } -async function getAccountType(address: `0x${string}`, client: PublicClient): Promise { +async function getAccountType(address: string, client: PublicClient): Promise { const bytecode = await client.getBytecode({ address }); if (!bytecode || bytecode === "0x") { return AccountType.EOA; diff --git a/tsconfig.json b/tsconfig.json index 363c3fb8bf..a0d81ea635 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,5 +27,5 @@ } }, "references": [{ "path": "./sdk" }], - "include": ["src", "scripts"] + "include": ["src", "scripts", "viem-override.d.ts"] } diff --git a/viem-override.d.ts b/viem-override.d.ts new file mode 100644 index 0000000000..8c2482caf4 --- /dev/null +++ b/viem-override.d.ts @@ -0,0 +1,12 @@ +import "abitype"; + +declare module "abitype" { + export interface Register { + addressType: string; + bytesType: { + inputs: string; + outputs: `0x${string}`; + }; + bigIntType: bigint; + } +} diff --git a/yarn.lock b/yarn.lock index 5b606cc048..5e7d3bb8eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16378,6 +16378,27 @@ __metadata: languageName: node linkType: hard +"viem@patch:viem@npm:2.37.1#.yarn/patches/viem-npm-2.37.1-7013552341::locator=gmx-interface%40workspace%3A.": + version: 2.37.1 + resolution: "viem@patch:viem@npm%3A2.37.1#.yarn/patches/viem-npm-2.37.1-7013552341::version=2.37.1&hash=775d28&locator=gmx-interface%40workspace%3A." + dependencies: + "@noble/curves": 1.9.1 + "@noble/hashes": 1.8.0 + "@scure/bip32": 1.7.0 + "@scure/bip39": 1.6.0 + abitype: 1.0.8 + isows: 1.0.7 + ox: 0.9.3 + ws: 8.18.3 + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: d40647c06fca3c6e9c8d684cbfbff9b16c38cd0409e98ed988fc1540bd17ad563fe4384f6aae89084e9bac1be3a3f14671a3dde244eb3f15bafb92626938d250 + languageName: node + linkType: hard + "vite-bundle-analyzer@npm:0.20.1": version: 0.20.1 resolution: "vite-bundle-analyzer@npm:0.20.1" From 6268cbe4573d589fbc56517a7ec57990efa5154f Mon Sep 17 00:00:00 2001 From: midas-myth Date: Mon, 6 Oct 2025 13:49:32 +0200 Subject: [PATCH 2/4] Abi migration fixes --- sdk/src/utils/errors/parseError.ts | 4 ++-- src/components/UserIncentiveDistributionList/utils.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/src/utils/errors/parseError.ts b/sdk/src/utils/errors/parseError.ts index 15b343e697..84f4a5b28d 100644 --- a/sdk/src/utils/errors/parseError.ts +++ b/sdk/src/utils/errors/parseError.ts @@ -1,5 +1,5 @@ import cryptoJs from "crypto-js"; -import { Abi, Address, decodeErrorResult } from "viem"; +import { Abi, decodeErrorResult } from "viem"; import { abis } from "abis"; @@ -155,7 +155,7 @@ export function parseError(error: ErrorLike | string | undefined, errorDepth = 0 if (errorData) { const parsedError = decodeErrorResult({ abi: abis.CustomErrors as Abi, - data: errorData as Address, + data: errorData, }); if (parsedError) { diff --git a/src/components/UserIncentiveDistributionList/utils.tsx b/src/components/UserIncentiveDistributionList/utils.tsx index 3a6bc7f020..48dd6362b7 100644 --- a/src/components/UserIncentiveDistributionList/utils.tsx +++ b/src/components/UserIncentiveDistributionList/utils.tsx @@ -44,7 +44,7 @@ export async function checkValidity({ address: account, abi: abis.SmartAccount, functionName: "isValidSignature", - args: [hash, claimTermsAcceptedSignature], + args: [hash, claimTermsAcceptedSignature ?? "0x"], }), publicClient.readContract({ address: account, From 9c12ad834a81c197db6b4b121ecf029bcf6e7f88 Mon Sep 17 00:00:00 2001 From: midas-myth Date: Mon, 6 Oct 2025 14:12:36 +0200 Subject: [PATCH 3/4] Sync translation --- package.json | 1 - src/locales/de/messages.po | 2 +- src/locales/es/messages.po | 2 +- src/locales/fr/messages.po | 2 +- src/locales/ja/messages.po | 2 +- src/locales/ko/messages.po | 2 +- src/locales/ru/messages.po | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d0a5bcdadf..eca87c78be 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "ts:clean": "tsc --build --clean && tsc --build", "tscheck": "yarn ts:clean && tsc -p tsconfig.json --noEmit", "prettier": "prettier --write src/**/*.{js,ts,jsx,tsx,css,scss}", - "typechain": "typechain --target ethers-v6 --out-dir ./src/typechain-types './sdk/src/abis/*.json'", "typechain:stargate": "typechain --target ethers-v6 --out-dir ./src/typechain-types-stargate './node_modules/@stargatefinance/stg-evm-sdk-v2/artifacts/src/interfaces/IStargate.sol/IStargate.json'", "postinstall": "yarn typechain && cd ./sdk && echo \"Building SDK\" && yarn && yarn build", "prebuild": "cd ./sdk && yarn tsx scripts/prebuild" diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index d1fb39680f..6020ea0460 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -4191,7 +4191,7 @@ msgstr "Verringern" #: src/lib/legacy.ts msgid "Order cannot be executed as it would reduce the position's leverage below 1" -msgstr "Auftrag kann nicht ausgeführt werden, da er die Hebelwirkung der Position unter 1 reduzieren würde<<<<<<< HEAD" +msgstr "Auftrag kann nicht ausgeführt werden, da er die Hebelwirkung der Position unter 1 reduzieren würde" #: src/components/PositionShare/PositionShare.tsx msgid "Link copied to clipboard." diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 7a538bbfdd..c6ca65dd04 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -4191,7 +4191,7 @@ msgstr "Reducir" #: src/lib/legacy.ts msgid "Order cannot be executed as it would reduce the position's leverage below 1" -msgstr "La orden no se puede ejecutar pues reduciría el apalancamiento de la posición por debajo de 1<<<<<<< HEAD" +msgstr "La orden no se puede ejecutar pues reduciría el apalancamiento de la posición por debajo de 1" #: src/components/PositionShare/PositionShare.tsx msgid "Link copied to clipboard." diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 6de1c1b393..c49d28496e 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -4191,7 +4191,7 @@ msgstr "Diminuer" #: src/lib/legacy.ts msgid "Order cannot be executed as it would reduce the position's leverage below 1" -msgstr "L'ordre ne peut être exécuté car il réduirait l'effet de levier de la position en dessous de 1<<<<<<< HEAD" +msgstr "L'ordre ne peut être exécuté car il réduirait l'effet de levier de la position en dessous de 1" #: src/components/PositionShare/PositionShare.tsx msgid "Link copied to clipboard." diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 4f990655b1..6c3b4640f7 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -4191,7 +4191,7 @@ msgstr "減少" #: src/lib/legacy.ts msgid "Order cannot be executed as it would reduce the position's leverage below 1" -msgstr "レバレッジ倍率が1倍以下になるため注文を執行できません<<<<<<< HEAD" +msgstr "レバレッジ倍率が1倍以下になるため注文を執行できません" #: src/components/PositionShare/PositionShare.tsx msgid "Link copied to clipboard." diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 052ff14642..b04cc434b9 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -4191,7 +4191,7 @@ msgstr "감소" #: src/lib/legacy.ts msgid "Order cannot be executed as it would reduce the position's leverage below 1" -msgstr "포지션의 레버리지가 1 미만으로 감소되므로 주문을 실행할 수 없습니다<<<<<<< HEAD" +msgstr "포지션의 레버리지가 1 미만으로 감소되므로 주문을 실행할 수 없습니다" #: src/components/PositionShare/PositionShare.tsx msgid "Link copied to clipboard." diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 27cd72e5d2..a9561de25a 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -4191,7 +4191,7 @@ msgstr "Уменьшить" #: src/lib/legacy.ts msgid "Order cannot be executed as it would reduce the position's leverage below 1" -msgstr "Ордер не может быть выполнен, так как это уменьшит кредитное плечо позиции ниже 1<<<<<<< HEAD" +msgstr "Ордер не может быть выполнен, так как это уменьшит кредитное плечо позиции ниже 1" #: src/components/PositionShare/PositionShare.tsx msgid "Link copied to clipboard." From 92905c53878e91ee64d60d0c88f6d78f8f17e858 Mon Sep 17 00:00:00 2001 From: midas-myth Date: Mon, 6 Oct 2025 14:15:06 +0200 Subject: [PATCH 4/4] Update postinstall script in package.json to remove typechain command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eca87c78be..a5d4b75b2c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "tscheck": "yarn ts:clean && tsc -p tsconfig.json --noEmit", "prettier": "prettier --write src/**/*.{js,ts,jsx,tsx,css,scss}", "typechain:stargate": "typechain --target ethers-v6 --out-dir ./src/typechain-types-stargate './node_modules/@stargatefinance/stg-evm-sdk-v2/artifacts/src/interfaces/IStargate.sol/IStargate.json'", - "postinstall": "yarn typechain && cd ./sdk && echo \"Building SDK\" && yarn && yarn build", + "postinstall": "cd ./sdk && echo \"Building SDK\" && yarn && yarn build", "prebuild": "cd ./sdk && yarn tsx scripts/prebuild" }, "dependencies": {