diff --git a/ethereum.db b/ethereum.db index 44853ccde..68acc3ce3 100644 Binary files a/ethereum.db and b/ethereum.db differ diff --git a/package-lock.json b/package-lock.json index 0fbd00aa4..24ec3bb18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6031,9 +6031,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001612", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001612.tgz", - "integrity": "sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==", + "version": "1.0.30001680", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", + "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", "dev": true, "funding": [ { diff --git a/packages/adapters-library/src/adapters/dinero/common/deploymentAddresses.ts b/packages/adapters-library/src/adapters/dinero/common/deploymentAddresses.ts new file mode 100644 index 000000000..9e585be92 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/common/deploymentAddresses.ts @@ -0,0 +1,20 @@ +import { getAddress } from 'ethers' +import { Chain } from '../../../core/constants/chains' + +export const PX_ETH_DEPLOYMENTS: Partial> = { + [Chain.Ethereum]: getAddress('0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6'), + [Chain.Optimism]: getAddress('0x300d2c875c6fb8ce4bf5480b4d34b7c9ea8a33a4'), + [Chain.Arbitrum]: getAddress('0x300d2c875c6fb8ce4bf5480b4d34b7c9ea8a33a4'), + [Chain.Bsc]: getAddress('0x300d2c875c6fb8ce4bf5480b4d34b7c9ea8a33a4'), + [Chain.Base]: getAddress('0x58adE43A276ddF3e101941571eDe398a32492Ed7'), + [Chain.Linea]: getAddress('0x58adE43A276ddF3e101941571eDe398a32492Ed7'), +} + +export const APX_ETH_DEPLOYMENTS: Partial> = { + [Chain.Ethereum]: getAddress('0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6'), + [Chain.Optimism]: getAddress('0x16ed8e219cde31e14a80dcb6c9127a5ec6e88e46'), + [Chain.Arbitrum]: getAddress('0x16ed8e219cde31e14a80dcb6c9127a5ec6e88e46'), + [Chain.Bsc]: getAddress('0x16ed8e219cde31e14a80dcb6c9127a5ec6e88e46'), + [Chain.Base]: getAddress('0xEd97D39448D1c3891aAFCb28c9CF63F893D65743'), + [Chain.Linea]: getAddress('0xEd97D39448D1c3891aAFCb28c9CF63F893D65743'), +} diff --git a/packages/adapters-library/src/adapters/dinero/contracts/ApxEth.ts b/packages/adapters-library/src/adapters/dinero/contracts/ApxEth.ts new file mode 100644 index 000000000..78a770da5 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/ApxEth.ts @@ -0,0 +1,1283 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface ApxEthInterface extends Interface { + getFunction( + nameOrSignature: + | "DOMAIN_SEPARATOR" + | "acceptOwnership" + | "allowance" + | "approve" + | "asset" + | "assetsPerShare" + | "balanceOf" + | "convertToAssets" + | "convertToShares" + | "decimals" + | "deposit" + | "earned" + | "harvest" + | "lastTimeRewardApplicable" + | "lastUpdateTime" + | "maxDeposit" + | "maxMint" + | "maxRedeem" + | "maxWithdraw" + | "mint" + | "name" + | "nonces" + | "notifyRewardAmount" + | "owner" + | "pendingOwner" + | "periodFinish" + | "permit" + | "pirexEth" + | "platform" + | "platformFee" + | "previewDeposit" + | "previewMint" + | "previewRedeem" + | "previewWithdraw" + | "redeem" + | "renounceOwnership" + | "rewardPerToken" + | "rewardPerTokenPaid" + | "rewardPerTokenStored" + | "rewardRate" + | "rewards" + | "setPirexEth" + | "setPlatform" + | "setPlatformFee" + | "setWithdrawalPenalty" + | "symbol" + | "totalAssets" + | "totalStaked" + | "totalSupply" + | "transfer" + | "transferFrom" + | "transferOwnership" + | "withdraw" + | "withdrawalPenalty" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "Approval" + | "Deposit" + | "Harvest" + | "OwnershipTransferStarted" + | "OwnershipTransferred" + | "PlatformFeeUpdated" + | "PlatformUpdated" + | "RewardAdded" + | "SetPirexEth" + | "Transfer" + | "Withdraw" + | "WithdrawalPenaltyUpdated" + ): EventFragment; + + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "asset", values?: undefined): string; + encodeFunctionData( + functionFragment: "assetsPerShare", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "convertToAssets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "convertToShares", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "deposit", + values: [BigNumberish, AddressLike] + ): string; + encodeFunctionData(functionFragment: "earned", values?: undefined): string; + encodeFunctionData(functionFragment: "harvest", values?: undefined): string; + encodeFunctionData( + functionFragment: "lastTimeRewardApplicable", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastUpdateTime", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "maxDeposit", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "maxMint", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "maxRedeem", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "maxWithdraw", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "mint", + values: [BigNumberish, AddressLike] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "notifyRewardAmount", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "pendingOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "periodFinish", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "permit", + values: [ + AddressLike, + AddressLike, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData(functionFragment: "pirexEth", values?: undefined): string; + encodeFunctionData(functionFragment: "platform", values?: undefined): string; + encodeFunctionData( + functionFragment: "platformFee", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "previewDeposit", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "previewMint", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "previewRedeem", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "previewWithdraw", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "redeem", + values: [BigNumberish, AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardPerToken", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardPerTokenPaid", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardPerTokenStored", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardRate", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "rewards", values?: undefined): string; + encodeFunctionData( + functionFragment: "setPirexEth", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "setPlatform", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "setPlatformFee", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setWithdrawalPenalty", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalAssets", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalStaked", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "withdraw", + values: [BigNumberish, AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "withdrawalPenalty", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "asset", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "assetsPerShare", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "convertToAssets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "convertToShares", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "earned", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "harvest", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "lastTimeRewardApplicable", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastUpdateTime", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "maxDeposit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "maxMint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "maxRedeem", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "maxWithdraw", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "notifyRewardAmount", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "pendingOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "periodFinish", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "pirexEth", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "platform", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "platformFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "previewDeposit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "previewMint", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "previewRedeem", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "previewWithdraw", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "redeem", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerTokenPaid", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerTokenStored", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "rewardRate", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "rewards", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setPirexEth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPlatform", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPlatformFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setWithdrawalPenalty", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalAssets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalStaked", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "withdrawalPenalty", + data: BytesLike + ): Result; +} + +export namespace ApprovalEvent { + export type InputTuple = [ + owner: AddressLike, + spender: AddressLike, + amount: BigNumberish + ]; + export type OutputTuple = [owner: string, spender: string, amount: bigint]; + export interface OutputObject { + owner: string; + spender: string; + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DepositEvent { + export type InputTuple = [ + caller: AddressLike, + owner: AddressLike, + assets: BigNumberish, + shares: BigNumberish + ]; + export type OutputTuple = [ + caller: string, + owner: string, + assets: bigint, + shares: bigint + ]; + export interface OutputObject { + caller: string; + owner: string; + assets: bigint; + shares: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace HarvestEvent { + export type InputTuple = [caller: AddressLike, value: BigNumberish]; + export type OutputTuple = [caller: string, value: bigint]; + export interface OutputObject { + caller: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OwnershipTransferStartedEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PlatformFeeUpdatedEvent { + export type InputTuple = [fee: BigNumberish]; + export type OutputTuple = [fee: bigint]; + export interface OutputObject { + fee: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PlatformUpdatedEvent { + export type InputTuple = [_platform: AddressLike]; + export type OutputTuple = [_platform: string]; + export interface OutputObject { + _platform: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RewardAddedEvent { + export type InputTuple = [reward: BigNumberish]; + export type OutputTuple = [reward: bigint]; + export interface OutputObject { + reward: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SetPirexEthEvent { + export type InputTuple = [_pirexEth: AddressLike]; + export type OutputTuple = [_pirexEth: string]; + export interface OutputObject { + _pirexEth: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TransferEvent { + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + amount: BigNumberish + ]; + export type OutputTuple = [from: string, to: string, amount: bigint]; + export interface OutputObject { + from: string; + to: string; + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace WithdrawEvent { + export type InputTuple = [ + caller: AddressLike, + receiver: AddressLike, + owner: AddressLike, + assets: BigNumberish, + shares: BigNumberish + ]; + export type OutputTuple = [ + caller: string, + receiver: string, + owner: string, + assets: bigint, + shares: bigint + ]; + export interface OutputObject { + caller: string; + receiver: string; + owner: string; + assets: bigint; + shares: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace WithdrawalPenaltyUpdatedEvent { + export type InputTuple = [penalty: BigNumberish]; + export type OutputTuple = [penalty: bigint]; + export interface OutputObject { + penalty: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface ApxEth extends BaseContract { + connect(runner?: ContractRunner | null): ApxEth; + waitForDeployment(): Promise; + + interface: ApxEthInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; + + acceptOwnership: TypedContractMethod<[], [void], "nonpayable">; + + allowance: TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + + approve: TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + asset: TypedContractMethod<[], [string], "view">; + + assetsPerShare: TypedContractMethod<[], [bigint], "view">; + + balanceOf: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + convertToAssets: TypedContractMethod< + [shares: BigNumberish], + [bigint], + "view" + >; + + convertToShares: TypedContractMethod< + [assets: BigNumberish], + [bigint], + "view" + >; + + decimals: TypedContractMethod<[], [bigint], "view">; + + deposit: TypedContractMethod< + [assets: BigNumberish, receiver: AddressLike], + [bigint], + "nonpayable" + >; + + earned: TypedContractMethod<[], [bigint], "view">; + + harvest: TypedContractMethod<[], [void], "nonpayable">; + + lastTimeRewardApplicable: TypedContractMethod<[], [bigint], "view">; + + lastUpdateTime: TypedContractMethod<[], [bigint], "view">; + + maxDeposit: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + maxMint: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + maxRedeem: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + maxWithdraw: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + mint: TypedContractMethod< + [shares: BigNumberish, receiver: AddressLike], + [bigint], + "nonpayable" + >; + + name: TypedContractMethod<[], [string], "view">; + + nonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + notifyRewardAmount: TypedContractMethod<[], [void], "nonpayable">; + + owner: TypedContractMethod<[], [string], "view">; + + pendingOwner: TypedContractMethod<[], [string], "view">; + + periodFinish: TypedContractMethod<[], [bigint], "view">; + + permit: TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + + pirexEth: TypedContractMethod<[], [string], "view">; + + platform: TypedContractMethod<[], [string], "view">; + + platformFee: TypedContractMethod<[], [bigint], "view">; + + previewDeposit: TypedContractMethod<[assets: BigNumberish], [bigint], "view">; + + previewMint: TypedContractMethod<[shares: BigNumberish], [bigint], "view">; + + previewRedeem: TypedContractMethod<[shares: BigNumberish], [bigint], "view">; + + previewWithdraw: TypedContractMethod< + [assets: BigNumberish], + [bigint], + "view" + >; + + redeem: TypedContractMethod< + [shares: BigNumberish, receiver: AddressLike, owner: AddressLike], + [bigint], + "nonpayable" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + rewardPerToken: TypedContractMethod<[], [bigint], "view">; + + rewardPerTokenPaid: TypedContractMethod<[], [bigint], "view">; + + rewardPerTokenStored: TypedContractMethod<[], [bigint], "view">; + + rewardRate: TypedContractMethod<[], [bigint], "view">; + + rewards: TypedContractMethod<[], [bigint], "view">; + + setPirexEth: TypedContractMethod< + [_pirexEth: AddressLike], + [void], + "nonpayable" + >; + + setPlatform: TypedContractMethod< + [_platform: AddressLike], + [void], + "nonpayable" + >; + + setPlatformFee: TypedContractMethod< + [fee: BigNumberish], + [void], + "nonpayable" + >; + + setWithdrawalPenalty: TypedContractMethod< + [penalty: BigNumberish], + [void], + "nonpayable" + >; + + symbol: TypedContractMethod<[], [string], "view">; + + totalAssets: TypedContractMethod<[], [bigint], "view">; + + totalStaked: TypedContractMethod<[], [bigint], "view">; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + transfer: TypedContractMethod< + [to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + transferFrom: TypedContractMethod< + [from: AddressLike, to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + withdraw: TypedContractMethod< + [assets: BigNumberish, receiver: AddressLike, owner: AddressLike], + [bigint], + "nonpayable" + >; + + withdrawalPenalty: TypedContractMethod<[], [bigint], "view">; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "DOMAIN_SEPARATOR" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "acceptOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "allowance" + ): TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "approve" + ): TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "asset" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "assetsPerShare" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "balanceOf" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "convertToAssets" + ): TypedContractMethod<[shares: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "convertToShares" + ): TypedContractMethod<[assets: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "decimals" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "deposit" + ): TypedContractMethod< + [assets: BigNumberish, receiver: AddressLike], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "earned" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "harvest" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "lastTimeRewardApplicable" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "lastUpdateTime" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "maxDeposit" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "maxMint" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "maxRedeem" + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "maxWithdraw" + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "mint" + ): TypedContractMethod< + [shares: BigNumberish, receiver: AddressLike], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "name" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "nonces" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "notifyRewardAmount" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "pendingOwner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "periodFinish" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "permit" + ): TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "pirexEth" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "platform" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "platformFee" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "previewDeposit" + ): TypedContractMethod<[assets: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "previewMint" + ): TypedContractMethod<[shares: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "previewRedeem" + ): TypedContractMethod<[shares: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "previewWithdraw" + ): TypedContractMethod<[assets: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "redeem" + ): TypedContractMethod< + [shares: BigNumberish, receiver: AddressLike, owner: AddressLike], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "rewardPerToken" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "rewardPerTokenPaid" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "rewardPerTokenStored" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "rewardRate" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "rewards" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "setPirexEth" + ): TypedContractMethod<[_pirexEth: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "setPlatform" + ): TypedContractMethod<[_platform: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "setPlatformFee" + ): TypedContractMethod<[fee: BigNumberish], [void], "nonpayable">; + getFunction( + nameOrSignature: "setWithdrawalPenalty" + ): TypedContractMethod<[penalty: BigNumberish], [void], "nonpayable">; + getFunction( + nameOrSignature: "symbol" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "totalAssets" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "totalStaked" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "totalSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transfer" + ): TypedContractMethod< + [to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferFrom" + ): TypedContractMethod< + [from: AddressLike, to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "withdraw" + ): TypedContractMethod< + [assets: BigNumberish, receiver: AddressLike, owner: AddressLike], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "withdrawalPenalty" + ): TypedContractMethod<[], [bigint], "view">; + + getEvent( + key: "Approval" + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "Deposit" + ): TypedContractEvent< + DepositEvent.InputTuple, + DepositEvent.OutputTuple, + DepositEvent.OutputObject + >; + getEvent( + key: "Harvest" + ): TypedContractEvent< + HarvestEvent.InputTuple, + HarvestEvent.OutputTuple, + HarvestEvent.OutputObject + >; + getEvent( + key: "OwnershipTransferStarted" + ): TypedContractEvent< + OwnershipTransferStartedEvent.InputTuple, + OwnershipTransferStartedEvent.OutputTuple, + OwnershipTransferStartedEvent.OutputObject + >; + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + getEvent( + key: "PlatformFeeUpdated" + ): TypedContractEvent< + PlatformFeeUpdatedEvent.InputTuple, + PlatformFeeUpdatedEvent.OutputTuple, + PlatformFeeUpdatedEvent.OutputObject + >; + getEvent( + key: "PlatformUpdated" + ): TypedContractEvent< + PlatformUpdatedEvent.InputTuple, + PlatformUpdatedEvent.OutputTuple, + PlatformUpdatedEvent.OutputObject + >; + getEvent( + key: "RewardAdded" + ): TypedContractEvent< + RewardAddedEvent.InputTuple, + RewardAddedEvent.OutputTuple, + RewardAddedEvent.OutputObject + >; + getEvent( + key: "SetPirexEth" + ): TypedContractEvent< + SetPirexEthEvent.InputTuple, + SetPirexEthEvent.OutputTuple, + SetPirexEthEvent.OutputObject + >; + getEvent( + key: "Transfer" + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + getEvent( + key: "Withdraw" + ): TypedContractEvent< + WithdrawEvent.InputTuple, + WithdrawEvent.OutputTuple, + WithdrawEvent.OutputObject + >; + getEvent( + key: "WithdrawalPenaltyUpdated" + ): TypedContractEvent< + WithdrawalPenaltyUpdatedEvent.InputTuple, + WithdrawalPenaltyUpdatedEvent.OutputTuple, + WithdrawalPenaltyUpdatedEvent.OutputObject + >; + + filters: { + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "Deposit(address,address,uint256,uint256)": TypedContractEvent< + DepositEvent.InputTuple, + DepositEvent.OutputTuple, + DepositEvent.OutputObject + >; + Deposit: TypedContractEvent< + DepositEvent.InputTuple, + DepositEvent.OutputTuple, + DepositEvent.OutputObject + >; + + "Harvest(address,uint256)": TypedContractEvent< + HarvestEvent.InputTuple, + HarvestEvent.OutputTuple, + HarvestEvent.OutputObject + >; + Harvest: TypedContractEvent< + HarvestEvent.InputTuple, + HarvestEvent.OutputTuple, + HarvestEvent.OutputObject + >; + + "OwnershipTransferStarted(address,address)": TypedContractEvent< + OwnershipTransferStartedEvent.InputTuple, + OwnershipTransferStartedEvent.OutputTuple, + OwnershipTransferStartedEvent.OutputObject + >; + OwnershipTransferStarted: TypedContractEvent< + OwnershipTransferStartedEvent.InputTuple, + OwnershipTransferStartedEvent.OutputTuple, + OwnershipTransferStartedEvent.OutputObject + >; + + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + "PlatformFeeUpdated(uint256)": TypedContractEvent< + PlatformFeeUpdatedEvent.InputTuple, + PlatformFeeUpdatedEvent.OutputTuple, + PlatformFeeUpdatedEvent.OutputObject + >; + PlatformFeeUpdated: TypedContractEvent< + PlatformFeeUpdatedEvent.InputTuple, + PlatformFeeUpdatedEvent.OutputTuple, + PlatformFeeUpdatedEvent.OutputObject + >; + + "PlatformUpdated(address)": TypedContractEvent< + PlatformUpdatedEvent.InputTuple, + PlatformUpdatedEvent.OutputTuple, + PlatformUpdatedEvent.OutputObject + >; + PlatformUpdated: TypedContractEvent< + PlatformUpdatedEvent.InputTuple, + PlatformUpdatedEvent.OutputTuple, + PlatformUpdatedEvent.OutputObject + >; + + "RewardAdded(uint256)": TypedContractEvent< + RewardAddedEvent.InputTuple, + RewardAddedEvent.OutputTuple, + RewardAddedEvent.OutputObject + >; + RewardAdded: TypedContractEvent< + RewardAddedEvent.InputTuple, + RewardAddedEvent.OutputTuple, + RewardAddedEvent.OutputObject + >; + + "SetPirexEth(address)": TypedContractEvent< + SetPirexEthEvent.InputTuple, + SetPirexEthEvent.OutputTuple, + SetPirexEthEvent.OutputObject + >; + SetPirexEth: TypedContractEvent< + SetPirexEthEvent.InputTuple, + SetPirexEthEvent.OutputTuple, + SetPirexEthEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + "Withdraw(address,address,address,uint256,uint256)": TypedContractEvent< + WithdrawEvent.InputTuple, + WithdrawEvent.OutputTuple, + WithdrawEvent.OutputObject + >; + Withdraw: TypedContractEvent< + WithdrawEvent.InputTuple, + WithdrawEvent.OutputTuple, + WithdrawEvent.OutputObject + >; + + "WithdrawalPenaltyUpdated(uint256)": TypedContractEvent< + WithdrawalPenaltyUpdatedEvent.InputTuple, + WithdrawalPenaltyUpdatedEvent.OutputTuple, + WithdrawalPenaltyUpdatedEvent.OutputObject + >; + WithdrawalPenaltyUpdated: TypedContractEvent< + WithdrawalPenaltyUpdatedEvent.InputTuple, + WithdrawalPenaltyUpdatedEvent.OutputTuple, + WithdrawalPenaltyUpdatedEvent.OutputObject + >; + }; +} diff --git a/packages/adapters-library/src/adapters/dinero/contracts/PxEth.ts b/packages/adapters-library/src/adapters/dinero/contracts/PxEth.ts new file mode 100644 index 000000000..4d968ded0 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/PxEth.ts @@ -0,0 +1,955 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface PxEthInterface extends Interface { + getFunction( + nameOrSignature: + | "DEFAULT_ADMIN_ROLE" + | "DOMAIN_SEPARATOR" + | "acceptDefaultAdminTransfer" + | "allowance" + | "approve" + | "balanceOf" + | "beginDefaultAdminTransfer" + | "burn" + | "cancelDefaultAdminTransfer" + | "changeDefaultAdminDelay" + | "decimals" + | "defaultAdmin" + | "defaultAdminDelay" + | "defaultAdminDelayIncreaseWait" + | "getRoleAdmin" + | "grantRole" + | "hasRole" + | "mint" + | "name" + | "nonces" + | "operatorApprove" + | "owner" + | "pendingDefaultAdmin" + | "pendingDefaultAdminDelay" + | "permit" + | "renounceRole" + | "revokeRole" + | "rollbackDefaultAdminDelay" + | "supportsInterface" + | "symbol" + | "totalSupply" + | "transfer" + | "transferFrom" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "Approval" + | "DefaultAdminDelayChangeCanceled" + | "DefaultAdminDelayChangeScheduled" + | "DefaultAdminTransferCanceled" + | "DefaultAdminTransferScheduled" + | "RoleAdminChanged" + | "RoleGranted" + | "RoleRevoked" + | "Transfer" + ): EventFragment; + + encodeFunctionData( + functionFragment: "DEFAULT_ADMIN_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptDefaultAdminTransfer", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "beginDefaultAdminTransfer", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "burn", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "cancelDefaultAdminTransfer", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "changeDefaultAdminDelay", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "defaultAdmin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "defaultAdminDelay", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "defaultAdminDelayIncreaseWait", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getRoleAdmin", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "grantRole", + values: [BytesLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "hasRole", + values: [BytesLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "mint", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "operatorApprove", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "pendingDefaultAdmin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pendingDefaultAdminDelay", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "permit", + values: [ + AddressLike, + AddressLike, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "renounceRole", + values: [BytesLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "revokeRole", + values: [BytesLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "rollbackDefaultAdminDelay", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportsInterface", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "DEFAULT_ADMIN_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptDefaultAdminTransfer", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "beginDefaultAdminTransfer", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "cancelDefaultAdminTransfer", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "changeDefaultAdminDelay", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "defaultAdmin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "defaultAdminDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "defaultAdminDelayIncreaseWait", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRoleAdmin", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "grantRole", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "hasRole", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "operatorApprove", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "pendingDefaultAdmin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingDefaultAdminDelay", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceRole", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "revokeRole", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rollbackDefaultAdminDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportsInterface", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; +} + +export namespace ApprovalEvent { + export type InputTuple = [ + owner: AddressLike, + spender: AddressLike, + amount: BigNumberish + ]; + export type OutputTuple = [owner: string, spender: string, amount: bigint]; + export interface OutputObject { + owner: string; + spender: string; + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DefaultAdminDelayChangeCanceledEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DefaultAdminDelayChangeScheduledEvent { + export type InputTuple = [ + newDelay: BigNumberish, + effectSchedule: BigNumberish + ]; + export type OutputTuple = [newDelay: bigint, effectSchedule: bigint]; + export interface OutputObject { + newDelay: bigint; + effectSchedule: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DefaultAdminTransferCanceledEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DefaultAdminTransferScheduledEvent { + export type InputTuple = [ + newAdmin: AddressLike, + acceptSchedule: BigNumberish + ]; + export type OutputTuple = [newAdmin: string, acceptSchedule: bigint]; + export interface OutputObject { + newAdmin: string; + acceptSchedule: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RoleAdminChangedEvent { + export type InputTuple = [ + role: BytesLike, + previousAdminRole: BytesLike, + newAdminRole: BytesLike + ]; + export type OutputTuple = [ + role: string, + previousAdminRole: string, + newAdminRole: string + ]; + export interface OutputObject { + role: string; + previousAdminRole: string; + newAdminRole: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RoleGrantedEvent { + export type InputTuple = [ + role: BytesLike, + account: AddressLike, + sender: AddressLike + ]; + export type OutputTuple = [role: string, account: string, sender: string]; + export interface OutputObject { + role: string; + account: string; + sender: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RoleRevokedEvent { + export type InputTuple = [ + role: BytesLike, + account: AddressLike, + sender: AddressLike + ]; + export type OutputTuple = [role: string, account: string, sender: string]; + export interface OutputObject { + role: string; + account: string; + sender: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TransferEvent { + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + amount: BigNumberish + ]; + export type OutputTuple = [from: string, to: string, amount: bigint]; + export interface OutputObject { + from: string; + to: string; + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface PxEth extends BaseContract { + connect(runner?: ContractRunner | null): PxEth; + waitForDeployment(): Promise; + + interface: PxEthInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + DEFAULT_ADMIN_ROLE: TypedContractMethod<[], [string], "view">; + + DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; + + acceptDefaultAdminTransfer: TypedContractMethod<[], [void], "nonpayable">; + + allowance: TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + + approve: TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + beginDefaultAdminTransfer: TypedContractMethod< + [newAdmin: AddressLike], + [void], + "nonpayable" + >; + + burn: TypedContractMethod< + [_from: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + + cancelDefaultAdminTransfer: TypedContractMethod<[], [void], "nonpayable">; + + changeDefaultAdminDelay: TypedContractMethod< + [newDelay: BigNumberish], + [void], + "nonpayable" + >; + + decimals: TypedContractMethod<[], [bigint], "view">; + + defaultAdmin: TypedContractMethod<[], [string], "view">; + + defaultAdminDelay: TypedContractMethod<[], [bigint], "view">; + + defaultAdminDelayIncreaseWait: TypedContractMethod<[], [bigint], "view">; + + getRoleAdmin: TypedContractMethod<[role: BytesLike], [string], "view">; + + grantRole: TypedContractMethod< + [role: BytesLike, account: AddressLike], + [void], + "nonpayable" + >; + + hasRole: TypedContractMethod< + [role: BytesLike, account: AddressLike], + [boolean], + "view" + >; + + mint: TypedContractMethod< + [_to: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + + name: TypedContractMethod<[], [string], "view">; + + nonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + operatorApprove: TypedContractMethod< + [_from: AddressLike, _to: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + pendingDefaultAdmin: TypedContractMethod< + [], + [[string, bigint] & { newAdmin: string; schedule: bigint }], + "view" + >; + + pendingDefaultAdminDelay: TypedContractMethod< + [], + [[bigint, bigint] & { newDelay: bigint; schedule: bigint }], + "view" + >; + + permit: TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + + renounceRole: TypedContractMethod< + [role: BytesLike, account: AddressLike], + [void], + "nonpayable" + >; + + revokeRole: TypedContractMethod< + [role: BytesLike, account: AddressLike], + [void], + "nonpayable" + >; + + rollbackDefaultAdminDelay: TypedContractMethod<[], [void], "nonpayable">; + + supportsInterface: TypedContractMethod< + [interfaceId: BytesLike], + [boolean], + "view" + >; + + symbol: TypedContractMethod<[], [string], "view">; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + transfer: TypedContractMethod< + [to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + transferFrom: TypedContractMethod< + [from: AddressLike, to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "DEFAULT_ADMIN_ROLE" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "DOMAIN_SEPARATOR" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "acceptDefaultAdminTransfer" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "allowance" + ): TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "approve" + ): TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "balanceOf" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "beginDefaultAdminTransfer" + ): TypedContractMethod<[newAdmin: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "burn" + ): TypedContractMethod< + [_from: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "cancelDefaultAdminTransfer" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "changeDefaultAdminDelay" + ): TypedContractMethod<[newDelay: BigNumberish], [void], "nonpayable">; + getFunction( + nameOrSignature: "decimals" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "defaultAdmin" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "defaultAdminDelay" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "defaultAdminDelayIncreaseWait" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getRoleAdmin" + ): TypedContractMethod<[role: BytesLike], [string], "view">; + getFunction( + nameOrSignature: "grantRole" + ): TypedContractMethod< + [role: BytesLike, account: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "hasRole" + ): TypedContractMethod< + [role: BytesLike, account: AddressLike], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "mint" + ): TypedContractMethod< + [_to: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "name" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "nonces" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "operatorApprove" + ): TypedContractMethod< + [_from: AddressLike, _to: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "pendingDefaultAdmin" + ): TypedContractMethod< + [], + [[string, bigint] & { newAdmin: string; schedule: bigint }], + "view" + >; + getFunction( + nameOrSignature: "pendingDefaultAdminDelay" + ): TypedContractMethod< + [], + [[bigint, bigint] & { newDelay: bigint; schedule: bigint }], + "view" + >; + getFunction( + nameOrSignature: "permit" + ): TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "renounceRole" + ): TypedContractMethod< + [role: BytesLike, account: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "revokeRole" + ): TypedContractMethod< + [role: BytesLike, account: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "rollbackDefaultAdminDelay" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportsInterface" + ): TypedContractMethod<[interfaceId: BytesLike], [boolean], "view">; + getFunction( + nameOrSignature: "symbol" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "totalSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transfer" + ): TypedContractMethod< + [to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferFrom" + ): TypedContractMethod< + [from: AddressLike, to: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + getEvent( + key: "Approval" + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "DefaultAdminDelayChangeCanceled" + ): TypedContractEvent< + DefaultAdminDelayChangeCanceledEvent.InputTuple, + DefaultAdminDelayChangeCanceledEvent.OutputTuple, + DefaultAdminDelayChangeCanceledEvent.OutputObject + >; + getEvent( + key: "DefaultAdminDelayChangeScheduled" + ): TypedContractEvent< + DefaultAdminDelayChangeScheduledEvent.InputTuple, + DefaultAdminDelayChangeScheduledEvent.OutputTuple, + DefaultAdminDelayChangeScheduledEvent.OutputObject + >; + getEvent( + key: "DefaultAdminTransferCanceled" + ): TypedContractEvent< + DefaultAdminTransferCanceledEvent.InputTuple, + DefaultAdminTransferCanceledEvent.OutputTuple, + DefaultAdminTransferCanceledEvent.OutputObject + >; + getEvent( + key: "DefaultAdminTransferScheduled" + ): TypedContractEvent< + DefaultAdminTransferScheduledEvent.InputTuple, + DefaultAdminTransferScheduledEvent.OutputTuple, + DefaultAdminTransferScheduledEvent.OutputObject + >; + getEvent( + key: "RoleAdminChanged" + ): TypedContractEvent< + RoleAdminChangedEvent.InputTuple, + RoleAdminChangedEvent.OutputTuple, + RoleAdminChangedEvent.OutputObject + >; + getEvent( + key: "RoleGranted" + ): TypedContractEvent< + RoleGrantedEvent.InputTuple, + RoleGrantedEvent.OutputTuple, + RoleGrantedEvent.OutputObject + >; + getEvent( + key: "RoleRevoked" + ): TypedContractEvent< + RoleRevokedEvent.InputTuple, + RoleRevokedEvent.OutputTuple, + RoleRevokedEvent.OutputObject + >; + getEvent( + key: "Transfer" + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + filters: { + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "DefaultAdminDelayChangeCanceled()": TypedContractEvent< + DefaultAdminDelayChangeCanceledEvent.InputTuple, + DefaultAdminDelayChangeCanceledEvent.OutputTuple, + DefaultAdminDelayChangeCanceledEvent.OutputObject + >; + DefaultAdminDelayChangeCanceled: TypedContractEvent< + DefaultAdminDelayChangeCanceledEvent.InputTuple, + DefaultAdminDelayChangeCanceledEvent.OutputTuple, + DefaultAdminDelayChangeCanceledEvent.OutputObject + >; + + "DefaultAdminDelayChangeScheduled(uint48,uint48)": TypedContractEvent< + DefaultAdminDelayChangeScheduledEvent.InputTuple, + DefaultAdminDelayChangeScheduledEvent.OutputTuple, + DefaultAdminDelayChangeScheduledEvent.OutputObject + >; + DefaultAdminDelayChangeScheduled: TypedContractEvent< + DefaultAdminDelayChangeScheduledEvent.InputTuple, + DefaultAdminDelayChangeScheduledEvent.OutputTuple, + DefaultAdminDelayChangeScheduledEvent.OutputObject + >; + + "DefaultAdminTransferCanceled()": TypedContractEvent< + DefaultAdminTransferCanceledEvent.InputTuple, + DefaultAdminTransferCanceledEvent.OutputTuple, + DefaultAdminTransferCanceledEvent.OutputObject + >; + DefaultAdminTransferCanceled: TypedContractEvent< + DefaultAdminTransferCanceledEvent.InputTuple, + DefaultAdminTransferCanceledEvent.OutputTuple, + DefaultAdminTransferCanceledEvent.OutputObject + >; + + "DefaultAdminTransferScheduled(address,uint48)": TypedContractEvent< + DefaultAdminTransferScheduledEvent.InputTuple, + DefaultAdminTransferScheduledEvent.OutputTuple, + DefaultAdminTransferScheduledEvent.OutputObject + >; + DefaultAdminTransferScheduled: TypedContractEvent< + DefaultAdminTransferScheduledEvent.InputTuple, + DefaultAdminTransferScheduledEvent.OutputTuple, + DefaultAdminTransferScheduledEvent.OutputObject + >; + + "RoleAdminChanged(bytes32,bytes32,bytes32)": TypedContractEvent< + RoleAdminChangedEvent.InputTuple, + RoleAdminChangedEvent.OutputTuple, + RoleAdminChangedEvent.OutputObject + >; + RoleAdminChanged: TypedContractEvent< + RoleAdminChangedEvent.InputTuple, + RoleAdminChangedEvent.OutputTuple, + RoleAdminChangedEvent.OutputObject + >; + + "RoleGranted(bytes32,address,address)": TypedContractEvent< + RoleGrantedEvent.InputTuple, + RoleGrantedEvent.OutputTuple, + RoleGrantedEvent.OutputObject + >; + RoleGranted: TypedContractEvent< + RoleGrantedEvent.InputTuple, + RoleGrantedEvent.OutputTuple, + RoleGrantedEvent.OutputObject + >; + + "RoleRevoked(bytes32,address,address)": TypedContractEvent< + RoleRevokedEvent.InputTuple, + RoleRevokedEvent.OutputTuple, + RoleRevokedEvent.OutputObject + >; + RoleRevoked: TypedContractEvent< + RoleRevokedEvent.InputTuple, + RoleRevokedEvent.OutputTuple, + RoleRevokedEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + }; +} diff --git a/packages/adapters-library/src/adapters/dinero/contracts/abis/apx-eth.json b/packages/adapters-library/src/adapters/dinero/contracts/abis/apx-eth.json new file mode 100644 index 000000000..28418ddf4 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/abis/apx-eth.json @@ -0,0 +1,703 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_asset", "type": "address" }, + { "internalType": "address", "name": "_platform", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "ExceedsMax", "type": "error" }, + { "inputs": [], "name": "NoRewards", "type": "error" }, + { "inputs": [], "name": "NotPirexEth", "type": "error" }, + { "inputs": [], "name": "ZeroAddress", "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": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "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": 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": "fee", + "type": "uint256" + } + ], + "name": "PlatformFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_platform", + "type": "address" + } + ], + "name": "PlatformUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "RewardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_pirexEth", + "type": "address" + } + ], + "name": "SetPirexEth", + "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": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "penalty", + "type": "uint256" + } + ], + "name": "WithdrawalPenaltyUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [ + { "internalType": "contract ERC20", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "assetsPerShare", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "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": "shares", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "earned", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "harvest", + "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": "assets", "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": [], + "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": "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": "pirexEth", + "outputs": [ + { "internalType": "contract IPirexEth", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "platform", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "platformFee", + "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": "assets", "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": "_pirexEth", "type": "address" } + ], + "name": "setPirexEth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_platform", "type": "address" } + ], + "name": "setPlatform", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "fee", "type": "uint256" }], + "name": "setPlatformFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "penalty", "type": "uint256" } + ], + "name": "setWithdrawalPenalty", + "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": "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" + }, + { + "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": "shares", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalPenalty", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/packages/adapters-library/src/adapters/dinero/contracts/abis/px-eth.json b/packages/adapters-library/src/adapters/dinero/contracts/abis/px-eth.json new file mode 100644 index 000000000..4c93025ef --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/abis/px-eth.json @@ -0,0 +1,476 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_admin", "type": "address" }, + { "internalType": "uint48", "name": "_initialDelay", "type": "uint48" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "EmptyString", "type": "error" }, + { "inputs": [], "name": "ZeroAddress", "type": "error" }, + { "inputs": [], "name": "ZeroAmount", "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": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DefaultAdminDelayChangeCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint48", + "name": "newDelay", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "effectSchedule", + "type": "uint48" + } + ], + "name": "DefaultAdminDelayChangeScheduled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DefaultAdminTransferCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "acceptSchedule", + "type": "uint48" + } + ], + "name": "DefaultAdminTransferScheduled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "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": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "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": [], + "name": "acceptDefaultAdminTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "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": "amount", "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": "newAdmin", "type": "address" } + ], + "name": "beginDefaultAdminTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_from", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelDefaultAdminTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint48", "name": "newDelay", "type": "uint48" } + ], + "name": "changeDefaultAdminDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultAdminDelay", + "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultAdminDelayIncreaseWait", + "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" } + ], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_to", "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": "nonces", + "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": "_amount", "type": "uint256" } + ], + "name": "operatorApprove", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingDefaultAdmin", + "outputs": [ + { "internalType": "address", "name": "newAdmin", "type": "address" }, + { "internalType": "uint48", "name": "schedule", "type": "uint48" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingDefaultAdminDelay", + "outputs": [ + { "internalType": "uint48", "name": "newDelay", "type": "uint48" }, + { "internalType": "uint48", "name": "schedule", "type": "uint48" } + ], + "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": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rollbackDefaultAdminDelay", + "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": [], + "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/packages/adapters-library/src/adapters/dinero/contracts/common.ts b/packages/adapters-library/src/adapters/dinero/contracts/common.ts new file mode 100644 index 000000000..56b5f21e9 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/common.ts @@ -0,0 +1,131 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + FunctionFragment, + Typed, + EventFragment, + ContractTransaction, + ContractTransactionResponse, + DeferredTopicFilter, + EventLog, + TransactionRequest, + LogDescription, +} from "ethers"; + +export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> + extends DeferredTopicFilter {} + +export interface TypedContractEvent< + InputTuple extends Array = any, + OutputTuple extends Array = any, + OutputObject = any +> { + (...args: Partial): TypedDeferredTopicFilter< + TypedContractEvent + >; + name: string; + fragment: EventFragment; + getFragment(...args: Partial): EventFragment; +} + +type __TypechainAOutputTuple = T extends TypedContractEvent< + infer _U, + infer W +> + ? W + : never; +type __TypechainOutputObject = T extends TypedContractEvent< + infer _U, + infer _W, + infer V +> + ? V + : never; + +export interface TypedEventLog + extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export interface TypedLogDescription + extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export type TypedListener = ( + ...listenerArg: [ + ...__TypechainAOutputTuple, + TypedEventLog, + ...undefined[] + ] +) => void; + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never; +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; + +export type StateMutability = "nonpayable" | "payable" | "view"; + +export type BaseOverrides = Omit; +export type NonPayableOverrides = Omit< + BaseOverrides, + "value" | "blockTag" | "enableCcipRead" +>; +export type PayableOverrides = Omit< + BaseOverrides, + "blockTag" | "enableCcipRead" +>; +export type ViewOverrides = Omit; +export type Overrides = S extends "nonpayable" + ? NonPayableOverrides + : S extends "payable" + ? PayableOverrides + : ViewOverrides; + +export type PostfixOverrides, S extends StateMutability> = + | A + | [...A, Overrides]; +export type ContractMethodArgs< + A extends Array, + S extends StateMutability +> = PostfixOverrides<{ [I in keyof A]-?: A[I] | Typed }, S>; + +export type DefaultReturnType = R extends Array ? R[0] : R; + +// export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { +export interface TypedContractMethod< + A extends Array = Array, + R = any, + S extends StateMutability = "payable" +> { + (...args: ContractMethodArgs): S extends "view" + ? Promise> + : Promise; + + name: string; + + fragment: FunctionFragment; + + getFragment(...args: ContractMethodArgs): FunctionFragment; + + populateTransaction( + ...args: ContractMethodArgs + ): Promise; + staticCall( + ...args: ContractMethodArgs + ): Promise>; + send(...args: ContractMethodArgs): Promise; + estimateGas(...args: ContractMethodArgs): Promise; + staticCallResult(...args: ContractMethodArgs): Promise; +} diff --git a/packages/adapters-library/src/adapters/dinero/contracts/factories/ApxEth__factory.ts b/packages/adapters-library/src/adapters/dinero/contracts/factories/ApxEth__factory.ts new file mode 100644 index 000000000..8d87660e0 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/factories/ApxEth__factory.ts @@ -0,0 +1,1178 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { ApxEth, ApxEthInterface } from "../ApxEth"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "_asset", + type: "address", + }, + { + internalType: "address", + name: "_platform", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "ExceedsMax", + type: "error", + }, + { + inputs: [], + name: "NoRewards", + type: "error", + }, + { + inputs: [], + name: "NotPirexEth", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + 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: "amount", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "caller", + 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: 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: "fee", + type: "uint256", + }, + ], + name: "PlatformFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "_platform", + type: "address", + }, + ], + name: "PlatformUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "RewardAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "_pirexEth", + type: "address", + }, + ], + name: "SetPirexEth", + 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: "amount", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "caller", + 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", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "penalty", + type: "uint256", + }, + ], + name: "WithdrawalPenaltyUpdated", + type: "event", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + 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: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "asset", + outputs: [ + { + internalType: "contract ERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "assetsPerShare", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + 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: "shares", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "earned", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "harvest", + 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: "assets", + 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: [], + 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: "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: "pirexEth", + outputs: [ + { + internalType: "contract IPirexEth", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "platform", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "platformFee", + 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: "assets", + 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: "_pirexEth", + type: "address", + }, + ], + name: "setPirexEth", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_platform", + type: "address", + }, + ], + name: "setPlatform", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "setPlatformFee", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "penalty", + type: "uint256", + }, + ], + name: "setWithdrawalPenalty", + 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: "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", + }, + { + 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: "shares", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "withdrawalPenalty", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class ApxEth__factory { + static readonly abi = _abi; + static createInterface(): ApxEthInterface { + return new Interface(_abi) as ApxEthInterface; + } + static connect(address: string, runner?: ContractRunner | null): ApxEth { + return new Contract(address, _abi, runner) as unknown as ApxEth; + } +} diff --git a/packages/adapters-library/src/adapters/dinero/contracts/factories/PxEth__factory.ts b/packages/adapters-library/src/adapters/dinero/contracts/factories/PxEth__factory.ts new file mode 100644 index 000000000..c58b0037b --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/factories/PxEth__factory.ts @@ -0,0 +1,795 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { PxEth, PxEthInterface } from "../PxEth"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "_admin", + type: "address", + }, + { + internalType: "uint48", + name: "_initialDelay", + type: "uint48", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "EmptyString", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + type: "error", + }, + { + inputs: [], + name: "ZeroAmount", + 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: "amount", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "DefaultAdminDelayChangeCanceled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint48", + name: "newDelay", + type: "uint48", + }, + { + indexed: false, + internalType: "uint48", + name: "effectSchedule", + type: "uint48", + }, + ], + name: "DefaultAdminDelayChangeScheduled", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "DefaultAdminTransferCanceled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "newAdmin", + type: "address", + }, + { + indexed: false, + internalType: "uint48", + name: "acceptSchedule", + type: "uint48", + }, + ], + name: "DefaultAdminTransferScheduled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "previousAdminRole", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "newAdminRole", + type: "bytes32", + }, + ], + name: "RoleAdminChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleGranted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleRevoked", + 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: "amount", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + 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: [], + name: "acceptDefaultAdminTransfer", + outputs: [], + stateMutability: "nonpayable", + 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: "amount", + 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: "newAdmin", + type: "address", + }, + ], + name: "beginDefaultAdminTransfer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_from", + type: "address", + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "cancelDefaultAdminTransfer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint48", + name: "newDelay", + type: "uint48", + }, + ], + name: "changeDefaultAdminDelay", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "defaultAdmin", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "defaultAdminDelay", + outputs: [ + { + internalType: "uint48", + name: "", + type: "uint48", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "defaultAdminDelayIncreaseWait", + outputs: [ + { + internalType: "uint48", + name: "", + type: "uint48", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + ], + name: "getRoleAdmin", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "grantRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "hasRole", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_to", + 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: "nonces", + 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: "_amount", + type: "uint256", + }, + ], + name: "operatorApprove", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingDefaultAdmin", + outputs: [ + { + internalType: "address", + name: "newAdmin", + type: "address", + }, + { + internalType: "uint48", + name: "schedule", + type: "uint48", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingDefaultAdminDelay", + outputs: [ + { + internalType: "uint48", + name: "newDelay", + type: "uint48", + }, + { + internalType: "uint48", + name: "schedule", + type: "uint48", + }, + ], + 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: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "renounceRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "revokeRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "rollbackDefaultAdminDelay", + 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: [], + 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; + +export class PxEth__factory { + static readonly abi = _abi; + static createInterface(): PxEthInterface { + return new Interface(_abi) as PxEthInterface; + } + static connect(address: string, runner?: ContractRunner | null): PxEth { + return new Contract(address, _abi, runner) as unknown as PxEth; + } +} diff --git a/packages/adapters-library/src/adapters/dinero/contracts/factories/index.ts b/packages/adapters-library/src/adapters/dinero/contracts/factories/index.ts new file mode 100644 index 000000000..73506cd42 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/factories/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { ApxEth__factory } from "./ApxEth__factory"; +export { PxEth__factory } from "./PxEth__factory"; diff --git a/packages/adapters-library/src/adapters/dinero/contracts/index.ts b/packages/adapters-library/src/adapters/dinero/contracts/index.ts new file mode 100644 index 000000000..b60587358 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/contracts/index.ts @@ -0,0 +1,8 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { ApxEth } from "./ApxEth"; +export type { PxEth } from "./PxEth"; +export * as factories from "./factories"; +export { ApxEth__factory } from "./factories/ApxEth__factory"; +export { PxEth__factory } from "./factories/PxEth__factory"; diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/dineroApxEthAdapter.ts b/packages/adapters-library/src/adapters/dinero/products/apx-eth/dineroApxEthAdapter.ts new file mode 100644 index 000000000..c52b9d119 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/dineroApxEthAdapter.ts @@ -0,0 +1,152 @@ +import { AdaptersController } from '../../../../core/adaptersController' +import { Chain } from '../../../../core/constants/chains' +import { CacheToDb } from '../../../../core/decorators/cacheToDb' +import { CustomJsonRpcProvider } from '../../../../core/provider/CustomJsonRpcProvider' +import { Helpers } from '../../../../scripts/helpers' +import { + IProtocolAdapter, + ProtocolToken, +} from '../../../../types/IProtocolAdapter' +import { + GetEventsInput, + GetPositionsInput, + GetTotalValueLockedInput, + MovementsByBlock, + PositionType, + ProtocolAdapterParams, + ProtocolDetails, + ProtocolPosition, + ProtocolTokenTvl, + UnwrapExchangeRate, + UnwrapInput, +} from '../../../../types/adapter' +import { Protocol } from '../../../protocols' +import { + APX_ETH_DEPLOYMENTS, + PX_ETH_DEPLOYMENTS, +} from '../../common/deploymentAddresses' + +export class DineroApxEthAdapter implements IProtocolAdapter { + productId = 'apx-eth' + protocolId: Protocol + chainId: Chain + helpers: Helpers + + adapterSettings = { + enablePositionDetectionByProtocolTokenTransfer: true, + includeInUnwrap: true, + } + + private provider: CustomJsonRpcProvider + + adaptersController: AdaptersController + + constructor({ + provider, + chainId, + protocolId, + adaptersController, + helpers, + }: ProtocolAdapterParams) { + this.provider = provider + this.chainId = chainId + this.protocolId = protocolId + this.adaptersController = adaptersController + this.helpers = helpers + } + + getProtocolDetails(): ProtocolDetails { + return { + protocolId: this.protocolId, + name: 'Dinero', + description: + 'Dinero defi adapter for Autocompounding Pirex Ether (apxETH)', + siteUrl: 'https://dinero.xyz/', + iconUrl: 'https://dinero.xyz/images/eye.png', + positionType: PositionType.Supply, + chainId: this.chainId, + productId: this.productId, + } + } + + @CacheToDb + async getProtocolTokens(): Promise { + return [ + { + ...(await this.helpers.getTokenMetadata( + APX_ETH_DEPLOYMENTS[this.chainId]!, + )), + underlyingTokens: [ + await this.helpers.getTokenMetadata( + PX_ETH_DEPLOYMENTS[this.chainId]!, + ), + ], + }, + ] + } + + private async getProtocolTokenByAddress(protocolTokenAddress: string) { + return this.helpers.getProtocolTokenByAddress({ + protocolTokens: await this.getProtocolTokens(), + protocolTokenAddress, + }) + } + + async getPositions(input: GetPositionsInput): Promise { + return this.helpers.getBalanceOfTokens({ + ...input, + protocolTokens: await this.getProtocolTokens(), + }) + } + + async getWithdrawals({ + protocolTokenAddress, + fromBlock, + toBlock, + userAddress, + }: GetEventsInput): Promise { + return this.helpers.withdrawals({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + filter: { fromBlock, toBlock, userAddress }, + }) + } + + async getDeposits({ + protocolTokenAddress, + fromBlock, + toBlock, + userAddress, + }: GetEventsInput): Promise { + return this.helpers.deposits({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + filter: { fromBlock, toBlock, userAddress }, + }) + } + + async getTotalValueLocked({ + protocolTokenAddresses, + blockNumber, + }: GetTotalValueLockedInput): Promise { + const protocolTokens = await this.getProtocolTokens() + + return await this.helpers.tvl({ + protocolTokens, + filterProtocolTokenAddresses: protocolTokenAddresses, + blockNumber, + }) + } + + async unwrap({ + protocolTokenAddress, + tokenId, + blockNumber, + }: UnwrapInput): Promise { + return this.helpers.unwrapTokenAsRatio({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + underlyingTokens: ( + await this.getProtocolTokenByAddress(protocolTokenAddress) + ).underlyingTokens, + blockNumber, + }) + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.deposits.apx-eth-deposits.json b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.deposits.apx-eth-deposits.json new file mode 100644 index 000000000..623858c07 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.deposits.apx-eth-deposits.json @@ -0,0 +1,95 @@ +{ + "aggregatedValues": ["USD46,271.63"], + "latency": "Latency: 1.282 seconds", + "snapshot": { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Autocompounding Pirex Ether (apxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "apx-eth", + "chainName": "ethereum", + "success": true, + "movements": [ + { + "transactionHash": "0x4226fa18c401c2a7f6a0db03346d9fb676ffccff4547dbc235f76b8b403d5a0f", + "protocolToken": { + "address": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6", + "name": "Autocompounding Pirex Ether", + "symbol": "apxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6", + "name": "Autocompounding Pirex Ether", + "symbol": "apxETH", + "decimals": 18, + "balanceRaw": "16621785528888300428n", + "type": "underlying", + "blockNumber": 21023794, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "17573735570606811364n", + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "17573735570606811364n", + "balance": 17.57373557060681, + "price": 2632.99919198, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 17.57373557060681, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6/logo.png" + } + ], + "balance": 16.6217855288883 + } + ], + "blockNumber": 21023794 + } + ] + }, + "rpcResponses": { + "47ea6120c775f75bce43c2ad5c40e5fc": { + "result": [ + { + "address": "0x9ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e6", + "blockHash": "0x5d1032babc4d23e9f4bf7ea8e6731176276bbaf4902f5a1efd95a5110811dcc0", + "blockNumber": "0x140cc32", + "data": "0x000000000000000000000000000000000000000000000000e6ac71df5e1d938c", + "logIndex": "0x64", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000007bfee91193d9df2ac0bfe90191d40f23c773c060", + "0x000000000000000000000000a5ccbd739e7f5662b95d269ee9a48a37cbfb88bc" + ], + "transactionHash": "0x4226fa18c401c2a7f6a0db03346d9fb676ffccff4547dbc235f76b8b403d5a0f", + "transactionIndex": "0x33" + } + ] + }, + "ab387c35223676598edb0f06e6dcd9c1": { + "result": "0x000000000000000000000000000000000000000000000209286f5afae1b3a2d8" + }, + "3559684b23683c6ceffa13c85456290e": { + "result": "0x000000000000000000000000000000000000000000000227015b9ad826c921b3" + }, + "e0fa64826ae08e688a1740997ee6c96b": { + "result": "0x00000000000000000000000000000000000000000000000700000000000004800000000000000000000000000000000000000000000000000000003d4de5ed5e00000000000000000000000000000000000000000000000000000000671817a600000000000000000000000000000000000000000000000000000000671817bf0000000000000000000000000000000000000000000000070000000000000480" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.positions.apx-eth-positions.json b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.positions.apx-eth-positions.json new file mode 100644 index 000000000..34c41d4da --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.positions.apx-eth-positions.json @@ -0,0 +1,70 @@ +{ + "blockNumber": 21202764, + "latency": "Latency: 1.477 seconds", + "aggregatedValues": ["USD760,291.84"], + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Autocompounding Pirex Ether (apxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "apx-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6", + "name": "Autocompounding Pirex Ether", + "symbol": "apxETH", + "decimals": 18, + "balanceRaw": "227135211863407248638n", + "type": "protocol", + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "241019572535329142819n", + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "241019572535329142819n", + "balance": 241.01957253532913, + "price": 3154.481754, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 241.01957253532913, + "price": 3154.481754, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6/logo.png" + } + ], + "balance": 227.13521186340725 + } + ] + } + ], + "rpcResponses": { + "2f65686c044f6ea4d6f580c129ef43d7": { + "result": "0x00000000000000000000000000000000000000000000000c50225fc69d7ac4fe" + }, + "6a055f3643735630455199ca6988ba21": { + "result": "0x00000000000000000000000000000000000000000000027086c53e623cae8e6e" + }, + "0415b81860e4b537136dcdeb23261b09": { + "result": "0x000000000000000000000000000000000000000000000296b3de2364c3133c07" + }, + "2c3a0be107372f1aba571de708183d07": { + "result": "0x000000000000000000000000000000000000000000000007000000000000095300000000000000000000000000000000000000000000000000000049722d2b28000000000000000000000000000000000000000000000000000000006738ff71000000000000000000000000000000000000000000000000000000006738ff830000000000000000000000000000000000000000000000070000000000000953" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.prices.apx-eth-prices.json b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.prices.apx-eth-prices.json new file mode 100644 index 000000000..45916b480 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.prices.apx-eth-prices.json @@ -0,0 +1,48 @@ +{ + "latency": "Latency: 0.714 seconds", + "blockNumber": 21202764, + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Autocompounding Pirex Ether (apxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "apx-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6", + "name": "Autocompounding Pirex Ether", + "symbol": "apxETH", + "decimals": 18, + "baseRate": 1, + "type": "protocol", + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "type": "underlying", + "underlyingRateRaw": "1061128173646064000n", + "underlyingRate": 1.061128173646064, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6/logo.png" + } + ] + } + ] + } + ], + "rpcResponses": { + "6a055f3643735630455199ca6988ba21": { + "result": "0x00000000000000000000000000000000000000000000027086c53e623cae8e6e" + }, + "0415b81860e4b537136dcdeb23261b09": { + "result": "0x000000000000000000000000000000000000000000000296b3de2364c3133c07" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.profits.apx-eth-profits.json b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.profits.apx-eth-profits.json new file mode 100644 index 000000000..78b3e1867 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.profits.apx-eth-profits.json @@ -0,0 +1,112 @@ +{ + "blockNumber": 21202764, + "latency": "Latency: 3.514 seconds", + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Autocompounding Pirex Ether (apxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "apx-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6", + "name": "Autocompounding Pirex Ether", + "symbol": "apxETH", + "decimals": 18, + "type": "protocol", + "profit": 18080.10229685437, + "performance": 0.024359763235926812, + "apyInfo": { + "apyPercent": -0.507806097891883, + "apy": -0.00507806097891883, + "aprPercent": -0.5090962641995065, + "apr": -0.005090962641995065, + "period": { + "blocknumberStart": 21195618, + "blocknumberEnd": 21202764, + "interestPercent": -0.0013947842854781, + "interest": -0.000013947842854781 + }, + "compounding": { + "durationDays": 1, + "frequency": 365 + } + }, + "calculationData": { + "withdrawals": 79448.53176945599, + "deposits": 0, + "repays": 0, + "borrows": 0, + "startPositionValue": 821660.273392177, + "endPositionValue": 760291.8439195753 + } + } + ], + "fromBlock": 21195618, + "toBlock": 21202764 + } + ], + "rpcResponses": { + "63bdc1a66b04213d238108e2a373ada3": { + "result": "0x00000000000000000000000000000000000000000000000d9fc61d0628e09c72" + }, + "2f65686c044f6ea4d6f580c129ef43d7": { + "result": "0x00000000000000000000000000000000000000000000000c50225fc69d7ac4fe" + }, + "a9f9c53b7406d9bc588c128e59dd3cb6": { + "result": "0x000000000000000000000000000000000000000000000274fc768438832e5879" + }, + "6a055f3643735630455199ca6988ba21": { + "result": "0x00000000000000000000000000000000000000000000027086c53e623cae8e6e" + }, + "da349bac270fd65a0dc1fed8042eb650": { + "result": "0x00000000000000000000000000000000000000000000029b71cf1b60d0af8173" + }, + "0415b81860e4b537136dcdeb23261b09": { + "result": "0x000000000000000000000000000000000000000000000296b3de2364c3133c07" + }, + "6b956d512092fcc0d63a03e763e9aca9": { + "result": "0x000000000000000000000000000000000000000000000007000000000000092900000000000000000000000000000000000000000000000000000047bc1fc62d000000000000000000000000000000000000000000000000000000006737b27f000000000000000000000000000000000000000000000000000000006737b29b0000000000000000000000000000000000000000000000070000000000000929" + }, + "2c3a0be107372f1aba571de708183d07": { + "result": "0x000000000000000000000000000000000000000000000007000000000000095300000000000000000000000000000000000000000000000000000049722d2b28000000000000000000000000000000000000000000000000000000006738ff71000000000000000000000000000000000000000000000000000000006738ff830000000000000000000000000000000000000000000000070000000000000953" + }, + "ef34a1cdbd32c3b163248077fb95a9bb": { + "result": [ + { + "address": "0x9ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e6", + "blockHash": "0x1c14bdd38e4f4cfdaaa78830b396d3c4d7c623771be9e2d240c531f88eb2c583", + "blockNumber": "0x14371a3", + "data": "0x0000000000000000000000000000000000000000000000014fa3bd3f8b65d774", + "logIndex": "0x10e", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000a5ccbd739e7f5662b95d269ee9a48a37cbfb88bc", + "0x000000000000000000000000eaf19bec5477b58c1a70c32da03489b78b4c0254" + ], + "transactionHash": "0x9b229ea1b4581b2e96ae97b0655beda0009b841fe8f4a12fd40d444912bda12c", + "transactionIndex": "0x6d" + } + ] + }, + "c533c845c45934ab1fa301e91687f56e": { + "result": [] + }, + "e15b373143d190b79bb1ee329498117c": { + "result": "0x000000000000000000000000000000000000000000000274fc768438832e5879" + }, + "653d9ddaa246638dd2349e5d144a1ecc": { + "result": "0x00000000000000000000000000000000000000000000029b7023ca27b390d9f7" + }, + "69dd8a807375361a7fadaa1689f5b94b": { + "result": "0x00000000000000000000000000000000000000000000000700000000000009330000000000000000000000000000000000000000000000000000004813fcf430000000000000000000000000000000000000000000000000000000006737f98a000000000000000000000000000000000000000000000000000000006737f99f0000000000000000000000000000000000000000000000070000000000000933" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.tvl.apx-eth-tvl.json b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.tvl.apx-eth-tvl.json new file mode 100644 index 000000000..26b399155 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/snapshots/ethereum.tvl.apx-eth-tvl.json @@ -0,0 +1,65 @@ +{ + "latency": "Latency: 1.116 seconds", + "blockNumber": 21202764, + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Autocompounding Pirex Ether (apxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "apx-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6", + "name": "Autocompounding Pirex Ether", + "symbol": "apxETH", + "decimals": 18, + "type": "protocol", + "totalSupplyRaw": "11520479538757900340846n", + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "type": "underlying", + "totalSupplyRaw": "12224705412489020570726n", + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "totalSupplyRaw": "12224705412489020570726n", + "totalSupply": 12224.70541248902, + "price": 3154.481754, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "totalSupply": 12224.70541248902, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6/logo.png" + } + ], + "totalSupply": 11520.4795387579 + } + ] + } + ], + "rpcResponses": { + "6a055f3643735630455199ca6988ba21": { + "result": "0x00000000000000000000000000000000000000000000027086c53e623cae8e6e" + }, + "0415b81860e4b537136dcdeb23261b09": { + "result": "0x000000000000000000000000000000000000000000000296b3de2364c3133c07" + }, + "2c3a0be107372f1aba571de708183d07": { + "result": "0x000000000000000000000000000000000000000000000007000000000000095300000000000000000000000000000000000000000000000000000049722d2b28000000000000000000000000000000000000000000000000000000006738ff71000000000000000000000000000000000000000000000000000000006738ff830000000000000000000000000000000000000000000000070000000000000953" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/testCases.ts b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/testCases.ts new file mode 100644 index 000000000..9ceea5c73 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/apx-eth/tests/testCases.ts @@ -0,0 +1,52 @@ +import { Chain } from '../../../../../core/constants/chains' +import { TimePeriod } from '../../../../../core/constants/timePeriod' +import type { TestCase } from '../../../../../types/testCase' + +export const testCases: TestCase[] = [ + { + key: 'apx-eth-positions', + chainId: Chain.Ethereum, + method: 'positions', + input: { + userAddress: '0xa5cCBD739e7f5662b95D269ee9A48a37cBFb88Bc', + filterProtocolTokens: ['0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6'], + }, + blockNumber: 21202764, + }, + { + key: 'apx-eth-profits', + chainId: Chain.Ethereum, + method: 'profits', + input: { + userAddress: '0xa5cCBD739e7f5662b95D269ee9A48a37cBFb88Bc', + timePeriod: TimePeriod.oneDay, + filterProtocolTokens: ['0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6'], + }, + blockNumber: 21202764, + }, + { + key: 'apx-eth-prices', + chainId: Chain.Ethereum, + method: 'prices', + filterProtocolToken: '0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6', + blockNumber: 21202764, + }, + { + key: 'apx-eth-tvl', + chainId: Chain.Ethereum, + method: 'tvl', + filterProtocolTokens: ['0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6'], + blockNumber: 21202764, + }, + { + key: 'apx-eth-deposits', + chainId: Chain.Ethereum, + method: 'deposits', + input: { + userAddress: '0xa5cCBD739e7f5662b95D269ee9A48a37cBFb88Bc', + fromBlock: 21023794 - 1, + toBlock: 21023794 + 1, + protocolTokenAddress: '0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6', + }, + }, +] diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/dineroPxEthAdapter.ts b/packages/adapters-library/src/adapters/dinero/products/px-eth/dineroPxEthAdapter.ts new file mode 100644 index 000000000..3463b437d --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/dineroPxEthAdapter.ts @@ -0,0 +1,151 @@ +import { getAddress } from 'ethers' +import { AdaptersController } from '../../../../core/adaptersController' +import { ZERO_ADDRESS } from '../../../../core/constants/ZERO_ADDRESS' +import { Chain } from '../../../../core/constants/chains' +import { CacheToDb } from '../../../../core/decorators/cacheToDb' +import { CustomJsonRpcProvider } from '../../../../core/provider/CustomJsonRpcProvider' +import { nativeToken } from '../../../../core/utils/nativeTokens' +import { Helpers } from '../../../../scripts/helpers' +import { + IProtocolAdapter, + ProtocolToken, +} from '../../../../types/IProtocolAdapter' +import { + GetEventsInput, + GetPositionsInput, + GetTotalValueLockedInput, + MovementsByBlock, + PositionType, + ProtocolAdapterParams, + ProtocolDetails, + ProtocolPosition, + ProtocolTokenTvl, + UnwrapExchangeRate, + UnwrapInput, +} from '../../../../types/adapter' +import { Protocol } from '../../../protocols' +import { PX_ETH_DEPLOYMENTS } from '../../common/deploymentAddresses' + +export class DineroPxEthAdapter implements IProtocolAdapter { + productId = 'px-eth' + protocolId: Protocol + chainId: Chain + helpers: Helpers + + adapterSettings = { + enablePositionDetectionByProtocolTokenTransfer: true, + includeInUnwrap: true, + } + + private provider: CustomJsonRpcProvider + + adaptersController: AdaptersController + + constructor({ + provider, + chainId, + protocolId, + adaptersController, + helpers, + }: ProtocolAdapterParams) { + this.provider = provider + this.chainId = chainId + this.protocolId = protocolId + this.adaptersController = adaptersController + this.helpers = helpers + } + + getProtocolDetails(): ProtocolDetails { + return { + protocolId: this.protocolId, + name: 'Dinero', + description: 'Dinero defi adapter for Pirex Ether (pxETH)', + siteUrl: 'https://dinero.xyz/', + iconUrl: 'https://dinero.xyz/images/eye.png', + positionType: PositionType.Supply, + chainId: this.chainId, + productId: this.productId, + } + } + + @CacheToDb + async getProtocolTokens(): Promise { + return [ + { + ...(await this.helpers.getTokenMetadata( + PX_ETH_DEPLOYMENTS[this.chainId]!, + )), + underlyingTokens: [ + { + ...nativeToken[this.chainId], + address: ZERO_ADDRESS, + }, + ], + }, + ] + } + + private async getProtocolTokenByAddress(protocolTokenAddress: string) { + return this.helpers.getProtocolTokenByAddress({ + protocolTokens: await this.getProtocolTokens(), + protocolTokenAddress, + }) + } + + async getPositions(input: GetPositionsInput): Promise { + return this.helpers.getBalanceOfTokens({ + ...input, + protocolTokens: await this.getProtocolTokens(), + }) + } + + async getWithdrawals({ + protocolTokenAddress, + fromBlock, + toBlock, + userAddress, + }: GetEventsInput): Promise { + return this.helpers.withdrawals({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + filter: { fromBlock, toBlock, userAddress }, + }) + } + + async getDeposits({ + protocolTokenAddress, + fromBlock, + toBlock, + userAddress, + }: GetEventsInput): Promise { + return this.helpers.deposits({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + filter: { fromBlock, toBlock, userAddress }, + }) + } + + async getTotalValueLocked({ + protocolTokenAddresses, + blockNumber, + }: GetTotalValueLockedInput): Promise { + const protocolTokens = await this.getProtocolTokens() + + return await this.helpers.tvl({ + protocolTokens, + filterProtocolTokenAddresses: protocolTokenAddresses, + blockNumber, + }) + } + + async unwrap({ + protocolTokenAddress, + tokenId, + blockNumber, + }: UnwrapInput): Promise { + return this.helpers.unwrapOneToOne({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + underlyingTokens: ( + await this.getProtocolTokenByAddress(protocolTokenAddress) + ).underlyingTokens, + }) + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.deposits.px-eth-deposits.json b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.deposits.px-eth-deposits.json new file mode 100644 index 000000000..d009a8fde --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.deposits.px-eth-deposits.json @@ -0,0 +1,77 @@ +{ + "aggregatedValues": ["USD6,362.04"], + "latency": "Latency: 0.511 seconds", + "snapshot": { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Pirex Ether (pxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "px-eth", + "chainName": "ethereum", + "success": true, + "movements": [ + { + "transactionHash": "0x98fdcf2851e8827299e3c6df080cb3b4e8c5e5a4da28c2deb3f6b8d2232f4a57", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "2000000000000000000n", + "type": "underlying", + "blockNumber": 21200800, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "2000000000000000000n", + "balance": 2, + "price": 3181.02, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 2 + } + ], + "blockNumber": 21200800 + } + ] + }, + "rpcResponses": { + "4c5004c70c75545a76fda3643137a408": { + "result": [ + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0xccd6f6e4fb2e2fa655a573a0891d78a3c18f60a8494ca5cd5d5c7819143b1126", + "blockNumber": "0x1437fa0", + "data": "0x0000000000000000000000000000000000000000000000001bc16d674ec80000", + "logIndex": "0x143", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000c24a2f37d6781d8f5d46c7fba9fe2ae0dde65caa" + ], + "transactionHash": "0x98fdcf2851e8827299e3c6df080cb3b4e8c5e5a4da28c2deb3f6b8d2232f4a57", + "transactionIndex": "0x36" + } + ] + }, + "3588585b24eb95bdb458fc0cc1dd4c3b": { + "result": "0x000000000000000000000000000000000000000000000007000000000000094a0000000000000000000000000000000000000000000000000000004a105b5180000000000000000000000000000000000000000000000000000000006738a6d1000000000000000000000000000000000000000000000000000000006738a6df000000000000000000000000000000000000000000000007000000000000094a" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.positions.px-eth-positions.json b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.positions.px-eth-positions.json new file mode 100644 index 000000000..7f631ee7e --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.positions.px-eth-positions.json @@ -0,0 +1,51 @@ +{ + "blockNumber": 21202764, + "latency": "Latency: 1.724 seconds", + "aggregatedValues": ["USD819.43"], + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Pirex Ether (pxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "px-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "259768007423606052n", + "type": "protocol", + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "259768007423606052n", + "balance": 0.25976800742360606, + "price": 3154.481754, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 0.25976800742360606 + } + ] + } + ], + "rpcResponses": { + "5ec0f724ffebb0440825df73a3a33f0d": { + "result": "0x000000000000000000000000000000000000000000000000039ae1a05e7ebd24" + }, + "2c3a0be107372f1aba571de708183d07": { + "result": "0x000000000000000000000000000000000000000000000007000000000000095300000000000000000000000000000000000000000000000000000049722d2b28000000000000000000000000000000000000000000000000000000006738ff71000000000000000000000000000000000000000000000000000000006738ff830000000000000000000000000000000000000000000000070000000000000953" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.prices.apx-eth-prices.json b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.prices.apx-eth-prices.json new file mode 100644 index 000000000..96be9da55 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.prices.apx-eth-prices.json @@ -0,0 +1,41 @@ +{ + "latency": "Latency: 0 seconds", + "blockNumber": 21202764, + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Pirex Ether (pxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "px-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "baseRate": 1, + "type": "protocol", + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "underlyingRateRaw": "1000000000000000000n", + "underlyingRate": 1, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ] + } + ] + } + ], + "rpcResponses": {} +} diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.tvl.apx-eth-tvl.json b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.tvl.apx-eth-tvl.json new file mode 100644 index 000000000..db7081a05 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.tvl.apx-eth-tvl.json @@ -0,0 +1,50 @@ +{ + "latency": "Latency: 0.65 seconds", + "blockNumber": 21202764, + "snapshot": [ + { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Pirex Ether (pxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "px-eth", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "type": "protocol", + "totalSupplyRaw": "30511436448949191084372n", + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "totalSupplyRaw": "30511436448949191084372n", + "totalSupply": 30511.436448949193, + "price": 3154.481754, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "totalSupply": 30511.436448949193 + } + ] + } + ], + "rpcResponses": { + "9934ce4cf2e0b9819d7d0bca611ac430": { + "result": "0x000000000000000000000000000000000000000000000676073da1ccfa7c8954" + }, + "2c3a0be107372f1aba571de708183d07": { + "result": "0x000000000000000000000000000000000000000000000007000000000000095300000000000000000000000000000000000000000000000000000049722d2b28000000000000000000000000000000000000000000000000000000006738ff71000000000000000000000000000000000000000000000000000000006738ff830000000000000000000000000000000000000000000000070000000000000953" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.withdrawals.json b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.withdrawals.json new file mode 100644 index 000000000..8d78c547b --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/snapshots/ethereum.withdrawals.json @@ -0,0 +1,349 @@ +{ + "aggregatedValues": [ + "USD227,128.17", + "USD277,042.92", + "USD1,392.18", + "USD318,404.51", + "USD20,754.79", + "USD159,252.51" + ], + "latency": "Latency: 0.854 seconds", + "snapshot": { + "protocolId": "dinero", + "name": "Dinero", + "description": "Dinero defi adapter for Pirex Ether (pxETH)", + "siteUrl": "https://dinero.xyz/", + "iconUrl": "https://dinero.xyz/images/eye.png", + "positionType": "supply", + "chainId": 1, + "productId": "px-eth", + "chainName": "ethereum", + "success": true, + "movements": [ + { + "transactionHash": "0x499414a9f796711a4af7a85204aaf78cba67a32742e9395a13e7c9e76f11156c", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "90000000000000000000n", + "type": "underlying", + "blockNumber": 21087397, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "90000000000000000000n", + "balance": 90, + "price": 2523.6463, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 90 + } + ], + "blockNumber": 21087397 + }, + { + "transactionHash": "0xca8d1b765fd1bfb6a65d6bd62e3e2be44563701056fec7b4f1c44aa5fc7f040a", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "109778823162299999998n", + "type": "underlying", + "blockNumber": 21087408, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "109778823162299999998n", + "balance": 109.7788231623, + "price": 2523.6463, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 109.7788231623 + } + ], + "blockNumber": 21087408 + }, + { + "transactionHash": "0x4d4e7d341cac4efd304af860dea263d5d0f1921511215bf2ed13d16fb36f314a", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "551652386464158230n", + "type": "underlying", + "blockNumber": 21087428, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "551652386464158230n", + "balance": 0.5516523864641583, + "price": 2523.6463, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 0.5516523864641583 + } + ], + "blockNumber": 21087428 + }, + { + "transactionHash": "0xc0f5fafea425a2b2e92dc3a068545d4555293205bc1492883343020b67b1f9e9", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "112890592165112056289n", + "type": "underlying", + "blockNumber": 21134902, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "112890592165112056289n", + "balance": 112.89059216511205, + "price": 2820.4698, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 112.89059216511205 + } + ], + "blockNumber": 21134902 + }, + { + "transactionHash": "0x898d11c016105c52d151fb4d5a6c82acea248e6060b8eacbc582164fbd52347d", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "7358630288349999057n", + "type": "underlying", + "blockNumber": 21134912, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "7358630288349999057n", + "balance": 7.358630288349999, + "price": 2820.4698, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 7.358630288349999 + } + ], + "blockNumber": 21134912 + }, + { + "transactionHash": "0xeb3ffd44ff8dcc6a48f5f06acd9b4e9a9ef87e8f07c403222466ecbbde9c8010", + "protocolToken": { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6", + "name": "Pirex Ether", + "symbol": "pxETH", + "decimals": 18, + "balanceRaw": "51693832666649999998n", + "type": "underlying", + "blockNumber": 21193685, + "tokens": [ + { + "address": "0x0000000000000000000000000000000000000000", + "name": "Ethereum", + "symbol": "ETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "51693832666649999998n", + "balance": 51.69383266665, + "price": 3080.6869, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png" + } + ], + "balance": 51.69383266665 + } + ], + "blockNumber": 21193685 + } + ] + }, + "rpcResponses": { + "ff56b54db29dd6ea8d8e2054336f5935": { + "result": [ + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0xaa742e58b18170b317fa6e5344636ecdc28e8390e1acdda163b931d6bd3acf70", + "blockNumber": "0x141c4a5", + "data": "0x000000000000000000000000000000000000000000000004e1003b28d9280000", + "logIndex": "0x5b", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9f7aca75cf438ce22184331a66591a02df3a216", + "0x000000000000000000000000b28ca7e465c452ce4252598e0bc96aeba553cf82" + ], + "transactionHash": "0x499414a9f796711a4af7a85204aaf78cba67a32742e9395a13e7c9e76f11156c", + "transactionIndex": "0xc" + }, + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0x3bf32c389679ca878dc566edd56d3281386065b35662118ec15e8be0e20eb269", + "blockNumber": "0x141c4b0", + "data": "0x000000000000000000000000000000000000000000000005f37cba087150e6fe", + "logIndex": "0x11b", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9f7aca75cf438ce22184331a66591a02df3a216", + "0x0000000000000000000000006ac8bab8b775a03b8b72b2940251432442f61b94" + ], + "transactionHash": "0xca8d1b765fd1bfb6a65d6bd62e3e2be44563701056fec7b4f1c44aa5fc7f040a", + "transactionIndex": "0x70" + }, + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0x59d338035d0ee5ccde4bb714ee74d58786753b404569dda4609c632d8d4859f0", + "blockNumber": "0x141c4c4", + "data": "0x00000000000000000000000000000000000000000000000007a7dcec36b15216", + "logIndex": "0x1c", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9f7aca75cf438ce22184331a66591a02df3a216", + "0x000000000000000000000000e2ed1dac3a9547bc6057e32bf8133b5268d7d987" + ], + "transactionHash": "0x4d4e7d341cac4efd304af860dea263d5d0f1921511215bf2ed13d16fb36f314a", + "transactionIndex": "0x7" + }, + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0x53edbdce751b8cf455cb9b8945cf34394c261aabd05f12943e784baf24649956", + "blockNumber": "0x1427e36", + "data": "0x0000000000000000000000000000000000000000000000061eabf374450009e1", + "logIndex": "0x17", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9f7aca75cf438ce22184331a66591a02df3a216", + "0x0000000000000000000000006ac8bab8b775a03b8b72b2940251432442f61b94" + ], + "transactionHash": "0xc0f5fafea425a2b2e92dc3a068545d4555293205bc1492883343020b67b1f9e9", + "transactionIndex": "0x7" + }, + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0x46a6f4c28863c3e32c585808206ca68196914858bdf5632c31f9d4aee31b9b05", + "blockNumber": "0x1427e40", + "data": "0x000000000000000000000000000000000000000000000000661f1b4272882fd1", + "logIndex": "0x24", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9f7aca75cf438ce22184331a66591a02df3a216", + "0x0000000000000000000000006ac8bab8b775a03b8b72b2940251432442f61b94" + ], + "transactionHash": "0x898d11c016105c52d151fb4d5a6c82acea248e6060b8eacbc582164fbd52347d", + "transactionIndex": "0xb" + }, + { + "address": "0x04c154b66cb340f3ae24111cc767e0184ed00cc6", + "blockHash": "0x9dea156563f5e117bb4e0b3cb983e66bd3b3817e0a1f9b9cde43cf8bde292b23", + "blockNumber": "0x14363d5", + "data": "0x000000000000000000000000000000000000000000000002cd6562ecb6283a7e", + "logIndex": "0x37", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9f7aca75cf438ce22184331a66591a02df3a216", + "0x0000000000000000000000006ac8bab8b775a03b8b72b2940251432442f61b94" + ], + "transactionHash": "0xeb3ffd44ff8dcc6a48f5f06acd9b4e9a9ef87e8f07c403222466ecbbde9c8010", + "transactionIndex": "0xe" + } + ] + }, + "e60ae0203cea0df6c5943d445c84a20c": { + "result": "0x00000000000000000000000000000000000000000000000700000000000005c20000000000000000000000000000000000000000000000000000003ac21aa7f0000000000000000000000000000000000000000000000000000000006723c7aa000000000000000000000000000000000000000000000000000000006723c7bb00000000000000000000000000000000000000000000000700000000000005c2" + }, + "625b99caee624ef3919ca1130919b55f": { + "result": "0x00000000000000000000000000000000000000000000000700000000000005c20000000000000000000000000000000000000000000000000000003ac21aa7f0000000000000000000000000000000000000000000000000000000006723c7aa000000000000000000000000000000000000000000000000000000006723c7bb00000000000000000000000000000000000000000000000700000000000005c2" + }, + "251f3d9c948bee114bd5a06aff8edd49": { + "result": "0x00000000000000000000000000000000000000000000000700000000000005c20000000000000000000000000000000000000000000000000000003ac21aa7f0000000000000000000000000000000000000000000000000000000006723c7aa000000000000000000000000000000000000000000000000000000006723c7bb00000000000000000000000000000000000000000000000700000000000005c2" + }, + "870a8457bf8a3b3294d6cdaebec9d576": { + "result": "0x000000000000000000000000000000000000000000000007000000000000091400000000000000000000000000000000000000000000000000000047ba532850000000000000000000000000000000000000000000000000000000006737581b000000000000000000000000000000000000000000000000000000006737582f0000000000000000000000000000000000000000000000070000000000000914" + }, + "0800acc520e17f0087b1b88bf7e043c0": { + "result": "0x00000000000000000000000000000000000000000000000700000000000006e500000000000000000000000000000000000000000000000000000041ab4f5fa000000000000000000000000000000000000000000000000000000000672c81ca00000000000000000000000000000000000000000000000000000000672c81d700000000000000000000000000000000000000000000000700000000000006e5" + }, + "aa7454c34272e013bb673280a13b260a": { + "result": "0x00000000000000000000000000000000000000000000000700000000000006e500000000000000000000000000000000000000000000000000000041ab4f5fa000000000000000000000000000000000000000000000000000000000672c81ca00000000000000000000000000000000000000000000000000000000672c81d700000000000000000000000000000000000000000000000700000000000006e5" + } + } +} diff --git a/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/testCases.ts b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/testCases.ts new file mode 100644 index 000000000..c126a6549 --- /dev/null +++ b/packages/adapters-library/src/adapters/dinero/products/px-eth/tests/testCases.ts @@ -0,0 +1,50 @@ +import { Chain } from '../../../../../core/constants/chains' +import type { TestCase } from '../../../../../types/testCase' + +export const testCases: TestCase[] = [ + { + key: 'px-eth-positions', + chainId: Chain.Ethereum, + method: 'positions', + input: { + userAddress: '0xF9F7AcA75cf438CE22184331a66591A02dF3a216', + filterProtocolTokens: ['0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6'], + }, + blockNumber: 21202764, + }, + { + key: 'apx-eth-prices', + chainId: Chain.Ethereum, + method: 'prices', + filterProtocolToken: '0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6', + blockNumber: 21202764, + }, + { + key: 'apx-eth-tvl', + chainId: Chain.Ethereum, + method: 'tvl', + filterProtocolTokens: ['0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6'], + blockNumber: 21202764, + }, + { + key: 'px-eth-deposits', + chainId: Chain.Ethereum, + method: 'deposits', + input: { + userAddress: '0xC24A2F37D6781D8F5d46C7fBa9fe2Ae0DDe65Caa', + fromBlock: 21200800 - 1, + toBlock: 21200800 + 1, + protocolTokenAddress: '0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6', + }, + }, + { + chainId: Chain.Ethereum, + method: 'withdrawals', + input: { + userAddress: '0xF9F7AcA75cf438CE22184331a66591A02dF3a216', + fromBlock: 21087384 - 200, + toBlock: 21202764, + protocolTokenAddress: '0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6', + }, + }, +] diff --git a/packages/adapters-library/src/adapters/integration.test.ts b/packages/adapters-library/src/adapters/integration.test.ts index a6f7e3d17..7fc49dcbe 100644 --- a/packages/adapters-library/src/adapters/integration.test.ts +++ b/packages/adapters-library/src/adapters/integration.test.ts @@ -43,6 +43,8 @@ import { testCases as curvePoolTestCases } from './curve/products/pool/tests/tes import { testCases as curveStakingTestCases } from './curve/products/staking/tests/testCases' import { testCases as curveVotingEscrowTestCases } from './curve/products/voting-escrow/tests/testCases' import { testCases as deriPoolTestCases } from './deri/products/pool/tests/testCases' +import { testCases as dineroApxEthTestCases } from './dinero/products/apx-eth/tests/testCases' +import { testCases as dineroPxEthTestCases } from './dinero/products/px-eth/tests/testCases' import { testCases as ethenaLpStakingTestCases } from './ethena/products/lp-staking/tests/testCases' import { testCases as ethenaStakedEnaTestCases } from './ethena/products/staked-ena/tests/testCases' import { testCases as ethenaStakedUsdeTestCases } from './ethena/products/staked-usde/tests/testCases' @@ -202,6 +204,11 @@ const allTestCases: Record> = { ['pool']: deriPoolTestCases, }, + [Protocol.Dinero]: { + ['apx-eth']: dineroApxEthTestCases, + ['px-eth']: dineroPxEthTestCases, + }, + [Protocol.Ethena]: { ['lp-staking']: ethenaLpStakingTestCases, ['staked-ena']: ethenaStakedEnaTestCases, diff --git a/packages/adapters-library/src/adapters/protocols.ts b/packages/adapters-library/src/adapters/protocols.ts index b0ad3568a..e8fa9d23c 100644 --- a/packages/adapters-library/src/adapters/protocols.ts +++ b/packages/adapters-library/src/adapters/protocols.ts @@ -12,6 +12,7 @@ export const Protocol = { Convex: 'convex', Curve: 'curve', Deri: 'deri', + Dinero: 'dinero', Ethena: 'ethena', EtherFi: 'etherfi', Flux: 'flux', diff --git a/packages/adapters-library/src/adapters/supportedProtocols.ts b/packages/adapters-library/src/adapters/supportedProtocols.ts index cd8d16317..81ed156e1 100644 --- a/packages/adapters-library/src/adapters/supportedProtocols.ts +++ b/packages/adapters-library/src/adapters/supportedProtocols.ts @@ -143,6 +143,10 @@ import { CompoundV3LendingAdapter } from './compound-v3/products/lending/compoun import { BalancerV2VestingAdapter } from './balancer-v2/products/vesting/balancerV2VestingAdapter' import { CompoundV3BorrowAdapter } from './compound-v3/products/borrow/compoundV3BorrowAdapter' +import { DineroPxEthAdapter } from './dinero/products/px-eth/dineroPxEthAdapter' + +import { DineroApxEthAdapter } from './dinero/products/apx-eth/dineroApxEthAdapter' + export const supportedProtocols: Record< Protocol, Partial< @@ -338,6 +342,15 @@ export const supportedProtocols: Record< [Chain.Linea]: [DeriPoolAdapter], }, + [Protocol.Dinero]: { + [Chain.Ethereum]: [DineroPxEthAdapter, DineroApxEthAdapter], + // [Chain.Optimism]: [DineroPxEthAdapter, DineroApxEthAdapter], + // [Chain.Bsc]: [DineroPxEthAdapter, DineroApxEthAdapter], + // [Chain.Base]: [DineroPxEthAdapter, DineroApxEthAdapter], + // [Chain.Arbitrum]: [DineroPxEthAdapter, DineroApxEthAdapter], + // [Chain.Linea]: [DineroPxEthAdapter, DineroApxEthAdapter], + }, + [Protocol.Ethena]: { [Chain.Ethereum]: [ EthenaStakedUsdeAdapter,