@merkl/api 0.10.154 → 0.10.156

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/dist/database/api/.generated/edge.js +2 -2
  2. package/dist/database/api/.generated/index.js +2 -2
  3. package/dist/database/api/.generated/package.json +1 -1
  4. package/dist/database/api/.generated/schema.prisma +1 -0
  5. package/dist/src/eden/index.d.ts +51 -3
  6. package/dist/src/index.d.ts +17 -1
  7. package/dist/src/index.js +1 -25
  8. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +8 -0
  9. package/dist/src/modules/v4/campaign/campaign.model.d.ts +3 -1
  10. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +8 -0
  11. package/dist/src/modules/v4/campaign/campaign.repository.js +1 -0
  12. package/dist/src/modules/v4/campaign/campaign.service.d.ts +16 -0
  13. package/dist/src/modules/v4/campaign/campaign.service.js +4 -2
  14. package/dist/src/modules/v4/chain/chain.model.d.ts +1 -1
  15. package/dist/src/modules/v4/chain/chain.model.js +4 -1
  16. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +8 -0
  17. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +32 -0
  18. package/dist/src/modules/v4/opportunity/opportunity.repository.js +13 -2
  19. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +8 -0
  20. package/dist/src/modules/v4/router.d.ts +17 -1
  21. package/dist/src/modules/v4/status/status.model.d.ts +3 -2
  22. package/dist/src/modules/v4/user/user.controller.d.ts +1 -1
  23. package/dist/src/routes/v3/ERC20Campaigns.d.ts +17 -1
  24. package/dist/src/routes/v3/blacklist.d.ts +17 -1
  25. package/dist/src/routes/v3/campaigns.d.ts +18 -2
  26. package/dist/src/routes/v3/campaignsInfo.d.ts +17 -1
  27. package/dist/src/routes/v3/multiChainPositions.d.ts +17 -1
  28. package/dist/src/routes/v3/opportunity.d.ts +17 -1
  29. package/dist/src/routes/v3/positions.d.ts +17 -1
  30. package/dist/src/routes/v3/rewards.d.ts +17 -1
  31. package/dist/src/routes/v3/updates.d.ts +17 -1
  32. package/dist/src/routes/v3/userRewards.d.ts +17 -1
  33. package/dist/tsconfig.package.tsbuildinfo +1 -1
  34. package/package.json +1 -1
@@ -584,8 +584,8 @@ const config = {
584
584
  }
585
585
  }
586
586
  },
587
- "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\", \"tracing\"]\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 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 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 ProtocolTag[]\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 icon String\n verified 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 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}\n\nenum ProtocolTag {\n AMM\n ALM\n DEX\n LENDING\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",
588
- "inlineSchemaHash": "3aa6c07271bc09d5c825edde5800f9571a702d8e6bf30900de1634c0f880b777",
587
+ "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\", \"tracing\"]\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 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 ProtocolTag[]\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 icon String\n verified 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 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}\n\nenum ProtocolTag {\n AMM\n ALM\n DEX\n LENDING\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",
588
+ "inlineSchemaHash": "677b04d3fd42c8be466a758243e5821b1c608b4aa854c3e534ac7a1aeef08cd3",
589
589
  "copyEngine": true
590
590
  }
591
591
  config.dirname = '/'
@@ -585,8 +585,8 @@ const config = {
585
585
  }
586
586
  }
587
587
  },
588
- "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\", \"tracing\"]\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 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 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 ProtocolTag[]\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 icon String\n verified 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 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}\n\nenum ProtocolTag {\n AMM\n ALM\n DEX\n LENDING\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",
589
- "inlineSchemaHash": "3aa6c07271bc09d5c825edde5800f9571a702d8e6bf30900de1634c0f880b777",
588
+ "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\", \"tracing\"]\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 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 ProtocolTag[]\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 icon String\n verified 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 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}\n\nenum ProtocolTag {\n AMM\n ALM\n DEX\n LENDING\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",
589
+ "inlineSchemaHash": "677b04d3fd42c8be466a758243e5821b1c608b4aa854c3e534ac7a1aeef08cd3",
590
590
  "copyEngine": true
591
591
  }
592
592
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-3acc656527e81e787b21b82c86521adf2c7da64cb6edd622ea50e3ab94e2fdb4",
2
+ "name": "prisma-client-06c75f2e09fdf91bac4e83ac2b5edc582e2e9dfa8b8f6cb4126769f5bacebd4b",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -31,6 +31,7 @@ model Campaign {
31
31
  DailyRewardsBreakdown DailyRewardsBreakdown[]
32
32
  Creator User @relation(fields: [creatorAddress], references: [address])
33
33
  creatorAddress String @db.Char(42)
34
+ // Should probably be a 1 to 1 relation if we do not want to keep historic records
34
35
  CampaignStatus CampaignStatus[]
35
36
 
36
37
  @@unique([distributionChainId, campaignId])
@@ -215,6 +215,14 @@ declare const eden: {
215
215
  id: number;
216
216
  icon: string;
217
217
  } | undefined;
218
+ campaignStatus: {
219
+ error: string;
220
+ details: import("database/api/.generated/runtime/library").JsonValue;
221
+ status: import("../../database/api/.generated").$Enums.RunStatus;
222
+ campaignId: string;
223
+ computedUntil: bigint;
224
+ processingStarted: bigint;
225
+ };
218
226
  type: import("../../database/api/.generated").$Enums.CampaignType;
219
227
  id: string;
220
228
  subType: number | null;
@@ -487,6 +495,14 @@ declare const eden: {
487
495
  id: number;
488
496
  icon: string;
489
497
  } | undefined;
498
+ campaignStatus: {
499
+ error: string;
500
+ details: import("database/api/.generated/runtime/library").JsonValue;
501
+ status: import("../../database/api/.generated").$Enums.RunStatus;
502
+ campaignId: string;
503
+ computedUntil: bigint;
504
+ processingStarted: bigint;
505
+ };
490
506
  type: import("../../database/api/.generated").$Enums.CampaignType;
491
507
  id: string;
492
508
  subType: number | null;
@@ -1226,7 +1242,7 @@ declare const eden: {
1226
1242
  get: (options: {
1227
1243
  headers?: Record<string, unknown> | undefined;
1228
1244
  query: {
1229
- chainId: number | number[];
1245
+ chainId: number[];
1230
1246
  };
1231
1247
  fetch?: RequestInit | undefined;
1232
1248
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -2044,6 +2060,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2044
2060
  id: number;
2045
2061
  icon: string;
2046
2062
  } | undefined;
2063
+ campaignStatus: {
2064
+ error: string;
2065
+ details: import("database/api/.generated/runtime/library").JsonValue;
2066
+ status: import("../../database/api/.generated").$Enums.RunStatus;
2067
+ campaignId: string;
2068
+ computedUntil: bigint;
2069
+ processingStarted: bigint;
2070
+ };
2047
2071
  type: import("../../database/api/.generated").$Enums.CampaignType;
2048
2072
  id: string;
2049
2073
  subType: number | null;
@@ -2321,6 +2345,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2321
2345
  id: number;
2322
2346
  icon: string;
2323
2347
  } | undefined;
2348
+ campaignStatus: {
2349
+ error: string;
2350
+ details: import("database/api/.generated/runtime/library").JsonValue;
2351
+ status: import("../../database/api/.generated").$Enums.RunStatus;
2352
+ campaignId: string;
2353
+ computedUntil: bigint;
2354
+ processingStarted: bigint;
2355
+ };
2324
2356
  type: import("../../database/api/.generated").$Enums.CampaignType;
2325
2357
  id: string;
2326
2358
  subType: number | null;
@@ -3319,7 +3351,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3319
3351
  address: string;
3320
3352
  };
3321
3353
  query: {
3322
- chainId: number | number[];
3354
+ chainId: number[];
3323
3355
  };
3324
3356
  headers: unknown;
3325
3357
  response: {
@@ -4174,6 +4206,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4174
4206
  id: number;
4175
4207
  icon: string;
4176
4208
  } | undefined;
4209
+ campaignStatus: {
4210
+ error: string;
4211
+ details: import("database/api/.generated/runtime/library").JsonValue;
4212
+ status: import("../../database/api/.generated").$Enums.RunStatus;
4213
+ campaignId: string;
4214
+ computedUntil: bigint;
4215
+ processingStarted: bigint;
4216
+ };
4177
4217
  type: import("../../database/api/.generated").$Enums.CampaignType;
4178
4218
  id: string;
4179
4219
  subType: number | null;
@@ -4446,6 +4486,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4446
4486
  id: number;
4447
4487
  icon: string;
4448
4488
  } | undefined;
4489
+ campaignStatus: {
4490
+ error: string;
4491
+ details: import("database/api/.generated/runtime/library").JsonValue;
4492
+ status: import("../../database/api/.generated").$Enums.RunStatus;
4493
+ campaignId: string;
4494
+ computedUntil: bigint;
4495
+ processingStarted: bigint;
4496
+ };
4449
4497
  type: import("../../database/api/.generated").$Enums.CampaignType;
4450
4498
  id: string;
4451
4499
  subType: number | null;
@@ -5185,7 +5233,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5185
5233
  get: (options: {
5186
5234
  headers?: Record<string, unknown> | undefined;
5187
5235
  query: {
5188
- chainId: number | number[];
5236
+ chainId: number[];
5189
5237
  };
5190
5238
  fetch?: RequestInit | undefined;
5191
5239
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -282,6 +282,14 @@ declare const app: Elysia<"", false, {
282
282
  id: number;
283
283
  icon: string;
284
284
  } | undefined;
285
+ campaignStatus: {
286
+ error: string;
287
+ details: import("database/api/.generated/runtime/library").JsonValue;
288
+ status: import("../database/api/.generated").$Enums.RunStatus;
289
+ campaignId: string;
290
+ computedUntil: bigint;
291
+ processingStarted: bigint;
292
+ };
285
293
  type: import("../database/api/.generated").$Enums.CampaignType;
286
294
  id: string;
287
295
  subType: number | null;
@@ -559,6 +567,14 @@ declare const app: Elysia<"", false, {
559
567
  id: number;
560
568
  icon: string;
561
569
  } | undefined;
570
+ campaignStatus: {
571
+ error: string;
572
+ details: import("database/api/.generated/runtime/library").JsonValue;
573
+ status: import("../database/api/.generated").$Enums.RunStatus;
574
+ campaignId: string;
575
+ computedUntil: bigint;
576
+ processingStarted: bigint;
577
+ };
562
578
  type: import("../database/api/.generated").$Enums.CampaignType;
563
579
  id: string;
564
580
  subType: number | null;
@@ -1557,7 +1573,7 @@ declare const app: Elysia<"", false, {
1557
1573
  address: string;
1558
1574
  };
1559
1575
  query: {
1560
- chainId: number | number[];
1576
+ chainId: number[];
1561
1577
  };
1562
1578
  headers: unknown;
1563
1579
  response: {
package/dist/src/index.js CHANGED
@@ -32,34 +32,10 @@ const app = new Elysia({
32
32
  version: "1.0.1",
33
33
  },
34
34
  },
35
- exclude: [/engine\/*/, /v1\/.*/, /v2\/.*/],
35
+ exclude: [/engine\/*/, /v1\/.*/, /v2\/.*/, /full\/*/],
36
36
  }))
37
37
  .use(cors())
38
38
  .get("/", () => "Merkl API")
39
- .use(swagger({
40
- path: "/docs",
41
- documentation: {
42
- info: {
43
- contact: {
44
- email: "contact@angle.money",
45
- name: "Angle Labs",
46
- },
47
- description: "API to access data related to merkl campaigns, built and maintained by Angle Labs. This API is provided as is, without any warranty of any kind.",
48
- license: {
49
- name: "UNLICENSED",
50
- },
51
- title: "Merkl API v4 (in development)",
52
- version: "1.0.1",
53
- },
54
- tags: [
55
- {
56
- name: "Participate",
57
- description: "Interact with opportunities on-chain",
58
- },
59
- ],
60
- },
61
- exclude: [/v1\/.*/, /v2\/.*/, /v3\/.*/, /docs.*/, "/"],
62
- }))
63
39
  .use(v4)
64
40
  .use(autoroutes({
65
41
  routesDir: `${import.meta.dir}/routes`,
@@ -98,6 +98,14 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
98
98
  id: number;
99
99
  icon: string;
100
100
  } | undefined;
101
+ campaignStatus: {
102
+ error: string;
103
+ details: import("database/api/.generated/runtime/library").JsonValue;
104
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
105
+ campaignId: string;
106
+ computedUntil: bigint;
107
+ processingStarted: bigint;
108
+ };
101
109
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
102
110
  id: string;
103
111
  subType: number | null;
@@ -3,6 +3,7 @@ import type { Token } from "../token";
3
3
  import { CampaignType } from "../../../../database/api/.generated";
4
4
  import { type CampaignParameters } from "@sdk";
5
5
  import type { Chain } from "../chain";
6
+ import type { Status } from "../status";
6
7
  /**
7
8
  * Campaign
8
9
  * @description Target description of rewards campaigns
@@ -10,9 +11,10 @@ import type { Chain } from "../chain";
10
11
  */
11
12
  export type Campaign<C extends CampaignType = CampaignType> = Resource<"Campaign", "opportunityId" | "rewardTokenId", {
12
13
  chain: Chain["model"];
13
- distributionChain?: Chain["model"];
14
14
  rewardToken: Token["model"];
15
15
  params: CampaignParameters<ConvertedCampaignType<C>>["campaignParameters"];
16
+ distributionChain?: Chain["model"];
17
+ campaignStatus?: Status["model"];
16
18
  }>;
17
19
  export declare const campaignTypeToEnumMap: {
18
20
  readonly INVALID: any;
@@ -105,6 +105,14 @@ export declare abstract class CampaignRepository {
105
105
  verified: boolean;
106
106
  price: number | null;
107
107
  };
108
+ CampaignStatus: {
109
+ error: string;
110
+ details: Prisma.JsonValue;
111
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
112
+ campaignId: string;
113
+ computedUntil: bigint;
114
+ processingStarted: bigint;
115
+ }[];
108
116
  } & {
109
117
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
110
118
  id: string;
@@ -313,6 +313,7 @@ export class CampaignRepository {
313
313
  DistributionChain: true,
314
314
  ComputeChain: true,
315
315
  RewardToken: true,
316
+ CampaignStatus: true,
316
317
  },
317
318
  orderBy: {
318
319
  endTimestamp: "desc",
@@ -51,6 +51,14 @@ export declare abstract class CampaignService {
51
51
  id: number;
52
52
  icon: string;
53
53
  } | undefined;
54
+ campaignStatus: {
55
+ error: string;
56
+ details: import("database/api/.generated/runtime/library").JsonValue;
57
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
58
+ campaignId: string;
59
+ computedUntil: bigint;
60
+ processingStarted: bigint;
61
+ };
54
62
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
55
63
  id: string;
56
64
  subType: number | null;
@@ -175,6 +183,14 @@ export declare abstract class CampaignService {
175
183
  id: number;
176
184
  icon: string;
177
185
  } | undefined;
186
+ campaignStatus: {
187
+ error: string;
188
+ details: import("database/api/.generated/runtime/library").JsonValue;
189
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
190
+ campaignId: string;
191
+ computedUntil: bigint;
192
+ processingStarted: bigint;
193
+ };
178
194
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
179
195
  id: string;
180
196
  subType: number | null;
@@ -78,7 +78,7 @@ export class CampaignService {
78
78
  return await CampaignRepository.findUniqueOrThrow(campaign);
79
79
  }
80
80
  static async findCampaignsToProcess(distributionChainId) {
81
- return (await CampaignRepository.findCampaignsToProcess(distributionChainId)).filter(campaign => campaign.endTimestamp > campaign.CampaignStatus[0].computedUntil);
81
+ return (await CampaignRepository.findCampaignsToProcess(distributionChainId)).filter(campaign => campaign.endTimestamp > campaign?.CampaignStatus?.[0]?.computedUntil);
82
82
  }
83
83
  static async pickCampaignToProcess(chainId) {
84
84
  const campaigns = await CampaignService.findCampaignsToProcess(chainId);
@@ -166,13 +166,15 @@ export class CampaignService {
166
166
  static format(campaign) {
167
167
  if (campaign === null)
168
168
  return null;
169
- const { DistributionChain, ComputeChain, RewardToken, params, ...c } = campaign;
169
+ const { DistributionChain, ComputeChain, RewardToken, params, CampaignStatus, ...c } = campaign;
170
170
  return {
171
171
  ...c,
172
172
  params: params,
173
173
  chain: ComputeChain,
174
174
  rewardToken: RewardToken,
175
175
  distributionChain: DistributionChain === null ? undefined : DistributionChain,
176
+ // Todo: need to be change to single 1 to 1 with campaign
177
+ campaignStatus: CampaignStatus?.[0],
176
178
  };
177
179
  }
178
180
  /**
@@ -12,7 +12,7 @@ export declare const ChainUniqueDto: import("@sinclair/typebox").TObject<{
12
12
  chainId: import("@sinclair/typebox").TNumber;
13
13
  }>;
14
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>]>;
15
+ chainId: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>]>, number[]>;
16
16
  }>;
17
17
  export declare const CreateChainExplorerDto: import("@sinclair/typebox").TObject<{
18
18
  type: import("@sinclair/typebox").TEnum<{
@@ -8,7 +8,10 @@ export const ChainUniqueDto = t.Object({
8
8
  chainId: t.Numeric(),
9
9
  });
10
10
  export const ChainArrayDto = t.Object({
11
- chainId: t.Union([t.Numeric(), t.Array(t.Numeric())]),
11
+ chainId: t
12
+ .Transform(t.Union([t.String(), t.Array(t.Numeric())]))
13
+ .Decode(value => (typeof value === "string" ? value.split(",").map(v => Number.parseInt(v)) : value))
14
+ .Encode(value => [...value]),
12
15
  });
13
16
  export const CreateChainExplorerDto = t.Object({
14
17
  type: t.Enum(ExplorerType),
@@ -255,6 +255,14 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
255
255
  id: number;
256
256
  icon: string;
257
257
  } | undefined;
258
+ campaignStatus: {
259
+ error: string;
260
+ details: import("database/api/.generated/runtime/library").JsonValue;
261
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
262
+ campaignId: string;
263
+ computedUntil: bigint;
264
+ processingStarted: bigint;
265
+ };
258
266
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
259
267
  id: string;
260
268
  subType: number | null;
@@ -84,6 +84,14 @@ export declare abstract class OpportunityRepository {
84
84
  verified: boolean;
85
85
  price: number | null;
86
86
  };
87
+ CampaignStatus: {
88
+ error: string;
89
+ details: Prisma.JsonValue;
90
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
91
+ campaignId: string;
92
+ computedUntil: bigint;
93
+ processingStarted: bigint;
94
+ }[];
87
95
  };
88
96
  } & {
89
97
  id: number;
@@ -139,6 +147,14 @@ export declare abstract class OpportunityRepository {
139
147
  verified: boolean;
140
148
  price: number | null;
141
149
  };
150
+ CampaignStatus: {
151
+ error: string;
152
+ details: Prisma.JsonValue;
153
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
154
+ campaignId: string;
155
+ computedUntil: bigint;
156
+ processingStarted: bigint;
157
+ }[];
142
158
  } & {
143
159
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
144
160
  id: string;
@@ -226,6 +242,14 @@ export declare abstract class OpportunityRepository {
226
242
  verified: boolean;
227
243
  price: number | null;
228
244
  };
245
+ CampaignStatus: {
246
+ error: string;
247
+ details: Prisma.JsonValue;
248
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
249
+ campaignId: string;
250
+ computedUntil: bigint;
251
+ processingStarted: bigint;
252
+ }[];
229
253
  };
230
254
  } & {
231
255
  id: number;
@@ -373,6 +397,14 @@ export declare abstract class OpportunityRepository {
373
397
  verified: boolean;
374
398
  price: number | null;
375
399
  };
400
+ CampaignStatus: {
401
+ error: string;
402
+ details: Prisma.JsonValue;
403
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
404
+ campaignId: string;
405
+ computedUntil: bigint;
406
+ processingStarted: bigint;
407
+ }[];
376
408
  };
377
409
  } & {
378
410
  id: number;
@@ -22,7 +22,15 @@ export class OpportunityRepository {
22
22
  include: {
23
23
  DailyRewardsBreakdown: {
24
24
  include: {
25
- Campaign: { select: { startTimestamp: true, endTimestamp: true, amount: true, RewardToken: true } },
25
+ Campaign: {
26
+ select: {
27
+ startTimestamp: true,
28
+ endTimestamp: true,
29
+ amount: true,
30
+ RewardToken: true,
31
+ CampaignStatus: true,
32
+ },
33
+ },
26
34
  },
27
35
  },
28
36
  },
@@ -71,7 +79,7 @@ export class OpportunityRepository {
71
79
  });
72
80
  }
73
81
  static async findUniqueOrThrowWithCampaigns(id) {
74
- return await apiDbClient.opportunity.findUniqueOrThrow({
82
+ const b = await apiDbClient.opportunity.findUniqueOrThrow({
75
83
  include: {
76
84
  ...OpportunityRepository.#getRecordInclusion(),
77
85
  Chain: true,
@@ -80,6 +88,7 @@ export class OpportunityRepository {
80
88
  RewardToken: true,
81
89
  ComputeChain: true,
82
90
  DistributionChain: true,
91
+ CampaignStatus: true, // [][0]
83
92
  },
84
93
  orderBy: {
85
94
  endTimestamp: "desc",
@@ -91,6 +100,8 @@ export class OpportunityRepository {
91
100
  },
92
101
  where: { id },
93
102
  });
103
+ console.debug(b);
104
+ return b;
94
105
  }
95
106
  static async findManyWithCampaigns(filters) {
96
107
  return await apiDbClient.opportunity.findMany({
@@ -125,6 +125,14 @@ export declare abstract class OpportunityService {
125
125
  id: number;
126
126
  icon: string;
127
127
  } | undefined;
128
+ campaignStatus: {
129
+ error: string;
130
+ details: Prisma.JsonValue;
131
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
132
+ campaignId: string;
133
+ computedUntil: bigint;
134
+ processingStarted: bigint;
135
+ };
128
136
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
129
137
  id: string;
130
138
  subType: number | null;