@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,226 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
export declare const lendingApi: {
|
|
4
|
+
name: string;
|
|
5
|
+
createApp: <E extends Env>(factory: Factory<E>) => import("hono/hono-base").HonoBase<E, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
6
|
+
"/deploy": {
|
|
7
|
+
$post: {
|
|
8
|
+
input: {
|
|
9
|
+
json: {
|
|
10
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
11
|
+
adminAddress: `0x${string}`;
|
|
12
|
+
lending: {
|
|
13
|
+
minInterest: number;
|
|
14
|
+
maxInterest: number;
|
|
15
|
+
minDuration: bigint;
|
|
16
|
+
maxDuration: bigint;
|
|
17
|
+
minimumProportionOverObligation: bigint;
|
|
18
|
+
};
|
|
19
|
+
discount?: {
|
|
20
|
+
burnForDiscount: {
|
|
21
|
+
burnableTokenAddress: `0x${string}`;
|
|
22
|
+
};
|
|
23
|
+
} | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
output: {
|
|
27
|
+
data: `0x${string}`;
|
|
28
|
+
to: `0x${string}`;
|
|
29
|
+
details: {
|
|
30
|
+
functionName: string;
|
|
31
|
+
address: `0x${string}`;
|
|
32
|
+
abi: any[];
|
|
33
|
+
args: any[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
outputFormat: "json";
|
|
37
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
} & {
|
|
41
|
+
"/createSale": {
|
|
42
|
+
$post: {
|
|
43
|
+
input: {
|
|
44
|
+
json: {
|
|
45
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
46
|
+
fractions: {
|
|
47
|
+
symbol: string;
|
|
48
|
+
name: string;
|
|
49
|
+
amount: bigint;
|
|
50
|
+
token?: `0x${string}` | undefined;
|
|
51
|
+
};
|
|
52
|
+
cap: {
|
|
53
|
+
soft: bigint;
|
|
54
|
+
hard: bigint;
|
|
55
|
+
softPerAccount?: bigint | undefined;
|
|
56
|
+
hardPerAccount?: bigint | undefined;
|
|
57
|
+
};
|
|
58
|
+
market: `0x${string}`;
|
|
59
|
+
timeBoundary: {
|
|
60
|
+
start: Date;
|
|
61
|
+
end: Date;
|
|
62
|
+
};
|
|
63
|
+
wrapped: [{
|
|
64
|
+
values: [bigint, ...bigint[]];
|
|
65
|
+
type: "ERC20";
|
|
66
|
+
address: `0x${string}`;
|
|
67
|
+
} | {
|
|
68
|
+
type: "ERC721";
|
|
69
|
+
address: `0x${string}`;
|
|
70
|
+
tokenIds: [bigint, ...bigint[]];
|
|
71
|
+
} | {
|
|
72
|
+
values: [bigint, ...bigint[]];
|
|
73
|
+
type: "ERC1155";
|
|
74
|
+
address: `0x${string}`;
|
|
75
|
+
tokenIds: [bigint, ...bigint[]];
|
|
76
|
+
}, ...({
|
|
77
|
+
values: [bigint, ...bigint[]];
|
|
78
|
+
type: "ERC20";
|
|
79
|
+
address: `0x${string}`;
|
|
80
|
+
} | {
|
|
81
|
+
type: "ERC721";
|
|
82
|
+
address: `0x${string}`;
|
|
83
|
+
tokenIds: [bigint, ...bigint[]];
|
|
84
|
+
} | {
|
|
85
|
+
values: [bigint, ...bigint[]];
|
|
86
|
+
type: "ERC1155";
|
|
87
|
+
address: `0x${string}`;
|
|
88
|
+
tokenIds: [bigint, ...bigint[]];
|
|
89
|
+
})[]];
|
|
90
|
+
funding: [{
|
|
91
|
+
amountPerPacket: bigint;
|
|
92
|
+
token: `0x${string}`;
|
|
93
|
+
}, ...{
|
|
94
|
+
amountPerPacket: bigint;
|
|
95
|
+
token: `0x${string}`;
|
|
96
|
+
}[]];
|
|
97
|
+
refundAddress: `0x${string}`;
|
|
98
|
+
amountOfPacketsPerFraction: bigint;
|
|
99
|
+
buyback: {
|
|
100
|
+
durationSeconds: number;
|
|
101
|
+
interestPercentage: number;
|
|
102
|
+
liquidationLimitPercentage: number;
|
|
103
|
+
marginCallLimitPercentage: number;
|
|
104
|
+
};
|
|
105
|
+
discounts?: {
|
|
106
|
+
burnableTokenAddress: `0x${string}`;
|
|
107
|
+
amountToBurn: bigint;
|
|
108
|
+
percentDiscount: number;
|
|
109
|
+
} | undefined;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
output: {
|
|
113
|
+
data: `0x${string}`;
|
|
114
|
+
to: `0x${string}`;
|
|
115
|
+
details: {
|
|
116
|
+
functionName: string;
|
|
117
|
+
address: `0x${string}`;
|
|
118
|
+
abi: any[];
|
|
119
|
+
args: any[];
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
outputFormat: "json";
|
|
123
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
} & {
|
|
127
|
+
"/buyback": {
|
|
128
|
+
$post: {
|
|
129
|
+
input: {
|
|
130
|
+
json: {
|
|
131
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
132
|
+
campaignId: bigint;
|
|
133
|
+
buybackPacketsAmount: bigint;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
output: {
|
|
137
|
+
data: `0x${string}`;
|
|
138
|
+
to: `0x${string}`;
|
|
139
|
+
details: {
|
|
140
|
+
functionName: string;
|
|
141
|
+
address: `0x${string}`;
|
|
142
|
+
abi: any[];
|
|
143
|
+
args: any[];
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
outputFormat: "json";
|
|
147
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
} & {
|
|
151
|
+
"/setCollateralPrice": {
|
|
152
|
+
$post: {
|
|
153
|
+
input: {
|
|
154
|
+
json: {
|
|
155
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
156
|
+
campaignId: bigint;
|
|
157
|
+
collateralPriceInFundingPackets: bigint;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
output: {
|
|
161
|
+
data: `0x${string}`;
|
|
162
|
+
to: `0x${string}`;
|
|
163
|
+
details: {
|
|
164
|
+
functionName: string;
|
|
165
|
+
address: `0x${string}`;
|
|
166
|
+
abi: any[];
|
|
167
|
+
args: any[];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
outputFormat: "json";
|
|
171
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
} & {
|
|
175
|
+
"/forcefullyUnlockWrappersNft": {
|
|
176
|
+
$post: {
|
|
177
|
+
input: {
|
|
178
|
+
json: {
|
|
179
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
180
|
+
campaignId: bigint;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
output: {
|
|
184
|
+
data: `0x${string}`;
|
|
185
|
+
to: `0x${string}`;
|
|
186
|
+
details: {
|
|
187
|
+
functionName: string;
|
|
188
|
+
address: `0x${string}`;
|
|
189
|
+
abi: any[];
|
|
190
|
+
args: any[];
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
outputFormat: "json";
|
|
194
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
} & {
|
|
198
|
+
"/buyBackAfterLiquidation": {
|
|
199
|
+
$post: {
|
|
200
|
+
input: {
|
|
201
|
+
json: {
|
|
202
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
203
|
+
campaignId: bigint;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
output: {
|
|
207
|
+
data: `0x${string}`;
|
|
208
|
+
to: `0x${string}`;
|
|
209
|
+
details: {
|
|
210
|
+
functionName: string;
|
|
211
|
+
address: `0x${string}`;
|
|
212
|
+
abi: any[];
|
|
213
|
+
args: any[];
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
outputFormat: "json";
|
|
217
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
}, "/markets">, "/v0/lending">, "/">;
|
|
221
|
+
config: {
|
|
222
|
+
title: string;
|
|
223
|
+
description: string;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lending/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAmBvC,eAAO,MAAM,UAAU;;gBAET,CAAC,SAAS,GAAG,WAAW,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM/C,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createDeployLendingMarketTransactionV0 } from "./deployMarket/v0/lending.routes.js";
|
|
2
|
+
import { createBuybackTransactionV0 } from "./buyback/v0/buyback.routes.js";
|
|
3
|
+
import { createSetCollateralPriceTransactionV0 } from "./setCollateralPrice/v0/setCollateralPrice.routes.js";
|
|
4
|
+
import { createForcefullyUnlockWrappersNftTransactionV0 } from "./forcefullyUnlockWrappersNft/v0/forcefullyUnlockWrappersNft.routes.js";
|
|
5
|
+
import { createBuyBackAfterLiquidationTransactionV0 } from "./buyBackAfterLiquidation/v0/buyBackAfterLiquidation.routes.js";
|
|
6
|
+
import { createLendingSale } from "./createLendingSale.js";
|
|
7
|
+
function createLendingMarketsApp(factory) {
|
|
8
|
+
return factory
|
|
9
|
+
.createApp()
|
|
10
|
+
.post("/deploy", ...createDeployLendingMarketTransactionV0(factory))
|
|
11
|
+
.post("/createSale", ...createLendingSale(factory))
|
|
12
|
+
.post("/buyback", ...createBuybackTransactionV0(factory))
|
|
13
|
+
.post("/setCollateralPrice", ...createSetCollateralPriceTransactionV0(factory))
|
|
14
|
+
.post("/forcefullyUnlockWrappersNft", ...createForcefullyUnlockWrappersNftTransactionV0(factory))
|
|
15
|
+
.post("/buyBackAfterLiquidation", ...createBuyBackAfterLiquidationTransactionV0(factory));
|
|
16
|
+
}
|
|
17
|
+
export const lendingApi = {
|
|
18
|
+
name: "Lending API",
|
|
19
|
+
createApp: (factory) => factory.createApp().route("/v0/lending", factory.createApp().route("/markets", createLendingMarketsApp(factory))),
|
|
20
|
+
config: {
|
|
21
|
+
title: "Lending API",
|
|
22
|
+
description: "Create and manage lending markets with collateral",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
export declare function createSetCollateralPriceTransactionV0<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
|
+
collateralPriceInFundingPackets: bigint;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
out: {
|
|
21
|
+
json: {
|
|
22
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
23
|
+
campaignId: bigint;
|
|
24
|
+
collateralPriceInFundingPackets: 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
|
+
collateralPriceInFundingPackets: bigint;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
out: {
|
|
45
|
+
json: {
|
|
46
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
47
|
+
campaignId: bigint;
|
|
48
|
+
collateralPriceInFundingPackets: 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=setCollateralPrice.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setCollateralPrice.routes.d.ts","sourceRoot":"","sources":["../../../../src/lending/setCollateralPrice/v0/setCollateralPrice.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAqBvC,wBAAgB,qCAAqC,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAevF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SetCollateralPriceRequestSchema } from "./setCollateralPrice.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: "Set collateral price for lending market",
|
|
7
|
+
description: "Returns transaction data for setting the collateral price in a lending market",
|
|
8
|
+
tags: ["Lending"],
|
|
9
|
+
responses: {
|
|
10
|
+
200: {
|
|
11
|
+
description: "Returns transaction data for setting collateral price",
|
|
12
|
+
content: {
|
|
13
|
+
"application/json": {
|
|
14
|
+
schema: resolver(TransactionSchema),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export function createSetCollateralPriceTransactionV0(factory) {
|
|
21
|
+
return factory.createHandlers(route, validator("json", SetCollateralPriceRequestSchema), async (c) => {
|
|
22
|
+
const { campaignId, collateralPriceInFundingPackets } = 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: "setCollateralPrice",
|
|
29
|
+
args: [campaignId, collateralPriceInFundingPackets],
|
|
30
|
+
};
|
|
31
|
+
return c.json(toTransaction(tx));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SetCollateralPriceRequestSchema: 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
|
+
collateralPriceInFundingPackets: z.ZodBigInt;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
8
|
+
campaignId: bigint;
|
|
9
|
+
collateralPriceInFundingPackets: bigint;
|
|
10
|
+
}, {
|
|
11
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
12
|
+
campaignId: bigint;
|
|
13
|
+
collateralPriceInFundingPackets: bigint;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=setCollateralPrice.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setCollateralPrice.schema.d.ts","sourceRoot":"","sources":["../../../../src/lending/setCollateralPrice/v0/setCollateralPrice.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAUU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TmiChainIdSchema } from "../../../common/index.js";
|
|
3
|
+
export const SetCollateralPriceRequestSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
chainId: TmiChainIdSchema,
|
|
6
|
+
campaignId: z.coerce.bigint().openapi({
|
|
7
|
+
description: "The campaign ID to set collateral price for",
|
|
8
|
+
}),
|
|
9
|
+
collateralPriceInFundingPackets: z.coerce.bigint().openapi({
|
|
10
|
+
description: "Collateral price in funding packets",
|
|
11
|
+
}),
|
|
12
|
+
})
|
|
13
|
+
.openapi({ ref: "SetCollateralPriceRequestSchema" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evergonlabs/tmi-protocol-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@evergonlabs/tmi-contracts-fractions-sdk": "1.1.0",
|
|
23
|
-
"@evergonlabs/tmi-evm-contracts": "0.
|
|
23
|
+
"@evergonlabs/tmi-evm-contracts": "0.6.0",
|
|
24
24
|
"@evergonlabs/tmi-utils": "^0.2.0",
|
|
25
25
|
"@hono/node-server": "^1.19.3",
|
|
26
26
|
"@hono/swagger-ui": "^0.5.2",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"viem": "^2.23.2",
|
|
38
38
|
"zod": "^3.25.0",
|
|
39
39
|
"zod-openapi": "^4.2.4",
|
|
40
|
-
"@evergonlabs/tmi-protocol-indexer": "0.1.1",
|
|
41
|
-
"@evergonlabs/tmi-protocol-staking-sdk": "0.2.1",
|
|
42
40
|
"@evergonlabs/tmi-protocol-fractions-sdk": "0.2.1",
|
|
41
|
+
"@evergonlabs/tmi-protocol-indexer": "0.1.1",
|
|
43
42
|
"@evergonlabs/tmi-protocol-shared": "0.1.0",
|
|
44
|
-
"@evergonlabs/tmi-protocol-
|
|
45
|
-
"@evergonlabs/tmi-protocol-
|
|
43
|
+
"@evergonlabs/tmi-protocol-types": "0.2.1",
|
|
44
|
+
"@evergonlabs/tmi-protocol-staking-sdk": "0.2.1",
|
|
45
|
+
"@evergonlabs/tmi-protocol-utils": "0.2.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@evergonlabs/tmi-eslint-config": "^0.1.3",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
export declare function createSearchClaimV0App<E extends Env>(factory: Factory<E>): [import("hono/types").H<any, string, {}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>, import("hono/types").H<Env, string, {
|
|
4
|
-
in: {
|
|
5
|
-
json: {
|
|
6
|
-
filter: {
|
|
7
|
-
chainId?: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId | undefined;
|
|
8
|
-
platform?: `0x${string}` | undefined;
|
|
9
|
-
campaignId?: string | number | bigint | undefined;
|
|
10
|
-
claimer?: `0x${string}` | undefined;
|
|
11
|
-
};
|
|
12
|
-
page: {
|
|
13
|
-
skip: number;
|
|
14
|
-
limit: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
out: {
|
|
19
|
-
json: {
|
|
20
|
-
filter: {
|
|
21
|
-
chainId?: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId | undefined;
|
|
22
|
-
platform?: `0x${string}` | undefined;
|
|
23
|
-
campaignId?: bigint | undefined;
|
|
24
|
-
claimer?: `0x${string}` | undefined;
|
|
25
|
-
};
|
|
26
|
-
page: {
|
|
27
|
-
skip: number;
|
|
28
|
-
limit: number;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>, import("hono/types").H<import("hono/utils/types").IfAnyThenEmptyObject<E extends Env ? Env extends E ? {} : E : E> & {}, string, {
|
|
33
|
-
in: {
|
|
34
|
-
json: {
|
|
35
|
-
filter: {
|
|
36
|
-
chainId?: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId | undefined;
|
|
37
|
-
platform?: `0x${string}` | undefined;
|
|
38
|
-
campaignId?: string | number | bigint | undefined;
|
|
39
|
-
claimer?: `0x${string}` | undefined;
|
|
40
|
-
};
|
|
41
|
-
page: {
|
|
42
|
-
skip: number;
|
|
43
|
-
limit: number;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
out: {
|
|
48
|
-
json: {
|
|
49
|
-
filter: {
|
|
50
|
-
chainId?: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId | undefined;
|
|
51
|
-
platform?: `0x${string}` | undefined;
|
|
52
|
-
campaignId?: bigint | undefined;
|
|
53
|
-
claimer?: `0x${string}` | undefined;
|
|
54
|
-
};
|
|
55
|
-
page: {
|
|
56
|
-
skip: number;
|
|
57
|
-
limit: number;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>];
|
|
62
|
-
//# sourceMappingURL=searchClaim.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchClaim.route.d.ts","sourceRoot":"","sources":["../../../src/fractions/sales/searchClaim.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAWvC,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAqDxE"}
|
|
@@ -1,47 +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
|
-
import { FractionsSaleSchema } from "./common/fractionsSale.js";
|
|
10
|
-
export function createSearchClaimV0App(factory) {
|
|
11
|
-
return factory.createHandlers(describeRoute({
|
|
12
|
-
summary: "Search claim events",
|
|
13
|
-
description: "Search claim events by users, platforms and pools",
|
|
14
|
-
tags: ["Fractions"],
|
|
15
|
-
responses: {
|
|
16
|
-
200: {
|
|
17
|
-
description: "Returns list of claim events within specified platforms and pools",
|
|
18
|
-
content: {
|
|
19
|
-
"application/json": {
|
|
20
|
-
schema: resolver(z.array(FractionsSaleSchema)),
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
}), validator("json", z.object({
|
|
26
|
-
page: PageSchema,
|
|
27
|
-
filter: z.object({
|
|
28
|
-
chainId: TmiChainIdSchema.optional(),
|
|
29
|
-
claimer: AddressSchema.optional(),
|
|
30
|
-
platform: PlatformContractAddress.optional(),
|
|
31
|
-
campaignId: CampaignIdSchema.optional(),
|
|
32
|
-
}),
|
|
33
|
-
})), async (c) => {
|
|
34
|
-
const { page, filter } = c.req.valid("json");
|
|
35
|
-
const { fractions: { fractionsClaims }, } = indexerSchemas;
|
|
36
|
-
const result = await indexerClient.db.query.fractionsClaims.findMany({
|
|
37
|
-
with: {
|
|
38
|
-
fractionSale: true,
|
|
39
|
-
},
|
|
40
|
-
where: and(filter.chainId ? eq(fractionsClaims.chainId, Number(filter.chainId)) : undefined, filter.claimer ? eq(fractionsClaims.receiver, filter.claimer) : undefined, filter.platform ? eq(fractionsClaims.diamondAddress, filter.platform) : undefined, typeof filter.campaignId === "number" ? eq(fractionsClaims.saleId, BigInt(filter.campaignId)) : undefined),
|
|
41
|
-
limit: page.limit,
|
|
42
|
-
offset: page.skip,
|
|
43
|
-
orderBy: fractionsClaims.createdAt,
|
|
44
|
-
});
|
|
45
|
-
return c.json(result, 200);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
import { z } from "../../common/zod.js";
|
|
4
|
-
export declare const FractionsPurchaseSchema: z.ZodObject<{
|
|
5
|
-
chainId: z.ZodType<import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId, z.ZodTypeDef, import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId>;
|
|
6
|
-
platform: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
7
|
-
campaignId: z.ZodString;
|
|
8
|
-
buyerAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
9
|
-
amountOfFractions: z.ZodString;
|
|
10
|
-
priceId: z.ZodString;
|
|
11
|
-
txHash: z.ZodString;
|
|
12
|
-
createdAt: z.ZodDate;
|
|
13
|
-
updatedAt: z.ZodDate;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
16
|
-
platform: `0x${string}`;
|
|
17
|
-
campaignId: string;
|
|
18
|
-
txHash: string;
|
|
19
|
-
createdAt: Date;
|
|
20
|
-
updatedAt: Date;
|
|
21
|
-
buyerAddress: `0x${string}`;
|
|
22
|
-
amountOfFractions: string;
|
|
23
|
-
priceId: string;
|
|
24
|
-
}, {
|
|
25
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
26
|
-
platform: `0x${string}`;
|
|
27
|
-
campaignId: string;
|
|
28
|
-
txHash: string;
|
|
29
|
-
createdAt: Date;
|
|
30
|
-
updatedAt: Date;
|
|
31
|
-
buyerAddress: `0x${string}`;
|
|
32
|
-
amountOfFractions: string;
|
|
33
|
-
priceId: string;
|
|
34
|
-
}>;
|
|
35
|
-
export declare function createSearchPurchasesV0App<E extends Env>(factory: Factory<E>): [import("hono/types").H<any, string, {}, Promise<Response & import("hono").TypedResponse<{
|
|
36
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
37
|
-
platform: `0x${string}`;
|
|
38
|
-
campaignId: string;
|
|
39
|
-
txHash: string;
|
|
40
|
-
createdAt: string;
|
|
41
|
-
updatedAt: string;
|
|
42
|
-
buyerAddress: `0x${string}`;
|
|
43
|
-
amountOfFractions: string;
|
|
44
|
-
priceId: string;
|
|
45
|
-
}[], 200, "json">>>, import("hono/types").H<Env, string, {
|
|
46
|
-
in: {
|
|
47
|
-
json: {
|
|
48
|
-
filter: {
|
|
49
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
50
|
-
platform: `0x${string}`;
|
|
51
|
-
campaignId: string | number | bigint;
|
|
52
|
-
};
|
|
53
|
-
page: {
|
|
54
|
-
skip: number;
|
|
55
|
-
limit: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
out: {
|
|
60
|
-
json: {
|
|
61
|
-
filter: {
|
|
62
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
63
|
-
platform: `0x${string}`;
|
|
64
|
-
campaignId: bigint;
|
|
65
|
-
};
|
|
66
|
-
page: {
|
|
67
|
-
skip: number;
|
|
68
|
-
limit: number;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}, Promise<Response & import("hono").TypedResponse<{
|
|
73
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
74
|
-
platform: `0x${string}`;
|
|
75
|
-
campaignId: string;
|
|
76
|
-
txHash: string;
|
|
77
|
-
createdAt: string;
|
|
78
|
-
updatedAt: string;
|
|
79
|
-
buyerAddress: `0x${string}`;
|
|
80
|
-
amountOfFractions: string;
|
|
81
|
-
priceId: string;
|
|
82
|
-
}[], 200, "json">>>, import("hono/types").H<import("hono/utils/types").IfAnyThenEmptyObject<E extends Env ? Env extends E ? {} : E : E> & {}, string, {
|
|
83
|
-
in: {
|
|
84
|
-
json: {
|
|
85
|
-
filter: {
|
|
86
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
87
|
-
platform: `0x${string}`;
|
|
88
|
-
campaignId: string | number | bigint;
|
|
89
|
-
};
|
|
90
|
-
page: {
|
|
91
|
-
skip: number;
|
|
92
|
-
limit: number;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
out: {
|
|
97
|
-
json: {
|
|
98
|
-
filter: {
|
|
99
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
100
|
-
platform: `0x${string}`;
|
|
101
|
-
campaignId: bigint;
|
|
102
|
-
};
|
|
103
|
-
page: {
|
|
104
|
-
skip: number;
|
|
105
|
-
limit: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
}, Promise<Response & import("hono").TypedResponse<{
|
|
110
|
-
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
111
|
-
platform: `0x${string}`;
|
|
112
|
-
campaignId: string;
|
|
113
|
-
txHash: string;
|
|
114
|
-
createdAt: string;
|
|
115
|
-
updatedAt: string;
|
|
116
|
-
buyerAddress: `0x${string}`;
|
|
117
|
-
amountOfFractions: string;
|
|
118
|
-
priceId: string;
|
|
119
|
-
}[], 200, "json">>>];
|
|
120
|
-
//# sourceMappingURL=searchPurchase.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchPurchase.route.d.ts","sourceRoot":"","sources":["../../../src/fractions/sales/searchPurchase.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAMxC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAchC,CAAC;AAEL,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkE5E"}
|