@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,117 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
export declare function createDeployLendingMarketTransactionV0<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
|
+
adminAddress: `0x${string}`;
|
|
17
|
+
lending: {
|
|
18
|
+
minInterest: number;
|
|
19
|
+
maxInterest: number;
|
|
20
|
+
minDuration: bigint;
|
|
21
|
+
maxDuration: bigint;
|
|
22
|
+
minimumProportionsOverObligation: bigint;
|
|
23
|
+
};
|
|
24
|
+
discount?: {
|
|
25
|
+
burnForDiscount: {
|
|
26
|
+
burnableTokenAddress: `0x${string}`;
|
|
27
|
+
};
|
|
28
|
+
} | undefined;
|
|
29
|
+
cap?: {
|
|
30
|
+
maxHardCap: bigint;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
out: {
|
|
35
|
+
json: {
|
|
36
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
37
|
+
adminAddress: `0x${string}`;
|
|
38
|
+
lending: {
|
|
39
|
+
minInterest: number;
|
|
40
|
+
maxInterest: number;
|
|
41
|
+
minDuration: bigint;
|
|
42
|
+
maxDuration: bigint;
|
|
43
|
+
minimumProportionsOverObligation: bigint;
|
|
44
|
+
};
|
|
45
|
+
discount?: {
|
|
46
|
+
burnForDiscount: {
|
|
47
|
+
burnableTokenAddress: `0x${string}`;
|
|
48
|
+
};
|
|
49
|
+
} | undefined;
|
|
50
|
+
cap?: {
|
|
51
|
+
maxHardCap: bigint;
|
|
52
|
+
} | undefined;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
56
|
+
data: `0x${string}`;
|
|
57
|
+
to: `0x${string}`;
|
|
58
|
+
details: {
|
|
59
|
+
functionName: string;
|
|
60
|
+
address: `0x${string}`;
|
|
61
|
+
abi: any[];
|
|
62
|
+
args: any[];
|
|
63
|
+
};
|
|
64
|
+
}, 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, {
|
|
65
|
+
in: {
|
|
66
|
+
json: {
|
|
67
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
68
|
+
adminAddress: `0x${string}`;
|
|
69
|
+
lending: {
|
|
70
|
+
minInterest: number;
|
|
71
|
+
maxInterest: number;
|
|
72
|
+
minDuration: bigint;
|
|
73
|
+
maxDuration: bigint;
|
|
74
|
+
minimumProportionsOverObligation: bigint;
|
|
75
|
+
};
|
|
76
|
+
discount?: {
|
|
77
|
+
burnForDiscount: {
|
|
78
|
+
burnableTokenAddress: `0x${string}`;
|
|
79
|
+
};
|
|
80
|
+
} | undefined;
|
|
81
|
+
cap?: {
|
|
82
|
+
maxHardCap: bigint;
|
|
83
|
+
} | undefined;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
out: {
|
|
87
|
+
json: {
|
|
88
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
89
|
+
adminAddress: `0x${string}`;
|
|
90
|
+
lending: {
|
|
91
|
+
minInterest: number;
|
|
92
|
+
maxInterest: number;
|
|
93
|
+
minDuration: bigint;
|
|
94
|
+
maxDuration: bigint;
|
|
95
|
+
minimumProportionsOverObligation: bigint;
|
|
96
|
+
};
|
|
97
|
+
discount?: {
|
|
98
|
+
burnForDiscount: {
|
|
99
|
+
burnableTokenAddress: `0x${string}`;
|
|
100
|
+
};
|
|
101
|
+
} | undefined;
|
|
102
|
+
cap?: {
|
|
103
|
+
maxHardCap: bigint;
|
|
104
|
+
} | undefined;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
108
|
+
data: `0x${string}`;
|
|
109
|
+
to: `0x${string}`;
|
|
110
|
+
details: {
|
|
111
|
+
functionName: string;
|
|
112
|
+
address: `0x${string}`;
|
|
113
|
+
abi: any[];
|
|
114
|
+
args: any[];
|
|
115
|
+
};
|
|
116
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
|
|
117
|
+
//# sourceMappingURL=deployMarket.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployMarket.routes.d.ts","sourceRoot":"","sources":["../../../../src/lending/deployMarket/v0/deployMarket.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAsBvC,wBAAgB,sCAAsC,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAcxF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DeployLendingMarketRequestSchema } from "./deployMarket.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
|
+
import { createLendingPlatform } from "@evergonlabs/tmi-protocol-fractions-sdk";
|
|
6
|
+
const route = describeRoute({
|
|
7
|
+
summary: "Deploy a lending market",
|
|
8
|
+
description: "Returns transaction data for deploying a lending market with fractionalized collateral",
|
|
9
|
+
tags: ["Lending"],
|
|
10
|
+
responses: {
|
|
11
|
+
200: {
|
|
12
|
+
description: "Returns transaction data for deploying a lending market",
|
|
13
|
+
content: {
|
|
14
|
+
"application/json": {
|
|
15
|
+
schema: resolver(TransactionSchema),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
export function createDeployLendingMarketTransactionV0(factory) {
|
|
22
|
+
return factory.createHandlers(route, validator("json", DeployLendingMarketRequestSchema), async (c) => {
|
|
23
|
+
const { chainId, adminAddress, cap, lending } = c.req.valid("json");
|
|
24
|
+
const fee = getFeeConfig();
|
|
25
|
+
const tx = createLendingPlatform({
|
|
26
|
+
chainId: chainId,
|
|
27
|
+
adminAddress: adminAddress,
|
|
28
|
+
cap: cap,
|
|
29
|
+
fee: fee,
|
|
30
|
+
min: lending,
|
|
31
|
+
});
|
|
32
|
+
return c.json(toTransaction(tx));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const LendingConfigSchema: z.ZodObject<{
|
|
3
|
+
minInterest: z.ZodNumber;
|
|
4
|
+
maxInterest: z.ZodNumber;
|
|
5
|
+
minDuration: z.ZodBigInt;
|
|
6
|
+
maxDuration: z.ZodBigInt;
|
|
7
|
+
minimumProportionsOverObligation: z.ZodBigInt;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
minInterest: number;
|
|
10
|
+
maxInterest: number;
|
|
11
|
+
minDuration: bigint;
|
|
12
|
+
maxDuration: bigint;
|
|
13
|
+
minimumProportionsOverObligation: bigint;
|
|
14
|
+
}, {
|
|
15
|
+
minInterest: number;
|
|
16
|
+
maxInterest: number;
|
|
17
|
+
minDuration: bigint;
|
|
18
|
+
maxDuration: bigint;
|
|
19
|
+
minimumProportionsOverObligation: bigint;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const DeployLendingMarketRequestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
22
|
+
chainId: z.ZodType<import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId, z.ZodTypeDef, import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId>;
|
|
23
|
+
adminAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
24
|
+
discount: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
burnForDiscount: z.ZodObject<{
|
|
26
|
+
burnableTokenAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
burnableTokenAddress: `0x${string}`;
|
|
29
|
+
}, {
|
|
30
|
+
burnableTokenAddress: `0x${string}`;
|
|
31
|
+
}>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
burnForDiscount: {
|
|
34
|
+
burnableTokenAddress: `0x${string}`;
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
burnForDiscount: {
|
|
38
|
+
burnableTokenAddress: `0x${string}`;
|
|
39
|
+
};
|
|
40
|
+
}>>;
|
|
41
|
+
cap: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
maxHardCap: z.ZodBigInt;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
maxHardCap: bigint;
|
|
45
|
+
}, {
|
|
46
|
+
maxHardCap: bigint;
|
|
47
|
+
}>>;
|
|
48
|
+
}, {
|
|
49
|
+
lending: z.ZodObject<{
|
|
50
|
+
minInterest: z.ZodNumber;
|
|
51
|
+
maxInterest: z.ZodNumber;
|
|
52
|
+
minDuration: z.ZodBigInt;
|
|
53
|
+
maxDuration: z.ZodBigInt;
|
|
54
|
+
minimumProportionsOverObligation: z.ZodBigInt;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
minInterest: number;
|
|
57
|
+
maxInterest: number;
|
|
58
|
+
minDuration: bigint;
|
|
59
|
+
maxDuration: bigint;
|
|
60
|
+
minimumProportionsOverObligation: bigint;
|
|
61
|
+
}, {
|
|
62
|
+
minInterest: number;
|
|
63
|
+
maxInterest: number;
|
|
64
|
+
minDuration: bigint;
|
|
65
|
+
maxDuration: bigint;
|
|
66
|
+
minimumProportionsOverObligation: bigint;
|
|
67
|
+
}>;
|
|
68
|
+
}>, "strip", z.ZodTypeAny, {
|
|
69
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
70
|
+
adminAddress: `0x${string}`;
|
|
71
|
+
lending: {
|
|
72
|
+
minInterest: number;
|
|
73
|
+
maxInterest: number;
|
|
74
|
+
minDuration: bigint;
|
|
75
|
+
maxDuration: bigint;
|
|
76
|
+
minimumProportionsOverObligation: bigint;
|
|
77
|
+
};
|
|
78
|
+
discount?: {
|
|
79
|
+
burnForDiscount: {
|
|
80
|
+
burnableTokenAddress: `0x${string}`;
|
|
81
|
+
};
|
|
82
|
+
} | undefined;
|
|
83
|
+
cap?: {
|
|
84
|
+
maxHardCap: bigint;
|
|
85
|
+
} | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
88
|
+
adminAddress: `0x${string}`;
|
|
89
|
+
lending: {
|
|
90
|
+
minInterest: number;
|
|
91
|
+
maxInterest: number;
|
|
92
|
+
minDuration: bigint;
|
|
93
|
+
maxDuration: bigint;
|
|
94
|
+
minimumProportionsOverObligation: bigint;
|
|
95
|
+
};
|
|
96
|
+
discount?: {
|
|
97
|
+
burnForDiscount: {
|
|
98
|
+
burnableTokenAddress: `0x${string}`;
|
|
99
|
+
};
|
|
100
|
+
} | undefined;
|
|
101
|
+
cap?: {
|
|
102
|
+
maxHardCap: bigint;
|
|
103
|
+
} | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
//# sourceMappingURL=deployMarket.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployMarket.schema.d.ts","sourceRoot":"","sources":["../../../../src/lending/deployMarket/v0/deployMarket.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DeployMarketRequestSchema } from "../../../fractions/deployMarket/v0/deployMarket.schema.js";
|
|
3
|
+
export const LendingConfigSchema = z.object({
|
|
4
|
+
minInterest: z.number().min(0).max(100000), // 0 to 100000 basis points (0% to 1000%)
|
|
5
|
+
maxInterest: z.number().min(0).max(100000), // 0 to 100000 basis points (0% to 1000%)
|
|
6
|
+
minDuration: z.coerce.bigint().min(BigInt(1)), // Minimum duration in seconds
|
|
7
|
+
maxDuration: z.coerce.bigint().min(BigInt(1)), // Maximum duration in seconds
|
|
8
|
+
minimumProportionsOverObligation: z.coerce.bigint().min(BigInt(1)),
|
|
9
|
+
});
|
|
10
|
+
export const DeployLendingMarketRequestSchema = DeployMarketRequestSchema.extend({
|
|
11
|
+
lending: LendingConfigSchema,
|
|
12
|
+
}).openapi({ ref: "DeployLendingMarketRequestSchema" });
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
export declare function createDeployLendingMarketTransactionV0<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
|
+
adminAddress: `0x${string}`;
|
|
17
|
+
lending: {
|
|
18
|
+
minInterest: number;
|
|
19
|
+
maxInterest: number;
|
|
20
|
+
minDuration: bigint;
|
|
21
|
+
maxDuration: bigint;
|
|
22
|
+
minimumProportionOverObligation: bigint;
|
|
23
|
+
};
|
|
24
|
+
discount?: {
|
|
25
|
+
burnForDiscount: {
|
|
26
|
+
burnableTokenAddress: `0x${string}`;
|
|
27
|
+
};
|
|
28
|
+
} | undefined;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
out: {
|
|
32
|
+
json: {
|
|
33
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
34
|
+
adminAddress: `0x${string}`;
|
|
35
|
+
lending: {
|
|
36
|
+
minInterest: number;
|
|
37
|
+
maxInterest: number;
|
|
38
|
+
minDuration: bigint;
|
|
39
|
+
maxDuration: bigint;
|
|
40
|
+
minimumProportionOverObligation: bigint;
|
|
41
|
+
};
|
|
42
|
+
discount?: {
|
|
43
|
+
burnForDiscount: {
|
|
44
|
+
burnableTokenAddress: `0x${string}`;
|
|
45
|
+
};
|
|
46
|
+
} | undefined;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
50
|
+
data: `0x${string}`;
|
|
51
|
+
to: `0x${string}`;
|
|
52
|
+
details: {
|
|
53
|
+
functionName: string;
|
|
54
|
+
address: `0x${string}`;
|
|
55
|
+
abi: any[];
|
|
56
|
+
args: any[];
|
|
57
|
+
};
|
|
58
|
+
}, 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, {
|
|
59
|
+
in: {
|
|
60
|
+
json: {
|
|
61
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
62
|
+
adminAddress: `0x${string}`;
|
|
63
|
+
lending: {
|
|
64
|
+
minInterest: number;
|
|
65
|
+
maxInterest: number;
|
|
66
|
+
minDuration: bigint;
|
|
67
|
+
maxDuration: bigint;
|
|
68
|
+
minimumProportionOverObligation: bigint;
|
|
69
|
+
};
|
|
70
|
+
discount?: {
|
|
71
|
+
burnForDiscount: {
|
|
72
|
+
burnableTokenAddress: `0x${string}`;
|
|
73
|
+
};
|
|
74
|
+
} | undefined;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
out: {
|
|
78
|
+
json: {
|
|
79
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
80
|
+
adminAddress: `0x${string}`;
|
|
81
|
+
lending: {
|
|
82
|
+
minInterest: number;
|
|
83
|
+
maxInterest: number;
|
|
84
|
+
minDuration: bigint;
|
|
85
|
+
maxDuration: bigint;
|
|
86
|
+
minimumProportionOverObligation: bigint;
|
|
87
|
+
};
|
|
88
|
+
discount?: {
|
|
89
|
+
burnForDiscount: {
|
|
90
|
+
burnableTokenAddress: `0x${string}`;
|
|
91
|
+
};
|
|
92
|
+
} | undefined;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
96
|
+
data: `0x${string}`;
|
|
97
|
+
to: `0x${string}`;
|
|
98
|
+
details: {
|
|
99
|
+
functionName: string;
|
|
100
|
+
address: `0x${string}`;
|
|
101
|
+
abi: any[];
|
|
102
|
+
args: any[];
|
|
103
|
+
};
|
|
104
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
|
|
105
|
+
//# sourceMappingURL=lending.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lending.routes.d.ts","sourceRoot":"","sources":["../../../../src/lending/deployMarket/v0/lending.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuBvC,wBAAgB,sCAAsC,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAcxF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DeployLendingMarketRequestSchema } from "./lending.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
|
+
import { createLendingPlatform } from "@evergonlabs/tmi-protocol-fractions-sdk";
|
|
6
|
+
import { discountConfig, getFeeConfig } from "../../../fractions/deployMarket/v0/index.js";
|
|
7
|
+
const route = describeRoute({
|
|
8
|
+
summary: "Deploy a lending market",
|
|
9
|
+
description: "Returns transaction data for deploying a lending market with fractionalized collateral",
|
|
10
|
+
tags: ["Lending"],
|
|
11
|
+
responses: {
|
|
12
|
+
200: {
|
|
13
|
+
description: "Returns transaction data for deploying a lending market",
|
|
14
|
+
content: {
|
|
15
|
+
"application/json": {
|
|
16
|
+
schema: resolver(TransactionSchema),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
export function createDeployLendingMarketTransactionV0(factory) {
|
|
23
|
+
return factory.createHandlers(route, validator("json", DeployLendingMarketRequestSchema), async (c) => {
|
|
24
|
+
const { chainId, adminAddress, lending, discount } = c.req.valid("json");
|
|
25
|
+
const fee = getFeeConfig();
|
|
26
|
+
const tx = createLendingPlatform({
|
|
27
|
+
chainId: chainId,
|
|
28
|
+
adminAddress: adminAddress,
|
|
29
|
+
fee: fee,
|
|
30
|
+
lending: lending,
|
|
31
|
+
discountConfig: discountConfig(discount),
|
|
32
|
+
});
|
|
33
|
+
return c.json(toTransaction(tx, true));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const LendingConfigSchema: z.ZodObject<{
|
|
3
|
+
minInterest: z.ZodNumber;
|
|
4
|
+
maxInterest: z.ZodNumber;
|
|
5
|
+
minDuration: z.ZodBigInt;
|
|
6
|
+
maxDuration: z.ZodBigInt;
|
|
7
|
+
minimumProportionOverObligation: z.ZodBigInt;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
minInterest: number;
|
|
10
|
+
maxInterest: number;
|
|
11
|
+
minDuration: bigint;
|
|
12
|
+
maxDuration: bigint;
|
|
13
|
+
minimumProportionOverObligation: bigint;
|
|
14
|
+
}, {
|
|
15
|
+
minInterest: number;
|
|
16
|
+
maxInterest: number;
|
|
17
|
+
minDuration: bigint;
|
|
18
|
+
maxDuration: bigint;
|
|
19
|
+
minimumProportionOverObligation: bigint;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const DeployLendingMarketRequestSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
22
|
+
chainId: z.ZodType<import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId, z.ZodTypeDef, import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId>;
|
|
23
|
+
adminAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
24
|
+
discount: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
burnForDiscount: z.ZodObject<{
|
|
26
|
+
burnableTokenAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
burnableTokenAddress: `0x${string}`;
|
|
29
|
+
}, {
|
|
30
|
+
burnableTokenAddress: `0x${string}`;
|
|
31
|
+
}>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
burnForDiscount: {
|
|
34
|
+
burnableTokenAddress: `0x${string}`;
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
burnForDiscount: {
|
|
38
|
+
burnableTokenAddress: `0x${string}`;
|
|
39
|
+
};
|
|
40
|
+
}>>;
|
|
41
|
+
cap: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
maxHardCap: z.ZodBigInt;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
maxHardCap: bigint;
|
|
45
|
+
}, {
|
|
46
|
+
maxHardCap: bigint;
|
|
47
|
+
}>>;
|
|
48
|
+
}, {
|
|
49
|
+
lending: z.ZodObject<{
|
|
50
|
+
minInterest: z.ZodNumber;
|
|
51
|
+
maxInterest: z.ZodNumber;
|
|
52
|
+
minDuration: z.ZodBigInt;
|
|
53
|
+
maxDuration: z.ZodBigInt;
|
|
54
|
+
minimumProportionOverObligation: z.ZodBigInt;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
minInterest: number;
|
|
57
|
+
maxInterest: number;
|
|
58
|
+
minDuration: bigint;
|
|
59
|
+
maxDuration: bigint;
|
|
60
|
+
minimumProportionOverObligation: bigint;
|
|
61
|
+
}, {
|
|
62
|
+
minInterest: number;
|
|
63
|
+
maxInterest: number;
|
|
64
|
+
minDuration: bigint;
|
|
65
|
+
maxDuration: bigint;
|
|
66
|
+
minimumProportionOverObligation: bigint;
|
|
67
|
+
}>;
|
|
68
|
+
}>, "cap">, "strip", z.ZodTypeAny, {
|
|
69
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
70
|
+
adminAddress: `0x${string}`;
|
|
71
|
+
lending: {
|
|
72
|
+
minInterest: number;
|
|
73
|
+
maxInterest: number;
|
|
74
|
+
minDuration: bigint;
|
|
75
|
+
maxDuration: bigint;
|
|
76
|
+
minimumProportionOverObligation: bigint;
|
|
77
|
+
};
|
|
78
|
+
discount?: {
|
|
79
|
+
burnForDiscount: {
|
|
80
|
+
burnableTokenAddress: `0x${string}`;
|
|
81
|
+
};
|
|
82
|
+
} | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
85
|
+
adminAddress: `0x${string}`;
|
|
86
|
+
lending: {
|
|
87
|
+
minInterest: number;
|
|
88
|
+
maxInterest: number;
|
|
89
|
+
minDuration: bigint;
|
|
90
|
+
maxDuration: bigint;
|
|
91
|
+
minimumProportionOverObligation: bigint;
|
|
92
|
+
};
|
|
93
|
+
discount?: {
|
|
94
|
+
burnForDiscount: {
|
|
95
|
+
burnableTokenAddress: `0x${string}`;
|
|
96
|
+
};
|
|
97
|
+
} | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
//# sourceMappingURL=lending.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lending.schema.d.ts","sourceRoot":"","sources":["../../../../src/lending/deployMarket/v0/lending.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DeployMarketRequestSchema } from "../../../fractions/deployMarket/v0/deployMarket.schema.js";
|
|
3
|
+
export const LendingConfigSchema = z.object({
|
|
4
|
+
minInterest: z.number(), // 0 to 100000 basis points (0% to 1000%)
|
|
5
|
+
maxInterest: z.number(), // 0 to 100000 basis points (0% to 1000%)
|
|
6
|
+
minDuration: z.coerce.bigint(), // Minimum duration in seconds
|
|
7
|
+
maxDuration: z.coerce.bigint(), // Maximum duration in seconds
|
|
8
|
+
minimumProportionOverObligation: z.coerce.bigint(),
|
|
9
|
+
});
|
|
10
|
+
export const DeployLendingMarketRequestSchema = DeployMarketRequestSchema.extend({
|
|
11
|
+
lending: LendingConfigSchema,
|
|
12
|
+
})
|
|
13
|
+
.omit({ cap: true })
|
|
14
|
+
.openapi({ ref: "DeployLendingMarketRequestSchema" });
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
export declare function createForcefullyUnlockWrappersNftTransactionV0<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
|
+
};
|
|
18
|
+
};
|
|
19
|
+
out: {
|
|
20
|
+
json: {
|
|
21
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
22
|
+
campaignId: bigint;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
26
|
+
data: `0x${string}`;
|
|
27
|
+
to: `0x${string}`;
|
|
28
|
+
details: {
|
|
29
|
+
functionName: string;
|
|
30
|
+
address: `0x${string}`;
|
|
31
|
+
abi: any[];
|
|
32
|
+
args: any[];
|
|
33
|
+
};
|
|
34
|
+
}, 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, {
|
|
35
|
+
in: {
|
|
36
|
+
json: {
|
|
37
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
38
|
+
campaignId: bigint;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
out: {
|
|
42
|
+
json: {
|
|
43
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
44
|
+
campaignId: bigint;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
48
|
+
data: `0x${string}`;
|
|
49
|
+
to: `0x${string}`;
|
|
50
|
+
details: {
|
|
51
|
+
functionName: string;
|
|
52
|
+
address: `0x${string}`;
|
|
53
|
+
abi: any[];
|
|
54
|
+
args: any[];
|
|
55
|
+
};
|
|
56
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
|
|
57
|
+
//# sourceMappingURL=forcefullyUnlockWrappersNft.routes.d.ts.map
|
package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forcefullyUnlockWrappersNft.routes.d.ts","sourceRoot":"","sources":["../../../../src/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAqBvC,wBAAgB,8CAA8C,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAehG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ForcefullyUnlockWrappersNftRequestSchema } from "./forcefullyUnlockWrappersNft.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: "Forcefully unlock wrapper NFT during liquidation",
|
|
7
|
+
description: "Returns transaction data for forcefully unlocking wrapper NFT when campaign is in liquidation state",
|
|
8
|
+
tags: ["Lending"],
|
|
9
|
+
responses: {
|
|
10
|
+
200: {
|
|
11
|
+
description: "Returns transaction data for forcefully unlocking wrapper NFT",
|
|
12
|
+
content: {
|
|
13
|
+
"application/json": {
|
|
14
|
+
schema: resolver(TransactionSchema),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export function createForcefullyUnlockWrappersNftTransactionV0(factory) {
|
|
21
|
+
return factory.createHandlers(route, validator("json", ForcefullyUnlockWrappersNftRequestSchema), 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: "forcefullyUnlockWrappersNft",
|
|
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 ForcefullyUnlockWrappersNftRequestSchema: 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=forcefullyUnlockWrappersNft.schema.d.ts.map
|
package/dist/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forcefullyUnlockWrappersNft.schema.d.ts","sourceRoot":"","sources":["../../../../src/lending/forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,wCAAwC;;;;;;;;;EAOU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TmiChainIdSchema } from "../../../common/index.js";
|
|
3
|
+
export const ForcefullyUnlockWrappersNftRequestSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
chainId: TmiChainIdSchema,
|
|
6
|
+
campaignId: z.coerce.bigint().openapi({
|
|
7
|
+
description: "The campaign ID to forcefully unlock wrapper NFT for",
|
|
8
|
+
}),
|
|
9
|
+
})
|
|
10
|
+
.openapi({ ref: "ForcefullyUnlockWrappersNftRequestSchema" });
|