@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,180 @@
|
|
1
|
+
import { type CampaignUnique, type ConvertedCampaignType, type CreateCampaignModel, type GetCampaignQueryModel } from "./";
|
2
|
+
import { CampaignRepository } from "./campaign.repository";
|
3
|
+
import type { CampaignType } from "../../../../database/api/.generated";
|
4
|
+
import type { CampaignParameters, Campaign as CampaignTypeV3, ChainId } from "@sdk";
|
5
|
+
export declare abstract class CampaignService {
|
6
|
+
static hashId(campaign: CampaignUnique): string;
|
7
|
+
static create(campaign: Omit<CreateCampaignModel, "id">): Promise<{
|
8
|
+
id: string;
|
9
|
+
computeChainId: number;
|
10
|
+
distributionChainId: number;
|
11
|
+
identifier: string;
|
12
|
+
campaignId: string;
|
13
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
14
|
+
subType: number | null;
|
15
|
+
rewardTokenId: string;
|
16
|
+
amount: string;
|
17
|
+
opportunityId: string;
|
18
|
+
startTimestamp: bigint;
|
19
|
+
endTimestamp: bigint;
|
20
|
+
params: import("../../../../database/api/.generated").Prisma.JsonValue;
|
21
|
+
creatorAddress: string;
|
22
|
+
} | undefined>;
|
23
|
+
static createMany(campaigns: Omit<CreateCampaignModel, "id">[]): Promise<{
|
24
|
+
success: number;
|
25
|
+
fail: number;
|
26
|
+
}>;
|
27
|
+
/**
|
28
|
+
* Get the list of campaigns satisfying the query
|
29
|
+
* @param query
|
30
|
+
* @returns A list of campaigns
|
31
|
+
*/
|
32
|
+
static findMany(query: GetCampaignQueryModel): Promise<({
|
33
|
+
params: any;
|
34
|
+
chain: {
|
35
|
+
id: number;
|
36
|
+
name: string;
|
37
|
+
icon: string;
|
38
|
+
};
|
39
|
+
rewardToken: {
|
40
|
+
id: string;
|
41
|
+
name: string | null;
|
42
|
+
chainId: number;
|
43
|
+
address: string;
|
44
|
+
decimals: number;
|
45
|
+
symbol: string;
|
46
|
+
icon: string;
|
47
|
+
verified: boolean;
|
48
|
+
price: number | null;
|
49
|
+
};
|
50
|
+
distributionChain: {
|
51
|
+
id: number;
|
52
|
+
name: string;
|
53
|
+
icon: string;
|
54
|
+
} | undefined;
|
55
|
+
id: string;
|
56
|
+
computeChainId: number;
|
57
|
+
distributionChainId: number;
|
58
|
+
identifier: string;
|
59
|
+
campaignId: string;
|
60
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
61
|
+
subType: number | null;
|
62
|
+
rewardTokenId: string;
|
63
|
+
amount: string;
|
64
|
+
opportunityId: string;
|
65
|
+
startTimestamp: bigint;
|
66
|
+
endTimestamp: bigint;
|
67
|
+
creatorAddress: string;
|
68
|
+
} | null)[]>;
|
69
|
+
/**
|
70
|
+
* Counts the number of campaigns that complies to query
|
71
|
+
* @description used for pagination purposes
|
72
|
+
* @param query
|
73
|
+
* @returns the number of campaigns
|
74
|
+
*/
|
75
|
+
static countMany(query: GetCampaignQueryModel): Promise<number>;
|
76
|
+
static checkIfExist(campaign: CampaignUnique): Promise<boolean>;
|
77
|
+
static findUniqueOrThrow(campaign: CampaignUnique): Promise<{
|
78
|
+
id: string;
|
79
|
+
computeChainId: number;
|
80
|
+
distributionChainId: number;
|
81
|
+
identifier: string;
|
82
|
+
campaignId: string;
|
83
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
84
|
+
subType: number | null;
|
85
|
+
rewardTokenId: string;
|
86
|
+
amount: string;
|
87
|
+
opportunityId: string;
|
88
|
+
startTimestamp: bigint;
|
89
|
+
endTimestamp: bigint;
|
90
|
+
params: import("../../../../database/api/.generated").Prisma.JsonValue;
|
91
|
+
creatorAddress: string;
|
92
|
+
}>;
|
93
|
+
static fill(campaigns: CampaignUnique[]): Promise<{
|
94
|
+
success: number;
|
95
|
+
fail: number;
|
96
|
+
}>;
|
97
|
+
static fetchMissingCampaigns(chainId: ChainId, campaignIds: CampaignUnique[]): Promise<{
|
98
|
+
success: number;
|
99
|
+
fail: number;
|
100
|
+
}>;
|
101
|
+
static findChains(): Promise<Record<string, ChainId>>;
|
102
|
+
/**
|
103
|
+
* Returns the campaign data
|
104
|
+
* @param type index of Campaign enum from sdk
|
105
|
+
* @returns CampaignType as db-related enum for v4
|
106
|
+
*/
|
107
|
+
static getTypeFromV3(type: CampaignTypeV3): CampaignType;
|
108
|
+
/**
|
109
|
+
* Split a campaigns array into three array for each status
|
110
|
+
* @param campaigns
|
111
|
+
* @param timestamp to compare to campaigns timestamps
|
112
|
+
* @returns a status => campaigns map
|
113
|
+
*/
|
114
|
+
static splitOnStatus<C extends {
|
115
|
+
startTimestamp: bigint | number;
|
116
|
+
endTimestamp: bigint | number;
|
117
|
+
}>(campaigns: C[], timestamp?: number): {
|
118
|
+
past: C[];
|
119
|
+
live: C[];
|
120
|
+
soon: C[];
|
121
|
+
};
|
122
|
+
/**
|
123
|
+
* Returns the campaign data
|
124
|
+
* @param chainId to fetch campaigns for
|
125
|
+
* @param timestamp from which campaigns endTimestamp are filtered
|
126
|
+
* @returns
|
127
|
+
*/
|
128
|
+
static getFromEngineDb(chainId: number, timestamp: number): Promise<CampaignParameters<CampaignV3>[]>;
|
129
|
+
/**
|
130
|
+
* Convert raw
|
131
|
+
* @param query
|
132
|
+
* @returns A list of opportunities
|
133
|
+
* TODO: remove this function in favor of prisma client extensions
|
134
|
+
*/
|
135
|
+
static format(campaign: NonNullable<Awaited<ReturnType<typeof CampaignRepository.findMany>>>[number] | null): {
|
136
|
+
params: any;
|
137
|
+
chain: {
|
138
|
+
id: number;
|
139
|
+
name: string;
|
140
|
+
icon: string;
|
141
|
+
};
|
142
|
+
rewardToken: {
|
143
|
+
id: string;
|
144
|
+
name: string | null;
|
145
|
+
chainId: number;
|
146
|
+
address: string;
|
147
|
+
decimals: number;
|
148
|
+
symbol: string;
|
149
|
+
icon: string;
|
150
|
+
verified: boolean;
|
151
|
+
price: number | null;
|
152
|
+
};
|
153
|
+
distributionChain: {
|
154
|
+
id: number;
|
155
|
+
name: string;
|
156
|
+
icon: string;
|
157
|
+
} | undefined;
|
158
|
+
id: string;
|
159
|
+
computeChainId: number;
|
160
|
+
distributionChainId: number;
|
161
|
+
identifier: string;
|
162
|
+
campaignId: string;
|
163
|
+
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
164
|
+
subType: number | null;
|
165
|
+
rewardTokenId: string;
|
166
|
+
amount: string;
|
167
|
+
opportunityId: string;
|
168
|
+
startTimestamp: bigint;
|
169
|
+
endTimestamp: bigint;
|
170
|
+
creatorAddress: string;
|
171
|
+
} | null;
|
172
|
+
/**
|
173
|
+
* Fetches the campaign dynamic data for a v3 campaign onchain
|
174
|
+
* @param chainId
|
175
|
+
* @param campaignType
|
176
|
+
* @param campaigns of v3 type
|
177
|
+
* @returns
|
178
|
+
*/
|
179
|
+
static fetchDynamicData<C extends CampaignType>(chainId: number, campaignType: CampaignType, campaigns: CampaignParameters<ConvertedCampaignType<C>>[]): Promise<any>;
|
180
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import Elysia from "elysia";
|
2
|
+
export declare const ChainController: Elysia<"/chains", false, {
|
3
|
+
decorator: {};
|
4
|
+
store: {};
|
5
|
+
derive: {};
|
6
|
+
resolve: {};
|
7
|
+
}, {
|
8
|
+
type: {};
|
9
|
+
error: {};
|
10
|
+
}, {
|
11
|
+
schema: {};
|
12
|
+
macro: {};
|
13
|
+
}, {
|
14
|
+
chains: {
|
15
|
+
":chainId": {
|
16
|
+
get: {
|
17
|
+
body: unknown;
|
18
|
+
params: {
|
19
|
+
chainId: number;
|
20
|
+
};
|
21
|
+
query: unknown;
|
22
|
+
headers: unknown;
|
23
|
+
response: {
|
24
|
+
200: ({
|
25
|
+
Explorer: {
|
26
|
+
id: string;
|
27
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
28
|
+
url: string;
|
29
|
+
chainId: number;
|
30
|
+
}[];
|
31
|
+
} & {
|
32
|
+
id: number;
|
33
|
+
name: string;
|
34
|
+
icon: string;
|
35
|
+
}) | null;
|
36
|
+
};
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
} & {
|
41
|
+
chains: {
|
42
|
+
index: {
|
43
|
+
get: {
|
44
|
+
body: unknown;
|
45
|
+
params: Record<never, string>;
|
46
|
+
query: {
|
47
|
+
search?: string | undefined;
|
48
|
+
};
|
49
|
+
headers: unknown;
|
50
|
+
response: {
|
51
|
+
200: ({
|
52
|
+
Explorer: {
|
53
|
+
id: string;
|
54
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
55
|
+
url: string;
|
56
|
+
chainId: number;
|
57
|
+
}[];
|
58
|
+
} & {
|
59
|
+
id: number;
|
60
|
+
name: string;
|
61
|
+
icon: string;
|
62
|
+
})[];
|
63
|
+
};
|
64
|
+
};
|
65
|
+
};
|
66
|
+
};
|
67
|
+
} & {
|
68
|
+
chains: {
|
69
|
+
count: {
|
70
|
+
get: {
|
71
|
+
body: unknown;
|
72
|
+
params: Record<never, string>;
|
73
|
+
query: {
|
74
|
+
search?: string | undefined;
|
75
|
+
};
|
76
|
+
headers: unknown;
|
77
|
+
response: {
|
78
|
+
200: number;
|
79
|
+
};
|
80
|
+
};
|
81
|
+
};
|
82
|
+
};
|
83
|
+
}, {
|
84
|
+
derive: {};
|
85
|
+
resolve: {};
|
86
|
+
schema: {};
|
87
|
+
}, {
|
88
|
+
derive: {};
|
89
|
+
resolve: {};
|
90
|
+
schema: {};
|
91
|
+
}>;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { Resource } from "../prisma";
|
2
|
+
/**
|
3
|
+
* Chain
|
4
|
+
* @description Metadata for each supported network
|
5
|
+
* @see {@link Resource}
|
6
|
+
*/
|
7
|
+
export type Chain = Resource<"Chain">;
|
8
|
+
export declare const GetChainQueryDto: import("@sinclair/typebox").TObject<{
|
9
|
+
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
10
|
+
}>;
|
11
|
+
export declare const ChainUniqueDto: import("@sinclair/typebox").TObject<{
|
12
|
+
chainId: import("@sinclair/typebox").TNumber;
|
13
|
+
}>;
|
14
|
+
export declare const ChainArrayDto: import("@sinclair/typebox").TObject<{
|
15
|
+
chainId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>]>;
|
16
|
+
}>;
|
17
|
+
export type ChainUniqueModel = typeof ChainUniqueDto.static;
|
18
|
+
export type ChainSearchDto = typeof GetChainQueryDto.static;
|
19
|
+
export type ChainsArrayModel = typeof ChainArrayDto.static;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import type { Campaign, CampaignParameters } from "@sdk";
|
2
|
+
import type { Chain, ChainSearchDto } from "./chain.model";
|
3
|
+
export declare abstract class ChainRepository {
|
4
|
+
#private;
|
5
|
+
/**
|
6
|
+
* @param id ChainId
|
7
|
+
* @returns
|
8
|
+
*/
|
9
|
+
static read(id: number): Promise<({
|
10
|
+
Explorer: {
|
11
|
+
id: string;
|
12
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
13
|
+
url: string;
|
14
|
+
chainId: number;
|
15
|
+
}[];
|
16
|
+
} & {
|
17
|
+
id: number;
|
18
|
+
name: string;
|
19
|
+
icon: string;
|
20
|
+
}) | null>;
|
21
|
+
/** Returns many chains based on query
|
22
|
+
* @param query object with fields to search for
|
23
|
+
* @returns
|
24
|
+
*/
|
25
|
+
static readMany(query: ChainSearchDto): Promise<({
|
26
|
+
Explorer: {
|
27
|
+
id: string;
|
28
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
29
|
+
url: string;
|
30
|
+
chainId: number;
|
31
|
+
}[];
|
32
|
+
} & {
|
33
|
+
id: number;
|
34
|
+
name: string;
|
35
|
+
icon: string;
|
36
|
+
})[]>;
|
37
|
+
static countMany(query: ChainSearchDto): Promise<number>;
|
38
|
+
/** Returns all chainIds in the database
|
39
|
+
*/
|
40
|
+
static readIds(): Promise<{
|
41
|
+
id: number;
|
42
|
+
}[]>;
|
43
|
+
/**
|
44
|
+
* Creates a new chain
|
45
|
+
* @param template for chain creation
|
46
|
+
* @returns
|
47
|
+
*/
|
48
|
+
static create(template: Chain["action"]["create"]["args"]): Promise<{
|
49
|
+
id: number;
|
50
|
+
name: string;
|
51
|
+
icon: string;
|
52
|
+
}>;
|
53
|
+
static findMany(): Promise<{
|
54
|
+
id: number;
|
55
|
+
name: string;
|
56
|
+
icon: string;
|
57
|
+
}[]>;
|
58
|
+
/**
|
59
|
+
* Fetches the campaign dynamic data for a v3 campaign onchain
|
60
|
+
* @param chainId
|
61
|
+
* @param campaignType
|
62
|
+
* @param campaigns of v3 type
|
63
|
+
* @returns
|
64
|
+
*/
|
65
|
+
static fetchDynamicDataV3<CampaignType extends Campaign>(chainId: number, campaignType: CampaignType, campaigns: CampaignParameters<CampaignType>[]): Promise<any>;
|
66
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import type { ChainSearchDto } from "./chain.model";
|
2
|
+
export declare abstract class ChainService {
|
3
|
+
static get(chainId: number): Promise<({
|
4
|
+
Explorer: {
|
5
|
+
id: string;
|
6
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
7
|
+
url: string;
|
8
|
+
chainId: number;
|
9
|
+
}[];
|
10
|
+
} & {
|
11
|
+
id: number;
|
12
|
+
name: string;
|
13
|
+
icon: string;
|
14
|
+
}) | null>;
|
15
|
+
static findMany(): Promise<{
|
16
|
+
id: number;
|
17
|
+
name: string;
|
18
|
+
icon: string;
|
19
|
+
}[]>;
|
20
|
+
static getMany(query: ChainSearchDto): Promise<({
|
21
|
+
Explorer: {
|
22
|
+
id: string;
|
23
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
24
|
+
url: string;
|
25
|
+
chainId: number;
|
26
|
+
}[];
|
27
|
+
} & {
|
28
|
+
id: number;
|
29
|
+
name: string;
|
30
|
+
icon: string;
|
31
|
+
})[]>;
|
32
|
+
static countMany(query: ChainSearchDto): Promise<number>;
|
33
|
+
/** List all chainIds available in the databse
|
34
|
+
* @warning some chains may not be fully integrated yet
|
35
|
+
* @returns an array of chainId
|
36
|
+
*/
|
37
|
+
static getIds(): Promise<number[]>;
|
38
|
+
/** List all chainIds which have a distribituor (i.e. which is fully integrated)
|
39
|
+
* @returns an array of chainId
|
40
|
+
*/
|
41
|
+
static getSupportedIds(): Promise<number[]>;
|
42
|
+
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
export declare const slugToProtocolId: {
|
2
|
+
readonly "uniswap-v2": "uniswap-v2";
|
3
|
+
readonly "aave-v2": "aave";
|
4
|
+
readonly "camelot-v2": "camelot";
|
5
|
+
};
|
6
|
+
export type EnsoSlug = keyof typeof slugToProtocolId;
|
7
|
+
export declare const apiTypes: {
|
8
|
+
readonly "/v1/protocols": {
|
9
|
+
readonly query: import("@sinclair/typebox").TObject<{
|
10
|
+
slug: import("@sinclair/typebox").TString;
|
11
|
+
}>;
|
12
|
+
readonly response: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
13
|
+
slug: import("@sinclair/typebox").TString;
|
14
|
+
name: import("@sinclair/typebox").TString;
|
15
|
+
desription: import("@sinclair/typebox").TString;
|
16
|
+
url: import("@sinclair/typebox").TString;
|
17
|
+
logosUri: import("@sinclair/typebox").TString;
|
18
|
+
chains: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
19
|
+
id: import("@sinclair/typebox").TNumber;
|
20
|
+
name: import("@sinclair/typebox").TString;
|
21
|
+
}>>;
|
22
|
+
}>>;
|
23
|
+
};
|
24
|
+
readonly "/v1/tokens": {
|
25
|
+
readonly query: import("@sinclair/typebox").TObject<{
|
26
|
+
protocolSlug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
27
|
+
primaryAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
28
|
+
address: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
29
|
+
chainId: import("@sinclair/typebox").TNumber;
|
30
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
31
|
+
defi: "defi";
|
32
|
+
base: "base";
|
33
|
+
}>>;
|
34
|
+
page: import("@sinclair/typebox").TNumber;
|
35
|
+
inludeMetadatra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
36
|
+
}>;
|
37
|
+
readonly response: import("@sinclair/typebox").TObject<{
|
38
|
+
data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
39
|
+
chainId: import("@sinclair/typebox").TNumber;
|
40
|
+
address: import("@sinclair/typebox").TString;
|
41
|
+
type: import("@sinclair/typebox").TEnum<{
|
42
|
+
defi: "defi";
|
43
|
+
base: "base";
|
44
|
+
}>;
|
45
|
+
primaryAddress: import("@sinclair/typebox").TString;
|
46
|
+
underlyingTokens: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
47
|
+
address: import("@sinclair/typebox").TString;
|
48
|
+
chainId: import("@sinclair/typebox").TNumber;
|
49
|
+
type: import("@sinclair/typebox").TEnum<{
|
50
|
+
defi: "defi";
|
51
|
+
base: "base";
|
52
|
+
}>;
|
53
|
+
}>>;
|
54
|
+
apy: import("@sinclair/typebox").TNumber;
|
55
|
+
}>>;
|
56
|
+
meta: import("@sinclair/typebox").TObject<{
|
57
|
+
total: import("@sinclair/typebox").TNumber;
|
58
|
+
lastPage: import("@sinclair/typebox").TNumber;
|
59
|
+
currentPage: import("@sinclair/typebox").TNumber;
|
60
|
+
perPage: import("@sinclair/typebox").TNumber;
|
61
|
+
prev: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TNumber]>;
|
62
|
+
next: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TNumber]>;
|
63
|
+
}>;
|
64
|
+
}>;
|
65
|
+
};
|
66
|
+
readonly "/v1/shortcuts/quote": {
|
67
|
+
readonly query: import("@sinclair/typebox").TObject<{
|
68
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
69
|
+
fromAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
70
|
+
routingStrategy: import("@sinclair/typebox").TEnum<{
|
71
|
+
ensowallet: "ensowallet";
|
72
|
+
delegate: "delegate";
|
73
|
+
router: "router";
|
74
|
+
}>;
|
75
|
+
feeReceiver: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
76
|
+
tokenIn: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
77
|
+
tokenOut: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
78
|
+
amountIn: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
79
|
+
fee: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
80
|
+
disableRFQs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
81
|
+
ignoreAggregators: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
82
|
+
ignoreStandards: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
83
|
+
}>;
|
84
|
+
readonly response: import("@sinclair/typebox").TObject<{
|
85
|
+
gas: import("@sinclair/typebox").TString;
|
86
|
+
amountOut: import("@sinclair/typebox").TObject<{}>;
|
87
|
+
priceImpact: import("@sinclair/typebox").TNumber;
|
88
|
+
feeAmount: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
89
|
+
}>;
|
90
|
+
};
|
91
|
+
readonly "/v1/shortcuts/route": {
|
92
|
+
readonly query: import("@sinclair/typebox").TObject<{
|
93
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
94
|
+
fromAddress: import("@sinclair/typebox").TString;
|
95
|
+
routingStrategy: import("@sinclair/typebox").TEnum<{
|
96
|
+
ensowallet: "ensowallet";
|
97
|
+
delegate: "delegate";
|
98
|
+
router: "router";
|
99
|
+
}>;
|
100
|
+
receiver: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
101
|
+
spender: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
102
|
+
amountIn: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
103
|
+
amountOut: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
104
|
+
minAmountOut: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
105
|
+
slippage: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
106
|
+
fee: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
107
|
+
feeReceiver: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
108
|
+
disableRFQs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
109
|
+
ignoreAggregators: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
110
|
+
ignoreStandards: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
111
|
+
tokenIn: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
112
|
+
tokenOut: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
113
|
+
}>;
|
114
|
+
readonly response: import("@sinclair/typebox").TObject<{
|
115
|
+
gas: import("@sinclair/typebox").TString;
|
116
|
+
amountOut: import("@sinclair/typebox").TString;
|
117
|
+
priceImpact: import("@sinclair/typebox").TNumber;
|
118
|
+
feeAmount: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
119
|
+
createAt: import("@sinclair/typebox").TNumber;
|
120
|
+
tx: import("@sinclair/typebox").TObject<{
|
121
|
+
data: import("@sinclair/typebox").TString;
|
122
|
+
to: import("@sinclair/typebox").TString;
|
123
|
+
from: import("@sinclair/typebox").TString;
|
124
|
+
value: import("@sinclair/typebox").TString;
|
125
|
+
}>;
|
126
|
+
}>;
|
127
|
+
};
|
128
|
+
};
|
129
|
+
export type EnsoRoute = keyof typeof apiTypes;
|
130
|
+
export type EnsoApi<T extends EnsoRoute> = (typeof apiTypes)[T];
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import type { GetParticipateProtocolsQuery } from "../participate/participate.model";
|
2
|
+
import { type ProtocolId } from "../protocol";
|
3
|
+
import { type EnsoApi, type EnsoSlug } from "./enso.model";
|
4
|
+
export declare abstract class EnsoService {
|
5
|
+
#private;
|
6
|
+
static getSlug(protocolId: ProtocolId | string): EnsoSlug | undefined;
|
7
|
+
static getProtocolId(slug: EnsoSlug | string): ProtocolId | undefined;
|
8
|
+
static getCompatibleProtocols(query: GetParticipateProtocolsQuery): Promise<({
|
9
|
+
name: string;
|
10
|
+
url: string;
|
11
|
+
description: string;
|
12
|
+
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
13
|
+
icon: string;
|
14
|
+
} & {})[] | null>;
|
15
|
+
static getTokens(chainId: number, slug: EnsoSlug, identifier?: string): Promise<{
|
16
|
+
type: "base" | "defi";
|
17
|
+
chainId: number;
|
18
|
+
address: string;
|
19
|
+
primaryAddress: string;
|
20
|
+
underlyingTokens: {
|
21
|
+
type: "base" | "defi";
|
22
|
+
chainId: number;
|
23
|
+
address: string;
|
24
|
+
}[];
|
25
|
+
apy: number;
|
26
|
+
}[]>;
|
27
|
+
static getQuote(query: EnsoApi<"/v1/shortcuts/quote">["query"]["static"]): Promise<{
|
28
|
+
amountOut: {};
|
29
|
+
gas: string;
|
30
|
+
feeAmount: string[];
|
31
|
+
priceImpact: number;
|
32
|
+
}>;
|
33
|
+
static getTransaction(query: EnsoApi<"/v1/shortcuts/route">["query"]["static"]): Promise<{
|
34
|
+
amountOut: string;
|
35
|
+
gas: string;
|
36
|
+
feeAmount: string[];
|
37
|
+
priceImpact: number;
|
38
|
+
createAt: number;
|
39
|
+
tx: {
|
40
|
+
data: string;
|
41
|
+
from: string;
|
42
|
+
value: string;
|
43
|
+
to: string;
|
44
|
+
};
|
45
|
+
}>;
|
46
|
+
static getDepositSchema(protocolId: ProtocolId): void;
|
47
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./explorer.service";
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import Elysia from "elysia";
|
2
|
+
export declare const MerklRootController: Elysia<"/roots", false, {
|
3
|
+
decorator: {};
|
4
|
+
store: {};
|
5
|
+
derive: {};
|
6
|
+
resolve: {};
|
7
|
+
}, {
|
8
|
+
type: {};
|
9
|
+
error: {};
|
10
|
+
}, {
|
11
|
+
schema: {};
|
12
|
+
macro: {};
|
13
|
+
}, {
|
14
|
+
roots: {
|
15
|
+
index: {
|
16
|
+
get: {
|
17
|
+
body: unknown;
|
18
|
+
params: Record<never, string>;
|
19
|
+
query: {
|
20
|
+
chainId: number;
|
21
|
+
fromTimestamp: string;
|
22
|
+
toTimestamp: string;
|
23
|
+
};
|
24
|
+
headers: unknown;
|
25
|
+
response: {
|
26
|
+
200: {
|
27
|
+
root: string;
|
28
|
+
chainId: number;
|
29
|
+
epoch: number;
|
30
|
+
timestamp: bigint;
|
31
|
+
}[];
|
32
|
+
};
|
33
|
+
};
|
34
|
+
};
|
35
|
+
};
|
36
|
+
}, {
|
37
|
+
derive: {};
|
38
|
+
resolve: {};
|
39
|
+
schema: {};
|
40
|
+
}, {
|
41
|
+
derive: {};
|
42
|
+
resolve: {};
|
43
|
+
schema: {};
|
44
|
+
}>;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const RootByTimestampsDto: import("@sinclair/typebox").TObject<{
|
2
|
+
chainId: import("@sinclair/typebox").TNumber;
|
3
|
+
fromTimestamp: import("@sinclair/typebox").TString;
|
4
|
+
toTimestamp: import("@sinclair/typebox").TString;
|
5
|
+
}>;
|
6
|
+
export type RootByTimestampModel = typeof RootByTimestampsDto.static;
|