@evergonlabs/tmi-protocol-api 0.4.0 → 0.5.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 +476 -157
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +4 -0
- package/dist/client.d.ts +529 -157
- package/dist/client.d.ts.map +1 -1
- package/dist/common/abis/erc20Whitelisted.d.ts +27 -12
- package/dist/common/abis/erc20Whitelisted.d.ts.map +1 -1
- package/dist/common/abis/erc20Whitelisted.js +192 -1
- package/dist/common/blockchain.d.ts +20 -26
- package/dist/common/blockchain.d.ts.map +1 -1
- package/dist/common/blockchain.js +22 -19
- package/dist/common/config.d.ts +43 -1
- package/dist/common/config.d.ts.map +1 -1
- package/dist/common/config.js +47 -25
- package/dist/common/context.d.ts +11 -0
- package/dist/common/context.d.ts.map +1 -0
- package/dist/common/context.js +0 -0
- package/dist/common/indexer/client.d.ts +3 -2
- package/dist/common/indexer/client.d.ts.map +1 -1
- package/dist/common/indexer/schemas.d.ts +1 -1
- package/dist/common/indexer/schemas.d.ts.map +1 -1
- package/dist/common/middleware/indexer.d.ts +3 -0
- package/dist/common/middleware/indexer.d.ts.map +1 -0
- package/dist/common/middleware/indexer.js +7 -0
- package/dist/common/models/asset.d.ts +4 -4
- package/dist/common/models/chainId.d.ts +3 -0
- package/dist/common/models/chainId.d.ts.map +1 -1
- package/dist/common/models/chainId.js +6 -14
- package/dist/common/models/numOrStr.d.ts +7 -0
- package/dist/common/models/numOrStr.d.ts.map +1 -0
- package/dist/common/models/numOrStr.js +11 -0
- package/dist/common/models/platform.d.ts +1 -1
- package/dist/common/models/platform.d.ts.map +1 -1
- package/dist/common/models/platform.js +1 -1
- package/dist/common/models/routes.d.ts +2 -2
- package/dist/common/models/transaction.d.ts +8 -8
- package/dist/common/models/transaction.d.ts.map +1 -1
- package/dist/common/models/transaction.js +1 -1
- package/dist/fractions/activity/searchActivity.route.d.ts +17 -17
- package/dist/fractions/activity/searchActivity.route.d.ts.map +1 -1
- package/dist/fractions/activity/searchActivity.route.js +1 -2
- package/dist/fractions/activity/utils.d.ts +8 -8
- package/dist/fractions/approveSale/v0/approveSale.route.d.ts +3 -3
- package/dist/fractions/approveWrapper/v0/approveWrapper.route.d.ts +9 -9
- package/dist/fractions/completeSale/v0/completeSale.route.d.ts +3 -3
- package/dist/fractions/createFractions/v0/createFractions.route.d.ts +19 -19
- package/dist/fractions/createFractions/v0/createFractions.schema.d.ts +20 -20
- package/dist/fractions/deployMarket/v0/deployMarket.routes.d.ts +25 -12
- package/dist/fractions/deployMarket/v0/deployMarket.routes.d.ts.map +1 -1
- package/dist/fractions/deployMarket/v0/deployMarket.routes.js +3 -2
- 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/deployMarket/v0/initNid.route.d.ts +3 -3
- package/dist/fractions/grantRole/v0/grantRole.route.d.ts +3 -3
- package/dist/fractions/index.d.ts +141 -77
- package/dist/fractions/index.d.ts.map +1 -1
- package/dist/fractions/index.js +5 -3
- package/dist/fractions/markets/common/platform.d.ts +11 -11
- package/dist/fractions/markets/getMarket/index.d.ts +19 -19
- package/dist/fractions/markets/getMarket/index.d.ts.map +1 -1
- package/dist/fractions/markets/getMarket/v0/getMarket.d.ts +17 -17
- package/dist/fractions/markets/getMarket/v0/getMarket.d.ts.map +1 -1
- package/dist/fractions/markets/getMarket/v0/getMarket.js +1 -2
- package/dist/fractions/markets/index.d.ts +22 -22
- package/dist/fractions/markets/index.d.ts.map +1 -1
- package/dist/fractions/markets/searchMarkets/index.d.ts +5 -5
- package/dist/fractions/markets/searchMarkets/index.d.ts.map +1 -1
- package/dist/fractions/markets/searchMarkets/v0/searchMarkets.d.ts +13 -13
- package/dist/fractions/markets/searchMarkets/v0/searchMarkets.d.ts.map +1 -1
- package/dist/fractions/markets/searchMarkets/v0/searchMarkets.js +1 -2
- package/dist/fractions/purchase/v0/purchase.route.d.ts +3 -3
- package/dist/fractions/purchase/v0/statistics.route.d.ts +15 -15
- package/dist/fractions/purchase/v0/statistics.route.d.ts.map +1 -1
- package/dist/fractions/purchase/v0/statistics.route.js +3 -3
- package/dist/fractions/sales/common/fractionsSale.d.ts +40 -40
- package/dist/fractions/sales/getFractionSaleStatistics.route.d.ts +13 -13
- package/dist/fractions/sales/getFractionSaleStatistics.route.d.ts.map +1 -1
- package/dist/fractions/sales/getFractionSaleStatistics.route.js +3 -3
- package/dist/fractions/sales/getVaultAddress.d.ts +4 -4
- package/dist/fractions/sales/getVaultAddress.d.ts.map +1 -1
- package/dist/fractions/sales/getVaultAddress.js +3 -3
- package/dist/fractions/sales/receiveFundsAfterNonFunded.route.d.ts +6 -6
- package/dist/fractions/sales/receiveNonPurchasedWrappedAssets.route.d.ts +3 -3
- package/dist/fractions/sales/recoverFractions.d.ts +3 -3
- package/dist/fractions/sales/rejectFractions.d.ts +3 -3
- package/dist/fractions/sales/searchSales/v0/searchSales.d.ts +32 -32
- package/dist/fractions/sales/searchSales/v0/searchSales.d.ts.map +1 -1
- package/dist/fractions/sales/searchSales/v0/searchSales.js +1 -2
- package/dist/fractions/sales/searchWithdrawal.route.d.ts +7 -7
- package/dist/fractions/sales/searchWithdrawal.route.d.ts.map +1 -1
- package/dist/fractions/sales/searchWithdrawal.route.js +1 -2
- package/dist/fractions/sales/setFeeCapLimit.d.ts +3 -3
- package/dist/fractions/sales/unlockWrappedAssets.route.d.ts +3 -3
- package/dist/fractions/sales/vesting/v0/claimStatistics.route.d.ts +17 -17
- package/dist/fractions/sales/vesting/v0/claimStatistics.route.d.ts.map +1 -1
- package/dist/fractions/sales/vesting/v0/claimStatistics.route.js +6 -5
- package/dist/fractions/sales/vesting/v0/claimVestedTokens.route.d.ts +9 -9
- package/dist/fractions/sales/vesting/v0/editCliff.route.d.ts +3 -3
- package/dist/fractions/withdraw/v0/withdraw.route.d.ts +3 -3
- package/dist/general/balanceClient.d.ts +6 -6
- package/dist/general/common.d.ts +6 -6
- package/dist/general/estimateGas.d.ts +8 -8
- package/dist/general/getBalance.d.ts +4 -4
- package/dist/general/getBalancesBatch.d.ts +4 -4
- package/dist/general/index.d.ts +5 -5
- package/dist/general/searchBalances.d.ts +4 -4
- package/dist/general/utils/tokenBalance/tokenBalance.d.ts +3 -3
- package/dist/issuance/approve.d.ts +3 -3
- package/dist/issuance/burn.d.ts +3 -3
- package/dist/issuance/common.d.ts +2 -0
- package/dist/issuance/common.d.ts.map +1 -0
- package/dist/issuance/common.js +1 -0
- package/dist/issuance/deploy.d.ts +7 -0
- package/dist/issuance/deploy.d.ts.map +1 -1
- package/dist/issuance/deploy.js +44 -3
- package/dist/issuance/getInitData.d.ts +75 -0
- package/dist/issuance/getInitData.d.ts.map +1 -0
- package/dist/issuance/getInitData.js +53 -0
- package/dist/issuance/grantRole.d.ts +9 -9
- package/dist/issuance/index.d.ts +71 -15
- package/dist/issuance/index.d.ts.map +1 -1
- package/dist/issuance/index.js +7 -2
- package/dist/issuance/mint.d.ts +3 -3
- package/dist/issuance/recover.d.ts +82 -0
- package/dist/issuance/recover.d.ts.map +1 -0
- package/dist/issuance/recover.js +38 -0
- package/dist/issuance/renounceRole.d.ts +9 -9
- package/dist/issuance/transfer.d.ts +9 -9
- package/dist/issuance/upgrade.d.ts +3 -3
- package/dist/staking/index.d.ts +10 -10
- package/dist/staking/index.d.ts.map +1 -1
- package/dist/staking/platforms/getPlatform/index.d.ts +3 -3
- package/dist/staking/platforms/getPlatform/index.d.ts.map +1 -1
- package/dist/staking/platforms/getPlatform/v0/getPlatform.d.ts +8 -8
- package/dist/staking/platforms/getPlatform/v0/getPlatform.d.ts.map +1 -1
- package/dist/staking/platforms/getPlatform/v0/getPlatform.js +3 -3
- package/dist/staking/platforms/index.d.ts +3 -3
- package/dist/staking/platforms/index.d.ts.map +1 -1
- package/dist/staking/platforms/searchPlatforms/index.d.ts +2 -2
- package/dist/staking/platforms/searchPlatforms/index.d.ts.map +1 -1
- package/dist/staking/platforms/searchPlatforms/v0/searchPlatforms.d.ts +4 -4
- package/dist/staking/platforms/searchPlatforms/v0/searchPlatforms.d.ts.map +1 -1
- package/dist/staking/platforms/searchPlatforms/v0/searchPlatforms.js +3 -3
- package/dist/staking/pools/common/pool.d.ts +4 -4
- package/dist/staking/pools/getPool/index.d.ts +3 -3
- package/dist/staking/pools/getPool/index.d.ts.map +1 -1
- package/dist/staking/pools/getPool/v0/getPool.d.ts +7 -7
- package/dist/staking/pools/getPool/v0/getPool.d.ts.map +1 -1
- package/dist/staking/pools/getPool/v0/getPool.js +3 -3
- package/dist/staking/pools/index.d.ts +3 -3
- package/dist/staking/pools/index.d.ts.map +1 -1
- package/dist/staking/pools/searchPools/index.d.ts +2 -2
- package/dist/staking/pools/searchPools/index.d.ts.map +1 -1
- package/dist/staking/pools/searchPools/v0/searchPools.d.ts +3 -3
- package/dist/staking/pools/searchPools/v0/searchPools.d.ts.map +1 -1
- package/dist/staking/pools/searchPools/v0/searchPools.js +3 -3
- package/dist/staking/roles/common/roleAssignment.d.ts +2 -2
- package/dist/staking/roles/common/roleEvent.d.ts +4 -4
- package/dist/staking/roles/grantRole/index.d.ts +1 -1
- package/dist/staking/roles/grantRole/v0/grantRole.d.ts +3 -3
- package/dist/staking/roles/index.d.ts +5 -5
- package/dist/staking/roles/index.d.ts.map +1 -1
- package/dist/staking/roles/searchRoleEvents/index.d.ts +3 -3
- package/dist/staking/roles/searchRoleEvents/index.d.ts.map +1 -1
- package/dist/staking/roles/searchRoleEvents/v0/searchRoleEvents.d.ts +7 -7
- package/dist/staking/roles/searchRoleEvents/v0/searchRoleEvents.d.ts.map +1 -1
- package/dist/staking/roles/searchRoleEvents/v0/searchRoleEvents.js +3 -3
- package/dist/staking/roles/searchRoles/index.d.ts +3 -3
- package/dist/staking/roles/searchRoles/index.d.ts.map +1 -1
- package/dist/staking/roles/searchRoles/v0/searchRoles.d.ts +7 -7
- package/dist/staking/roles/searchRoles/v0/searchRoles.d.ts.map +1 -1
- package/dist/staking/roles/searchRoles/v0/searchRoles.js +3 -3
- package/dist/staking/stakes/common/stake.d.ts +2 -2
- package/dist/staking/stakes/common/stakeEvent.d.ts +4 -4
- package/dist/staking/stakes/getStake/index.d.ts +3 -3
- package/dist/staking/stakes/getStake/index.d.ts.map +1 -1
- package/dist/staking/stakes/getStake/v0/getStake.d.ts +7 -7
- package/dist/staking/stakes/getStake/v0/getStake.d.ts.map +1 -1
- package/dist/staking/stakes/getStake/v0/getStake.js +3 -3
- package/dist/staking/stakes/index.d.ts +5 -5
- package/dist/staking/stakes/index.d.ts.map +1 -1
- package/dist/staking/stakes/searchStakeEvents/index.d.ts +3 -3
- package/dist/staking/stakes/searchStakeEvents/index.d.ts.map +1 -1
- package/dist/staking/stakes/searchStakeEvents/v0/searchStakeEvents.d.ts +7 -7
- package/dist/staking/stakes/searchStakeEvents/v0/searchStakeEvents.d.ts.map +1 -1
- package/dist/staking/stakes/searchStakeEvents/v0/searchStakeEvents.js +3 -3
- package/dist/staking/stakes/searchStakes/index.d.ts +3 -3
- package/dist/staking/stakes/searchStakes/index.d.ts.map +1 -1
- package/dist/staking/stakes/searchStakes/v0/searchStakes.d.ts +7 -7
- package/dist/staking/stakes/searchStakes/v0/searchStakes.d.ts.map +1 -1
- package/dist/staking/stakes/searchStakes/v0/searchStakes.js +3 -3
- package/dist/staking-templates/index.d.ts +42 -42
- package/dist/staking-templates/templates/common/getReward.d.ts +7 -7
- package/dist/staking-templates/templates/common/partialUnstake.d.ts +7 -7
- package/dist/staking-templates/templates/common/rewardDistribution.js +2 -2
- package/dist/staking-templates/templates/common/unstake.d.ts +7 -7
- package/dist/staking-templates/templates/reputation/index.d.ts +13 -13
- package/dist/staking-templates/templates/reputation/v0/createPlatform.d.ts +3 -3
- package/dist/staking-templates/templates/reputation/v0/createPool.d.ts +7 -7
- package/dist/staking-templates/templates/reputation/v0/index.d.ts +13 -13
- package/dist/staking-templates/templates/reputation/v0/restake.d.ts +7 -7
- package/dist/staking-templates/templates/reputation/v0/stake.d.ts +7 -7
- package/dist/staking-templates/templates/reputationLock/index.d.ts +13 -13
- package/dist/staking-templates/templates/reputationLock/v0/createPlatform.d.ts +3 -3
- package/dist/staking-templates/templates/reputationLock/v0/createPool.d.ts +7 -7
- package/dist/staking-templates/templates/reputationLock/v0/index.d.ts +13 -13
- package/dist/staking-templates/templates/reputationLock/v0/restake.d.ts +7 -7
- package/dist/staking-templates/templates/reputationLock/v0/stake.d.ts +7 -7
- package/dist/staking-templates/templates/rwa/index.d.ts +16 -16
- package/dist/staking-templates/templates/rwa/v0/createPlatform.d.ts +3 -3
- package/dist/staking-templates/templates/rwa/v0/createPool.d.ts +7 -7
- package/dist/staking-templates/templates/rwa/v0/distributeRewards.d.ts +61 -0
- package/dist/staking-templates/templates/rwa/v0/distributeRewards.d.ts.map +1 -0
- package/dist/staking-templates/templates/rwa/v0/distributeRewards.js +41 -0
- package/dist/staking-templates/templates/rwa/v0/index.d.ts +16 -16
- package/dist/staking-templates/templates/rwa/v0/index.js +2 -2
- package/dist/staking-templates/templates/rwa/v0/restake.d.ts +7 -7
- package/dist/staking-templates/templates/rwa/v0/stake.d.ts +7 -7
- package/dist/v0/fractions/index.d.ts +68 -0
- package/dist/v0/fractions/index.d.ts.map +1 -0
- package/dist/v0/fractions/index.js +9 -0
- package/dist/v0/fractions/networkStatistics.route.d.ts +176 -0
- package/dist/v0/fractions/networkStatistics.route.d.ts.map +1 -0
- package/dist/v0/fractions/networkStatistics.route.js +354 -0
- package/dist/v1/fractions/lending/buyback/buyback.routes.d.ts +65 -0
- package/dist/v1/fractions/lending/buyback/buyback.routes.d.ts.map +1 -0
- package/dist/v1/fractions/lending/buyback/buyback.routes.js +27 -0
- package/dist/v1/fractions/lending/buyback/buyback.schema.d.ts +19 -0
- package/dist/v1/fractions/lending/buyback/buyback.schema.d.ts.map +1 -0
- package/dist/v1/fractions/lending/buyback/buyback.schema.js +12 -0
- package/dist/v1/fractions/lending/createLendingSale.d.ts +585 -0
- package/dist/v1/fractions/lending/createLendingSale.d.ts.map +1 -0
- package/dist/v1/fractions/lending/createLendingSale.js +81 -0
- package/dist/v1/fractions/lending/deployMarket/lending.routes.d.ts +117 -0
- package/dist/v1/fractions/lending/deployMarket/lending.routes.d.ts.map +1 -0
- package/dist/v1/fractions/lending/deployMarket/lending.routes.js +35 -0
- package/dist/v1/fractions/lending/index.d.ts +209 -0
- package/dist/v1/fractions/lending/index.d.ts.map +1 -0
- package/dist/v1/fractions/lending/index.js +22 -0
- package/dist/v1/fractions/lending/purchase/directPurchase.route.d.ts +82 -0
- package/dist/v1/fractions/lending/purchase/directPurchase.route.d.ts.map +1 -0
- package/dist/v1/fractions/lending/purchase/directPurchase.route.js +34 -0
- package/dist/v1/fractions/lending/setCollateralPrice/setCollateralPrice.routes.d.ts +61 -0
- package/dist/v1/fractions/lending/setCollateralPrice/setCollateralPrice.routes.d.ts.map +1 -0
- package/dist/v1/fractions/lending/setCollateralPrice/setCollateralPrice.routes.js +27 -0
- package/dist/v1/fractions/lending/setCollateralPrice/setCollateralPrice.schema.d.ts +16 -0
- package/dist/v1/fractions/lending/setCollateralPrice/setCollateralPrice.schema.d.ts.map +1 -0
- package/dist/v1/fractions/lending/setCollateralPrice/setCollateralPrice.schema.js +10 -0
- package/dist/v1/fractions/schemas.d.ts +108 -0
- package/dist/v1/fractions/schemas.d.ts.map +1 -0
- package/dist/v1/fractions/schemas.js +35 -0
- package/package.json +10 -7
|
@@ -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
|
+
address: `0x${string}`;
|
|
8
|
+
functionName: 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: 72080 | 11155111 | 31337;
|
|
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
|
+
cap?: {
|
|
30
|
+
maxHardCap: bigint;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
out: {
|
|
35
|
+
json: {
|
|
36
|
+
chainId: 72080 | 11155111 | 31337;
|
|
37
|
+
adminAddress: `0x${string}`;
|
|
38
|
+
lending: {
|
|
39
|
+
minInterest: number;
|
|
40
|
+
maxInterest: number;
|
|
41
|
+
minDuration: bigint;
|
|
42
|
+
maxDuration: bigint;
|
|
43
|
+
minimumProportionOverObligation: 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
|
+
address: `0x${string}`;
|
|
60
|
+
functionName: 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: 72080 | 11155111 | 31337;
|
|
68
|
+
adminAddress: `0x${string}`;
|
|
69
|
+
lending: {
|
|
70
|
+
minInterest: number;
|
|
71
|
+
maxInterest: number;
|
|
72
|
+
minDuration: bigint;
|
|
73
|
+
maxDuration: bigint;
|
|
74
|
+
minimumProportionOverObligation: 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: 72080 | 11155111 | 31337;
|
|
89
|
+
adminAddress: `0x${string}`;
|
|
90
|
+
lending: {
|
|
91
|
+
minInterest: number;
|
|
92
|
+
maxInterest: number;
|
|
93
|
+
minDuration: bigint;
|
|
94
|
+
maxDuration: bigint;
|
|
95
|
+
minimumProportionOverObligation: 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
|
+
address: `0x${string}`;
|
|
112
|
+
functionName: string;
|
|
113
|
+
abi: any[];
|
|
114
|
+
args: any[];
|
|
115
|
+
};
|
|
116
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
|
|
117
|
+
//# sourceMappingURL=lending.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lending.routes.d.ts","sourceRoot":"","sources":["../../../../../src/v1/fractions/lending/deployMarket/lending.routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAwBvC,wBAAgB,sCAAsC,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAcxF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describeRoute } from "hono-openapi";
|
|
2
|
+
import { resolver, validator } from "hono-openapi/zod";
|
|
3
|
+
import { toTransaction, TransactionSchema } from "../../../../common/index.js";
|
|
4
|
+
import { createLendingPlatform } from "@evergonlabs/tmi-protocol-fractions-sdk";
|
|
5
|
+
import { discountConfig, getFeeConfig } from "../../../../fractions/deployMarket/v0/index.js";
|
|
6
|
+
import { DeployLendingMarketRequestSchema } from "../../schemas.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: ["Buy-back"],
|
|
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,209 @@
|
|
|
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<{
|
|
6
|
+
"/deploy": {
|
|
7
|
+
$post: {
|
|
8
|
+
input: {
|
|
9
|
+
json: {
|
|
10
|
+
chainId: 72080 | 11155111 | 31337;
|
|
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
|
+
cap?: {
|
|
25
|
+
maxHardCap: bigint;
|
|
26
|
+
} | undefined;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
output: {
|
|
30
|
+
data: `0x${string}`;
|
|
31
|
+
to: `0x${string}`;
|
|
32
|
+
details: {
|
|
33
|
+
address: `0x${string}`;
|
|
34
|
+
functionName: string;
|
|
35
|
+
abi: any[];
|
|
36
|
+
args: any[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
outputFormat: "json";
|
|
40
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
} & {
|
|
44
|
+
"/createSale": {
|
|
45
|
+
$post: {
|
|
46
|
+
input: {
|
|
47
|
+
json: {
|
|
48
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
49
|
+
fractions: {
|
|
50
|
+
symbol: string;
|
|
51
|
+
name: string;
|
|
52
|
+
amount: bigint;
|
|
53
|
+
token?: `0x${string}` | undefined;
|
|
54
|
+
};
|
|
55
|
+
cap: {
|
|
56
|
+
soft: bigint;
|
|
57
|
+
hard: bigint;
|
|
58
|
+
softPerAccount?: bigint | undefined;
|
|
59
|
+
hardPerAccount?: bigint | undefined;
|
|
60
|
+
};
|
|
61
|
+
market: `0x${string}`;
|
|
62
|
+
timeBoundary: {
|
|
63
|
+
start: Date;
|
|
64
|
+
end: Date;
|
|
65
|
+
};
|
|
66
|
+
wrapped: [{
|
|
67
|
+
type: "ERC20";
|
|
68
|
+
values: [bigint, ...bigint[]];
|
|
69
|
+
address: `0x${string}`;
|
|
70
|
+
} | {
|
|
71
|
+
type: "ERC721";
|
|
72
|
+
address: `0x${string}`;
|
|
73
|
+
tokenIds: [bigint, ...bigint[]];
|
|
74
|
+
} | {
|
|
75
|
+
type: "ERC1155";
|
|
76
|
+
values: [bigint, ...bigint[]];
|
|
77
|
+
address: `0x${string}`;
|
|
78
|
+
tokenIds: [bigint, ...bigint[]];
|
|
79
|
+
}, ...({
|
|
80
|
+
type: "ERC20";
|
|
81
|
+
values: [bigint, ...bigint[]];
|
|
82
|
+
address: `0x${string}`;
|
|
83
|
+
} | {
|
|
84
|
+
type: "ERC721";
|
|
85
|
+
address: `0x${string}`;
|
|
86
|
+
tokenIds: [bigint, ...bigint[]];
|
|
87
|
+
} | {
|
|
88
|
+
type: "ERC1155";
|
|
89
|
+
values: [bigint, ...bigint[]];
|
|
90
|
+
address: `0x${string}`;
|
|
91
|
+
tokenIds: [bigint, ...bigint[]];
|
|
92
|
+
})[]];
|
|
93
|
+
funding: [{
|
|
94
|
+
amountPerPacket: bigint;
|
|
95
|
+
token: `0x${string}`;
|
|
96
|
+
}, ...{
|
|
97
|
+
amountPerPacket: bigint;
|
|
98
|
+
token: `0x${string}`;
|
|
99
|
+
}[]];
|
|
100
|
+
refundAddress: `0x${string}`;
|
|
101
|
+
amountOfPacketsPerFraction: bigint;
|
|
102
|
+
buyback: {
|
|
103
|
+
durationSeconds: number;
|
|
104
|
+
interestPercentage: number;
|
|
105
|
+
liquidationLimitPercentage: number;
|
|
106
|
+
marginCallLimitPercentage: number;
|
|
107
|
+
};
|
|
108
|
+
discounts?: {
|
|
109
|
+
burnableTokenAddress: `0x${string}`;
|
|
110
|
+
amountToBurn: bigint;
|
|
111
|
+
percentDiscount: number;
|
|
112
|
+
} | undefined;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
output: {
|
|
116
|
+
data: `0x${string}`;
|
|
117
|
+
to: `0x${string}`;
|
|
118
|
+
details: {
|
|
119
|
+
address: `0x${string}`;
|
|
120
|
+
functionName: string;
|
|
121
|
+
abi: any[];
|
|
122
|
+
args: any[];
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
outputFormat: "json";
|
|
126
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
} & {
|
|
130
|
+
"/purchase": {
|
|
131
|
+
$post: {
|
|
132
|
+
input: {
|
|
133
|
+
json: {
|
|
134
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
135
|
+
campaignId: bigint;
|
|
136
|
+
market: `0x${string}`;
|
|
137
|
+
amountToBuy: bigint;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
output: {
|
|
141
|
+
data: `0x${string}`;
|
|
142
|
+
to: `0x${string}`;
|
|
143
|
+
details: {
|
|
144
|
+
address: `0x${string}`;
|
|
145
|
+
functionName: string;
|
|
146
|
+
abi: any[];
|
|
147
|
+
args: any[];
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
outputFormat: "json";
|
|
151
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
} & {
|
|
155
|
+
"/setCollateralPrice": {
|
|
156
|
+
$post: {
|
|
157
|
+
input: {
|
|
158
|
+
json: {
|
|
159
|
+
campaignId: bigint;
|
|
160
|
+
market: `0x${string}`;
|
|
161
|
+
collateralPriceInFundingPackets: bigint;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
output: {
|
|
165
|
+
data: `0x${string}`;
|
|
166
|
+
to: `0x${string}`;
|
|
167
|
+
details: {
|
|
168
|
+
address: `0x${string}`;
|
|
169
|
+
functionName: string;
|
|
170
|
+
abi: any[];
|
|
171
|
+
args: any[];
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
outputFormat: "json";
|
|
175
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
} & {
|
|
179
|
+
"/buyback": {
|
|
180
|
+
$post: {
|
|
181
|
+
input: {
|
|
182
|
+
json: {
|
|
183
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
184
|
+
campaignId: bigint;
|
|
185
|
+
market: `0x${string}`;
|
|
186
|
+
buybackPacketsAmount: bigint;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
output: {
|
|
190
|
+
data: `0x${string}`;
|
|
191
|
+
to: `0x${string}`;
|
|
192
|
+
details: {
|
|
193
|
+
address: `0x${string}`;
|
|
194
|
+
functionName: string;
|
|
195
|
+
abi: any[];
|
|
196
|
+
args: any[];
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
outputFormat: "json";
|
|
200
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
}, "/v0/buyback">, "/">;
|
|
204
|
+
config: {
|
|
205
|
+
title: string;
|
|
206
|
+
description: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v1/fractions/lending/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAkBvC,eAAO,MAAM,UAAU;;gBAET,CAAC,SAAS,GAAG,WAAW,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM/C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createDeployLendingMarketTransactionV0 } from "./deployMarket/lending.routes.js";
|
|
2
|
+
import { createSetCollateralPriceTransactionV0 } from "./setCollateralPrice/setCollateralPrice.routes.js";
|
|
3
|
+
import { createLendingSale } from "./createLendingSale.js";
|
|
4
|
+
import { createDirectPurchaseSalesTransactionV0 } from "./purchase/directPurchase.route.js";
|
|
5
|
+
import { createBuybackTransactionV0 } from "./buyback/buyback.routes.js";
|
|
6
|
+
function createLendingMarketsApp(factory) {
|
|
7
|
+
return factory
|
|
8
|
+
.createApp()
|
|
9
|
+
.post("/deploy", ...createDeployLendingMarketTransactionV0(factory))
|
|
10
|
+
.post("/createSale", ...createLendingSale(factory))
|
|
11
|
+
.post("/purchase", ...createDirectPurchaseSalesTransactionV0(factory))
|
|
12
|
+
.post("/setCollateralPrice", ...createSetCollateralPriceTransactionV0(factory))
|
|
13
|
+
.post("/buyback", ...createBuybackTransactionV0(factory));
|
|
14
|
+
}
|
|
15
|
+
export const lendingApi = {
|
|
16
|
+
name: "Buy-back API",
|
|
17
|
+
createApp: (factory) => factory.createApp().route("/v0/buyback", createLendingMarketsApp(factory)),
|
|
18
|
+
config: {
|
|
19
|
+
title: "Buy-back API",
|
|
20
|
+
description: "Create and manage lending markets with collateral",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Env } from "hono";
|
|
2
|
+
import { Factory } from "hono/factory";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
export declare const DirectPurchaseRequestSchema: z.ZodObject<{
|
|
5
|
+
chainId: z.ZodType<import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId, z.ZodTypeDef, import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId>;
|
|
6
|
+
market: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
7
|
+
campaignId: z.ZodBigInt;
|
|
8
|
+
amountToBuy: z.ZodBigInt;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
11
|
+
campaignId: bigint;
|
|
12
|
+
market: `0x${string}`;
|
|
13
|
+
amountToBuy: bigint;
|
|
14
|
+
}, {
|
|
15
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
16
|
+
campaignId: bigint;
|
|
17
|
+
market: `0x${string}`;
|
|
18
|
+
amountToBuy: bigint;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function createDirectPurchaseSalesTransactionV0<E extends Env>(factory: Factory<E>): [import("hono/types").H<any, string, {}, Promise<Response & import("hono").TypedResponse<{
|
|
21
|
+
data: `0x${string}`;
|
|
22
|
+
to: `0x${string}`;
|
|
23
|
+
details: {
|
|
24
|
+
address: `0x${string}`;
|
|
25
|
+
functionName: string;
|
|
26
|
+
abi: any[];
|
|
27
|
+
args: any[];
|
|
28
|
+
};
|
|
29
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>, import("hono/types").H<Env, string, {
|
|
30
|
+
in: {
|
|
31
|
+
json: {
|
|
32
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
33
|
+
campaignId: bigint;
|
|
34
|
+
market: `0x${string}`;
|
|
35
|
+
amountToBuy: bigint;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
out: {
|
|
39
|
+
json: {
|
|
40
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
41
|
+
campaignId: bigint;
|
|
42
|
+
market: `0x${string}`;
|
|
43
|
+
amountToBuy: bigint;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
47
|
+
data: `0x${string}`;
|
|
48
|
+
to: `0x${string}`;
|
|
49
|
+
details: {
|
|
50
|
+
address: `0x${string}`;
|
|
51
|
+
functionName: string;
|
|
52
|
+
abi: any[];
|
|
53
|
+
args: any[];
|
|
54
|
+
};
|
|
55
|
+
}, 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, {
|
|
56
|
+
in: {
|
|
57
|
+
json: {
|
|
58
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
59
|
+
campaignId: bigint;
|
|
60
|
+
market: `0x${string}`;
|
|
61
|
+
amountToBuy: bigint;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
out: {
|
|
65
|
+
json: {
|
|
66
|
+
chainId: import("@evergonlabs/tmi-protocol-fractions-sdk").TmiChainId;
|
|
67
|
+
campaignId: bigint;
|
|
68
|
+
market: `0x${string}`;
|
|
69
|
+
amountToBuy: bigint;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
73
|
+
data: `0x${string}`;
|
|
74
|
+
to: `0x${string}`;
|
|
75
|
+
details: {
|
|
76
|
+
address: `0x${string}`;
|
|
77
|
+
functionName: string;
|
|
78
|
+
abi: any[];
|
|
79
|
+
args: any[];
|
|
80
|
+
};
|
|
81
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
|
|
82
|
+
//# sourceMappingURL=directPurchase.route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directPurchase.route.d.ts","sourceRoot":"","sources":["../../../../../src/v1/fractions/lending/purchase/directPurchase.route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAKtC,CAAC;AAkBH,wBAAgB,sCAAsC,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAWxF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { resolver, validator } from "hono-openapi/zod";
|
|
2
|
+
import { describeRoute } from "hono-openapi";
|
|
3
|
+
import { buildDirectPurchaseTx } from "@evergonlabs/tmi-protocol-fractions-sdk";
|
|
4
|
+
import { TmiChainIdSchema, toTransaction, TransactionSchema } from "../../../../common/index.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { AddressSchema } from "@evergonlabs/tmi-protocol-types/evm";
|
|
7
|
+
export const DirectPurchaseRequestSchema = z.object({
|
|
8
|
+
chainId: TmiChainIdSchema,
|
|
9
|
+
market: AddressSchema,
|
|
10
|
+
campaignId: z.coerce.bigint(),
|
|
11
|
+
amountToBuy: z.coerce.bigint(),
|
|
12
|
+
});
|
|
13
|
+
const route = describeRoute({
|
|
14
|
+
summary: "Make a purchase",
|
|
15
|
+
description: "Returns transaction data for making a purchase",
|
|
16
|
+
tags: ["Buy-back"],
|
|
17
|
+
responses: {
|
|
18
|
+
200: {
|
|
19
|
+
description: "Returns transaction data for making a purchase",
|
|
20
|
+
content: {
|
|
21
|
+
"application/json": {
|
|
22
|
+
schema: resolver(TransactionSchema),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export function createDirectPurchaseSalesTransactionV0(factory) {
|
|
29
|
+
return factory.createHandlers(route, validator("json", DirectPurchaseRequestSchema.openapi({ ref: "PurchaseRequestSchema" })), async (c) => {
|
|
30
|
+
const { chainId, market, campaignId, amountToBuy } = c.req.valid("json");
|
|
31
|
+
const tx = buildDirectPurchaseTx(chainId, market, campaignId, amountToBuy);
|
|
32
|
+
return c.json(toTransaction(tx));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -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
|
+
address: `0x${string}`;
|
|
8
|
+
functionName: 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
|
+
campaignId: bigint;
|
|
16
|
+
market: `0x${string}`;
|
|
17
|
+
collateralPriceInFundingPackets: bigint;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
out: {
|
|
21
|
+
json: {
|
|
22
|
+
campaignId: bigint;
|
|
23
|
+
market: `0x${string}`;
|
|
24
|
+
collateralPriceInFundingPackets: bigint;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
28
|
+
data: `0x${string}`;
|
|
29
|
+
to: `0x${string}`;
|
|
30
|
+
details: {
|
|
31
|
+
address: `0x${string}`;
|
|
32
|
+
functionName: 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
|
+
campaignId: bigint;
|
|
40
|
+
market: `0x${string}`;
|
|
41
|
+
collateralPriceInFundingPackets: bigint;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
out: {
|
|
45
|
+
json: {
|
|
46
|
+
campaignId: bigint;
|
|
47
|
+
market: `0x${string}`;
|
|
48
|
+
collateralPriceInFundingPackets: bigint;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, Promise<Response & import("hono").TypedResponse<{
|
|
52
|
+
data: `0x${string}`;
|
|
53
|
+
to: `0x${string}`;
|
|
54
|
+
details: {
|
|
55
|
+
address: `0x${string}`;
|
|
56
|
+
functionName: 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/v1/fractions/lending/setCollateralPrice/setCollateralPrice.routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuBvC,wBAAgB,qCAAqC,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAQvF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describeRoute } from "hono-openapi";
|
|
2
|
+
import { resolver, validator } from "hono-openapi/zod";
|
|
3
|
+
import { toTransaction, TransactionSchema } from "../../../../common/index.js";
|
|
4
|
+
import { buildSetCollateralPriceTx } from "@evergonlabs/tmi-protocol-fractions-sdk";
|
|
5
|
+
import { SetCollateralPriceRequestSchema } from "./setCollateralPrice.schema.js";
|
|
6
|
+
const route = describeRoute({
|
|
7
|
+
summary: "Set collateral price for lending market",
|
|
8
|
+
description: "Returns transaction data for setting the collateral price in a lending market",
|
|
9
|
+
tags: ["Buy-back"],
|
|
10
|
+
responses: {
|
|
11
|
+
200: {
|
|
12
|
+
description: "Returns transaction data for setting collateral price",
|
|
13
|
+
content: {
|
|
14
|
+
"application/json": {
|
|
15
|
+
schema: resolver(TransactionSchema),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
export function createSetCollateralPriceTransactionV0(factory) {
|
|
22
|
+
return factory.createHandlers(route, validator("json", SetCollateralPriceRequestSchema), async (c) => {
|
|
23
|
+
const { market, campaignId, collateralPriceInFundingPackets } = c.req.valid("json");
|
|
24
|
+
const tx = buildSetCollateralPriceTx(market, campaignId, collateralPriceInFundingPackets);
|
|
25
|
+
return c.json(toTransaction(tx));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SetCollateralPriceRequestSchema: z.ZodObject<{
|
|
3
|
+
collateralPriceInFundingPackets: z.ZodBigInt;
|
|
4
|
+
} & {
|
|
5
|
+
market: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
6
|
+
campaignId: z.ZodBigInt;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
campaignId: bigint;
|
|
9
|
+
market: `0x${string}`;
|
|
10
|
+
collateralPriceInFundingPackets: bigint;
|
|
11
|
+
}, {
|
|
12
|
+
campaignId: bigint;
|
|
13
|
+
market: `0x${string}`;
|
|
14
|
+
collateralPriceInFundingPackets: bigint;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=setCollateralPrice.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setCollateralPrice.schema.d.ts","sourceRoot":"","sources":["../../../../../src/v1/fractions/lending/setCollateralPrice/setCollateralPrice.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;EAOU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SaleIdSchema } from "../../../../common/models/saleId.js";
|
|
3
|
+
export const SetCollateralPriceRequestSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
collateralPriceInFundingPackets: z.coerce.bigint().openapi({
|
|
6
|
+
description: "Collateral price in funding packets",
|
|
7
|
+
}),
|
|
8
|
+
})
|
|
9
|
+
.extend(SaleIdSchema.shape)
|
|
10
|
+
.openapi({ ref: "SetCollateralPriceRequestSchema" });
|