@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.
- package/dist/app.d.ts +71 -3
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +2 -0
- package/dist/client.d.ts +83 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/fractions/activity/searchActivity.route.d.ts +45 -9
- package/dist/fractions/activity/searchActivity.route.d.ts.map +1 -1
- package/dist/fractions/activity/utils.d.ts +91 -15
- package/dist/fractions/activity/utils.d.ts.map +1 -1
- package/dist/fractions/activity/utils.js +12 -3
- package/dist/fractions/deployMarket/v0/index.d.ts +3 -0
- package/dist/fractions/deployMarket/v0/index.d.ts.map +1 -0
- package/dist/fractions/deployMarket/v0/index.js +2 -0
- package/dist/fractions/index.d.ts +15 -3
- package/dist/fractions/index.d.ts.map +1 -1
- package/dist/fractions/sales/searchActivity.route.js +2 -2
- package/dist/fractions/sales/searchSaleEvents/v0/searchSaleEvents.js +6 -6
- package/dist/general/balanceClient.d.ts +21 -5
- package/dist/general/balanceClient.d.ts.map +1 -1
- package/dist/general/utils/tokenBalance/tokenBalance.d.ts +19 -3
- package/dist/general/utils/tokenBalance/tokenBalance.d.ts.map +1 -1
- package/dist/general/utils/tokenBalance/tokenBalance.js +8 -3
- package/dist/issuance/deploy.d.ts +63 -0
- package/dist/issuance/deploy.d.ts.map +1 -1
- package/dist/issuance/deploy.js +78 -0
- package/dist/issuance/index.d.ts +56 -0
- package/dist/issuance/index.d.ts.map +1 -1
- package/dist/issuance/index.js +6 -2
- package/dist/issuance/upgrade.d.ts +82 -0
- package/dist/issuance/upgrade.d.ts.map +1 -0
- package/dist/issuance/upgrade.js +46 -0
- package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.d.ts +57 -0
- package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.d.ts.map +1 -0
- package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.js +33 -0
- package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.d.ts +12 -0
- package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.d.ts.map +1 -0
- package/dist/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.js +10 -0
- package/dist/lending/buyback/v0/buyback.routes.d.ts +61 -0
- package/dist/lending/buyback/v0/buyback.routes.d.ts.map +1 -0
- package/dist/lending/buyback/v0/buyback.routes.js +33 -0
- package/dist/lending/buyback/v0/buyback.schema.d.ts +15 -0
- package/dist/lending/buyback/v0/buyback.schema.d.ts.map +1 -0
- package/dist/lending/buyback/v0/buyback.schema.js +13 -0
- package/dist/lending/createLendingSale.d.ts +585 -0
- package/dist/lending/createLendingSale.d.ts.map +1 -0
- package/dist/lending/createLendingSale.js +81 -0
- package/dist/lending/deployMarket/v0/deployMarket.routes.d.ts +117 -0
- package/dist/lending/deployMarket/v0/deployMarket.routes.d.ts.map +1 -0
- package/dist/lending/deployMarket/v0/deployMarket.routes.js +34 -0
- package/dist/lending/deployMarket/v0/deployMarket.schema.d.ts +105 -0
- package/dist/lending/deployMarket/v0/deployMarket.schema.d.ts.map +1 -0
- package/dist/lending/deployMarket/v0/deployMarket.schema.js +12 -0
- package/dist/lending/deployMarket/v0/lending.routes.d.ts +105 -0
- package/dist/lending/deployMarket/v0/lending.routes.d.ts.map +1 -0
- package/dist/lending/deployMarket/v0/lending.routes.js +35 -0
- package/dist/lending/deployMarket/v0/lending.schema.d.ts +99 -0
- package/dist/lending/deployMarket/v0/lending.schema.d.ts.map +1 -0
- package/dist/lending/deployMarket/v0/lending.schema.js +14 -0
- package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.d.ts +57 -0
- package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.d.ts.map +1 -0
- package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.js +33 -0
- package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.d.ts +12 -0
- package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.d.ts.map +1 -0
- package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.js +10 -0
- package/dist/lending/index.d.ts +226 -0
- package/dist/lending/index.d.ts.map +1 -0
- package/dist/lending/index.js +24 -0
- package/dist/lending/setCollateralPrice/v0/setCollateralPrice.routes.d.ts +61 -0
- package/dist/lending/setCollateralPrice/v0/setCollateralPrice.routes.d.ts.map +1 -0
- package/dist/lending/setCollateralPrice/v0/setCollateralPrice.routes.js +33 -0
- package/dist/lending/setCollateralPrice/v0/setCollateralPrice.schema.d.ts +15 -0
- package/dist/lending/setCollateralPrice/v0/setCollateralPrice.schema.d.ts.map +1 -0
- package/dist/lending/setCollateralPrice/v0/setCollateralPrice.schema.js +13 -0
- package/package.json +6 -6
- package/dist/fractions/sales/searchClaim.route.d.ts +0 -62
- package/dist/fractions/sales/searchClaim.route.d.ts.map +0 -1
- package/dist/fractions/sales/searchClaim.route.js +0 -47
- package/dist/fractions/sales/searchPurchase.route.d.ts +0 -120
- package/dist/fractions/sales/searchPurchase.route.d.ts.map +0 -1
- 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
|
-
}
|