@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,413 @@
|
|
1
|
+
import { type CreateCampaignModel } from "../campaign";
|
2
|
+
import { type Status } from "../../../../database/api/.generated";
|
3
|
+
import type { ChainId } from "@sdk";
|
4
|
+
import type { CreateOpportunityModel, GetOpportunitiesQueryEntity, LightOpportunityFromDB, OpportunityMetadata, OpportunityUnique } from "./opportunity.model";
|
5
|
+
import { OpportunityRepository } from "./opportunity.repository";
|
6
|
+
export declare abstract class OpportunityService {
|
7
|
+
static hashId(opportunity: OpportunityUnique): string;
|
8
|
+
/**
|
9
|
+
* create an opportunity without campaigns
|
10
|
+
* @param newOpp the new opportunity to create
|
11
|
+
* @returns {Promise<Opportunity|undefined>}
|
12
|
+
*/
|
13
|
+
static create(newOpp: Omit<CreateOpportunityModel, "id">): Promise<void>;
|
14
|
+
/**
|
15
|
+
* build/fetch metadata of a campaign's opportunity
|
16
|
+
* @param campaign
|
17
|
+
* @returns {OpportunityMetadata}
|
18
|
+
*/
|
19
|
+
static getMetadata(campaign: CreateCampaignModel): Promise<OpportunityMetadata>;
|
20
|
+
static updateMetadata(chain: ChainId): Promise<void>;
|
21
|
+
static updateStatus(opportunityId: string, newStatus: Status): Promise<{
|
22
|
+
id: string;
|
23
|
+
chainId: number;
|
24
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
25
|
+
identifier: string;
|
26
|
+
name: string;
|
27
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
28
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
29
|
+
mainProtocolId: string | null;
|
30
|
+
tvl: number;
|
31
|
+
apr: number;
|
32
|
+
dailyRewards: number;
|
33
|
+
tags: string[];
|
34
|
+
}>;
|
35
|
+
static getUniqueWithCampaignsOrThrow(opportunityId: string | OpportunityUnique): Promise<({
|
36
|
+
aprRecord: {
|
37
|
+
cumulated: number;
|
38
|
+
cummulated: number;
|
39
|
+
timestamp: bigint;
|
40
|
+
breakdowns: {
|
41
|
+
id: number;
|
42
|
+
identifier: string;
|
43
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
44
|
+
value: number;
|
45
|
+
aprRecordId: string;
|
46
|
+
}[];
|
47
|
+
};
|
48
|
+
tvlRecord: {
|
49
|
+
id: string;
|
50
|
+
total: number;
|
51
|
+
timestamp: bigint;
|
52
|
+
breakdowns: {
|
53
|
+
id: number;
|
54
|
+
identifier: string;
|
55
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
56
|
+
value: number;
|
57
|
+
tvlRecordId: string;
|
58
|
+
}[];
|
59
|
+
};
|
60
|
+
rewardsRecord: {
|
61
|
+
id: string;
|
62
|
+
total: number;
|
63
|
+
timestamp: bigint;
|
64
|
+
breakdowns: {
|
65
|
+
id: number;
|
66
|
+
value: number;
|
67
|
+
campaignId: string;
|
68
|
+
dailyRewardsRecordId: string;
|
69
|
+
}[];
|
70
|
+
};
|
71
|
+
id: string;
|
72
|
+
tokens: {
|
73
|
+
id: string;
|
74
|
+
name: string | null;
|
75
|
+
chainId: number;
|
76
|
+
address: string;
|
77
|
+
decimals: number;
|
78
|
+
symbol: string;
|
79
|
+
icon: string;
|
80
|
+
verified: boolean;
|
81
|
+
price: number | null;
|
82
|
+
}[];
|
83
|
+
chain: {
|
84
|
+
id: number;
|
85
|
+
name: string;
|
86
|
+
icon: string;
|
87
|
+
};
|
88
|
+
protocol: {
|
89
|
+
id: string;
|
90
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
91
|
+
name: string;
|
92
|
+
description: string;
|
93
|
+
url: string;
|
94
|
+
icon: string;
|
95
|
+
} | undefined;
|
96
|
+
name: string;
|
97
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
98
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
99
|
+
tags: string[];
|
100
|
+
identifier: string;
|
101
|
+
chainId: number;
|
102
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
103
|
+
tvl: number;
|
104
|
+
apr: number;
|
105
|
+
dailyRewards: number;
|
106
|
+
} & {
|
107
|
+
campaigns: ({
|
108
|
+
params: any;
|
109
|
+
chain: {
|
110
|
+
id: number;
|
111
|
+
name: string;
|
112
|
+
icon: string;
|
113
|
+
};
|
114
|
+
rewardToken: {
|
115
|
+
id: string;
|
116
|
+
name: string | null;
|
117
|
+
chainId: number;
|
118
|
+
address: string;
|
119
|
+
decimals: number;
|
120
|
+
symbol: string;
|
121
|
+
icon: string;
|
122
|
+
verified: boolean;
|
123
|
+
price: number | null;
|
124
|
+
};
|
125
|
+
distributionChain: {
|
126
|
+
id: number;
|
127
|
+
name: string;
|
128
|
+
icon: string;
|
129
|
+
} | undefined;
|
130
|
+
id: string;
|
131
|
+
computeChainId: number;
|
132
|
+
distributionChainId: number;
|
133
|
+
identifier: string;
|
134
|
+
campaignId: string;
|
135
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
136
|
+
subType: number | null;
|
137
|
+
rewardTokenId: string;
|
138
|
+
amount: string;
|
139
|
+
opportunityId: string;
|
140
|
+
startTimestamp: bigint;
|
141
|
+
endTimestamp: bigint;
|
142
|
+
creatorAddress: string;
|
143
|
+
} | null)[];
|
144
|
+
}) | null>;
|
145
|
+
static getUniqueOrThrow(opportunityId: string | OpportunityUnique): Promise<{
|
146
|
+
aprRecord: {
|
147
|
+
cumulated: number;
|
148
|
+
cummulated: number;
|
149
|
+
timestamp: bigint;
|
150
|
+
breakdowns: {
|
151
|
+
id: number;
|
152
|
+
identifier: string;
|
153
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
154
|
+
value: number;
|
155
|
+
aprRecordId: string;
|
156
|
+
}[];
|
157
|
+
};
|
158
|
+
tvlRecord: {
|
159
|
+
id: string;
|
160
|
+
total: number;
|
161
|
+
timestamp: bigint;
|
162
|
+
breakdowns: {
|
163
|
+
id: number;
|
164
|
+
identifier: string;
|
165
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
166
|
+
value: number;
|
167
|
+
tvlRecordId: string;
|
168
|
+
}[];
|
169
|
+
};
|
170
|
+
rewardsRecord: {
|
171
|
+
id: string;
|
172
|
+
total: number;
|
173
|
+
timestamp: bigint;
|
174
|
+
breakdowns: {
|
175
|
+
id: number;
|
176
|
+
value: number;
|
177
|
+
campaignId: string;
|
178
|
+
dailyRewardsRecordId: string;
|
179
|
+
}[];
|
180
|
+
};
|
181
|
+
id: string;
|
182
|
+
tokens: {
|
183
|
+
id: string;
|
184
|
+
name: string | null;
|
185
|
+
chainId: number;
|
186
|
+
address: string;
|
187
|
+
decimals: number;
|
188
|
+
symbol: string;
|
189
|
+
icon: string;
|
190
|
+
verified: boolean;
|
191
|
+
price: number | null;
|
192
|
+
}[];
|
193
|
+
chain: {
|
194
|
+
id: number;
|
195
|
+
name: string;
|
196
|
+
icon: string;
|
197
|
+
};
|
198
|
+
protocol: {
|
199
|
+
id: string;
|
200
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
201
|
+
name: string;
|
202
|
+
description: string;
|
203
|
+
url: string;
|
204
|
+
icon: string;
|
205
|
+
} | undefined;
|
206
|
+
name: string;
|
207
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
208
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
209
|
+
tags: string[];
|
210
|
+
identifier: string;
|
211
|
+
chainId: number;
|
212
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
213
|
+
tvl: number;
|
214
|
+
apr: number;
|
215
|
+
dailyRewards: number;
|
216
|
+
} | null>;
|
217
|
+
/**
|
218
|
+
* Get the list of opportunities satisfying the query
|
219
|
+
* @param query
|
220
|
+
* @returns A list of opportunities
|
221
|
+
*/
|
222
|
+
static getMany(query: GetOpportunitiesQueryEntity): Promise<({
|
223
|
+
aprRecord: {
|
224
|
+
cumulated: number;
|
225
|
+
cummulated: number;
|
226
|
+
timestamp: bigint;
|
227
|
+
breakdowns: {
|
228
|
+
id: number;
|
229
|
+
identifier: string;
|
230
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
231
|
+
value: number;
|
232
|
+
aprRecordId: string;
|
233
|
+
}[];
|
234
|
+
};
|
235
|
+
tvlRecord: {
|
236
|
+
id: string;
|
237
|
+
total: number;
|
238
|
+
timestamp: bigint;
|
239
|
+
breakdowns: {
|
240
|
+
id: number;
|
241
|
+
identifier: string;
|
242
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
243
|
+
value: number;
|
244
|
+
tvlRecordId: string;
|
245
|
+
}[];
|
246
|
+
};
|
247
|
+
rewardsRecord: {
|
248
|
+
id: string;
|
249
|
+
total: number;
|
250
|
+
timestamp: bigint;
|
251
|
+
breakdowns: {
|
252
|
+
id: number;
|
253
|
+
value: number;
|
254
|
+
campaignId: string;
|
255
|
+
dailyRewardsRecordId: string;
|
256
|
+
}[];
|
257
|
+
};
|
258
|
+
id: string;
|
259
|
+
tokens: {
|
260
|
+
id: string;
|
261
|
+
name: string | null;
|
262
|
+
chainId: number;
|
263
|
+
address: string;
|
264
|
+
decimals: number;
|
265
|
+
symbol: string;
|
266
|
+
icon: string;
|
267
|
+
verified: boolean;
|
268
|
+
price: number | null;
|
269
|
+
}[];
|
270
|
+
chain: {
|
271
|
+
id: number;
|
272
|
+
name: string;
|
273
|
+
icon: string;
|
274
|
+
};
|
275
|
+
protocol: {
|
276
|
+
id: string;
|
277
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
278
|
+
name: string;
|
279
|
+
description: string;
|
280
|
+
url: string;
|
281
|
+
icon: string;
|
282
|
+
} | undefined;
|
283
|
+
name: string;
|
284
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
285
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
286
|
+
tags: string[];
|
287
|
+
identifier: string;
|
288
|
+
chainId: number;
|
289
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
290
|
+
tvl: number;
|
291
|
+
apr: number;
|
292
|
+
dailyRewards: number;
|
293
|
+
} | null)[]>;
|
294
|
+
static getAllIds(): Promise<{
|
295
|
+
id: string;
|
296
|
+
}[]>;
|
297
|
+
/**
|
298
|
+
* Counts the number of opportunities that complies to query
|
299
|
+
* @description used for pagination purposes
|
300
|
+
* @param query
|
301
|
+
* @returns the number of opportunities
|
302
|
+
*/
|
303
|
+
static countMany(query: GetOpportunitiesQueryEntity): Promise<number>;
|
304
|
+
static formatResponse(opportunity: Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>): {
|
305
|
+
aprRecord: {
|
306
|
+
cumulated: number;
|
307
|
+
cummulated: number;
|
308
|
+
timestamp: bigint;
|
309
|
+
breakdowns: {
|
310
|
+
id: number;
|
311
|
+
identifier: string;
|
312
|
+
type: import("../../../../database/api/.generated").$Enums.AprType;
|
313
|
+
value: number;
|
314
|
+
aprRecordId: string;
|
315
|
+
}[];
|
316
|
+
};
|
317
|
+
tvlRecord: {
|
318
|
+
id: string;
|
319
|
+
total: number;
|
320
|
+
timestamp: bigint;
|
321
|
+
breakdowns: {
|
322
|
+
id: number;
|
323
|
+
identifier: string;
|
324
|
+
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
325
|
+
value: number;
|
326
|
+
tvlRecordId: string;
|
327
|
+
}[];
|
328
|
+
};
|
329
|
+
rewardsRecord: {
|
330
|
+
id: string;
|
331
|
+
total: number;
|
332
|
+
timestamp: bigint;
|
333
|
+
breakdowns: {
|
334
|
+
id: number;
|
335
|
+
value: number;
|
336
|
+
campaignId: string;
|
337
|
+
dailyRewardsRecordId: string;
|
338
|
+
}[];
|
339
|
+
};
|
340
|
+
id: string;
|
341
|
+
tokens: {
|
342
|
+
id: string;
|
343
|
+
name: string | null;
|
344
|
+
chainId: number;
|
345
|
+
address: string;
|
346
|
+
decimals: number;
|
347
|
+
symbol: string;
|
348
|
+
icon: string;
|
349
|
+
verified: boolean;
|
350
|
+
price: number | null;
|
351
|
+
}[];
|
352
|
+
chain: {
|
353
|
+
id: number;
|
354
|
+
name: string;
|
355
|
+
icon: string;
|
356
|
+
};
|
357
|
+
protocol: {
|
358
|
+
id: string;
|
359
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
360
|
+
name: string;
|
361
|
+
description: string;
|
362
|
+
url: string;
|
363
|
+
icon: string;
|
364
|
+
} | undefined;
|
365
|
+
name: string;
|
366
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
367
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
368
|
+
tags: string[];
|
369
|
+
identifier: string;
|
370
|
+
chainId: number;
|
371
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
372
|
+
tvl: number;
|
373
|
+
apr: number;
|
374
|
+
dailyRewards: number;
|
375
|
+
} | null;
|
376
|
+
static formatResponseBase(opportunity: LightOpportunityFromDB): {
|
377
|
+
id: string;
|
378
|
+
tokens: {
|
379
|
+
id: string;
|
380
|
+
name: string | null;
|
381
|
+
chainId: number;
|
382
|
+
address: string;
|
383
|
+
decimals: number;
|
384
|
+
symbol: string;
|
385
|
+
icon: string;
|
386
|
+
verified: boolean;
|
387
|
+
price: number | null;
|
388
|
+
}[];
|
389
|
+
chain: {
|
390
|
+
id: number;
|
391
|
+
name: string;
|
392
|
+
icon: string;
|
393
|
+
};
|
394
|
+
protocol: {
|
395
|
+
id: string;
|
396
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
397
|
+
name: string;
|
398
|
+
description: string;
|
399
|
+
url: string;
|
400
|
+
icon: string;
|
401
|
+
} | undefined;
|
402
|
+
name: string;
|
403
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
404
|
+
status: import("../../../../database/api/.generated").$Enums.Status;
|
405
|
+
tags: string[];
|
406
|
+
identifier: string;
|
407
|
+
chainId: number;
|
408
|
+
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
409
|
+
tvl: number;
|
410
|
+
apr: number;
|
411
|
+
dailyRewards: number;
|
412
|
+
};
|
413
|
+
}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { AjnaCampaign, ChainId } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getAjnaMetadata: (chainId: ChainId, campaignSubType: AjnaCampaign["campaignSubType"], params: AjnaCampaign["campaignParameters"]) => Promise<OpportunityMetadata>;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { type ChainId, type CompoundCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getCompoundMetadata: (chainId: ChainId, campaignSubType: CompoundCampaign["campaignSubType"], params: CompoundCampaign["campaignParameters"]) => OpportunityMetadata;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { ChainId, DolomiteCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getDolomiteMetadata: (chainId: ChainId, campaignSubType: DolomiteCampaign["campaignSubType"], params: DolomiteCampaign["campaignParameters"]) => OpportunityMetadata;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { OpportunityMetadata } from "..";
|
2
|
+
import type { ChainId, ERC20Campaign } from "@sdk";
|
3
|
+
export declare const getErc20Metadata: (chainId: ChainId, campaignId: string, rewardToken: string, amount: string, params: ERC20Campaign["campaignParameters"]) => Promise<OpportunityMetadata>;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { ChainId, EulerCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getEulerMetadata: (chainId: ChainId, campaignId: string, campaignSubType: EulerCampaign["campaignSubType"], rewardToken: string, amount: string, params: EulerCampaign["campaignParameters"]) => Promise<OpportunityMetadata>;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { ChainId, JSON_AIRDROPCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getJsonAirdropMetadata: (chainId: ChainId, creator: string, params: JSON_AIRDROPCampaign["campaignParameters"]) => Promise<OpportunityMetadata>;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { OpportunityMetadata } from "..";
|
2
|
+
import { type ChainId, type MorphoCampaign, type MorphoSubCampaignType } from "@sdk";
|
3
|
+
export declare const getMorphoMetadata: (chainId: ChainId, campaignSubType: MorphoCampaign<MorphoSubCampaignType>["campaignSubType"], params: MorphoCampaign<MorphoSubCampaignType>["campaignParameters"]) => OpportunityMetadata;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { ChainId, RadiantCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getRadiantMetadata: (chainId: ChainId, campaignSubType: RadiantCampaign["campaignSubType"], params: RadiantCampaign["campaignParameters"]) => OpportunityMetadata;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { ChainId, SILOCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getSiloMetadata: (chainId: ChainId, campaignSubType: SILOCampaign["campaignSubType"], params: SILOCampaign["campaignParameters"]) => OpportunityMetadata;
|
@@ -0,0 +1,120 @@
|
|
1
|
+
import Elysia from "elysia";
|
2
|
+
export declare const ParticipateController: Elysia<"/participate", false, {
|
3
|
+
decorator: {};
|
4
|
+
store: {};
|
5
|
+
derive: {};
|
6
|
+
resolve: {};
|
7
|
+
}, {
|
8
|
+
type: {};
|
9
|
+
error: {};
|
10
|
+
}, {
|
11
|
+
schema: {};
|
12
|
+
macro: {};
|
13
|
+
}, {
|
14
|
+
participate: {
|
15
|
+
targets: {
|
16
|
+
get: {
|
17
|
+
body: unknown;
|
18
|
+
params: Record<never, string>;
|
19
|
+
query: {
|
20
|
+
identifier?: string | undefined;
|
21
|
+
chainId: number;
|
22
|
+
protocolId: string;
|
23
|
+
};
|
24
|
+
headers: unknown;
|
25
|
+
response: {
|
26
|
+
200: import("./participate.model").ParticipateTarget[] | undefined;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
};
|
30
|
+
};
|
31
|
+
} & {
|
32
|
+
participate: {
|
33
|
+
protocols: {
|
34
|
+
get: {
|
35
|
+
body: unknown;
|
36
|
+
params: Record<never, string>;
|
37
|
+
query: {
|
38
|
+
chainId?: number | undefined;
|
39
|
+
};
|
40
|
+
headers: unknown;
|
41
|
+
response: {
|
42
|
+
200: ({
|
43
|
+
name: string;
|
44
|
+
url: string;
|
45
|
+
description: string;
|
46
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
47
|
+
icon: string;
|
48
|
+
} & {})[] | null;
|
49
|
+
};
|
50
|
+
};
|
51
|
+
};
|
52
|
+
};
|
53
|
+
} & {
|
54
|
+
participate: {
|
55
|
+
quote: {
|
56
|
+
get: {
|
57
|
+
body: unknown;
|
58
|
+
params: Record<never, string>;
|
59
|
+
query: {
|
60
|
+
identifier: string;
|
61
|
+
chainId: number;
|
62
|
+
protocolId: string;
|
63
|
+
userAddress: string;
|
64
|
+
fromAmount: string;
|
65
|
+
fromTokenAddress: string;
|
66
|
+
};
|
67
|
+
headers: unknown;
|
68
|
+
response: {
|
69
|
+
200: {
|
70
|
+
amountOut: {};
|
71
|
+
gas: string;
|
72
|
+
feeAmount: string[];
|
73
|
+
priceImpact: number;
|
74
|
+
} | undefined;
|
75
|
+
};
|
76
|
+
};
|
77
|
+
};
|
78
|
+
};
|
79
|
+
} & {
|
80
|
+
participate: {
|
81
|
+
transaction: {
|
82
|
+
get: {
|
83
|
+
body: unknown;
|
84
|
+
params: Record<never, string>;
|
85
|
+
query: {
|
86
|
+
identifier: string;
|
87
|
+
chainId: number;
|
88
|
+
protocolId: string;
|
89
|
+
userAddress: string;
|
90
|
+
fromAmount: string;
|
91
|
+
fromTokenAddress: string;
|
92
|
+
};
|
93
|
+
headers: unknown;
|
94
|
+
response: {
|
95
|
+
200: {
|
96
|
+
amountOut: string;
|
97
|
+
gas: string;
|
98
|
+
feeAmount: string[];
|
99
|
+
priceImpact: number;
|
100
|
+
createAt: number;
|
101
|
+
tx: {
|
102
|
+
data: string;
|
103
|
+
from: string;
|
104
|
+
value: string;
|
105
|
+
to: string;
|
106
|
+
};
|
107
|
+
} | undefined;
|
108
|
+
};
|
109
|
+
};
|
110
|
+
};
|
111
|
+
};
|
112
|
+
}, {
|
113
|
+
derive: {};
|
114
|
+
resolve: {};
|
115
|
+
schema: {};
|
116
|
+
}, {
|
117
|
+
derive: {};
|
118
|
+
resolve: {};
|
119
|
+
schema: {};
|
120
|
+
}>;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import type { Token } from "../token";
|
2
|
+
export declare const participateInputTypes: readonly ["tokenAmount", "token"];
|
3
|
+
export type ParticipateInputType = (typeof participateInputTypes)[number];
|
4
|
+
export type ParticipateInput<T extends ParticipateInputType = ParticipateInputType> = {
|
5
|
+
tokenAmount: {
|
6
|
+
chain: number[];
|
7
|
+
address: string[];
|
8
|
+
amount: number[];
|
9
|
+
};
|
10
|
+
token: {
|
11
|
+
address: string;
|
12
|
+
};
|
13
|
+
}[T];
|
14
|
+
export declare const participateTypes: readonly ["link", "deposit", "withdraw"];
|
15
|
+
export type ParticipateType = (typeof participateTypes)[number];
|
16
|
+
export type ParticipateSchema<T extends ParticipateType> = {
|
17
|
+
link: {
|
18
|
+
link: string;
|
19
|
+
};
|
20
|
+
deposit: {
|
21
|
+
inputs: ParticipateInput[];
|
22
|
+
};
|
23
|
+
withdraw: {
|
24
|
+
d: string;
|
25
|
+
};
|
26
|
+
}[T];
|
27
|
+
export type ParticipateTarget = {
|
28
|
+
identifier: string;
|
29
|
+
name: string;
|
30
|
+
tokens: Token["model"][];
|
31
|
+
};
|
32
|
+
export type ParticipateSchemas = {
|
33
|
+
[T in ParticipateType]?: ParticipateSchema<T>;
|
34
|
+
};
|
35
|
+
export declare const GetParticipateTargetsQueryDto: import("@sinclair/typebox").TObject<{
|
36
|
+
chainId: import("@sinclair/typebox").TNumber;
|
37
|
+
protocolId: import("@sinclair/typebox").TString;
|
38
|
+
identifier: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
39
|
+
}>;
|
40
|
+
export declare const GetParticipateQuoteQueryDto: import("@sinclair/typebox").TObject<{
|
41
|
+
chainId: import("@sinclair/typebox").TNumber;
|
42
|
+
protocolId: import("@sinclair/typebox").TString;
|
43
|
+
identifier: import("@sinclair/typebox").TString;
|
44
|
+
userAddress: import("@sinclair/typebox").TString;
|
45
|
+
fromTokenAddress: import("@sinclair/typebox").TString;
|
46
|
+
fromAmount: import("@sinclair/typebox").TString;
|
47
|
+
}>;
|
48
|
+
export declare const GetParticipateProtocolsQueryDto: import("@sinclair/typebox").TObject<{
|
49
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
50
|
+
}>;
|
51
|
+
export type GetParticipateProtocolsQuery = typeof GetParticipateProtocolsQueryDto.static;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { EnsoService } from "../enso/enso.service";
|
2
|
+
import type { ProtocolId } from "../protocol";
|
3
|
+
import type { ParticipateTarget } from "./participate.model";
|
4
|
+
export declare abstract class ParticipateService {
|
5
|
+
static getTarget(chainId: number, protocolId: ProtocolId, identifier: string): Promise<ParticipateTarget[] | undefined>;
|
6
|
+
static getTargetsFromEnsoTokens(tokens: Awaited<ReturnType<typeof EnsoService.getTokens>>): Promise<ParticipateTarget[]>;
|
7
|
+
static getTargets(chainId: number, protocolId: ProtocolId): Promise<ParticipateTarget[] | undefined>;
|
8
|
+
}
|