@merkl/api 0.10.78
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +125 -0
- package/dist/database/api/.generated/default.d.ts +1 -0
- package/dist/database/api/.generated/edge.d.ts +1 -0
- package/dist/database/api/.generated/index.d.ts +36404 -0
- package/dist/database/api/.generated/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/package.json +84 -0
- package/dist/database/api/.generated/runtime/index-browser.d.ts +365 -0
- package/dist/database/api/.generated/runtime/library.d.ts +3273 -0
- package/dist/database/api/.generated/schema.prisma +366 -0
- package/dist/database/api/.generated/wasm.d.ts +1 -0
- package/dist/database/api/seeder/resources/protocol.d.ts +353 -0
- package/dist/database/engine/.generated/default.d.ts +1 -0
- package/dist/database/engine/.generated/edge.d.ts +1 -0
- package/dist/database/engine/.generated/index.d.ts +16342 -0
- package/dist/database/engine/.generated/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/package.json +84 -0
- package/dist/database/engine/.generated/runtime/index-browser.d.ts +365 -0
- package/dist/database/engine/.generated/runtime/library.d.ts +3273 -0
- package/dist/database/engine/.generated/schema.prisma +205 -0
- package/dist/database/engine/.generated/wasm.d.ts +1 -0
- package/dist/src/backgroundJobs/index.d.ts +1 -0
- package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.d.ts +45 -0
- package/dist/src/backgroundJobs/jobs/health.d.ts +40 -0
- package/dist/src/backgroundJobs/jobs/opportunityUpdater.d.ts +37 -0
- package/dist/src/backgroundJobs/jobs/priceUpdater.d.ts +35 -0
- package/dist/src/backgroundJobs/jobs/sync.d.ts +39 -0
- package/dist/src/cache/declaration.d.ts +153 -0
- package/dist/src/cache/index.d.ts +52 -0
- package/dist/src/cache/redis.d.ts +311 -0
- package/dist/src/constants.d.ts +349 -0
- package/dist/src/eden/index.d.ts +4882 -0
- package/dist/src/eden/index.js +4 -0
- package/dist/src/entities/campaign.d.ts +58 -0
- package/dist/src/entities/opportunity.d.ts +17 -0
- package/dist/src/errors/BadRequest.error.d.ts +4 -0
- package/dist/src/errors/Conflict.error.d.ts +4 -0
- package/dist/src/errors/HttpError.d.ts +6 -0
- package/dist/src/errors/NotFound.error.d.ts +4 -0
- package/dist/src/errors/Opportunity.error.d.ts +6 -0
- package/dist/src/errors/Unauthorized.error.d.ts +4 -0
- package/dist/src/errors/index.d.ts +5 -0
- package/dist/src/guards/BackOffice.guard.d.ts +7 -0
- package/dist/src/guards/Engine.guard.d.ts +7 -0
- package/dist/src/guards/TokenAuth.guard.d.ts +7 -0
- package/dist/src/hooks/checkQueryAddressValidity.d.ts +21 -0
- package/dist/src/hooks/checkQueryChainIdValidity.d.ts +21 -0
- package/dist/src/index.d.ts +1889 -0
- package/dist/src/internal/controllers/endingCampaigns.d.ts +42 -0
- package/dist/src/internal/controllers/unclaimed.d.ts +43 -0
- package/dist/src/internal/index.d.ts +1 -0
- package/dist/src/libs/campaigns/campaignTypes/AjnaDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/BadgerDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/CLAMMDynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/CompoundDynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/DolomiteDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/eulerVaultNames.d.ts +1 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/getBlacklistedSupply.d.ts +1 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/metamorphoTvl.d.ts +1 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/spliceTVL.d.ts +7 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +45 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.d.ts +4 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.d.ts +23 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +7 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.d.ts +6 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.d.ts +4 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20_SNAPSHOTDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/JSON_AIRDROPDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/MORPHODynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/RadiantDynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/SILODynamicData.d.ts +7 -0
- package/dist/src/libs/campaigns/campaignsDynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/getCampaigns.d.ts +1 -0
- package/dist/src/libs/campaigns/getRewards.d.ts +29 -0
- package/dist/src/libs/campaigns/utils/fetchA51Strategies.d.ts +18 -0
- package/dist/src/libs/campaigns/utils/fetchClamInfo.d.ts +2 -0
- package/dist/src/libs/campaigns/utils/fetchLogs.d.ts +10 -0
- package/dist/src/libs/campaigns/utils/getCompV2ForksVaults.d.ts +19 -0
- package/dist/src/libs/campaigns/utils/getContractCreationBlock.d.ts +2 -0
- package/dist/src/libs/campaigns/utils/getDolomiteMarkets.d.ts +7 -0
- package/dist/src/libs/campaigns/utils/getEulerV2Vaults.d.ts +16 -0
- package/dist/src/libs/campaigns/utils/getLastEligibilityRatio.d.ts +2 -0
- package/dist/src/libs/computeFee.d.ts +4 -0
- package/dist/src/libs/custom/twtParticipants.d.ts +6 -0
- package/dist/src/libs/deprecated-merklv3/index.d.ts +5 -0
- package/dist/src/libs/getTokensList.d.ts +27 -0
- package/dist/src/libs/merklChainData.d.ts +4 -0
- package/dist/src/libs/parse/marketsWithCache.d.ts +4 -0
- package/dist/src/libs/positions/ajna/index.d.ts +41 -0
- package/dist/src/libs/positions/badger/index.d.ts +27 -0
- package/dist/src/libs/positions/clamm/index.d.ts +8 -0
- package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.d.ts +5 -0
- package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.d.ts +8 -0
- package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.d.ts +11 -0
- package/dist/src/libs/positions/clamm/thegraph/index.d.ts +37 -0
- package/dist/src/libs/positions/compound/index.d.ts +26 -0
- package/dist/src/libs/positions/dolomite/index.d.ts +17 -0
- package/dist/src/libs/positions/erc20/index.d.ts +5 -0
- package/dist/src/libs/positions/euler/index.d.ts +5 -0
- package/dist/src/libs/positions/index.d.ts +3 -0
- package/dist/src/libs/positions/morpho/index.d.ts +40 -0
- package/dist/src/libs/positions/prepareFetch.d.ts +22 -0
- package/dist/src/libs/positions/silo/index.d.ts +5 -0
- package/dist/src/libs/positions/types.d.ts +20 -0
- package/dist/src/libs/reports/campaignReport.d.ts +9 -0
- package/dist/src/libs/reports/mainParameterRewards.d.ts +3 -0
- package/dist/src/libs/rewards/userRewards.d.ts +2 -0
- package/dist/src/libs/staticCampaigns.d.ts +2 -0
- package/dist/src/libs/tokens/balances.d.ts +11 -0
- package/dist/src/libs/tokens/tokenInfo.d.ts +8 -0
- package/dist/src/modules/v4/accounting/accounting.controller.d.ts +206 -0
- package/dist/src/modules/v4/accounting/accounting.model.d.ts +32 -0
- package/dist/src/modules/v4/accounting/accounting.repository.d.ts +99 -0
- package/dist/src/modules/v4/accounting/accounting.service.d.ts +44 -0
- package/dist/src/modules/v4/accounting/index.d.ts +3 -0
- package/dist/src/modules/v4/apr/apr.controller.d.ts +0 -0
- package/dist/src/modules/v4/apr/apr.model.d.ts +15 -0
- package/dist/src/modules/v4/apr/apr.repository.d.ts +0 -0
- package/dist/src/modules/v4/apr/apr.service.d.ts +6 -0
- package/dist/src/modules/v4/apr/index.d.ts +2 -0
- package/dist/src/modules/v4/blacklist/blacklist.controller.d.ts +122 -0
- package/dist/src/modules/v4/blacklist/blacklist.model.d.ts +15 -0
- package/dist/src/modules/v4/blacklist/blacklist.repository.d.ts +24 -0
- package/dist/src/modules/v4/blacklist/blacklist.service.d.ts +24 -0
- package/dist/src/modules/v4/blacklist/index.d.ts +3 -0
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +139 -0
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +85 -0
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +110 -0
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +180 -0
- package/dist/src/modules/v4/campaign/index.d.ts +3 -0
- package/dist/src/modules/v4/chain/chain.controller.d.ts +91 -0
- package/dist/src/modules/v4/chain/chain.model.d.ts +19 -0
- package/dist/src/modules/v4/chain/chain.repository.d.ts +66 -0
- package/dist/src/modules/v4/chain/chain.service.d.ts +42 -0
- package/dist/src/modules/v4/chain/index.d.ts +3 -0
- package/dist/src/modules/v4/enso/enso.model.d.ts +130 -0
- package/dist/src/modules/v4/enso/enso.service.d.ts +47 -0
- package/dist/src/modules/v4/explorer/explorer.repository.d.ts +8 -0
- package/dist/src/modules/v4/explorer/explorer.service.d.ts +8 -0
- package/dist/src/modules/v4/explorer/index.d.ts +1 -0
- package/dist/src/modules/v4/index.d.ts +4 -0
- package/dist/src/modules/v4/merklRoot/index.d.ts +3 -0
- package/dist/src/modules/v4/merklRoot/merklRoot.controller.d.ts +44 -0
- package/dist/src/modules/v4/merklRoot/merklRoot.model.d.ts +6 -0
- package/dist/src/modules/v4/merklRoot/merklRoot.repository.d.ts +21 -0
- package/dist/src/modules/v4/merklRoot/merklRoot.service.d.ts +34 -0
- package/dist/src/modules/v4/opportunity/index.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +349 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +113 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +432 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +413 -0
- package/dist/src/modules/v4/opportunity/subservices/getAjnaMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getBadgerMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getClammMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getCompoundMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getDolomiteMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getErc20Metadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getErc20SnapshotMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getEulerMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getJsonAirDropMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getMorphoMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getRadiantMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getSiloMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/transform-id.pipe.d.ts +5 -0
- package/dist/src/modules/v4/opportunity/validate-id.pipe.d.ts +5 -0
- package/dist/src/modules/v4/participate/participate.controller.d.ts +120 -0
- package/dist/src/modules/v4/participate/participate.model.d.ts +51 -0
- package/dist/src/modules/v4/participate/participate.service.d.ts +8 -0
- package/dist/src/modules/v4/price/index.d.ts +3 -0
- package/dist/src/modules/v4/price/price.controller.d.ts +169 -0
- package/dist/src/modules/v4/price/price.model.d.ts +32 -0
- package/dist/src/modules/v4/price/price.repository.d.ts +33 -0
- package/dist/src/modules/v4/price/price.service.d.ts +33 -0
- package/dist/src/modules/v4/prisma/index.d.ts +32 -0
- package/dist/src/modules/v4/protocol/index.d.ts +3 -0
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +87 -0
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +27 -0
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +37 -0
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +10 -0
- package/dist/src/modules/v4/reward/index.d.ts +3 -0
- package/dist/src/modules/v4/reward/reward.controller.d.ts +158 -0
- package/dist/src/modules/v4/reward/reward.model.d.ts +158 -0
- package/dist/src/modules/v4/reward/reward.repository.d.ts +158 -0
- package/dist/src/modules/v4/reward/reward.service.d.ts +523 -0
- package/dist/src/modules/v4/reward/rewardConvertor.service.d.ts +14 -0
- package/dist/src/modules/v4/router.d.ts +1865 -0
- package/dist/src/modules/v4/status/index.d.ts +3 -0
- package/dist/src/modules/v4/status/status.controller.d.ts +143 -0
- package/dist/src/modules/v4/status/status.model.d.ts +23 -0
- package/dist/src/modules/v4/status/status.repository.d.ts +68 -0
- package/dist/src/modules/v4/status/status.service.d.ts +38 -0
- package/dist/src/modules/v4/token/index.d.ts +3 -0
- package/dist/src/modules/v4/token/token.controller.d.ts +131 -0
- package/dist/src/modules/v4/token/token.model.d.ts +35 -0
- package/dist/src/modules/v4/token/token.repository.d.ts +59 -0
- package/dist/src/modules/v4/token/token.service.d.ts +165 -0
- package/dist/src/modules/v4/tvl/index.d.ts +2 -0
- package/dist/src/modules/v4/tvl/tvl.controller.d.ts +0 -0
- package/dist/src/modules/v4/tvl/tvl.model.d.ts +15 -0
- package/dist/src/modules/v4/tvl/tvl.repository.d.ts +0 -0
- package/dist/src/modules/v4/tvl/tvl.service.d.ts +6 -0
- package/dist/src/modules/v4/uniswapV4/index.d.ts +4 -0
- package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.d.ts +52 -0
- package/dist/src/modules/v4/uniswapV4/uniswapV4.model.d.ts +15 -0
- package/dist/src/modules/v4/uniswapV4/uniswapV4.repository.d.ts +2 -0
- package/dist/src/modules/v4/uniswapV4/uniswapV4.service.d.ts +20 -0
- package/dist/src/modules/v4/user/index.d.ts +3 -0
- package/dist/src/modules/v4/user/user.controller.d.ts +325 -0
- package/dist/src/modules/v4/user/user.model.d.ts +25 -0
- package/dist/src/modules/v4/user/user.repository.d.ts +19 -0
- package/dist/src/modules/v4/user/user.service.d.ts +19 -0
- package/dist/src/plugins/error-handling.plugin.d.ts +28 -0
- package/dist/src/plugins/logger.plugin.d.ts +21 -0
- package/dist/src/routes/v1/allowances.d.ts +66 -0
- package/dist/src/routes/v1/balances.d.ts +49 -0
- package/dist/src/routes/v1/prices.d.ts +41 -0
- package/dist/src/routes/v1/tokens.d.ts +44 -0
- package/dist/src/routes/v2/merkl.d.ts +54 -0
- package/dist/src/routes/v3/ERC20Campaigns.d.ts +1910 -0
- package/dist/src/routes/v3/app.d.ts +39 -0
- package/dist/src/routes/v3/blacklist.d.ts +1910 -0
- package/dist/src/routes/v3/campaign/delay.d.ts +41 -0
- package/dist/src/routes/v3/campaignClaims.d.ts +43 -0
- package/dist/src/routes/v3/campaignReport.d.ts +42 -0
- package/dist/src/routes/v3/campaignUnclaimed.d.ts +43 -0
- package/dist/src/routes/v3/campaigns.d.ts +1915 -0
- package/dist/src/routes/v3/campaignsForMainParameter.d.ts +42 -0
- package/dist/src/routes/v3/campaignsInfo.d.ts +1902 -0
- package/dist/src/routes/v3/campaignsRewardsReport.d.ts +43 -0
- package/dist/src/routes/v3/claims.d.ts +45 -0
- package/dist/src/routes/v3/compoundV2.d.ts +40 -0
- package/dist/src/routes/v3/createCampaign.d.ts +46 -0
- package/dist/src/routes/v3/dolomite.d.ts +40 -0
- package/dist/src/routes/v3/euler.d.ts +40 -0
- package/dist/src/routes/v3/exports/campaigns.d.ts +42 -0
- package/dist/src/routes/v3/fetch.d.ts +45 -0
- package/dist/src/routes/v3/health.d.ts +39 -0
- package/dist/src/routes/v3/lostyield.d.ts +52 -0
- package/dist/src/routes/v3/merkl.d.ts +87 -0
- package/dist/src/routes/v3/morphoMarkets.d.ts +61 -0
- package/dist/src/routes/v3/morphoVaults.d.ts +51 -0
- package/dist/src/routes/v3/multiChainPositions.d.ts +1909 -0
- package/dist/src/routes/v3/opportunity.d.ts +1946 -0
- package/dist/src/routes/v3/overview.d.ts +60 -0
- package/dist/src/routes/v3/parse.d.ts +46 -0
- package/dist/src/routes/v3/payload.d.ts +57 -0
- package/dist/src/routes/v3/poolInfo.d.ts +42 -0
- package/dist/src/routes/v3/positions.d.ts +1927 -0
- package/dist/src/routes/v3/radiant.d.ts +55 -0
- package/dist/src/routes/v3/recipients.d.ts +38 -0
- package/dist/src/routes/v3/rewards.d.ts +1910 -0
- package/dist/src/routes/v3/rewardsReport.d.ts +48 -0
- package/dist/src/routes/v3/rootForTimestamp.d.ts +52 -0
- package/dist/src/routes/v3/silo.d.ts +52 -0
- package/dist/src/routes/v3/token.d.ts +50 -0
- package/dist/src/routes/v3/tokenUnclaimed.d.ts +43 -0
- package/dist/src/routes/v3/twt/participants.d.ts +40 -0
- package/dist/src/routes/v3/updates.d.ts +1907 -0
- package/dist/src/routes/v3/userRewards.d.ts +1931 -0
- package/dist/src/types/index.d.ts +46 -0
- package/dist/src/types/parameters/Action.d.ts +4 -0
- package/dist/src/types/parameters/Chain.d.ts +4 -0
- package/dist/src/types/parameters/ChainCampaignId.d.ts +4 -0
- package/dist/src/types/parameters/MainParameter.d.ts +4 -0
- package/dist/src/types/parameters/OpportunityId.d.ts +4 -0
- package/dist/src/types/parameters/Timestamp.d.ts +4 -0
- package/dist/src/types/parameters/Type.d.ts +4 -0
- package/dist/src/types/parameters/index.d.ts +36 -0
- package/dist/src/types/returnTypes.d.ts +27 -0
- package/dist/src/types/utils.d.ts +5 -0
- package/dist/src/utils/addString.d.ts +2 -0
- package/dist/src/utils/bigintToString.d.ts +1 -0
- package/dist/src/utils/crypto.d.ts +1 -0
- package/dist/src/utils/error.d.ts +53 -0
- package/dist/src/utils/execute.d.ts +32 -0
- package/dist/src/utils/generic.d.ts +24 -0
- package/dist/src/utils/hashArray.d.ts +1 -0
- package/dist/src/utils/lastBlockBefore.d.ts +3 -0
- package/dist/src/utils/logger.d.ts +24 -0
- package/dist/src/utils/pricer.d.ts +52 -0
- package/dist/src/utils/prices/chainlinkRead.d.ts +4 -0
- package/dist/src/utils/prices/curveVirtualPrice.d.ts +4 -0
- package/dist/src/utils/prices/getDQUICK.d.ts +4 -0
- package/dist/src/utils/prices/priceFetcherFactory.d.ts +10 -0
- package/dist/src/utils/prices/priceService.d.ts +13 -0
- package/dist/src/utils/prices/services/coinGeckoService.d.ts +12 -0
- package/dist/src/utils/prices/services/defillamaService.d.ts +12 -0
- package/dist/src/utils/prices/services/dexScreenerService.d.ts +12 -0
- package/dist/src/utils/prices/services/erc4626Service.d.ts +9 -0
- package/dist/src/utils/prices/services/getERC4626.d.ts +4 -0
- package/dist/src/utils/prices/services/indexCoopService.d.ts +12 -0
- package/dist/src/utils/prices/services/priceFetcher.d.ts +8 -0
- package/dist/src/utils/prices/uniV2Price.d.ts +7 -0
- package/dist/src/utils/prisma.d.ts +16 -0
- package/dist/src/utils/providers.d.ts +13 -0
- package/dist/src/utils/queries/activeCampaigns.d.ts +3 -0
- package/dist/src/utils/queries/allCampaigns.d.ts +6 -0
- package/dist/src/utils/queries/campaignsForMainParameter.d.ts +2 -0
- package/dist/src/utils/queries/claimsOverTime.d.ts +8 -0
- package/dist/src/utils/queries/endingCampaigns.d.ts +10 -0
- package/dist/src/utils/queries/futureCampaigns.d.ts +3 -0
- package/dist/src/utils/queries/mainParameterCampaigns.d.ts +5 -0
- package/dist/src/utils/queries/rewardsAmount.d.ts +10 -0
- package/dist/src/utils/queries/unclaimed.d.ts +11 -0
- package/dist/src/utils/rateLimit.d.ts +63 -0
- package/dist/src/utils/stryke.d.ts +2 -0
- package/dist/src/utils/throw.d.ts +4 -0
- package/dist/src/utils/trace.d.ts +26 -0
- package/dist/src/utils/validation.d.ts +5 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -0
- package/package.json +91 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
import { type ChainId } from "@sdk";
|
2
|
+
import type { RootByTimestampModel } from "./merklRoot.model";
|
3
|
+
export declare class MerklRootRepository {
|
4
|
+
static firstRoot(chainId: ChainId): Promise<{
|
5
|
+
root: string;
|
6
|
+
chainId: number;
|
7
|
+
epoch: number;
|
8
|
+
timestamp: bigint;
|
9
|
+
} | null>;
|
10
|
+
static rootForTimestamp(x: RootByTimestampModel): Promise<{
|
11
|
+
root: string;
|
12
|
+
chainId: number;
|
13
|
+
epoch: number;
|
14
|
+
timestamp: bigint;
|
15
|
+
}[]>;
|
16
|
+
static fetch(chainId: ChainId): Promise<{
|
17
|
+
live: any;
|
18
|
+
tree: any;
|
19
|
+
lastTree: any;
|
20
|
+
}>;
|
21
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type { CacheKeys } from "../../../cache/keys";
|
2
|
+
import type { ChainId } from "@sdk";
|
3
|
+
import type { RootByTimestampModel } from "./merklRoot.model";
|
4
|
+
export declare class MerklRootService {
|
5
|
+
static firstRoot(chainId: ChainId): Promise<{
|
6
|
+
root: string;
|
7
|
+
chainId: number;
|
8
|
+
epoch: number;
|
9
|
+
timestamp: bigint;
|
10
|
+
} | null>;
|
11
|
+
static rootForTimestamp(x: RootByTimestampModel): Promise<{
|
12
|
+
root: string;
|
13
|
+
chainId: number;
|
14
|
+
epoch: number;
|
15
|
+
timestamp: bigint;
|
16
|
+
}[]>;
|
17
|
+
/**
|
18
|
+
* Fetch roots for the provided chain
|
19
|
+
* @param chainId to fetch roots for
|
20
|
+
* @returns object with live and last tree roots
|
21
|
+
*/
|
22
|
+
static fetch(chainId: ChainId): Promise<CacheKeys["CurrentRoot"]["returns"]>;
|
23
|
+
/**
|
24
|
+
* Fetch all roots for the provided chains
|
25
|
+
* @param chainIds to fetch roots for
|
26
|
+
* @returns record of chains to object with live and last tree roots
|
27
|
+
*/
|
28
|
+
static fetchAll(chainIds?: ChainId[]): Promise<{
|
29
|
+
[chainId: number]: {
|
30
|
+
live: string;
|
31
|
+
lastTree: string;
|
32
|
+
};
|
33
|
+
}>;
|
34
|
+
}
|
@@ -0,0 +1,349 @@
|
|
1
|
+
import Elysia from "elysia";
|
2
|
+
export declare const OpportunityController: Elysia<"/opportunities", false, {
|
3
|
+
decorator: {};
|
4
|
+
store: {};
|
5
|
+
derive: {};
|
6
|
+
resolve: {};
|
7
|
+
}, {
|
8
|
+
type: {};
|
9
|
+
error: {};
|
10
|
+
}, {
|
11
|
+
schema: {};
|
12
|
+
macro: {};
|
13
|
+
}, {
|
14
|
+
opportunities: {
|
15
|
+
index: {
|
16
|
+
post: {
|
17
|
+
body: {
|
18
|
+
name?: string | undefined;
|
19
|
+
type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4";
|
20
|
+
tokens: {
|
21
|
+
chainId: number;
|
22
|
+
address: string;
|
23
|
+
}[];
|
24
|
+
status: "NONE" | "PAST" | "LIVE" | "SOON";
|
25
|
+
identifier: string;
|
26
|
+
chainId: number;
|
27
|
+
action: "INVALID" | "POOL" | "HOLD" | "DROP" | "LEND" | "BORROW";
|
28
|
+
protocols: string[];
|
29
|
+
mainProtocol: string;
|
30
|
+
};
|
31
|
+
params: Record<never, string>;
|
32
|
+
query: unknown;
|
33
|
+
headers: {
|
34
|
+
authorization: string;
|
35
|
+
};
|
36
|
+
response: {
|
37
|
+
200: void;
|
38
|
+
};
|
39
|
+
};
|
40
|
+
};
|
41
|
+
};
|
42
|
+
} & {
|
43
|
+
opportunities: {
|
44
|
+
":id": {
|
45
|
+
get: {
|
46
|
+
body: unknown;
|
47
|
+
params: {
|
48
|
+
id: string;
|
49
|
+
};
|
50
|
+
query: unknown;
|
51
|
+
headers: unknown;
|
52
|
+
response: {
|
53
|
+
200: {
|
54
|
+
aprRecord: {
|
55
|
+
cumulated: number;
|
56
|
+
cummulated: number;
|
57
|
+
timestamp: bigint;
|
58
|
+
breakdowns: {
|
59
|
+
id: number;
|
60
|
+
identifier: string;
|
61
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
62
|
+
value: number;
|
63
|
+
aprRecordId: string;
|
64
|
+
}[];
|
65
|
+
};
|
66
|
+
tvlRecord: {
|
67
|
+
id: string;
|
68
|
+
total: number;
|
69
|
+
timestamp: bigint;
|
70
|
+
breakdowns: {
|
71
|
+
id: number;
|
72
|
+
identifier: string;
|
73
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
74
|
+
value: number;
|
75
|
+
tvlRecordId: string;
|
76
|
+
}[];
|
77
|
+
};
|
78
|
+
rewardsRecord: {
|
79
|
+
id: string;
|
80
|
+
total: number;
|
81
|
+
timestamp: bigint;
|
82
|
+
breakdowns: {
|
83
|
+
id: number;
|
84
|
+
value: number;
|
85
|
+
campaignId: string;
|
86
|
+
dailyRewardsRecordId: string;
|
87
|
+
}[];
|
88
|
+
};
|
89
|
+
id: string;
|
90
|
+
tokens: {
|
91
|
+
id: string;
|
92
|
+
name: string | null;
|
93
|
+
chainId: number;
|
94
|
+
address: string;
|
95
|
+
decimals: number;
|
96
|
+
symbol: string;
|
97
|
+
icon: string;
|
98
|
+
verified: boolean;
|
99
|
+
price: number | null;
|
100
|
+
}[];
|
101
|
+
chain: {
|
102
|
+
id: number;
|
103
|
+
name: string;
|
104
|
+
icon: string;
|
105
|
+
};
|
106
|
+
protocol: {
|
107
|
+
id: string;
|
108
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
109
|
+
name: string;
|
110
|
+
description: string;
|
111
|
+
url: string;
|
112
|
+
icon: string;
|
113
|
+
} | undefined;
|
114
|
+
name: string;
|
115
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
116
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
117
|
+
tags: string[];
|
118
|
+
identifier: string;
|
119
|
+
chainId: number;
|
120
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
121
|
+
tvl: number;
|
122
|
+
apr: number;
|
123
|
+
dailyRewards: number;
|
124
|
+
} | null | undefined;
|
125
|
+
};
|
126
|
+
};
|
127
|
+
};
|
128
|
+
};
|
129
|
+
} & {
|
130
|
+
opportunities: {
|
131
|
+
":id": {
|
132
|
+
campaigns: {
|
133
|
+
get: {
|
134
|
+
body: unknown;
|
135
|
+
params: {
|
136
|
+
id: string;
|
137
|
+
};
|
138
|
+
query: unknown;
|
139
|
+
headers: unknown;
|
140
|
+
response: {
|
141
|
+
200: {
|
142
|
+
aprRecord: {
|
143
|
+
cumulated: number;
|
144
|
+
cummulated: number;
|
145
|
+
timestamp: bigint;
|
146
|
+
breakdowns: {
|
147
|
+
id: number;
|
148
|
+
identifier: string;
|
149
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
150
|
+
value: number;
|
151
|
+
aprRecordId: string;
|
152
|
+
}[];
|
153
|
+
};
|
154
|
+
tvlRecord: {
|
155
|
+
id: string;
|
156
|
+
total: number;
|
157
|
+
timestamp: bigint;
|
158
|
+
breakdowns: {
|
159
|
+
id: number;
|
160
|
+
identifier: string;
|
161
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
162
|
+
value: number;
|
163
|
+
tvlRecordId: string;
|
164
|
+
}[];
|
165
|
+
};
|
166
|
+
rewardsRecord: {
|
167
|
+
id: string;
|
168
|
+
total: number;
|
169
|
+
timestamp: bigint;
|
170
|
+
breakdowns: {
|
171
|
+
id: number;
|
172
|
+
value: number;
|
173
|
+
campaignId: string;
|
174
|
+
dailyRewardsRecordId: string;
|
175
|
+
}[];
|
176
|
+
};
|
177
|
+
id: string;
|
178
|
+
tokens: {
|
179
|
+
id: string;
|
180
|
+
name: string | null;
|
181
|
+
chainId: number;
|
182
|
+
address: string;
|
183
|
+
decimals: number;
|
184
|
+
symbol: string;
|
185
|
+
icon: string;
|
186
|
+
verified: boolean;
|
187
|
+
price: number | null;
|
188
|
+
}[];
|
189
|
+
chain: {
|
190
|
+
id: number;
|
191
|
+
name: string;
|
192
|
+
icon: string;
|
193
|
+
};
|
194
|
+
protocol: {
|
195
|
+
id: string;
|
196
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
197
|
+
name: string;
|
198
|
+
description: string;
|
199
|
+
url: string;
|
200
|
+
icon: string;
|
201
|
+
} | undefined;
|
202
|
+
name: string;
|
203
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
204
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
205
|
+
tags: string[];
|
206
|
+
identifier: string;
|
207
|
+
chainId: number;
|
208
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
209
|
+
tvl: number;
|
210
|
+
apr: number;
|
211
|
+
dailyRewards: number;
|
212
|
+
} | null | undefined;
|
213
|
+
};
|
214
|
+
};
|
215
|
+
};
|
216
|
+
};
|
217
|
+
};
|
218
|
+
} & {
|
219
|
+
opportunities: {
|
220
|
+
index: {
|
221
|
+
get: {
|
222
|
+
body: unknown;
|
223
|
+
params: Record<never, string>;
|
224
|
+
query: {
|
225
|
+
sort?: "tvl" | "apr" | "rewards" | undefined;
|
226
|
+
name?: string | undefined;
|
227
|
+
tokens?: string | undefined;
|
228
|
+
status?: string | undefined;
|
229
|
+
items?: number | undefined;
|
230
|
+
tags?: string | undefined;
|
231
|
+
chainId?: string | undefined;
|
232
|
+
page?: number | undefined;
|
233
|
+
action?: string | undefined;
|
234
|
+
mainProtocolId?: string | undefined;
|
235
|
+
order?: "asc" | "desc" | undefined;
|
236
|
+
};
|
237
|
+
headers: unknown;
|
238
|
+
response: {
|
239
|
+
200: ({
|
240
|
+
aprRecord: {
|
241
|
+
cumulated: number;
|
242
|
+
cummulated: number;
|
243
|
+
timestamp: bigint;
|
244
|
+
breakdowns: {
|
245
|
+
id: number;
|
246
|
+
identifier: string;
|
247
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
248
|
+
value: number;
|
249
|
+
aprRecordId: string;
|
250
|
+
}[];
|
251
|
+
};
|
252
|
+
tvlRecord: {
|
253
|
+
id: string;
|
254
|
+
total: number;
|
255
|
+
timestamp: bigint;
|
256
|
+
breakdowns: {
|
257
|
+
id: number;
|
258
|
+
identifier: string;
|
259
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
260
|
+
value: number;
|
261
|
+
tvlRecordId: string;
|
262
|
+
}[];
|
263
|
+
};
|
264
|
+
rewardsRecord: {
|
265
|
+
id: string;
|
266
|
+
total: number;
|
267
|
+
timestamp: bigint;
|
268
|
+
breakdowns: {
|
269
|
+
id: number;
|
270
|
+
value: number;
|
271
|
+
campaignId: string;
|
272
|
+
dailyRewardsRecordId: string;
|
273
|
+
}[];
|
274
|
+
};
|
275
|
+
id: string;
|
276
|
+
tokens: {
|
277
|
+
id: string;
|
278
|
+
name: string | null;
|
279
|
+
chainId: number;
|
280
|
+
address: string;
|
281
|
+
decimals: number;
|
282
|
+
symbol: string;
|
283
|
+
icon: string;
|
284
|
+
verified: boolean;
|
285
|
+
price: number | null;
|
286
|
+
}[];
|
287
|
+
chain: {
|
288
|
+
id: number;
|
289
|
+
name: string;
|
290
|
+
icon: string;
|
291
|
+
};
|
292
|
+
protocol: {
|
293
|
+
id: string;
|
294
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
295
|
+
name: string;
|
296
|
+
description: string;
|
297
|
+
url: string;
|
298
|
+
icon: string;
|
299
|
+
} | undefined;
|
300
|
+
name: string;
|
301
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
302
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
303
|
+
tags: string[];
|
304
|
+
identifier: string;
|
305
|
+
chainId: number;
|
306
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
307
|
+
tvl: number;
|
308
|
+
apr: number;
|
309
|
+
dailyRewards: number;
|
310
|
+
} | null)[];
|
311
|
+
};
|
312
|
+
};
|
313
|
+
};
|
314
|
+
};
|
315
|
+
} & {
|
316
|
+
opportunities: {
|
317
|
+
count: {
|
318
|
+
get: {
|
319
|
+
body: unknown;
|
320
|
+
params: Record<never, string>;
|
321
|
+
query: {
|
322
|
+
sort?: "tvl" | "apr" | "rewards" | undefined;
|
323
|
+
name?: string | undefined;
|
324
|
+
tokens?: string | undefined;
|
325
|
+
status?: string | undefined;
|
326
|
+
items?: number | undefined;
|
327
|
+
tags?: string | undefined;
|
328
|
+
chainId?: string | undefined;
|
329
|
+
page?: number | undefined;
|
330
|
+
action?: string | undefined;
|
331
|
+
mainProtocolId?: string | undefined;
|
332
|
+
order?: "asc" | "desc" | undefined;
|
333
|
+
};
|
334
|
+
headers: unknown;
|
335
|
+
response: {
|
336
|
+
200: number;
|
337
|
+
};
|
338
|
+
};
|
339
|
+
};
|
340
|
+
};
|
341
|
+
}, {
|
342
|
+
derive: {};
|
343
|
+
resolve: {};
|
344
|
+
schema: {};
|
345
|
+
}, {
|
346
|
+
derive: {};
|
347
|
+
resolve: {};
|
348
|
+
schema: {};
|
349
|
+
}>;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import type { AprRecord } from "../apr/apr.model";
|
2
|
+
import type { Resource } from "../prisma";
|
3
|
+
import type { Protocol, ProtocolId } from "../protocol/protocol.model";
|
4
|
+
import type { DailyRewardsRecord } from "../reward";
|
5
|
+
import { type Token } from "../token/token.model";
|
6
|
+
import type { TvlRecord } from "../tvl/tvl.model";
|
7
|
+
import { CampaignType, OpportunityAction } from "../../../../database/api/.generated";
|
8
|
+
import type { ChainId } from "@sdk";
|
9
|
+
import type { Campaign } from "../campaign";
|
10
|
+
import type { Chain } from "../chain/chain.model";
|
11
|
+
import type { OpportunityRepository } from "./opportunity.repository";
|
12
|
+
/**
|
13
|
+
* Opportunity
|
14
|
+
* @description Target description of rewards campaigns
|
15
|
+
* @see {@link Resource}
|
16
|
+
*/
|
17
|
+
export type Opportunity = Resource<"Opportunity", "mainProtocolId", {
|
18
|
+
chain: Chain["model"];
|
19
|
+
tokens: Token["model"][];
|
20
|
+
protocol?: Protocol["model"];
|
21
|
+
aprRecord?: AprRecord["model"];
|
22
|
+
tvlRecord?: TvlRecord["model"];
|
23
|
+
rewardsRecord?: DailyRewardsRecord["model"];
|
24
|
+
campaigns?: Campaign["model"][];
|
25
|
+
}>;
|
26
|
+
export type LightOpportunityFromDB = Omit<Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>, "AprRecords" | "TvlRecords" | "DailyRewardsRecords">;
|
27
|
+
export type OpportunityMetadata = {
|
28
|
+
name: string;
|
29
|
+
action: OpportunityAction;
|
30
|
+
tokens: {
|
31
|
+
chainId: number;
|
32
|
+
address: string;
|
33
|
+
}[];
|
34
|
+
mainProtocol?: ProtocolId;
|
35
|
+
};
|
36
|
+
export type OpportunityUnique = {
|
37
|
+
chainId: ChainId;
|
38
|
+
type: CampaignType;
|
39
|
+
identifier: string;
|
40
|
+
};
|
41
|
+
export declare const OpportunityUniqueDto: import("@sinclair/typebox").TObject<{
|
42
|
+
id: import("@sinclair/typebox").TString;
|
43
|
+
}>;
|
44
|
+
export declare const GetOpportunitiesQueryDto: import("@sinclair/typebox").TObject<{
|
45
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
46
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRegExp>;
|
47
|
+
action: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TEnum<{
|
48
|
+
POOL: "POOL";
|
49
|
+
HOLD: "HOLD";
|
50
|
+
DROP: "DROP";
|
51
|
+
LEND: "LEND";
|
52
|
+
BORROW: "BORROW";
|
53
|
+
INVALID: "INVALID";
|
54
|
+
}>, import("@sinclair/typebox").TRegExp]>>;
|
55
|
+
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
56
|
+
tokens: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
57
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TEnum<{
|
58
|
+
NONE: "NONE";
|
59
|
+
PAST: "PAST";
|
60
|
+
LIVE: "LIVE";
|
61
|
+
SOON: "SOON";
|
62
|
+
}>, import("@sinclair/typebox").TRegExp]>>;
|
63
|
+
sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"tvl" | "apr" | "rewards">[]>>;
|
64
|
+
order: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"asc" | "desc">[]>>;
|
65
|
+
mainProtocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
66
|
+
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
67
|
+
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
68
|
+
}>;
|
69
|
+
export declare const CreateOpportunityDto: import("@sinclair/typebox").TObject<{
|
70
|
+
chainId: import("@sinclair/typebox").TNumber;
|
71
|
+
type: import("@sinclair/typebox").TEnum<{
|
72
|
+
INVALID: "INVALID";
|
73
|
+
ERC20: "ERC20";
|
74
|
+
CLAMM: "CLAMM";
|
75
|
+
ERC20_SNAPSHOT: "ERC20_SNAPSHOT";
|
76
|
+
JSON_AIRDROP: "JSON_AIRDROP";
|
77
|
+
SILO: "SILO";
|
78
|
+
RADIANT: "RADIANT";
|
79
|
+
MORPHO: "MORPHO";
|
80
|
+
DOLOMITE: "DOLOMITE";
|
81
|
+
BADGER: "BADGER";
|
82
|
+
COMPOUND: "COMPOUND";
|
83
|
+
AJNA: "AJNA";
|
84
|
+
EULER: "EULER";
|
85
|
+
UNISWAP_V4: "UNISWAP_V4";
|
86
|
+
}>;
|
87
|
+
identifier: import("@sinclair/typebox").TString;
|
88
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
89
|
+
status: import("@sinclair/typebox").TEnum<{
|
90
|
+
NONE: "NONE";
|
91
|
+
PAST: "PAST";
|
92
|
+
LIVE: "LIVE";
|
93
|
+
SOON: "SOON";
|
94
|
+
}>;
|
95
|
+
action: import("@sinclair/typebox").TEnum<{
|
96
|
+
POOL: "POOL";
|
97
|
+
HOLD: "HOLD";
|
98
|
+
DROP: "DROP";
|
99
|
+
LEND: "LEND";
|
100
|
+
BORROW: "BORROW";
|
101
|
+
INVALID: "INVALID";
|
102
|
+
}>;
|
103
|
+
tokens: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
104
|
+
address: import("@sinclair/typebox").TString;
|
105
|
+
chainId: import("@sinclair/typebox").TNumber;
|
106
|
+
}>>;
|
107
|
+
protocols: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
108
|
+
mainProtocol: import("@sinclair/typebox").TString;
|
109
|
+
}>;
|
110
|
+
export type GetOpportunitiesQueryEntity = typeof GetOpportunitiesQueryDto.static;
|
111
|
+
export type CreateOpportunityModel = typeof CreateOpportunityDto.static & {
|
112
|
+
id: string;
|
113
|
+
};
|