@evergonlabs/tmi-protocol-api 0.1.4 → 0.2.0

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.
Files changed (80) hide show
  1. package/dist/app.d.ts +71 -3
  2. package/dist/app.d.ts.map +1 -1
  3. package/dist/app.js +2 -0
  4. package/dist/client.d.ts +83 -3
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/fractions/activity/searchActivity.route.d.ts +45 -9
  7. package/dist/fractions/activity/searchActivity.route.d.ts.map +1 -1
  8. package/dist/fractions/activity/utils.d.ts +91 -15
  9. package/dist/fractions/activity/utils.d.ts.map +1 -1
  10. package/dist/fractions/activity/utils.js +12 -3
  11. package/dist/fractions/deployMarket/v0/index.d.ts +3 -0
  12. package/dist/fractions/deployMarket/v0/index.d.ts.map +1 -0
  13. package/dist/fractions/deployMarket/v0/index.js +2 -0
  14. package/dist/fractions/index.d.ts +15 -3
  15. package/dist/fractions/index.d.ts.map +1 -1
  16. package/dist/fractions/sales/searchActivity.route.js +2 -2
  17. package/dist/fractions/sales/searchSaleEvents/v0/searchSaleEvents.js +6 -6
  18. package/dist/general/balanceClient.d.ts +21 -5
  19. package/dist/general/balanceClient.d.ts.map +1 -1
  20. package/dist/general/utils/tokenBalance/tokenBalance.d.ts +19 -3
  21. package/dist/general/utils/tokenBalance/tokenBalance.d.ts.map +1 -1
  22. package/dist/general/utils/tokenBalance/tokenBalance.js +8 -3
  23. package/dist/issuance/deploy.d.ts +63 -0
  24. package/dist/issuance/deploy.d.ts.map +1 -1
  25. package/dist/issuance/deploy.js +78 -0
  26. package/dist/issuance/index.d.ts +56 -0
  27. package/dist/issuance/index.d.ts.map +1 -1
  28. package/dist/issuance/index.js +6 -2
  29. package/dist/issuance/upgrade.d.ts +82 -0
  30. package/dist/issuance/upgrade.d.ts.map +1 -0
  31. package/dist/issuance/upgrade.js +46 -0
  32. package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.d.ts +57 -0
  33. package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.d.ts.map +1 -0
  34. package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.js +33 -0
  35. package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.d.ts +12 -0
  36. package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.d.ts.map +1 -0
  37. package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.js +10 -0
  38. package/dist/lending/buyback/v0/buyback.routes.d.ts +61 -0
  39. package/dist/lending/buyback/v0/buyback.routes.d.ts.map +1 -0
  40. package/dist/lending/buyback/v0/buyback.routes.js +33 -0
  41. package/dist/lending/buyback/v0/buyback.schema.d.ts +15 -0
  42. package/dist/lending/buyback/v0/buyback.schema.d.ts.map +1 -0
  43. package/dist/lending/buyback/v0/buyback.schema.js +13 -0
  44. package/dist/lending/createLendingSale.d.ts +585 -0
  45. package/dist/lending/createLendingSale.d.ts.map +1 -0
  46. package/dist/lending/createLendingSale.js +81 -0
  47. package/dist/lending/deployMarket/v0/deployMarket.routes.d.ts +117 -0
  48. package/dist/lending/deployMarket/v0/deployMarket.routes.d.ts.map +1 -0
  49. package/dist/lending/deployMarket/v0/deployMarket.routes.js +34 -0
  50. package/dist/lending/deployMarket/v0/deployMarket.schema.d.ts +105 -0
  51. package/dist/lending/deployMarket/v0/deployMarket.schema.d.ts.map +1 -0
  52. package/dist/lending/deployMarket/v0/deployMarket.schema.js +12 -0
  53. package/dist/lending/deployMarket/v0/lending.routes.d.ts +105 -0
  54. package/dist/lending/deployMarket/v0/lending.routes.d.ts.map +1 -0
  55. package/dist/lending/deployMarket/v0/lending.routes.js +35 -0
  56. package/dist/lending/deployMarket/v0/lending.schema.d.ts +99 -0
  57. package/dist/lending/deployMarket/v0/lending.schema.d.ts.map +1 -0
  58. package/dist/lending/deployMarket/v0/lending.schema.js +14 -0
  59. package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.d.ts +57 -0
  60. package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.d.ts.map +1 -0
  61. package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.js +33 -0
  62. package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.d.ts +12 -0
  63. package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.d.ts.map +1 -0
  64. package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.js +10 -0
  65. package/dist/lending/index.d.ts +226 -0
  66. package/dist/lending/index.d.ts.map +1 -0
  67. package/dist/lending/index.js +24 -0
  68. package/dist/lending/setCollateralPrice/v0/setCollateralPrice.routes.d.ts +61 -0
  69. package/dist/lending/setCollateralPrice/v0/setCollateralPrice.routes.d.ts.map +1 -0
  70. package/dist/lending/setCollateralPrice/v0/setCollateralPrice.routes.js +33 -0
  71. package/dist/lending/setCollateralPrice/v0/setCollateralPrice.schema.d.ts +15 -0
  72. package/dist/lending/setCollateralPrice/v0/setCollateralPrice.schema.d.ts.map +1 -0
  73. package/dist/lending/setCollateralPrice/v0/setCollateralPrice.schema.js +13 -0
  74. package/package.json +6 -6
  75. package/dist/fractions/sales/searchClaim.route.d.ts +0 -62
  76. package/dist/fractions/sales/searchClaim.route.d.ts.map +0 -1
  77. package/dist/fractions/sales/searchClaim.route.js +0 -47
  78. package/dist/fractions/sales/searchPurchase.route.d.ts +0 -120
  79. package/dist/fractions/sales/searchPurchase.route.d.ts.map +0 -1
  80. package/dist/fractions/sales/searchPurchase.route.js +0 -70
@@ -1,70 +0,0 @@
1
- import { describeRoute } from "hono-openapi";
2
- import { resolver, validator } from "hono-openapi/zod";
3
- import { and, eq } from "@ponder/client";
4
- import { z } from "../../common/zod.js";
5
- import { indexerClient } from "../../common/indexer/index.js";
6
- import { indexerSchemas } from "../../common/indexer/schemas.js";
7
- import { PageSchema } from "../../common/models/page.js";
8
- import { AddressSchema, PlatformContractAddress, CampaignIdSchema, TmiChainIdSchema } from "../../common/index.js";
9
- export const FractionsPurchaseSchema = z
10
- .object({
11
- chainId: TmiChainIdSchema,
12
- platform: PlatformContractAddress,
13
- campaignId: z.coerce.string(),
14
- buyerAddress: AddressSchema,
15
- amountOfFractions: z.coerce.string(),
16
- priceId: z.coerce.string(),
17
- txHash: z.coerce.string(),
18
- createdAt: z.date(),
19
- updatedAt: z.date(),
20
- })
21
- .openapi({
22
- ref: "FractionsPurchase",
23
- });
24
- export function createSearchPurchasesV0App(factory) {
25
- return factory.createHandlers(describeRoute({
26
- summary: "Search purchase events",
27
- description: "Search purchase events by users, platforms and pools",
28
- tags: ["Fractions"],
29
- responses: {
30
- 200: {
31
- description: "Returns list of purchase events within specified platforms and pools",
32
- content: {
33
- "application/json": {
34
- schema: resolver(z.array(FractionsPurchaseSchema)),
35
- },
36
- },
37
- },
38
- },
39
- }), validator("json", z.object({
40
- page: PageSchema,
41
- filter: z.object({
42
- chainId: TmiChainIdSchema,
43
- platform: PlatformContractAddress,
44
- campaignId: CampaignIdSchema,
45
- }),
46
- })), async (c) => {
47
- const { page, filter } = c.req.valid("json");
48
- const { fractions: { fractionsPurchases }, } = indexerSchemas;
49
- const result = await indexerClient.db.query.fractionsPurchases.findMany({
50
- with: {
51
- fractionSale: true,
52
- },
53
- where: and(filter.chainId ? eq(fractionsPurchases.chainId, Number(filter.chainId)) : undefined, filter.platform ? eq(fractionsPurchases.diamondAddress, filter.platform) : undefined, typeof filter.campaignId === "number" ? eq(fractionsPurchases.saleId, BigInt(filter.campaignId)) : undefined),
54
- limit: page.limit,
55
- offset: page.skip,
56
- orderBy: fractionsPurchases.createdAt,
57
- });
58
- return c.json(result.map((i) => FractionsPurchaseSchema.parse({
59
- chainId: i.chainId,
60
- platform: i.diamondAddress,
61
- campaignId: i.saleId,
62
- buyerAddress: i.buyerAddress,
63
- amountOfFractions: i.amountOfFractions,
64
- priceId: i.priceId,
65
- txHash: i.txHash,
66
- createdAt: i.createdAt,
67
- updatedAt: i.updatedAt,
68
- })), 200);
69
- });
70
- }