@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BuyBackAfterLiquidationRequestSchema } from "./buyBackAfterLiquidation.schema.js";
|
|
2
|
+
import { describeRoute } from "hono-openapi";
|
|
3
|
+
import { resolver, validator } from "hono-openapi/zod";
|
|
4
|
+
import { toTransaction, TransactionSchema } from "../../../common/index.js";
|
|
5
|
+
const route = describeRoute({
|
|
6
|
+
summary: "Perform buyback after liquidation",
|
|
7
|
+
description: "Returns transaction data for performing buyback after liquidation by liquidator",
|
|
8
|
+
tags: ["Lending"],
|
|
9
|
+
responses: {
|
|
10
|
+
200: {
|
|
11
|
+
description: "Returns transaction data for buyback after liquidation",
|
|
12
|
+
content: {
|
|
13
|
+
"application/json": {
|
|
14
|
+
schema: resolver(TransactionSchema),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export function createBuyBackAfterLiquidationTransactionV0(factory) {
|
|
21
|
+
return factory.createHandlers(route, validator("json", BuyBackAfterLiquidationRequestSchema), async (c) => {
|
|
22
|
+
const { campaignId } = c.req.valid("json");
|
|
23
|
+
// TODO: Import and use the actual SDK function once available
|
|
24
|
+
// For now, return a mock transaction structure
|
|
25
|
+
const tx = {
|
|
26
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
27
|
+
abi: [],
|
|
28
|
+
functionName: "buyBackAfterLiquidation",
|
|
29
|
+
args: [campaignId],
|
|
30
|
+
};
|
|
31
|
+
return c.json(toTransaction(tx));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BuyBackAfterLiquidationRequestSchema: z.ZodObject<{
|
|
3
|
+
chainId: z.ZodType<import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId, z.ZodTypeDef, import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId>;
|
|
4
|
+
campaignId: z.ZodBigInt;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
7
|
+
campaignId: bigint;
|
|
8
|
+
}, {
|
|
9
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
10
|
+
campaignId: bigint;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=buyBackAfterLiquidation.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buyBackAfterLiquidation.schema.d.ts","sourceRoot":"","sources":["../../../../src/lending/buyBackAfterLiquidation/v0/buyBackAfterLiquidation.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oCAAoC;;;;;;;;;EAOU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TmiChainIdSchema } from "../../../common/index.js";
|
|
3
|
+
export const BuyBackAfterLiquidationRequestSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
chainId: TmiChainIdSchema,
|
|
6
|
+
campaignId: z.coerce.bigint().openapi({
|
|
7
|
+
description: "The campaign ID to perform buyback after liquidation for",
|
|
8
|
+
}),
|
|
9
|
+
})
|
|
10
|
+
.openapi({ ref: "BuyBackAfterLiquidationRequestSchema" });
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
export declare function createBuybackTransactionV0<E extends Env>(factory: Factory<E>): [import("hono/types").H<any, string, {}, Promise<Response & import("hono").TypedResponse<{
|
|
4
|
+
data: `0x${string}`;
|
|
5
|
+
to: `0x${string}`;
|
|
6
|
+
details: {
|
|
7
|
+
functionName: string;
|
|
8
|
+
address: `0x${string}`;
|
|
9
|
+
abi: any[];
|
|
10
|
+
args: any[];
|
|
11
|
+
};
|
|
12
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>, import("hono/types").H<Env, string, {
|
|
13
|
+
in: {
|
|
14
|
+
json: {
|
|
15
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
16
|
+
campaignId: bigint;
|
|
17
|
+
buybackPacketsAmount: bigint;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
out: {
|
|
21
|
+
json: {
|
|
22
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
23
|
+
campaignId: bigint;
|
|
24
|
+
buybackPacketsAmount: bigint;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
28
|
+
data: `0x${string}`;
|
|
29
|
+
to: `0x${string}`;
|
|
30
|
+
details: {
|
|
31
|
+
functionName: string;
|
|
32
|
+
address: `0x${string}`;
|
|
33
|
+
abi: any[];
|
|
34
|
+
args: any[];
|
|
35
|
+
};
|
|
36
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>, import("hono/types").H<import("hono/utils/types").IfAnyThenEmptyObject<E extends Env ? Env extends E ? {} : E : E> & {}, string, {
|
|
37
|
+
in: {
|
|
38
|
+
json: {
|
|
39
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
40
|
+
campaignId: bigint;
|
|
41
|
+
buybackPacketsAmount: bigint;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
out: {
|
|
45
|
+
json: {
|
|
46
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
47
|
+
campaignId: bigint;
|
|
48
|
+
buybackPacketsAmount: bigint;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
52
|
+
data: `0x${string}`;
|
|
53
|
+
to: `0x${string}`;
|
|
54
|
+
details: {
|
|
55
|
+
functionName: string;
|
|
56
|
+
address: `0x${string}`;
|
|
57
|
+
abi: any[];
|
|
58
|
+
args: any[];
|
|
59
|
+
};
|
|
60
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
|
|
61
|
+
//# sourceMappingURL=buyback.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buyback.routes.d.ts","sourceRoot":"","sources":["../../../../src/lending/buyback/v0/buyback.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAqBvC,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAe5E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BuybackRequestSchema } from "./buyback.schema.js";
|
|
2
|
+
import { describeRoute } from "hono-openapi";
|
|
3
|
+
import { resolver, validator } from "hono-openapi/zod";
|
|
4
|
+
import { toTransaction, TransactionSchema } from "../../../common/index.js";
|
|
5
|
+
const route = describeRoute({
|
|
6
|
+
summary: "Perform buyback of lending position",
|
|
7
|
+
description: "Returns transaction data for buying back the lending position with interest",
|
|
8
|
+
tags: ["Lending"],
|
|
9
|
+
responses: {
|
|
10
|
+
200: {
|
|
11
|
+
description: "Returns transaction data for buyback operation",
|
|
12
|
+
content: {
|
|
13
|
+
"application/json": {
|
|
14
|
+
schema: resolver(TransactionSchema),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export function createBuybackTransactionV0(factory) {
|
|
21
|
+
return factory.createHandlers(route, validator("json", BuybackRequestSchema), async (c) => {
|
|
22
|
+
const { campaignId, buybackPacketsAmount } = c.req.valid("json");
|
|
23
|
+
// TODO: Import and use the actual SDK function once available
|
|
24
|
+
// For now, return a mock transaction structure
|
|
25
|
+
const tx = {
|
|
26
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
27
|
+
abi: [],
|
|
28
|
+
functionName: "buyback",
|
|
29
|
+
args: [campaignId, buybackPacketsAmount],
|
|
30
|
+
};
|
|
31
|
+
return c.json(toTransaction(tx));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BuybackRequestSchema: z.ZodObject<{
|
|
3
|
+
chainId: z.ZodType<import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId, z.ZodTypeDef, import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId>;
|
|
4
|
+
campaignId: z.ZodBigInt;
|
|
5
|
+
buybackPacketsAmount: z.ZodBigInt;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
8
|
+
campaignId: bigint;
|
|
9
|
+
buybackPacketsAmount: bigint;
|
|
10
|
+
}, {
|
|
11
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
12
|
+
campaignId: bigint;
|
|
13
|
+
buybackPacketsAmount: bigint;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=buyback.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buyback.schema.d.ts","sourceRoot":"","sources":["../../../../src/lending/buyback/v0/buyback.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAUU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TmiChainIdSchema } from "../../../common/index.js";
|
|
3
|
+
export const BuybackRequestSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
chainId: TmiChainIdSchema,
|
|
6
|
+
campaignId: z.coerce.bigint().openapi({
|
|
7
|
+
description: "The campaign ID to perform buyback for",
|
|
8
|
+
}),
|
|
9
|
+
buybackPacketsAmount: z.coerce.bigint().openapi({
|
|
10
|
+
description: "Amount of packets to buyback (with interest)",
|
|
11
|
+
}),
|
|
12
|
+
})
|
|
13
|
+
.openapi({ ref: "BuybackRequestSchema" });
|