@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,158 @@
|
|
1
|
+
import type { Resource } from "../prisma";
|
2
|
+
import type { Token } from "../token";
|
3
|
+
/**
|
4
|
+
* Rewards Record
|
5
|
+
* @description Describes one rewards value snapshot for an opportunity
|
6
|
+
* @see {@link Resource}
|
7
|
+
*/
|
8
|
+
export type Reward = Resource<"Reward", "rewardTokenId" | "id", {
|
9
|
+
breakdowns: RewardBreakdown["model"][];
|
10
|
+
token: Token["model"];
|
11
|
+
pending: bigint;
|
12
|
+
claimed: bigint;
|
13
|
+
amount: bigint;
|
14
|
+
}>;
|
15
|
+
/**
|
16
|
+
* Rewards Breakdown
|
17
|
+
* @description Describes one reward amount for one token and campaign
|
18
|
+
* @see {@link Resource}
|
19
|
+
*/
|
20
|
+
export type RewardBreakdown = Resource<"RewardBreakdown", "id" | "rewardId" | "protocolId">;
|
21
|
+
/**
|
22
|
+
* Daily Rewards
|
23
|
+
* @description Describes rewards breakdown from the opportunity view
|
24
|
+
* @see {@link Resource}
|
25
|
+
*/
|
26
|
+
export type DailyRewardsRecord = Resource<"DailyRewardsRecord", "opportunityId" | "id", {
|
27
|
+
breakdowns: DailyRewardsBreakdown["model"][];
|
28
|
+
}>;
|
29
|
+
/**
|
30
|
+
* Daily Rewards Breakdown
|
31
|
+
* @description Describes one rewards value of a campaign
|
32
|
+
* @see {@link Resource}
|
33
|
+
*/
|
34
|
+
export type DailyRewardsBreakdown = Resource<"DailyRewardsBreakdown", "id" | "dailyRewardsRecordId">;
|
35
|
+
export declare const CreateManyBreakdownDto: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
36
|
+
distributionChainId: import("@sinclair/typebox").TNumber;
|
37
|
+
rewardToken: import("@sinclair/typebox").TString;
|
38
|
+
campaignId: import("@sinclair/typebox").TString;
|
39
|
+
root: import("@sinclair/typebox").TString;
|
40
|
+
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
41
|
+
recipient: import("@sinclair/typebox").TString;
|
42
|
+
protocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
43
|
+
reason: import("@sinclair/typebox").TString;
|
44
|
+
amount: import("@sinclair/typebox").TString;
|
45
|
+
claimed: import("@sinclair/typebox").TString;
|
46
|
+
pending: import("@sinclair/typebox").TString;
|
47
|
+
auxiliaryData1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
48
|
+
auxiliaryData2: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
49
|
+
}>>;
|
50
|
+
}>>;
|
51
|
+
declare const RewardDto: import("@sinclair/typebox").TObject<{
|
52
|
+
root: import("@sinclair/typebox").TString;
|
53
|
+
recipient: import("@sinclair/typebox").TString;
|
54
|
+
distributionChainId: import("@sinclair/typebox").TNumber;
|
55
|
+
rewardToken: import("@sinclair/typebox").TString;
|
56
|
+
proofs: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
57
|
+
}>;
|
58
|
+
export declare const CreateManyRewardDto: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
59
|
+
root: import("@sinclair/typebox").TString;
|
60
|
+
recipient: import("@sinclair/typebox").TString;
|
61
|
+
distributionChainId: import("@sinclair/typebox").TNumber;
|
62
|
+
rewardToken: import("@sinclair/typebox").TString;
|
63
|
+
proofs: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
64
|
+
}>>;
|
65
|
+
declare const PendingDto: import("@sinclair/typebox").TObject<{
|
66
|
+
recipient: import("@sinclair/typebox").TString;
|
67
|
+
reason: import("@sinclair/typebox").TString;
|
68
|
+
pending: import("@sinclair/typebox").TString;
|
69
|
+
auxiliaryData1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
70
|
+
auxiliaryData2: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
71
|
+
}>;
|
72
|
+
export declare const UpdatePendingDto: import("@sinclair/typebox").TObject<{
|
73
|
+
distributionChainId: import("@sinclair/typebox").TNumber;
|
74
|
+
rewardToken: import("@sinclair/typebox").TString;
|
75
|
+
campaignId: import("@sinclair/typebox").TString;
|
76
|
+
root: import("@sinclair/typebox").TString;
|
77
|
+
toUpdate: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
78
|
+
recipient: import("@sinclair/typebox").TString;
|
79
|
+
reason: import("@sinclair/typebox").TString;
|
80
|
+
pending: import("@sinclair/typebox").TString;
|
81
|
+
auxiliaryData1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
82
|
+
auxiliaryData2: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
83
|
+
}>>;
|
84
|
+
toCreate: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
85
|
+
recipient: import("@sinclair/typebox").TString;
|
86
|
+
reason: import("@sinclair/typebox").TString;
|
87
|
+
pending: import("@sinclair/typebox").TString;
|
88
|
+
auxiliaryData1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
89
|
+
auxiliaryData2: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
90
|
+
}>>;
|
91
|
+
}>;
|
92
|
+
export declare const RewardsByUser: import("@sinclair/typebox").TObject<{
|
93
|
+
address: import("@sinclair/typebox").TString;
|
94
|
+
}>;
|
95
|
+
export declare const RewardsByUserAndChain: import("@sinclair/typebox").TObject<{
|
96
|
+
address: import("@sinclair/typebox").TString;
|
97
|
+
chainId: import("@sinclair/typebox").TNumber;
|
98
|
+
}>;
|
99
|
+
export declare const UserRewardQueryDto: import("@sinclair/typebox").TObject<{
|
100
|
+
chainId: import("@sinclair/typebox").TNumber;
|
101
|
+
mainParameter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
102
|
+
proof: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
103
|
+
rewardToken: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
104
|
+
user: import("@sinclair/typebox").TString;
|
105
|
+
}>;
|
106
|
+
export declare const RewardsPerChainDto: import("@sinclair/typebox").TObject<{
|
107
|
+
chainId: import("@sinclair/typebox").TNumber;
|
108
|
+
}>;
|
109
|
+
export declare const CampaignIdListDto: import("@sinclair/typebox").TObject<{
|
110
|
+
chainId: import("@sinclair/typebox").TNumber;
|
111
|
+
campaignIdentifiers: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>]>;
|
112
|
+
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
113
|
+
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
114
|
+
}>;
|
115
|
+
export declare const UserRewardV3Dto: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
116
|
+
symbol: import("@sinclair/typebox").TString;
|
117
|
+
decimals: import("@sinclair/typebox").TNumber;
|
118
|
+
accumulated: import("@sinclair/typebox").TString;
|
119
|
+
unclaimed: import("@sinclair/typebox").TString;
|
120
|
+
pending: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
121
|
+
reasons: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
122
|
+
accumulated: import("@sinclair/typebox").TString;
|
123
|
+
unclaimed: import("@sinclair/typebox").TString;
|
124
|
+
pending: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
125
|
+
}>>;
|
126
|
+
proof: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
127
|
+
}>>;
|
128
|
+
export declare const RewardV3Dto: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
129
|
+
campaignData: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
130
|
+
accumulated: import("@sinclair/typebox").TString;
|
131
|
+
unclaimed: import("@sinclair/typebox").TString;
|
132
|
+
pending: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
133
|
+
auxiliaryData1: import("@sinclair/typebox").TString;
|
134
|
+
auxiliaryData2: import("@sinclair/typebox").TString;
|
135
|
+
decimals: import("@sinclair/typebox").TNumber;
|
136
|
+
mainParameter: import("@sinclair/typebox").TString;
|
137
|
+
symbol: import("@sinclair/typebox").TString;
|
138
|
+
token: import("@sinclair/typebox").TString;
|
139
|
+
}>>>;
|
140
|
+
tokenData: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
141
|
+
accumulated: import("@sinclair/typebox").TString;
|
142
|
+
unclaimed: import("@sinclair/typebox").TString;
|
143
|
+
pending: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
144
|
+
decimals: import("@sinclair/typebox").TNumber;
|
145
|
+
proof: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
146
|
+
symbol: import("@sinclair/typebox").TString;
|
147
|
+
}>>;
|
148
|
+
}>>;
|
149
|
+
export type CreateManyRewardModel = typeof CreateManyRewardDto.static;
|
150
|
+
export type CreateManyBreakdownModel = typeof CreateManyBreakdownDto.static;
|
151
|
+
export type RewardEntity = typeof RewardDto.static;
|
152
|
+
export type RewardPerChainModel = typeof RewardsPerChainDto.static;
|
153
|
+
export type UpdatePendingModel = typeof UpdatePendingDto.static;
|
154
|
+
export type PendingEntity = typeof PendingDto.static;
|
155
|
+
export type CampaignIdListModel = typeof CampaignIdListDto.static;
|
156
|
+
export type UserRewardV3Model = typeof UserRewardV3Dto.static;
|
157
|
+
export type RewardV3Model = typeof RewardV3Dto.static;
|
158
|
+
export {};
|
@@ -0,0 +1,158 @@
|
|
1
|
+
import type { Prisma } from "../../../../database/api/.generated";
|
2
|
+
import type { CampaignIdListModel, CreateManyBreakdownModel, CreateManyRewardModel, PendingEntity } from "./reward.model";
|
3
|
+
export declare abstract class RewardRepository {
|
4
|
+
static createManyReward(rewards: CreateManyRewardModel): Promise<Prisma.BatchPayload>;
|
5
|
+
static createManyBreakdown(data: CreateManyBreakdownModel): Promise<Prisma.BatchPayload>;
|
6
|
+
static getByRecipient(recipient: string, roots: string[], withToken: boolean): Promise<({
|
7
|
+
RewardToken: {
|
8
|
+
id: string;
|
9
|
+
name: string | null;
|
10
|
+
chainId: number;
|
11
|
+
address: string;
|
12
|
+
decimals: number;
|
13
|
+
symbol: string;
|
14
|
+
icon: string;
|
15
|
+
verified: boolean;
|
16
|
+
price: number | null;
|
17
|
+
};
|
18
|
+
Breakdown: ({
|
19
|
+
Campaign: {
|
20
|
+
identifier: string;
|
21
|
+
campaignId: string;
|
22
|
+
Opportunity: {
|
23
|
+
Chain: {
|
24
|
+
id: number;
|
25
|
+
name: string;
|
26
|
+
icon: string;
|
27
|
+
};
|
28
|
+
Tokens: {
|
29
|
+
id: string;
|
30
|
+
name: string | null;
|
31
|
+
chainId: number;
|
32
|
+
address: string;
|
33
|
+
decimals: number;
|
34
|
+
symbol: string;
|
35
|
+
icon: string;
|
36
|
+
verified: boolean;
|
37
|
+
price: number | null;
|
38
|
+
}[];
|
39
|
+
Protocols: {
|
40
|
+
id: string;
|
41
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
42
|
+
name: string;
|
43
|
+
description: string;
|
44
|
+
url: string;
|
45
|
+
icon: string;
|
46
|
+
}[];
|
47
|
+
MainProtocol: {
|
48
|
+
id: string;
|
49
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
50
|
+
name: string;
|
51
|
+
description: string;
|
52
|
+
url: string;
|
53
|
+
icon: string;
|
54
|
+
} | null;
|
55
|
+
} & {
|
56
|
+
id: string;
|
57
|
+
chainId: number;
|
58
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
59
|
+
identifier: string;
|
60
|
+
name: string;
|
61
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
62
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
63
|
+
mainProtocolId: string | null;
|
64
|
+
tvl: number;
|
65
|
+
apr: number;
|
66
|
+
dailyRewards: number;
|
67
|
+
tags: string[];
|
68
|
+
};
|
69
|
+
};
|
70
|
+
} & {
|
71
|
+
id: number;
|
72
|
+
protocolId: string | null;
|
73
|
+
reason: string;
|
74
|
+
amount: string;
|
75
|
+
claimed: string;
|
76
|
+
pending: string;
|
77
|
+
auxiliaryData1: string | null;
|
78
|
+
auxiliaryData2: string | null;
|
79
|
+
rewardId: string;
|
80
|
+
campaignId: string;
|
81
|
+
})[];
|
82
|
+
} & {
|
83
|
+
id: string;
|
84
|
+
root: string;
|
85
|
+
recipient: string;
|
86
|
+
rewardTokenId: string;
|
87
|
+
proofs: string[];
|
88
|
+
})[]>;
|
89
|
+
static getByChainRecipientToken(recipient: string, root: string, tokenId: string): Promise<({
|
90
|
+
Breakdown: ({
|
91
|
+
Campaign: {
|
92
|
+
identifier: string;
|
93
|
+
campaignId: string;
|
94
|
+
};
|
95
|
+
} & {
|
96
|
+
id: number;
|
97
|
+
protocolId: string | null;
|
98
|
+
reason: string;
|
99
|
+
amount: string;
|
100
|
+
claimed: string;
|
101
|
+
pending: string;
|
102
|
+
auxiliaryData1: string | null;
|
103
|
+
auxiliaryData2: string | null;
|
104
|
+
rewardId: string;
|
105
|
+
campaignId: string;
|
106
|
+
})[];
|
107
|
+
} & {
|
108
|
+
id: string;
|
109
|
+
root: string;
|
110
|
+
recipient: string;
|
111
|
+
rewardTokenId: string;
|
112
|
+
proofs: string[];
|
113
|
+
}) | null>;
|
114
|
+
static countRewardPerRewardTokenIdAndRoot(): Promise<(Prisma.PickEnumerable<Prisma.RewardGroupByOutputType, ("rewardTokenId" | "root")[]> & {
|
115
|
+
_count: {
|
116
|
+
_all: number;
|
117
|
+
};
|
118
|
+
})[]>;
|
119
|
+
static countRewardBreakdownPerCampaignId(): Promise<(Prisma.PickEnumerable<Prisma.RewardBreakdownGroupByOutputType, "campaignId"[]> & {
|
120
|
+
_count: {
|
121
|
+
_all: number;
|
122
|
+
};
|
123
|
+
})[]>;
|
124
|
+
static updatePendings(rewardTokenId: string, root: string, campaignId: string, toUpdate: PendingEntity[]): Promise<{
|
125
|
+
id: number;
|
126
|
+
protocolId: string | null;
|
127
|
+
reason: string;
|
128
|
+
amount: string;
|
129
|
+
claimed: string;
|
130
|
+
pending: string;
|
131
|
+
auxiliaryData1: string | null;
|
132
|
+
auxiliaryData2: string | null;
|
133
|
+
rewardId: string;
|
134
|
+
campaignId: string;
|
135
|
+
}[]>;
|
136
|
+
static createPendings(rewardTokenId: string, root: string, campaignId: string, toCreate: PendingEntity[]): Promise<{
|
137
|
+
id: number;
|
138
|
+
protocolId: string | null;
|
139
|
+
reason: string;
|
140
|
+
amount: string;
|
141
|
+
claimed: string;
|
142
|
+
pending: string;
|
143
|
+
auxiliaryData1: string | null;
|
144
|
+
auxiliaryData2: string | null;
|
145
|
+
rewardId: string;
|
146
|
+
campaignId: string;
|
147
|
+
}[]>;
|
148
|
+
static breakdownForCampaigns(root: string, campaignIds: string[], query: CampaignIdListModel): Promise<{
|
149
|
+
Campaign: {
|
150
|
+
identifier: string;
|
151
|
+
campaignId: string;
|
152
|
+
};
|
153
|
+
amount: string;
|
154
|
+
Reward: {
|
155
|
+
recipient: string;
|
156
|
+
};
|
157
|
+
}[]>;
|
158
|
+
}
|