@merkl/api 0.10.310 → 0.10.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/api/.generated/edge.js +2 -2
- package/dist/database/api/.generated/index.js +2 -2
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +2 -1
- package/dist/src/eden/index.d.ts +150 -12
- package/dist/src/index.d.ts +58 -4
- package/dist/src/modules/v4/explorer/explorer.controller.js +1 -1
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +52 -0
- package/dist/src/modules/v4/programPayload/programPayload.controller.js +20 -15
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +1 -0
- package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +5 -1
- package/dist/src/modules/v4/programPayload/programPayload.service.js +15 -0
- package/dist/src/modules/v4/reward/reward.controller.d.ts +6 -4
- package/dist/src/modules/v4/reward/reward.controller.js +7 -2
- package/dist/src/modules/v4/reward/reward.repository.d.ts +4 -10
- package/dist/src/modules/v4/reward/reward.repository.js +18 -9
- package/dist/src/modules/v4/reward/reward.service.d.ts +6 -4
- package/dist/src/modules/v4/reward/reward.service.js +46 -63
- package/dist/src/modules/v4/router.d.ts +58 -4
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +3 -1
@@ -594,8 +594,8 @@ const config = {
|
|
594
594
|
}
|
595
595
|
}
|
596
596
|
},
|
597
|
-
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n binaryTargets = [\"native\", \"linux-arm64-openssl-1.1.x\", \"linux-musl-arm64-openssl-3.0.x\"]\n output = \".generated/\"\n previewFeatures = [\"fullTextSearchPostgres\", \"relationJoins\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_API_URL\")\n}\n\nmodel Campaign {\n id String @id\n ComputeChain Chain @relation(\"compute\", fields: [computeChainId], references: [id])\n computeChainId Int\n DistributionChain Chain @relation(\"distribution\", fields: [distributionChainId], references: [id])\n distributionChainId Int\n campaignId String\n type CampaignType\n subType Int?\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n startTimestamp BigInt\n endTimestamp BigInt\n params Json\n RewardBreakdown RewardBreakdown[]\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n Creator User @relation(fields: [creatorAddress], references: [address])\n creatorAddress String @db.Char(42)\n // Should probably be a 1 to 1 relation if we do not want to keep historic records\n CampaignStatus CampaignStatus[]\n\n @@unique([distributionChainId, campaignId])\n @@index([opportunityId], type: Hash)\n}\n\nmodel Chain {\n id Int @id\n name String\n icon String\n Explorer Explorer[]\n Campaigns Campaign[] @relation(\"compute\")\n Distribution Campaign[] @relation(\"distribution\")\n Token Token[]\n Opportunity Opportunity[]\n MerklRoot MerklRoot[]\n Blacklist Blacklist[]\n Dump Dump[]\n}\n\nmodel Explorer {\n id String @id\n type ExplorerType\n Chain Chain @relation(fields: [chainId], references: [id])\n url String\n chainId Int\n\n @@unique([type, chainId])\n}\n\nmodel Opportunity {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id]) // compute\n chainId Int // compute\n type CampaignType\n identifier String // eg. 0xUniswapPool - formerly mainParameter\n name String\n depositUrl String?\n status Status\n action OpportunityAction\n Tokens Token[]\n Campaigns Campaign[]\n Protocols Protocol[]\n MainProtocol Protocol? @relation(name: \"main\", fields: [mainProtocolId], references: [id])\n mainProtocolId String?\n tvl Float @default(0)\n TvlRecords TVLRecord[]\n apr Float @default(0)\n AprRecords AprRecord[]\n dailyRewards Float @default(0)\n DailyRewardsRecords DailyRewardsRecord[]\n tags String[] @default([])\n\n @@unique([chainId, type, identifier])\n}\n\nmodel Protocol {\n id String @id\n tags String[] @default([])\n name String\n description String @default(\"\")\n url String\n icon String\n MainOpportunities Opportunity[] @relation(name: \"main\")\n Opportunities Opportunity[]\n RewardBreakdown RewardBreakdown[]\n}\n\nmodel Token {\n id String @id()\n name String?\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n address String @db.Char(42)\n decimals Int\n symbol String\n displaySymbol String @default(\"\")\n icon String\n verified Boolean @default(false)\n isTest Boolean @default(false)\n price Float?\n Opportunity Opportunity[]\n Campaigns Campaign[]\n Reward Reward[]\n DumpTo Dump[] @relation(\"to\")\n DumpFrom Dump[] @relation(\"from\")\n\n @@unique([chainId, address])\n @@index([chainId], type: Hash)\n @@index([symbol, address])\n}\n\nmodel AprRecord {\n id String @id\n timestamp BigInt\n cumulated Float\n AprBreakdown AprBreakdown[]\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel AprBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type AprType\n value Float\n AprRecord AprRecord @relation(fields: [aprRecordId], references: [id])\n aprRecordId String\n\n @@index([aprRecordId], type: Hash)\n}\n\nmodel TVLRecord {\n id String @id\n timestamp BigInt\n total Float\n TvlBreakdown TVLBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel TVLBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type TvlType\n value Float\n\n TvlRecord TVLRecord @relation(fields: [tvlRecordId], references: [id])\n tvlRecordId String\n\n @@index([tvlRecordId], type: Hash)\n}\n\nmodel DailyRewardsRecord {\n id String @id\n timestamp BigInt\n total Float\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel DailyRewardsBreakdown {\n id Int @id @default(autoincrement())\n value Float\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n DailyRewardsRecord DailyRewardsRecord @relation(fields: [dailyRewardsRecordId], references: [id])\n dailyRewardsRecordId String\n\n @@index([dailyRewardsRecordId], type: Hash)\n}\n\nmodel User {\n address String @id @db.Char(42)\n Rewards Reward[]\n Blacklist Blacklist[]\n CampaignsCreated Campaign[]\n tags String[]\n}\n\nmodel Reward {\n id String @id\n MerklRoot MerklRoot @relation(fields: [root], references: [root])\n root String\n User User @relation(fields: [recipient], references: [address])\n recipient String @db.Char(42)\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String @default(\"0\")\n claimed String @default(\"0\")\n pending String @default(\"0\")\n proofs String[]\n Breakdown RewardBreakdown[]\n\n @@unique([root, recipient, rewardTokenId])\n @@index([root], type: Hash)\n @@index([recipient, rewardTokenId])\n}\n\nmodel RewardBreakdown {\n id Int @id @default(autoincrement())\n Protocol Protocol? @relation(fields: [protocolId], references: [id])\n protocolId String?\n reason String\n amount String\n claimed String\n pending String\n auxiliaryData1 String?\n auxiliaryData2 String?\n Reward Reward @relation(fields: [rewardId], references: [id], onDelete: Cascade)\n rewardId String\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n\n @@unique([rewardId, campaignId, reason])\n @@index([rewardId], type: Hash)\n @@index([campaignId], type: Hash)\n @@index([amount(sort: Desc)])\n}\n\nmodel MerklRoot {\n root String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n epoch Int\n timestamp BigInt\n Rewards Reward[]\n\n @@index([chainId, root])\n}\n\nmodel PriceSource {\n id Int @id @default(autoincrement())\n symbol String @unique() // Price Id\n method PriceSourceMethod\n args Json?\n}\n\n// priceId -> number\n\nmodel Blacklist {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n poolAddress String @db.Char(42)\n User User @relation(fields: [userAddress], references: [address])\n userAddress String @db.Char(42)\n arrestTimestamp BigInt\n arrestDetails Json\n\n @@unique([chainId, userAddress, poolAddress])\n @@index([userAddress], type: Hash)\n}\n\nmodel Dump {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n FromToken Token @relation(name: \"from\", fields: [fromTokenId], references: [id])\n fromTokenId String\n ToToken Token @relation(name: \"to\", fields: [toTokenId], references: [id])\n toTokenId String\n multisig String @db.Char(42)\n recipient String @db.Char(42)\n amountIn String @default(\"0\")\n amountOut String @default(\"0\")\n datetime DateTime\n timestamp Int\n\n @@unique([chainId, fromTokenId, toTokenId, timestamp])\n}\n\nmodel CampaignStatus {\n campaignId String @id\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n computedUntil BigInt @default(0)\n processingStarted BigInt @default(0)\n status RunStatus @default(SUCCESS)\n error String @default(\"\")\n details Json @default(\"{}\")\n}\n\n// enums\n\nenum RunStatus {\n PROCESSING\n SUCCESS\n FAILED\n SKIPPED\n}\n\nenum CampaignType {\n INVALID\n ERC20\n CLAMM\n ERC20_SNAPSHOT\n JSON_AIRDROP\n SILO\n RADIANT\n MORPHO\n DOLOMITE\n BADGER\n COMPOUND\n AJNA\n EULER\n UNISWAP_V4\n ION\n EIGENLAYER\n ERC20TRANSFERS\n ERC20LOGPROCESSOR\n ERC20REBASELOGPROCESSOR\n VEST\n}\n\nenum OpportunityAction {\n POOL\n HOLD\n DROP\n LEND\n BORROW\n INVALID\n}\n\nenum Status {\n NONE\n PAST\n LIVE\n SOON\n}\n\nenum ExplorerType {\n ETHERSCAN\n BLOCKSCOUT\n}\n\nenum AprType {\n CAMPAIGN\n TOKEN\n PROTOCOL\n}\n\nenum TvlType {\n TOKEN\n PROTOCOL\n}\n\nenum PriceSourceMethod {\n COINGECKO\n CONSTANT\n EQUAL_TO\n ERC4626\n DEXSCREENER\n INDEXCOOP\n DEFILLAMA\n}\n",
|
598
|
-
"inlineSchemaHash": "
|
597
|
+
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n binaryTargets = [\"native\", \"linux-arm64-openssl-1.1.x\", \"linux-musl-arm64-openssl-3.0.x\"]\n output = \".generated/\"\n previewFeatures = [\"fullTextSearchPostgres\", \"relationJoins\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_API_URL\")\n}\n\nmodel Campaign {\n id String @id\n ComputeChain Chain @relation(\"compute\", fields: [computeChainId], references: [id])\n computeChainId Int\n DistributionChain Chain @relation(\"distribution\", fields: [distributionChainId], references: [id])\n distributionChainId Int\n campaignId String\n type CampaignType\n subType Int?\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n startTimestamp BigInt\n endTimestamp BigInt\n params Json\n RewardBreakdown RewardBreakdown[]\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n Creator User @relation(fields: [creatorAddress], references: [address])\n creatorAddress String @db.Char(42)\n // Should probably be a 1 to 1 relation if we do not want to keep historic records\n CampaignStatus CampaignStatus[]\n\n @@unique([distributionChainId, campaignId])\n @@index([opportunityId], type: Hash)\n}\n\nmodel Chain {\n id Int @id\n name String\n icon String\n Explorer Explorer[]\n Campaigns Campaign[] @relation(\"compute\")\n Distribution Campaign[] @relation(\"distribution\")\n Token Token[]\n Opportunity Opportunity[]\n MerklRoot MerklRoot[]\n Blacklist Blacklist[]\n Dump Dump[]\n}\n\nmodel Explorer {\n id String @id\n type ExplorerType\n Chain Chain @relation(fields: [chainId], references: [id])\n url String\n chainId Int\n\n @@unique([type, chainId])\n}\n\nmodel Opportunity {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id]) // compute\n chainId Int // compute\n type CampaignType\n identifier String // eg. 0xUniswapPool - formerly mainParameter\n name String\n depositUrl String?\n status Status\n action OpportunityAction\n Tokens Token[]\n Campaigns Campaign[]\n Protocols Protocol[]\n MainProtocol Protocol? @relation(name: \"main\", fields: [mainProtocolId], references: [id])\n mainProtocolId String?\n tvl Float @default(0)\n TvlRecords TVLRecord[]\n apr Float @default(0)\n AprRecords AprRecord[]\n dailyRewards Float @default(0)\n DailyRewardsRecords DailyRewardsRecord[]\n tags String[] @default([])\n\n @@unique([chainId, type, identifier])\n}\n\nmodel Protocol {\n id String @id\n tags String[] @default([])\n name String\n description String @default(\"\")\n url String\n icon String\n MainOpportunities Opportunity[] @relation(name: \"main\")\n Opportunities Opportunity[]\n RewardBreakdown RewardBreakdown[]\n}\n\nmodel Token {\n id String @id()\n name String?\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n address String @db.Char(42)\n decimals Int\n symbol String\n displaySymbol String @default(\"\")\n icon String\n verified Boolean @default(false)\n isTest Boolean @default(false)\n price Float?\n Opportunity Opportunity[]\n Campaigns Campaign[]\n Reward Reward[]\n DumpTo Dump[] @relation(\"to\")\n DumpFrom Dump[] @relation(\"from\")\n\n @@unique([chainId, address])\n @@index([chainId], type: Hash)\n @@index([symbol, address])\n}\n\nmodel AprRecord {\n id String @id\n timestamp BigInt\n cumulated Float\n AprBreakdown AprBreakdown[]\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel AprBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type AprType\n value Float\n AprRecord AprRecord @relation(fields: [aprRecordId], references: [id])\n aprRecordId String\n\n @@index([aprRecordId], type: Hash)\n}\n\nmodel TVLRecord {\n id String @id\n timestamp BigInt\n total Float\n TvlBreakdown TVLBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel TVLBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type TvlType\n value Float\n\n TvlRecord TVLRecord @relation(fields: [tvlRecordId], references: [id])\n tvlRecordId String\n\n @@index([tvlRecordId], type: Hash)\n}\n\nmodel DailyRewardsRecord {\n id String @id\n timestamp BigInt\n total Float\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel DailyRewardsBreakdown {\n id Int @id @default(autoincrement())\n value Float\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n DailyRewardsRecord DailyRewardsRecord @relation(fields: [dailyRewardsRecordId], references: [id])\n dailyRewardsRecordId String\n\n @@index([dailyRewardsRecordId], type: Hash)\n}\n\nmodel User {\n address String @id @db.Char(42)\n Rewards Reward[]\n Blacklist Blacklist[]\n CampaignsCreated Campaign[]\n tags String[]\n}\n\nmodel Reward {\n id String @id\n MerklRoot MerklRoot @relation(fields: [root], references: [root])\n root String\n User User @relation(fields: [recipient], references: [address])\n recipient String @db.Char(42)\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String @default(\"0\")\n claimed String @default(\"0\")\n pending String @default(\"0\")\n proofs String[]\n Breakdown RewardBreakdown[]\n // Hidden index on ((CAST(amount AS INTEGER) + CAST(pending AS INTEGER)));\n\n @@unique([root, recipient, rewardTokenId])\n @@index([root], type: Hash)\n @@index([recipient, rewardTokenId])\n}\n\nmodel RewardBreakdown {\n id Int @id @default(autoincrement())\n Protocol Protocol? @relation(fields: [protocolId], references: [id])\n protocolId String?\n reason String\n amount String\n claimed String\n pending String\n auxiliaryData1 String?\n auxiliaryData2 String?\n Reward Reward @relation(fields: [rewardId], references: [id], onDelete: Cascade)\n rewardId String\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n // Hidden index on ((CAST(amount AS INTEGER) + CAST(pending AS INTEGER)));\n\n @@unique([rewardId, campaignId, reason])\n @@index([rewardId], type: Hash)\n @@index([campaignId], type: Hash)\n}\n\nmodel MerklRoot {\n root String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n epoch Int\n timestamp BigInt\n Rewards Reward[]\n\n @@index([chainId, root])\n}\n\nmodel PriceSource {\n id Int @id @default(autoincrement())\n symbol String @unique() // Price Id\n method PriceSourceMethod\n args Json?\n}\n\n// priceId -> number\n\nmodel Blacklist {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n poolAddress String @db.Char(42)\n User User @relation(fields: [userAddress], references: [address])\n userAddress String @db.Char(42)\n arrestTimestamp BigInt\n arrestDetails Json\n\n @@unique([chainId, userAddress, poolAddress])\n @@index([userAddress], type: Hash)\n}\n\nmodel Dump {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n FromToken Token @relation(name: \"from\", fields: [fromTokenId], references: [id])\n fromTokenId String\n ToToken Token @relation(name: \"to\", fields: [toTokenId], references: [id])\n toTokenId String\n multisig String @db.Char(42)\n recipient String @db.Char(42)\n amountIn String @default(\"0\")\n amountOut String @default(\"0\")\n datetime DateTime\n timestamp Int\n\n @@unique([chainId, fromTokenId, toTokenId, timestamp])\n}\n\nmodel CampaignStatus {\n campaignId String @id\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n computedUntil BigInt @default(0)\n processingStarted BigInt @default(0)\n status RunStatus @default(SUCCESS)\n error String @default(\"\")\n details Json @default(\"{}\")\n}\n\n// enums\n\nenum RunStatus {\n PROCESSING\n SUCCESS\n FAILED\n SKIPPED\n}\n\nenum CampaignType {\n INVALID\n ERC20\n CLAMM\n ERC20_SNAPSHOT\n JSON_AIRDROP\n SILO\n RADIANT\n MORPHO\n DOLOMITE\n BADGER\n COMPOUND\n AJNA\n EULER\n UNISWAP_V4\n ION\n EIGENLAYER\n ERC20TRANSFERS\n ERC20LOGPROCESSOR\n ERC20REBASELOGPROCESSOR\n VEST\n}\n\nenum OpportunityAction {\n POOL\n HOLD\n DROP\n LEND\n BORROW\n INVALID\n}\n\nenum Status {\n NONE\n PAST\n LIVE\n SOON\n}\n\nenum ExplorerType {\n ETHERSCAN\n BLOCKSCOUT\n}\n\nenum AprType {\n CAMPAIGN\n TOKEN\n PROTOCOL\n}\n\nenum TvlType {\n TOKEN\n PROTOCOL\n}\n\nenum PriceSourceMethod {\n COINGECKO\n CONSTANT\n EQUAL_TO\n ERC4626\n DEXSCREENER\n INDEXCOOP\n DEFILLAMA\n}\n",
|
598
|
+
"inlineSchemaHash": "5c873a3a97326d2d26442609b1e3ada0699280c893bd83a1517ae67e90c229eb",
|
599
599
|
"copyEngine": true
|
600
600
|
}
|
601
601
|
config.dirname = '/'
|
@@ -595,8 +595,8 @@ const config = {
|
|
595
595
|
}
|
596
596
|
}
|
597
597
|
},
|
598
|
-
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n binaryTargets = [\"native\", \"linux-arm64-openssl-1.1.x\", \"linux-musl-arm64-openssl-3.0.x\"]\n output = \".generated/\"\n previewFeatures = [\"fullTextSearchPostgres\", \"relationJoins\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_API_URL\")\n}\n\nmodel Campaign {\n id String @id\n ComputeChain Chain @relation(\"compute\", fields: [computeChainId], references: [id])\n computeChainId Int\n DistributionChain Chain @relation(\"distribution\", fields: [distributionChainId], references: [id])\n distributionChainId Int\n campaignId String\n type CampaignType\n subType Int?\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n startTimestamp BigInt\n endTimestamp BigInt\n params Json\n RewardBreakdown RewardBreakdown[]\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n Creator User @relation(fields: [creatorAddress], references: [address])\n creatorAddress String @db.Char(42)\n // Should probably be a 1 to 1 relation if we do not want to keep historic records\n CampaignStatus CampaignStatus[]\n\n @@unique([distributionChainId, campaignId])\n @@index([opportunityId], type: Hash)\n}\n\nmodel Chain {\n id Int @id\n name String\n icon String\n Explorer Explorer[]\n Campaigns Campaign[] @relation(\"compute\")\n Distribution Campaign[] @relation(\"distribution\")\n Token Token[]\n Opportunity Opportunity[]\n MerklRoot MerklRoot[]\n Blacklist Blacklist[]\n Dump Dump[]\n}\n\nmodel Explorer {\n id String @id\n type ExplorerType\n Chain Chain @relation(fields: [chainId], references: [id])\n url String\n chainId Int\n\n @@unique([type, chainId])\n}\n\nmodel Opportunity {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id]) // compute\n chainId Int // compute\n type CampaignType\n identifier String // eg. 0xUniswapPool - formerly mainParameter\n name String\n depositUrl String?\n status Status\n action OpportunityAction\n Tokens Token[]\n Campaigns Campaign[]\n Protocols Protocol[]\n MainProtocol Protocol? @relation(name: \"main\", fields: [mainProtocolId], references: [id])\n mainProtocolId String?\n tvl Float @default(0)\n TvlRecords TVLRecord[]\n apr Float @default(0)\n AprRecords AprRecord[]\n dailyRewards Float @default(0)\n DailyRewardsRecords DailyRewardsRecord[]\n tags String[] @default([])\n\n @@unique([chainId, type, identifier])\n}\n\nmodel Protocol {\n id String @id\n tags String[] @default([])\n name String\n description String @default(\"\")\n url String\n icon String\n MainOpportunities Opportunity[] @relation(name: \"main\")\n Opportunities Opportunity[]\n RewardBreakdown RewardBreakdown[]\n}\n\nmodel Token {\n id String @id()\n name String?\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n address String @db.Char(42)\n decimals Int\n symbol String\n displaySymbol String @default(\"\")\n icon String\n verified Boolean @default(false)\n isTest Boolean @default(false)\n price Float?\n Opportunity Opportunity[]\n Campaigns Campaign[]\n Reward Reward[]\n DumpTo Dump[] @relation(\"to\")\n DumpFrom Dump[] @relation(\"from\")\n\n @@unique([chainId, address])\n @@index([chainId], type: Hash)\n @@index([symbol, address])\n}\n\nmodel AprRecord {\n id String @id\n timestamp BigInt\n cumulated Float\n AprBreakdown AprBreakdown[]\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel AprBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type AprType\n value Float\n AprRecord AprRecord @relation(fields: [aprRecordId], references: [id])\n aprRecordId String\n\n @@index([aprRecordId], type: Hash)\n}\n\nmodel TVLRecord {\n id String @id\n timestamp BigInt\n total Float\n TvlBreakdown TVLBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel TVLBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type TvlType\n value Float\n\n TvlRecord TVLRecord @relation(fields: [tvlRecordId], references: [id])\n tvlRecordId String\n\n @@index([tvlRecordId], type: Hash)\n}\n\nmodel DailyRewardsRecord {\n id String @id\n timestamp BigInt\n total Float\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel DailyRewardsBreakdown {\n id Int @id @default(autoincrement())\n value Float\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n DailyRewardsRecord DailyRewardsRecord @relation(fields: [dailyRewardsRecordId], references: [id])\n dailyRewardsRecordId String\n\n @@index([dailyRewardsRecordId], type: Hash)\n}\n\nmodel User {\n address String @id @db.Char(42)\n Rewards Reward[]\n Blacklist Blacklist[]\n CampaignsCreated Campaign[]\n tags String[]\n}\n\nmodel Reward {\n id String @id\n MerklRoot MerklRoot @relation(fields: [root], references: [root])\n root String\n User User @relation(fields: [recipient], references: [address])\n recipient String @db.Char(42)\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String @default(\"0\")\n claimed String @default(\"0\")\n pending String @default(\"0\")\n proofs String[]\n Breakdown RewardBreakdown[]\n\n @@unique([root, recipient, rewardTokenId])\n @@index([root], type: Hash)\n @@index([recipient, rewardTokenId])\n}\n\nmodel RewardBreakdown {\n id Int @id @default(autoincrement())\n Protocol Protocol? @relation(fields: [protocolId], references: [id])\n protocolId String?\n reason String\n amount String\n claimed String\n pending String\n auxiliaryData1 String?\n auxiliaryData2 String?\n Reward Reward @relation(fields: [rewardId], references: [id], onDelete: Cascade)\n rewardId String\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n\n @@unique([rewardId, campaignId, reason])\n @@index([rewardId], type: Hash)\n @@index([campaignId], type: Hash)\n @@index([amount(sort: Desc)])\n}\n\nmodel MerklRoot {\n root String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n epoch Int\n timestamp BigInt\n Rewards Reward[]\n\n @@index([chainId, root])\n}\n\nmodel PriceSource {\n id Int @id @default(autoincrement())\n symbol String @unique() // Price Id\n method PriceSourceMethod\n args Json?\n}\n\n// priceId -> number\n\nmodel Blacklist {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n poolAddress String @db.Char(42)\n User User @relation(fields: [userAddress], references: [address])\n userAddress String @db.Char(42)\n arrestTimestamp BigInt\n arrestDetails Json\n\n @@unique([chainId, userAddress, poolAddress])\n @@index([userAddress], type: Hash)\n}\n\nmodel Dump {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n FromToken Token @relation(name: \"from\", fields: [fromTokenId], references: [id])\n fromTokenId String\n ToToken Token @relation(name: \"to\", fields: [toTokenId], references: [id])\n toTokenId String\n multisig String @db.Char(42)\n recipient String @db.Char(42)\n amountIn String @default(\"0\")\n amountOut String @default(\"0\")\n datetime DateTime\n timestamp Int\n\n @@unique([chainId, fromTokenId, toTokenId, timestamp])\n}\n\nmodel CampaignStatus {\n campaignId String @id\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n computedUntil BigInt @default(0)\n processingStarted BigInt @default(0)\n status RunStatus @default(SUCCESS)\n error String @default(\"\")\n details Json @default(\"{}\")\n}\n\n// enums\n\nenum RunStatus {\n PROCESSING\n SUCCESS\n FAILED\n SKIPPED\n}\n\nenum CampaignType {\n INVALID\n ERC20\n CLAMM\n ERC20_SNAPSHOT\n JSON_AIRDROP\n SILO\n RADIANT\n MORPHO\n DOLOMITE\n BADGER\n COMPOUND\n AJNA\n EULER\n UNISWAP_V4\n ION\n EIGENLAYER\n ERC20TRANSFERS\n ERC20LOGPROCESSOR\n ERC20REBASELOGPROCESSOR\n VEST\n}\n\nenum OpportunityAction {\n POOL\n HOLD\n DROP\n LEND\n BORROW\n INVALID\n}\n\nenum Status {\n NONE\n PAST\n LIVE\n SOON\n}\n\nenum ExplorerType {\n ETHERSCAN\n BLOCKSCOUT\n}\n\nenum AprType {\n CAMPAIGN\n TOKEN\n PROTOCOL\n}\n\nenum TvlType {\n TOKEN\n PROTOCOL\n}\n\nenum PriceSourceMethod {\n COINGECKO\n CONSTANT\n EQUAL_TO\n ERC4626\n DEXSCREENER\n INDEXCOOP\n DEFILLAMA\n}\n",
|
599
|
-
"inlineSchemaHash": "
|
598
|
+
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n binaryTargets = [\"native\", \"linux-arm64-openssl-1.1.x\", \"linux-musl-arm64-openssl-3.0.x\"]\n output = \".generated/\"\n previewFeatures = [\"fullTextSearchPostgres\", \"relationJoins\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_API_URL\")\n}\n\nmodel Campaign {\n id String @id\n ComputeChain Chain @relation(\"compute\", fields: [computeChainId], references: [id])\n computeChainId Int\n DistributionChain Chain @relation(\"distribution\", fields: [distributionChainId], references: [id])\n distributionChainId Int\n campaignId String\n type CampaignType\n subType Int?\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n startTimestamp BigInt\n endTimestamp BigInt\n params Json\n RewardBreakdown RewardBreakdown[]\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n Creator User @relation(fields: [creatorAddress], references: [address])\n creatorAddress String @db.Char(42)\n // Should probably be a 1 to 1 relation if we do not want to keep historic records\n CampaignStatus CampaignStatus[]\n\n @@unique([distributionChainId, campaignId])\n @@index([opportunityId], type: Hash)\n}\n\nmodel Chain {\n id Int @id\n name String\n icon String\n Explorer Explorer[]\n Campaigns Campaign[] @relation(\"compute\")\n Distribution Campaign[] @relation(\"distribution\")\n Token Token[]\n Opportunity Opportunity[]\n MerklRoot MerklRoot[]\n Blacklist Blacklist[]\n Dump Dump[]\n}\n\nmodel Explorer {\n id String @id\n type ExplorerType\n Chain Chain @relation(fields: [chainId], references: [id])\n url String\n chainId Int\n\n @@unique([type, chainId])\n}\n\nmodel Opportunity {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id]) // compute\n chainId Int // compute\n type CampaignType\n identifier String // eg. 0xUniswapPool - formerly mainParameter\n name String\n depositUrl String?\n status Status\n action OpportunityAction\n Tokens Token[]\n Campaigns Campaign[]\n Protocols Protocol[]\n MainProtocol Protocol? @relation(name: \"main\", fields: [mainProtocolId], references: [id])\n mainProtocolId String?\n tvl Float @default(0)\n TvlRecords TVLRecord[]\n apr Float @default(0)\n AprRecords AprRecord[]\n dailyRewards Float @default(0)\n DailyRewardsRecords DailyRewardsRecord[]\n tags String[] @default([])\n\n @@unique([chainId, type, identifier])\n}\n\nmodel Protocol {\n id String @id\n tags String[] @default([])\n name String\n description String @default(\"\")\n url String\n icon String\n MainOpportunities Opportunity[] @relation(name: \"main\")\n Opportunities Opportunity[]\n RewardBreakdown RewardBreakdown[]\n}\n\nmodel Token {\n id String @id()\n name String?\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n address String @db.Char(42)\n decimals Int\n symbol String\n displaySymbol String @default(\"\")\n icon String\n verified Boolean @default(false)\n isTest Boolean @default(false)\n price Float?\n Opportunity Opportunity[]\n Campaigns Campaign[]\n Reward Reward[]\n DumpTo Dump[] @relation(\"to\")\n DumpFrom Dump[] @relation(\"from\")\n\n @@unique([chainId, address])\n @@index([chainId], type: Hash)\n @@index([symbol, address])\n}\n\nmodel AprRecord {\n id String @id\n timestamp BigInt\n cumulated Float\n AprBreakdown AprBreakdown[]\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel AprBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type AprType\n value Float\n AprRecord AprRecord @relation(fields: [aprRecordId], references: [id])\n aprRecordId String\n\n @@index([aprRecordId], type: Hash)\n}\n\nmodel TVLRecord {\n id String @id\n timestamp BigInt\n total Float\n TvlBreakdown TVLBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel TVLBreakdown {\n id Int @id @default(autoincrement())\n identifier String\n type TvlType\n value Float\n\n TvlRecord TVLRecord @relation(fields: [tvlRecordId], references: [id])\n tvlRecordId String\n\n @@index([tvlRecordId], type: Hash)\n}\n\nmodel DailyRewardsRecord {\n id String @id\n timestamp BigInt\n total Float\n DailyRewardsBreakdown DailyRewardsBreakdown[]\n\n Opportunity Opportunity @relation(fields: [opportunityId], references: [id])\n opportunityId String\n\n @@unique([opportunityId, timestamp])\n @@index([opportunityId, timestamp(sort: Desc)])\n}\n\nmodel DailyRewardsBreakdown {\n id Int @id @default(autoincrement())\n value Float\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n DailyRewardsRecord DailyRewardsRecord @relation(fields: [dailyRewardsRecordId], references: [id])\n dailyRewardsRecordId String\n\n @@index([dailyRewardsRecordId], type: Hash)\n}\n\nmodel User {\n address String @id @db.Char(42)\n Rewards Reward[]\n Blacklist Blacklist[]\n CampaignsCreated Campaign[]\n tags String[]\n}\n\nmodel Reward {\n id String @id\n MerklRoot MerklRoot @relation(fields: [root], references: [root])\n root String\n User User @relation(fields: [recipient], references: [address])\n recipient String @db.Char(42)\n RewardToken Token @relation(fields: [rewardTokenId], references: [id])\n rewardTokenId String\n amount String @default(\"0\")\n claimed String @default(\"0\")\n pending String @default(\"0\")\n proofs String[]\n Breakdown RewardBreakdown[]\n // Hidden index on ((CAST(amount AS INTEGER) + CAST(pending AS INTEGER)));\n\n @@unique([root, recipient, rewardTokenId])\n @@index([root], type: Hash)\n @@index([recipient, rewardTokenId])\n}\n\nmodel RewardBreakdown {\n id Int @id @default(autoincrement())\n Protocol Protocol? @relation(fields: [protocolId], references: [id])\n protocolId String?\n reason String\n amount String\n claimed String\n pending String\n auxiliaryData1 String?\n auxiliaryData2 String?\n Reward Reward @relation(fields: [rewardId], references: [id], onDelete: Cascade)\n rewardId String\n campaignId String\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n // Hidden index on ((CAST(amount AS INTEGER) + CAST(pending AS INTEGER)));\n\n @@unique([rewardId, campaignId, reason])\n @@index([rewardId], type: Hash)\n @@index([campaignId], type: Hash)\n}\n\nmodel MerklRoot {\n root String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n epoch Int\n timestamp BigInt\n Rewards Reward[]\n\n @@index([chainId, root])\n}\n\nmodel PriceSource {\n id Int @id @default(autoincrement())\n symbol String @unique() // Price Id\n method PriceSourceMethod\n args Json?\n}\n\n// priceId -> number\n\nmodel Blacklist {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n poolAddress String @db.Char(42)\n User User @relation(fields: [userAddress], references: [address])\n userAddress String @db.Char(42)\n arrestTimestamp BigInt\n arrestDetails Json\n\n @@unique([chainId, userAddress, poolAddress])\n @@index([userAddress], type: Hash)\n}\n\nmodel Dump {\n id String @id\n Chain Chain @relation(fields: [chainId], references: [id])\n chainId Int\n FromToken Token @relation(name: \"from\", fields: [fromTokenId], references: [id])\n fromTokenId String\n ToToken Token @relation(name: \"to\", fields: [toTokenId], references: [id])\n toTokenId String\n multisig String @db.Char(42)\n recipient String @db.Char(42)\n amountIn String @default(\"0\")\n amountOut String @default(\"0\")\n datetime DateTime\n timestamp Int\n\n @@unique([chainId, fromTokenId, toTokenId, timestamp])\n}\n\nmodel CampaignStatus {\n campaignId String @id\n Campaign Campaign @relation(fields: [campaignId], references: [id])\n computedUntil BigInt @default(0)\n processingStarted BigInt @default(0)\n status RunStatus @default(SUCCESS)\n error String @default(\"\")\n details Json @default(\"{}\")\n}\n\n// enums\n\nenum RunStatus {\n PROCESSING\n SUCCESS\n FAILED\n SKIPPED\n}\n\nenum CampaignType {\n INVALID\n ERC20\n CLAMM\n ERC20_SNAPSHOT\n JSON_AIRDROP\n SILO\n RADIANT\n MORPHO\n DOLOMITE\n BADGER\n COMPOUND\n AJNA\n EULER\n UNISWAP_V4\n ION\n EIGENLAYER\n ERC20TRANSFERS\n ERC20LOGPROCESSOR\n ERC20REBASELOGPROCESSOR\n VEST\n}\n\nenum OpportunityAction {\n POOL\n HOLD\n DROP\n LEND\n BORROW\n INVALID\n}\n\nenum Status {\n NONE\n PAST\n LIVE\n SOON\n}\n\nenum ExplorerType {\n ETHERSCAN\n BLOCKSCOUT\n}\n\nenum AprType {\n CAMPAIGN\n TOKEN\n PROTOCOL\n}\n\nenum TvlType {\n TOKEN\n PROTOCOL\n}\n\nenum PriceSourceMethod {\n COINGECKO\n CONSTANT\n EQUAL_TO\n ERC4626\n DEXSCREENER\n INDEXCOOP\n DEFILLAMA\n}\n",
|
599
|
+
"inlineSchemaHash": "5c873a3a97326d2d26442609b1e3ada0699280c893bd83a1517ae67e90c229eb",
|
600
600
|
"copyEngine": true
|
601
601
|
}
|
602
602
|
|
@@ -217,6 +217,7 @@ model Reward {
|
|
217
217
|
pending String @default("0")
|
218
218
|
proofs String[]
|
219
219
|
Breakdown RewardBreakdown[]
|
220
|
+
// Hidden index on ((CAST(amount AS INTEGER) + CAST(pending AS INTEGER)));
|
220
221
|
|
221
222
|
@@unique([root, recipient, rewardTokenId])
|
222
223
|
@@index([root], type: Hash)
|
@@ -237,11 +238,11 @@ model RewardBreakdown {
|
|
237
238
|
rewardId String
|
238
239
|
campaignId String
|
239
240
|
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
241
|
+
// Hidden index on ((CAST(amount AS INTEGER) + CAST(pending AS INTEGER)));
|
240
242
|
|
241
243
|
@@unique([rewardId, campaignId, reason])
|
242
244
|
@@index([rewardId], type: Hash)
|
243
245
|
@@index([campaignId], type: Hash)
|
244
|
-
@@index([amount(sort: Desc)])
|
245
246
|
}
|
246
247
|
|
247
248
|
model MerklRoot {
|
package/dist/src/eden/index.d.ts
CHANGED
@@ -1097,18 +1097,20 @@ declare const eden: {
|
|
1097
1097
|
count: number;
|
1098
1098
|
};
|
1099
1099
|
}>>;
|
1100
|
-
|
1100
|
+
chain: {
|
1101
1101
|
get: (options: {
|
1102
1102
|
headers: {
|
1103
1103
|
authorization: string;
|
1104
1104
|
};
|
1105
|
-
query
|
1105
|
+
query: {
|
1106
|
+
chainId: number;
|
1107
|
+
};
|
1106
1108
|
fetch?: RequestInit | undefined;
|
1107
1109
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1108
1110
|
200: {
|
1109
1111
|
[x: string]: {
|
1110
|
-
|
1111
|
-
|
1112
|
+
rewardCount: number;
|
1113
|
+
breakdownCount: number;
|
1112
1114
|
};
|
1113
1115
|
};
|
1114
1116
|
}>>;
|
@@ -2250,6 +2252,26 @@ declare const eden: {
|
|
2250
2252
|
200: any;
|
2251
2253
|
}>>;
|
2252
2254
|
};
|
2255
|
+
campaignData: {
|
2256
|
+
get: (options: {
|
2257
|
+
headers?: Record<string, unknown> | undefined;
|
2258
|
+
query: {
|
2259
|
+
creator: string;
|
2260
|
+
startTimestamp: number;
|
2261
|
+
endTimestamp: number;
|
2262
|
+
campaign: string;
|
2263
|
+
distributionChainId: number;
|
2264
|
+
amount: string;
|
2265
|
+
rewardToken: string;
|
2266
|
+
program: string;
|
2267
|
+
};
|
2268
|
+
fetch?: RequestInit | undefined;
|
2269
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2270
|
+
200: {
|
2271
|
+
args: any;
|
2272
|
+
};
|
2273
|
+
}>>;
|
2274
|
+
};
|
2253
2275
|
program: {
|
2254
2276
|
get: (options: {
|
2255
2277
|
headers?: Record<string, unknown> | undefined;
|
@@ -2267,6 +2289,26 @@ declare const eden: {
|
|
2267
2289
|
[x: string]: any;
|
2268
2290
|
200: any;
|
2269
2291
|
}>>;
|
2292
|
+
withAmounts: {
|
2293
|
+
post: (body: {
|
2294
|
+
[x: string]: string;
|
2295
|
+
}, options: {
|
2296
|
+
headers?: Record<string, unknown> | undefined;
|
2297
|
+
query: {
|
2298
|
+
amount?: string | undefined;
|
2299
|
+
creator: string;
|
2300
|
+
startTimestamp: number;
|
2301
|
+
endTimestamp: number;
|
2302
|
+
distributionChainId: number;
|
2303
|
+
rewardToken: string;
|
2304
|
+
program: string;
|
2305
|
+
};
|
2306
|
+
fetch?: RequestInit | undefined;
|
2307
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2308
|
+
[x: string]: any;
|
2309
|
+
200: any;
|
2310
|
+
}>>;
|
2311
|
+
};
|
2270
2312
|
};
|
2271
2313
|
};
|
2272
2314
|
boosts: {
|
@@ -4359,19 +4401,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4359
4401
|
};
|
4360
4402
|
} & {
|
4361
4403
|
count: {
|
4362
|
-
|
4404
|
+
chain: {
|
4363
4405
|
get: {
|
4364
4406
|
body: unknown;
|
4365
4407
|
params: {};
|
4366
|
-
query:
|
4408
|
+
query: {
|
4409
|
+
chainId: number;
|
4410
|
+
};
|
4367
4411
|
headers: {
|
4368
4412
|
authorization: string;
|
4369
4413
|
};
|
4370
4414
|
response: {
|
4371
4415
|
200: {
|
4372
4416
|
[x: string]: {
|
4373
|
-
|
4374
|
-
|
4417
|
+
rewardCount: number;
|
4418
|
+
breakdownCount: number;
|
4375
4419
|
};
|
4376
4420
|
};
|
4377
4421
|
};
|
@@ -5677,6 +5721,31 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5677
5721
|
};
|
5678
5722
|
};
|
5679
5723
|
};
|
5724
|
+
} & {
|
5725
|
+
"program-payload": {
|
5726
|
+
campaignData: {
|
5727
|
+
get: {
|
5728
|
+
body: unknown;
|
5729
|
+
params: {};
|
5730
|
+
query: {
|
5731
|
+
creator: string;
|
5732
|
+
startTimestamp: number;
|
5733
|
+
endTimestamp: number;
|
5734
|
+
campaign: string;
|
5735
|
+
distributionChainId: number;
|
5736
|
+
amount: string;
|
5737
|
+
rewardToken: string;
|
5738
|
+
program: string;
|
5739
|
+
};
|
5740
|
+
headers: unknown;
|
5741
|
+
response: {
|
5742
|
+
200: {
|
5743
|
+
args: any;
|
5744
|
+
};
|
5745
|
+
};
|
5746
|
+
};
|
5747
|
+
};
|
5748
|
+
};
|
5680
5749
|
} & {
|
5681
5750
|
"program-payload": {
|
5682
5751
|
program: {
|
@@ -5700,6 +5769,33 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5700
5769
|
};
|
5701
5770
|
};
|
5702
5771
|
};
|
5772
|
+
} & {
|
5773
|
+
"program-payload": {
|
5774
|
+
program: {
|
5775
|
+
withAmounts: {
|
5776
|
+
post: {
|
5777
|
+
body: {
|
5778
|
+
[x: string]: string;
|
5779
|
+
};
|
5780
|
+
params: {};
|
5781
|
+
query: {
|
5782
|
+
amount?: string | undefined;
|
5783
|
+
creator: string;
|
5784
|
+
startTimestamp: number;
|
5785
|
+
endTimestamp: number;
|
5786
|
+
distributionChainId: number;
|
5787
|
+
rewardToken: string;
|
5788
|
+
program: string;
|
5789
|
+
};
|
5790
|
+
headers: unknown;
|
5791
|
+
response: {
|
5792
|
+
[x: string]: any;
|
5793
|
+
200: any;
|
5794
|
+
};
|
5795
|
+
};
|
5796
|
+
};
|
5797
|
+
};
|
5798
|
+
};
|
5703
5799
|
};
|
5704
5800
|
} & {
|
5705
5801
|
v4: {
|
@@ -7582,18 +7678,20 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7582
7678
|
count: number;
|
7583
7679
|
};
|
7584
7680
|
}>>;
|
7585
|
-
|
7681
|
+
chain: {
|
7586
7682
|
get: (options: {
|
7587
7683
|
headers: {
|
7588
7684
|
authorization: string;
|
7589
7685
|
};
|
7590
|
-
query
|
7686
|
+
query: {
|
7687
|
+
chainId: number;
|
7688
|
+
};
|
7591
7689
|
fetch?: RequestInit | undefined;
|
7592
7690
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7593
7691
|
200: {
|
7594
7692
|
[x: string]: {
|
7595
|
-
|
7596
|
-
|
7693
|
+
rewardCount: number;
|
7694
|
+
breakdownCount: number;
|
7597
7695
|
};
|
7598
7696
|
};
|
7599
7697
|
}>>;
|
@@ -8735,6 +8833,26 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8735
8833
|
200: any;
|
8736
8834
|
}>>;
|
8737
8835
|
};
|
8836
|
+
campaignData: {
|
8837
|
+
get: (options: {
|
8838
|
+
headers?: Record<string, unknown> | undefined;
|
8839
|
+
query: {
|
8840
|
+
creator: string;
|
8841
|
+
startTimestamp: number;
|
8842
|
+
endTimestamp: number;
|
8843
|
+
campaign: string;
|
8844
|
+
distributionChainId: number;
|
8845
|
+
amount: string;
|
8846
|
+
rewardToken: string;
|
8847
|
+
program: string;
|
8848
|
+
};
|
8849
|
+
fetch?: RequestInit | undefined;
|
8850
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8851
|
+
200: {
|
8852
|
+
args: any;
|
8853
|
+
};
|
8854
|
+
}>>;
|
8855
|
+
};
|
8738
8856
|
program: {
|
8739
8857
|
get: (options: {
|
8740
8858
|
headers?: Record<string, unknown> | undefined;
|
@@ -8752,6 +8870,26 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8752
8870
|
[x: string]: any;
|
8753
8871
|
200: any;
|
8754
8872
|
}>>;
|
8873
|
+
withAmounts: {
|
8874
|
+
post: (body: {
|
8875
|
+
[x: string]: string;
|
8876
|
+
}, options: {
|
8877
|
+
headers?: Record<string, unknown> | undefined;
|
8878
|
+
query: {
|
8879
|
+
amount?: string | undefined;
|
8880
|
+
creator: string;
|
8881
|
+
startTimestamp: number;
|
8882
|
+
endTimestamp: number;
|
8883
|
+
distributionChainId: number;
|
8884
|
+
rewardToken: string;
|
8885
|
+
program: string;
|
8886
|
+
};
|
8887
|
+
fetch?: RequestInit | undefined;
|
8888
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8889
|
+
[x: string]: any;
|
8890
|
+
200: any;
|
8891
|
+
}>>;
|
8892
|
+
};
|
8755
8893
|
};
|
8756
8894
|
};
|
8757
8895
|
boosts: {
|
package/dist/src/index.d.ts
CHANGED
@@ -1486,19 +1486,21 @@ declare const app: Elysia<"", false, {
|
|
1486
1486
|
};
|
1487
1487
|
} & {
|
1488
1488
|
count: {
|
1489
|
-
|
1489
|
+
chain: {
|
1490
1490
|
get: {
|
1491
1491
|
body: unknown;
|
1492
1492
|
params: {};
|
1493
|
-
query:
|
1493
|
+
query: {
|
1494
|
+
chainId: number;
|
1495
|
+
};
|
1494
1496
|
headers: {
|
1495
1497
|
authorization: string;
|
1496
1498
|
};
|
1497
1499
|
response: {
|
1498
1500
|
200: {
|
1499
1501
|
[x: string]: {
|
1500
|
-
|
1501
|
-
|
1502
|
+
rewardCount: number;
|
1503
|
+
breakdownCount: number;
|
1502
1504
|
};
|
1503
1505
|
};
|
1504
1506
|
};
|
@@ -2804,6 +2806,31 @@ declare const app: Elysia<"", false, {
|
|
2804
2806
|
};
|
2805
2807
|
};
|
2806
2808
|
};
|
2809
|
+
} & {
|
2810
|
+
"program-payload": {
|
2811
|
+
campaignData: {
|
2812
|
+
get: {
|
2813
|
+
body: unknown;
|
2814
|
+
params: {};
|
2815
|
+
query: {
|
2816
|
+
creator: string;
|
2817
|
+
startTimestamp: number;
|
2818
|
+
endTimestamp: number;
|
2819
|
+
campaign: string;
|
2820
|
+
distributionChainId: number;
|
2821
|
+
amount: string;
|
2822
|
+
rewardToken: string;
|
2823
|
+
program: string;
|
2824
|
+
};
|
2825
|
+
headers: unknown;
|
2826
|
+
response: {
|
2827
|
+
200: {
|
2828
|
+
args: any;
|
2829
|
+
};
|
2830
|
+
};
|
2831
|
+
};
|
2832
|
+
};
|
2833
|
+
};
|
2807
2834
|
} & {
|
2808
2835
|
"program-payload": {
|
2809
2836
|
program: {
|
@@ -2827,6 +2854,33 @@ declare const app: Elysia<"", false, {
|
|
2827
2854
|
};
|
2828
2855
|
};
|
2829
2856
|
};
|
2857
|
+
} & {
|
2858
|
+
"program-payload": {
|
2859
|
+
program: {
|
2860
|
+
withAmounts: {
|
2861
|
+
post: {
|
2862
|
+
body: {
|
2863
|
+
[x: string]: string;
|
2864
|
+
};
|
2865
|
+
params: {};
|
2866
|
+
query: {
|
2867
|
+
amount?: string | undefined;
|
2868
|
+
creator: string;
|
2869
|
+
startTimestamp: number;
|
2870
|
+
endTimestamp: number;
|
2871
|
+
distributionChainId: number;
|
2872
|
+
rewardToken: string;
|
2873
|
+
program: string;
|
2874
|
+
};
|
2875
|
+
headers: unknown;
|
2876
|
+
response: {
|
2877
|
+
[x: string]: any;
|
2878
|
+
200: any;
|
2879
|
+
};
|
2880
|
+
};
|
2881
|
+
};
|
2882
|
+
};
|
2883
|
+
};
|
2830
2884
|
};
|
2831
2885
|
} & {
|
2832
2886
|
v4: {
|
@@ -4,7 +4,7 @@ import { ExplorerService } from ".";
|
|
4
4
|
import { CreateExplorerDto } from "./explorer.model";
|
5
5
|
// ─── Explorer Controller ───────────────────────────────────────────────────────
|
6
6
|
export const ExplorerController = new Elysia({ prefix: "/explorers", detail: { tags: ["Explorers"] } })
|
7
|
-
// ─── Create An Explorer
|
7
|
+
// ─── Create An Explorer ──────────────────────────────────────────────────────
|
8
8
|
.post("", async ({ body }) => await ExplorerService.create(body), {
|
9
9
|
beforeHandle: BackOfficeGuard,
|
10
10
|
headers: AuthorizationHeadersDto,
|
@@ -59,6 +59,31 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
59
59
|
};
|
60
60
|
};
|
61
61
|
};
|
62
|
+
} & {
|
63
|
+
"program-payload": {
|
64
|
+
campaignData: {
|
65
|
+
get: {
|
66
|
+
body: unknown;
|
67
|
+
params: {};
|
68
|
+
query: {
|
69
|
+
creator: string;
|
70
|
+
startTimestamp: number;
|
71
|
+
endTimestamp: number;
|
72
|
+
campaign: string;
|
73
|
+
distributionChainId: number;
|
74
|
+
amount: string;
|
75
|
+
rewardToken: string;
|
76
|
+
program: string;
|
77
|
+
};
|
78
|
+
headers: unknown;
|
79
|
+
response: {
|
80
|
+
200: {
|
81
|
+
args: any;
|
82
|
+
};
|
83
|
+
};
|
84
|
+
};
|
85
|
+
};
|
86
|
+
};
|
62
87
|
} & {
|
63
88
|
"program-payload": {
|
64
89
|
program: {
|
@@ -82,6 +107,33 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
82
107
|
};
|
83
108
|
};
|
84
109
|
};
|
110
|
+
} & {
|
111
|
+
"program-payload": {
|
112
|
+
program: {
|
113
|
+
withAmounts: {
|
114
|
+
post: {
|
115
|
+
body: {
|
116
|
+
[x: string]: string;
|
117
|
+
};
|
118
|
+
params: {};
|
119
|
+
query: {
|
120
|
+
amount?: string | undefined;
|
121
|
+
creator: string;
|
122
|
+
startTimestamp: number;
|
123
|
+
endTimestamp: number;
|
124
|
+
distributionChainId: number;
|
125
|
+
rewardToken: string;
|
126
|
+
program: string;
|
127
|
+
};
|
128
|
+
headers: unknown;
|
129
|
+
response: {
|
130
|
+
[x: string]: any;
|
131
|
+
200: any;
|
132
|
+
};
|
133
|
+
};
|
134
|
+
};
|
135
|
+
};
|
136
|
+
};
|
85
137
|
}, {
|
86
138
|
derive: {};
|
87
139
|
resolve: {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
2
|
import Elysia from "elysia";
|
3
3
|
import { throwOnUnsupportedChainId } from "src/utils/throw";
|
4
|
-
import { CampaignPayloadInputDto, ProgramPayloadInputDto } from "./programPayload.model";
|
4
|
+
import { CampaignAmountsInputDto, CampaignPayloadInputDto, ProgramPayloadInputDto } from "./programPayload.model";
|
5
5
|
import { ProgramPayloadService } from "./programPayload.service";
|
6
6
|
// ─── ProgramPaylod Controller ───────────────────────────────────────────────────────
|
7
7
|
export const ProgramPayloadController = new Elysia({ prefix: "/program-payload", detail: { tags: ["ProgramPayload"] } })
|
@@ -25,6 +25,16 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
|
|
25
25
|
// BackOfficeGuard({ headers });
|
26
26
|
throwOnUnsupportedChainId(query.distributionChainId);
|
27
27
|
},
|
28
|
+
})
|
29
|
+
.get("/campaignData", async ({ query }) => {
|
30
|
+
return ProgramPayloadService.buildCampaignData(query);
|
31
|
+
}, {
|
32
|
+
query: CampaignPayloadInputDto,
|
33
|
+
// headers: AuthorizationHeadersDto,
|
34
|
+
beforeHandle: ({ query, headers }) => {
|
35
|
+
// BackOfficeGuard({ headers });
|
36
|
+
throwOnUnsupportedChainId(query.distributionChainId);
|
37
|
+
},
|
28
38
|
})
|
29
39
|
.get("/program", async ({ query }) => {
|
30
40
|
return ProgramPayloadService.buildProgramPayload(query);
|
@@ -35,18 +45,13 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
|
|
35
45
|
// BackOfficeGuard({ headers });
|
36
46
|
throwOnUnsupportedChainId(query.distributionChainId);
|
37
47
|
},
|
48
|
+
})
|
49
|
+
.post("/program/withAmounts", async ({ query, body }) => {
|
50
|
+
return ProgramPayloadService.buildProgramPayloadWithAmounts(query, body);
|
51
|
+
}, {
|
52
|
+
query: ProgramPayloadInputDto,
|
53
|
+
body: CampaignAmountsInputDto,
|
54
|
+
beforeHandle: ({ query }) => {
|
55
|
+
throwOnUnsupportedChainId(query.distributionChainId);
|
56
|
+
},
|
38
57
|
});
|
39
|
-
// TO DO FIX
|
40
|
-
// .get(
|
41
|
-
// "/program/withAmounts",
|
42
|
-
// async ({ query, body }) => {
|
43
|
-
// return ProgramPayloadService.buildProgramPayloadWithAmounts(query, body);
|
44
|
-
// },
|
45
|
-
// {
|
46
|
-
// query: ProgramPayloadInputDto,
|
47
|
-
// body: CampaignAmountsInputDto,
|
48
|
-
// beforeHandle: ({ query }) => {
|
49
|
-
// throwOnUnsupportedChainId(query.distributionChainId);
|
50
|
-
// },
|
51
|
-
// }
|
52
|
-
// )
|
@@ -21,6 +21,7 @@ export declare const ProgramPayloadInputDto: import("@sinclair/typebox").TObject
|
|
21
21
|
export declare const CampaignAmountsInputDto: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
22
22
|
export type CampaignPayloadInputModel = typeof CampaignPayloadInputDto.static;
|
23
23
|
export type ProgramPayloadInputModel = typeof ProgramPayloadInputDto.static;
|
24
|
+
export type CampaignAmountsInputModel = typeof CampaignAmountsInputDto.static;
|
24
25
|
export type partialConfigERC20 = {
|
25
26
|
computeChainId?: MerklChainId;
|
26
27
|
hooks?: (HookParameters<HOOK> | string)[];
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import { type Campaign, type campaignConfig } from "@sdk";
|
2
|
-
import { type CampaignPayloadInputModel, type ProgramPayloadInputModel } from "./programPayload.model";
|
2
|
+
import { type CampaignAmountsInputModel, type CampaignPayloadInputModel, type ProgramPayloadInputModel } from "./programPayload.model";
|
3
3
|
export declare class ProgramPayloadService {
|
4
4
|
static buildConfig(query: CampaignPayloadInputModel): campaignConfig<Campaign>;
|
5
5
|
/** building payload for a single campaign */
|
6
|
+
static buildCampaignData(query: CampaignPayloadInputModel): {
|
7
|
+
args: any;
|
8
|
+
};
|
6
9
|
static buildPayload(query: CampaignPayloadInputModel, initialCampaignPayload?: null): any;
|
7
10
|
static buildProgramPayload(query: ProgramPayloadInputModel): any;
|
11
|
+
static buildProgramPayloadWithAmounts(query: ProgramPayloadInputModel, body: CampaignAmountsInputModel): any;
|
8
12
|
}
|