diff --git a/src/apps/apecoin/apecoin.module.ts b/src/apps/apecoin/apecoin.module.ts deleted file mode 100644 index 8271246c1..000000000 --- a/src/apps/apecoin/apecoin.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; - -import { ApecoinViemContractFactory } from './contracts'; -import { EthereumApecoinStakingContractPositionFetcher } from './ethereum/apecoin.staking.contract-position-fetcher'; - -@Module({ - providers: [ApecoinViemContractFactory, EthereumApecoinStakingContractPositionFetcher], -}) -export class ApecoinAppModule extends AbstractApp() {} diff --git a/src/apps/apecoin/assets/logo.png b/src/apps/apecoin/assets/logo.png deleted file mode 100644 index 0c80d4516..000000000 Binary files a/src/apps/apecoin/assets/logo.png and /dev/null differ diff --git a/src/apps/apecoin/contracts/abis/apecoin-staking.json b/src/apps/apecoin/contracts/abis/apecoin-staking.json deleted file mode 100644 index c9aa765e5..000000000 --- a/src/apps/apecoin/contracts/abis/apecoin-staking.json +++ /dev/null @@ -1,854 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_apeCoinContractAddress", "type": "address" }, - { "internalType": "address", "name": "_baycContractAddress", "type": "address" }, - { "internalType": "address", "name": "_maycContractAddress", "type": "address" }, - { "internalType": "address", "name": "_bakcContractAddress", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" } - ], - "name": "ClaimRewards", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "ClaimRewardsNft", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "name": "ClaimRewardsPairNft", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "DepositNft", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "name": "DepositPairNft", - "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": true, "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lastRewardedBlock", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "accumulatedRewardsPerShare", "type": "uint256" } - ], - "name": "UpdatePool", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" } - ], - "name": "Withdraw", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "WithdrawNft", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "name": "WithdrawPairNft", - "type": "event" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "_amount", "type": "uint256" }, - { "internalType": "uint256", "name": "_startTimestamp", "type": "uint256" }, - { "internalType": "uint256", "name": "_endTimeStamp", "type": "uint256" }, - { "internalType": "uint256", "name": "_capPerPosition", "type": "uint256" } - ], - "name": "addTimeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "addressPosition", - "outputs": [ - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { "internalType": "int256", "name": "rewardsDebt", "type": "int256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "apeCoin", - "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "name": "bakcToMain", - "outputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "bool", "name": "isPaired", "type": "bool" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_recipient", "type": "address" }], - "name": "claimApeCoin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNft[]", - "name": "_baycPairs", - "type": "tuple[]" - }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNft[]", - "name": "_maycPairs", - "type": "tuple[]" - }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "claimBAKC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256[]", "name": "_nfts", "type": "uint256[]" }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "claimBAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256[]", "name": "_nfts", "type": "uint256[]" }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "claimMAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "claimSelfApeCoin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNft[]", - "name": "_baycPairs", - "type": "tuple[]" - }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNft[]", - "name": "_maycPairs", - "type": "tuple[]" - } - ], - "name": "claimSelfBAKC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256[]", "name": "_nfts", "type": "uint256[]" }], - "name": "claimSelfBAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256[]", "name": "_nfts", "type": "uint256[]" }], - "name": "claimSelfMAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_amount", "type": "uint256" }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "depositApeCoin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNftWithAmount[]", - "name": "_baycPairs", - "type": "tuple[]" - }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNftWithAmount[]", - "name": "_maycPairs", - "type": "tuple[]" - } - ], - "name": "depositBAKC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.SingleNft[]", - "name": "_nfts", - "type": "tuple[]" - } - ], - "name": "depositBAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.SingleNft[]", - "name": "_nfts", - "type": "tuple[]" - } - ], - "name": "depositMAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], - "name": "depositSelfApeCoin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "getAllStakes", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "deposited", "type": "uint256" }, - { "internalType": "uint256", "name": "unclaimed", "type": "uint256" }, - { "internalType": "uint256", "name": "rewards24hr", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.DashboardPair", - "name": "pair", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.DashboardStake[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "getApeCoinStake", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "deposited", "type": "uint256" }, - { "internalType": "uint256", "name": "unclaimed", "type": "uint256" }, - { "internalType": "uint256", "name": "rewards24hr", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.DashboardPair", - "name": "pair", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.DashboardStake", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "getBakcStakes", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "deposited", "type": "uint256" }, - { "internalType": "uint256", "name": "unclaimed", "type": "uint256" }, - { "internalType": "uint256", "name": "rewards24hr", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.DashboardPair", - "name": "pair", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.DashboardStake[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "getBaycStakes", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "deposited", "type": "uint256" }, - { "internalType": "uint256", "name": "unclaimed", "type": "uint256" }, - { "internalType": "uint256", "name": "rewards24hr", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.DashboardPair", - "name": "pair", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.DashboardStake[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "getMaycStakes", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "deposited", "type": "uint256" }, - { "internalType": "uint256", "name": "unclaimed", "type": "uint256" }, - { "internalType": "uint256", "name": "rewards24hr", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.DashboardPair", - "name": "pair", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.DashboardStake[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPoolsUI", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "startTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "endTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "rewardsPerHour", "type": "uint256" }, - { "internalType": "uint256", "name": "capPerPosition", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.TimeRange", - "name": "currentTimeRange", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.PoolUI", - "name": "", - "type": "tuple" - }, - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "startTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "endTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "rewardsPerHour", "type": "uint256" }, - { "internalType": "uint256", "name": "capPerPosition", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.TimeRange", - "name": "currentTimeRange", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.PoolUI", - "name": "", - "type": "tuple" - }, - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "startTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "endTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "rewardsPerHour", "type": "uint256" }, - { "internalType": "uint256", "name": "capPerPosition", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.TimeRange", - "name": "currentTimeRange", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.PoolUI", - "name": "", - "type": "tuple" - }, - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "startTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "endTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "rewardsPerHour", "type": "uint256" }, - { "internalType": "uint256", "name": "capPerPosition", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.TimeRange", - "name": "currentTimeRange", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.PoolUI", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "getSplitStakes", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "deposited", "type": "uint256" }, - { "internalType": "uint256", "name": "unclaimed", "type": "uint256" }, - { "internalType": "uint256", "name": "rewards24hr", "type": "uint256" }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "mainTypePoolId", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.DashboardPair", - "name": "pair", - "type": "tuple" - } - ], - "internalType": "struct ApeCoinStaking.DashboardStake[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "_index", "type": "uint256" } - ], - "name": "getTimeRangeBy", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "startTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "endTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "rewardsPerHour", "type": "uint256" }, - { "internalType": "uint256", "name": "capPerPosition", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.TimeRange", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "name": "mainToBakc", - "outputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "bool", "name": "isPaired", "type": "bool" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "nftContracts", - "outputs": [{ "internalType": "contract ERC721Enumerable", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "name": "nftPosition", - "outputs": [ - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { "internalType": "int256", "name": "rewardsDebt", "type": "int256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_poolId", "type": "uint256" }, - { "internalType": "address", "name": "_address", "type": "address" }, - { "internalType": "uint256", "name": "_tokenId", "type": "uint256" } - ], - "name": "pendingRewards", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "pools", - "outputs": [ - { "internalType": "uint256", "name": "lastRewardedTimestampHour", "type": "uint256" }, - { "internalType": "uint256", "name": "lastRewardsRangeIndex", "type": "uint256" }, - { "internalType": "uint256", "name": "stakedAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "accumulatedRewardsPerShare", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_poolId", "type": "uint256" }], - "name": "removeLastTimeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "_poolId", "type": "uint256" }, - { "internalType": "uint256", "name": "_from", "type": "uint256" }, - { "internalType": "uint256", "name": "_to", "type": "uint256" } - ], - "name": "rewardsBy", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_addr", "type": "address" }], - "name": "stakedTotal", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_poolId", "type": "uint256" }], - "name": "updatePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_amount", "type": "uint256" }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "withdrawApeCoin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNftWithAmount[]", - "name": "_baycPairs", - "type": "tuple[]" - }, - { - "components": [ - { "internalType": "uint256", "name": "mainTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "bakcTokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.PairNftWithAmount[]", - "name": "_maycPairs", - "type": "tuple[]" - } - ], - "name": "withdrawBAKC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.SingleNft[]", - "name": "_nfts", - "type": "tuple[]" - }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "withdrawBAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.SingleNft[]", - "name": "_nfts", - "type": "tuple[]" - }, - { "internalType": "address", "name": "_recipient", "type": "address" } - ], - "name": "withdrawMAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], - "name": "withdrawSelfApeCoin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.SingleNft[]", - "name": "_nfts", - "type": "tuple[]" - } - ], - "name": "withdrawSelfBAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "internalType": "struct ApeCoinStaking.SingleNft[]", - "name": "_nfts", - "type": "tuple[]" - } - ], - "name": "withdrawSelfMAYC", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/apecoin/contracts/index.ts b/src/apps/apecoin/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/apecoin/contracts/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -export * from './viem.contract-factory'; diff --git a/src/apps/apecoin/contracts/viem.contract-factory.ts b/src/apps/apecoin/contracts/viem.contract-factory.ts deleted file mode 100644 index 550634f2d..000000000 --- a/src/apps/apecoin/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Injectable, Inject } from '@nestjs/common'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { Network } from '~types/network.interface'; - -import { ApecoinStaking__factory } from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class ApecoinViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - apecoinStaking({ address, network }: ContractOpts) { - return ApecoinStaking__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/apecoin/contracts/viem/ApecoinStaking.ts b/src/apps/apecoin/contracts/viem/ApecoinStaking.ts deleted file mode 100644 index 7a0b7017d..000000000 --- a/src/apps/apecoin/contracts/viem/ApecoinStaking.ts +++ /dev/null @@ -1,1833 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const apecoinStakingAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_apeCoinContractAddress', - type: 'address', - }, - { - internalType: 'address', - name: '_baycContractAddress', - type: 'address', - }, - { - internalType: 'address', - name: '_maycContractAddress', - type: 'address', - }, - { - internalType: 'address', - name: '_bakcContractAddress', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'ClaimRewards', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'ClaimRewardsNft', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - name: 'ClaimRewardsPairNft', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'DepositNft', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - name: 'DepositPairNft', - 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: true, - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lastRewardedBlock', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'accumulatedRewardsPerShare', - type: 'uint256', - }, - ], - name: 'UpdatePool', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'WithdrawNft', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - name: 'WithdrawPairNft', - type: 'event', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_startTimestamp', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_endTimeStamp', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_capPerPosition', - type: 'uint256', - }, - ], - name: 'addTimeRange', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'addressPosition', - outputs: [ - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'rewardsDebt', - type: 'int256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'apeCoin', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'bakcToMain', - outputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isPaired', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'claimApeCoin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNft[]', - name: '_baycPairs', - type: 'tuple[]', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNft[]', - name: '_maycPairs', - type: 'tuple[]', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'claimBAKC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: '_nfts', - type: 'uint256[]', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'claimBAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: '_nfts', - type: 'uint256[]', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'claimMAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'claimSelfApeCoin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNft[]', - name: '_baycPairs', - type: 'tuple[]', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNft[]', - name: '_maycPairs', - type: 'tuple[]', - }, - ], - name: 'claimSelfBAKC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: '_nfts', - type: 'uint256[]', - }, - ], - name: 'claimSelfBAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: '_nfts', - type: 'uint256[]', - }, - ], - name: 'claimSelfMAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'depositApeCoin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNftWithAmount[]', - name: '_baycPairs', - type: 'tuple[]', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNftWithAmount[]', - name: '_maycPairs', - type: 'tuple[]', - }, - ], - name: 'depositBAKC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.SingleNft[]', - name: '_nfts', - type: 'tuple[]', - }, - ], - name: 'depositBAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.SingleNft[]', - name: '_nfts', - type: 'tuple[]', - }, - ], - name: 'depositMAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'depositSelfApeCoin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'getAllStakes', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deposited', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'unclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewards24hr', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardPair', - name: 'pair', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardStake[]', - name: '', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'getApeCoinStake', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deposited', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'unclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewards24hr', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardPair', - name: 'pair', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardStake', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'getBakcStakes', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deposited', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'unclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewards24hr', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardPair', - name: 'pair', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardStake[]', - name: '', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'getBaycStakes', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deposited', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'unclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewards24hr', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardPair', - name: 'pair', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardStake[]', - name: '', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'getMaycStakes', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deposited', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'unclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewards24hr', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardPair', - name: 'pair', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardStake[]', - name: '', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPoolsUI', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'startTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewardsPerHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'capPerPosition', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.TimeRange', - name: 'currentTimeRange', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.PoolUI', - name: '', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'startTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewardsPerHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'capPerPosition', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.TimeRange', - name: 'currentTimeRange', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.PoolUI', - name: '', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'startTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewardsPerHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'capPerPosition', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.TimeRange', - name: 'currentTimeRange', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.PoolUI', - name: '', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'startTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewardsPerHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'capPerPosition', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.TimeRange', - name: 'currentTimeRange', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.PoolUI', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'getSplitStakes', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deposited', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'unclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewards24hr', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mainTypePoolId', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardPair', - name: 'pair', - type: 'tuple', - }, - ], - internalType: 'struct ApeCoinStaking.DashboardStake[]', - name: '', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_index', - type: 'uint256', - }, - ], - name: 'getTimeRangeBy', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'startTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rewardsPerHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'capPerPosition', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.TimeRange', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'mainToBakc', - outputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isPaired', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'nftContracts', - outputs: [ - { - internalType: 'contract ERC721Enumerable', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'nftPosition', - outputs: [ - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'rewardsDebt', - type: 'int256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_poolId', - type: 'uint256', - }, - { - internalType: 'address', - name: '_address', - type: 'address', - }, - { - internalType: 'uint256', - name: '_tokenId', - type: 'uint256', - }, - ], - name: 'pendingRewards', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'pools', - outputs: [ - { - internalType: 'uint256', - name: 'lastRewardedTimestampHour', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastRewardsRangeIndex', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stakedAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'accumulatedRewardsPerShare', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_poolId', - type: 'uint256', - }, - ], - name: 'removeLastTimeRange', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_poolId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_from', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_to', - type: 'uint256', - }, - ], - name: 'rewardsBy', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_addr', - type: 'address', - }, - ], - name: 'stakedTotal', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_poolId', - type: 'uint256', - }, - ], - name: 'updatePool', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'withdrawApeCoin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNftWithAmount[]', - name: '_baycPairs', - type: 'tuple[]', - }, - { - components: [ - { - internalType: 'uint256', - name: 'mainTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bakcTokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.PairNftWithAmount[]', - name: '_maycPairs', - type: 'tuple[]', - }, - ], - name: 'withdrawBAKC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.SingleNft[]', - name: '_nfts', - type: 'tuple[]', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'withdrawBAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.SingleNft[]', - name: '_nfts', - type: 'tuple[]', - }, - { - internalType: 'address', - name: '_recipient', - type: 'address', - }, - ], - name: 'withdrawMAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'withdrawSelfApeCoin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.SingleNft[]', - name: '_nfts', - type: 'tuple[]', - }, - ], - name: 'withdrawSelfBAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - internalType: 'struct ApeCoinStaking.SingleNft[]', - name: '_nfts', - type: 'tuple[]', - }, - ], - name: 'withdrawSelfMAYC', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type ApecoinStaking = typeof apecoinStakingAbi; -export type ApecoinStakingContract = GetContractReturnType; - -export class ApecoinStaking__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: apecoinStakingAbi, publicClient: client }); - } -} diff --git a/src/apps/apecoin/contracts/viem/index.ts b/src/apps/apecoin/contracts/viem/index.ts deleted file mode 100644 index edce59045..000000000 --- a/src/apps/apecoin/contracts/viem/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { ApecoinStaking } from './ApecoinStaking'; - -export { ApecoinStaking__factory } from './ApecoinStaking'; diff --git a/src/apps/apecoin/ethereum/apecoin.staking.contract-position-fetcher.ts b/src/apps/apecoin/ethereum/apecoin.staking.contract-position-fetcher.ts deleted file mode 100644 index 9bc7d1e57..000000000 --- a/src/apps/apecoin/ethereum/apecoin.staking.contract-position-fetcher.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { BigNumberish } from 'ethers'; -import { merge, sumBy } from 'lodash'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { drillBalance } from '~app-toolkit/helpers/drill-balance.helper'; -import { DefaultDataProps } from '~position/display.interface'; -import { ContractPositionBalance, RawContractPositionBalance } from '~position/position-balance.interface'; -import { MetaType } from '~position/position.interface'; -import { DefaultContractPositionDefinition } from '~position/template/contract-position.template.types'; -import { CustomContractPositionTemplatePositionFetcher } from '~position/template/custom-contract-position.template.position-fetcher'; - -import { ApecoinViemContractFactory } from '../contracts'; -import { ApecoinStaking } from '../contracts/viem'; - -enum PoolTypes { - APECOIN = 0, - BAYC = 1, - MAYC = 2, - BAKC = 3, -} - -const POOL_LABEL_PREFIXES = { - [PoolTypes.APECOIN]: 'Apecoin (APE) Pool', - [PoolTypes.BAYC]: 'Bored Ape (BAYC) Pool', - [PoolTypes.MAYC]: 'Mutant (MAYC) Pool', - [PoolTypes.BAKC]: 'Paired (BAKC) Pool', -}; - -@PositionTemplate() -export class EthereumApecoinStakingContractPositionFetcher extends CustomContractPositionTemplatePositionFetcher { - groupLabel = 'Staking'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(ApecoinViemContractFactory) private readonly contractFactory: ApecoinViemContractFactory, - ) { - super(appToolkit); - } - - async getDefinitions(): Promise { - return [{ address: '0x5954ab967bc958940b7eb73ee84797dc8a2afbb9' }]; - } - - async getTokenDefinitions() { - const apecoinAddress = '0x4d224452801aced8b2f0aebe155379bb5d594381'; - return [ - { - metaType: MetaType.SUPPLIED, - address: apecoinAddress, - network: this.network, - }, - { - metaType: MetaType.CLAIMABLE, - address: apecoinAddress, - network: this.network, - }, - ]; - } - - getContract(address: string) { - return this.contractFactory.apecoinStaking({ network: this.network, address }); - } - - async getLabel(): Promise { - return `Staked Apecoin`; - } - - async getTokenBalancesPerPosition(): Promise { - throw new Error('Method not implemented.'); - } - - async getBalances(address: string): Promise[]> { - const multicall = this.appToolkit.getViemMulticall(this.network); - - const contractPositions = await this.appToolkit.getAppContractPositions({ - appId: this.appId, - network: this.network, - groupIds: [this.groupId], - }); - - const contractPosition = contractPositions[0]; - if (!contractPosition) return []; - - const stakingContract = this.contractFactory.apecoinStaking(contractPosition); - const positions = await multicall.wrap(stakingContract).read.getAllStakes([address]); - if (positions.length === 0) return []; - - const allPositions = await Promise.all( - positions.map(async position => { - const depositAmountRaw = position.deposited; - const claimableAmountRaw = position.unclaimed; - const [depositToken, claimableToken] = contractPosition.tokens; - - const tokens = [ - drillBalance(depositToken, depositAmountRaw.toString()), - drillBalance(claimableToken, claimableAmountRaw.toString()), - ]; - const balanceUSD = sumBy(tokens, v => v.balanceUSD); - const positionKey = `${position.poolId}:${position.tokenId}`; - - let labelSuffix = `${POOL_LABEL_PREFIXES[Number(position.poolId)]}`; - if (Number(position.tokenId) > 0) labelSuffix += `, Token ID #${position.tokenId}`; - const label = `Staked APE in ${labelSuffix}`; - - const contractPositionBalance = merge({}, contractPosition, { - tokens, - balanceUSD, - dataProps: { positionKey }, - displayProps: { label }, - }); - - return contractPositionBalance; - }), - ); - - return allPositions.flat(); - } - - async getRawBalances(address: string): Promise { - const multicall = this.appToolkit.getViemMulticall(this.network); - - const contractPositions = await this.appToolkit.getAppContractPositions({ - appId: this.appId, - network: this.network, - groupIds: [this.groupId], - }); - - const contractPosition = contractPositions[0]; - if (!contractPosition) return []; - - const stakingContract = this.contractFactory.apecoinStaking(contractPosition); - const positions = await multicall.wrap(stakingContract).read.getAllStakes([address]); - if (positions.length === 0) return []; - - return ( - await Promise.all( - positions - .map(async position => { - const depositAmountRaw = position.deposited; - const claimableAmountRaw = position.unclaimed; - - return [ - { - key: this.appToolkit.getPositionKey(contractPositions[0]), - tokens: [ - { - key: this.appToolkit.getPositionKey(contractPositions[0].tokens[0]), - balance: depositAmountRaw.toString(), - }, - { - key: `${this.appToolkit.getPositionKey(contractPositions[0].tokens[1])}-claimable`, - balance: claimableAmountRaw.toString(), - }, - ], - }, - ]; - }) - .flat(), - ) - ).flat(); - } -}