@evergonlabs/tmi-protocol-api 0.10.0-rc.2 → 0.10.1-rc.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.
Files changed (121) hide show
  1. package/dist/app.d.ts +1 -23
  2. package/dist/app.d.ts.map +1 -1
  3. package/dist/client.d.ts +0 -24
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/common/blockchain.d.ts +2137 -766
  6. package/dist/common/blockchain.d.ts.map +1 -1
  7. package/dist/fractions/index.d.ts +1 -23
  8. package/dist/fractions/index.d.ts.map +1 -1
  9. package/dist/fractions/index.js +1 -1
  10. package/dist/fractions/markets/getDeployEvent.js +1 -1
  11. package/dist/fractions/markets/getMarket/getMarket.js +1 -1
  12. package/dist/fractions/markets/searchMarkets/searchMarkets.js +1 -1
  13. package/dist/fractions/platforms/index.d.ts +1 -23
  14. package/dist/fractions/platforms/index.d.ts.map +1 -1
  15. package/dist/fractions/platforms/index.js +1 -3
  16. package/dist/fractions/platforms/initCompilot.routes.js +1 -1
  17. package/dist/fractions/sales/getVaultAddress.js +1 -1
  18. package/dist/fractions/sales/getWithdrawEvent.js +1 -1
  19. package/dist/fractions/sales/parseFractionsCreatedEvent.js +1 -1
  20. package/dist/fractions/sales/vesting/parseClaimVestedTokensEvent.js +1 -1
  21. package/dist/issuance/common/factories.base.d.ts +56 -14
  22. package/dist/issuance/common/factories.base.d.ts.map +1 -1
  23. package/dist/issuance/erc1155/burn.js +1 -1
  24. package/dist/issuance/erc1155/default/deploy.js +2 -2
  25. package/dist/issuance/erc1155/default/initialize.js +1 -1
  26. package/dist/issuance/erc1155/default/parseDeployEvent.js +2 -2
  27. package/dist/issuance/erc1155/gated/deploy.js +2 -2
  28. package/dist/issuance/erc1155/gated/initialize.js +2 -2
  29. package/dist/issuance/erc1155/gated/parseDeployEvent.js +2 -2
  30. package/dist/issuance/erc1155/grantRole.js +2 -2
  31. package/dist/issuance/erc1155/mint.js +1 -1
  32. package/dist/issuance/erc1155/recover.js +1 -1
  33. package/dist/issuance/erc1155/renounceRole.js +2 -2
  34. package/dist/issuance/erc1155/revokeRole.js +2 -2
  35. package/dist/issuance/erc1155/setApprovalForAll.js +2 -2
  36. package/dist/issuance/erc1155/setBaseURI.d.ts.map +1 -1
  37. package/dist/issuance/erc1155/setBaseURI.js +2 -2
  38. package/dist/issuance/erc1155/setTokenURI.js +2 -2
  39. package/dist/issuance/erc20/approve.js +1 -1
  40. package/dist/issuance/erc20/burn.js +1 -1
  41. package/dist/issuance/erc20/default/deploy.js +1 -1
  42. package/dist/issuance/erc20/default/parseDeployEvent.js +1 -1
  43. package/dist/issuance/erc20/gated/deploy.js +1 -1
  44. package/dist/issuance/erc20/gated/initialize.js +1 -1
  45. package/dist/issuance/erc20/gated/parseDeployEvent.js +1 -1
  46. package/dist/issuance/erc20/gatedSimple/deploy.js +1 -1
  47. package/dist/issuance/erc20/gatedSimple/parseDeployEvent.js +1 -1
  48. package/dist/issuance/erc20/grantRole.js +1 -1
  49. package/dist/issuance/erc20/mint.js +1 -1
  50. package/dist/issuance/erc20/recover.js +1 -1
  51. package/dist/issuance/erc20/renounceRole.js +1 -1
  52. package/dist/issuance/erc20/revokeRole.js +1 -1
  53. package/dist/issuance/erc20/transfer.js +1 -1
  54. package/dist/issuance/erc20/transferFrom.js +1 -1
  55. package/dist/issuance/erc721/approve.js +1 -1
  56. package/dist/issuance/erc721/burn.js +1 -1
  57. package/dist/issuance/erc721/default/deploy.js +2 -2
  58. package/dist/issuance/erc721/default/initialize.js +1 -1
  59. package/dist/issuance/erc721/default/parseDeployEvent.js +2 -2
  60. package/dist/issuance/erc721/gated/deploy.js +2 -2
  61. package/dist/issuance/erc721/gated/initialize.js +2 -2
  62. package/dist/issuance/erc721/gated/parseDeployEvent.js +2 -2
  63. package/dist/issuance/erc721/grantRole.js +2 -2
  64. package/dist/issuance/erc721/mint.js +1 -1
  65. package/dist/issuance/erc721/recover.js +1 -1
  66. package/dist/issuance/erc721/renounceRole.js +2 -2
  67. package/dist/issuance/erc721/revokeRole.js +2 -2
  68. package/dist/issuance/erc721/setBaseURI.js +2 -2
  69. package/dist/issuance/erc721/setTokenURI.js +2 -2
  70. package/dist/issuance/erc721/transferFrom.js +1 -1
  71. package/dist/issuance/proxy/upgrade.js +1 -1
  72. package/dist/next/fractions/index.js +2 -2
  73. package/dist/next/fractions/lending/buyback/buyback.routes.js +4 -4
  74. package/dist/next/fractions/lending/createLendingSale.js +4 -4
  75. package/dist/next/fractions/lending/deployMarket/lending.routes.js +4 -4
  76. package/dist/next/fractions/lending/setCollateralPrice/setCollateralPrice.routes.js +3 -3
  77. package/dist/next/fractions/sales/parseFractionsCreatedEvent.js +1 -1
  78. package/dist/staking/platforms/getPlatform/v0/getPlatform.js +2 -2
  79. package/dist/staking/platforms/searchPlatforms/v0/searchPlatforms.js +2 -2
  80. package/dist/staking/pools/getPool/v0/getPool.js +1 -1
  81. package/dist/staking/pools/searchPools/v0/searchPools.js +1 -1
  82. package/dist/staking/roles/getRoles/v0/getRoles.js +1 -1
  83. package/dist/staking/roles/grantRole/v0/grantRole.js +1 -1
  84. package/dist/staking/stakes/getStake/v0/getStake.js +1 -1
  85. package/dist/stakingTemplates/templates/common/getCreatePoolEvent.js +1 -1
  86. package/dist/stakingTemplates/templates/common/getPlatformDeployEvent.js +1 -1
  87. package/dist/stakingTemplates/templates/common/getReward.js +3 -3
  88. package/dist/stakingTemplates/templates/common/getStakeEvent.js +1 -1
  89. package/dist/stakingTemplates/templates/common/partialUnstake.js +2 -2
  90. package/dist/stakingTemplates/templates/reputation/v0/createPlatform.js +3 -3
  91. package/dist/stakingTemplates/templates/reputation/v0/createPool.js +3 -3
  92. package/dist/stakingTemplates/templates/reputationLock/v0/createPlatform.js +3 -3
  93. package/dist/stakingTemplates/templates/reputationLock/v0/createPool.js +3 -3
  94. package/dist/stakingTemplates/templates/rwa/v0/createPlatform.js +3 -3
  95. package/dist/stakingTemplates/templates/rwa/v0/createPool.js +3 -3
  96. package/dist/stakingTemplates/templates/rwa/v0/distributeRewards.js +3 -3
  97. package/package.json +12 -10
  98. package/dist/fractions/fractions/approveWrapper.route.d.ts +0 -88
  99. package/dist/fractions/fractions/approveWrapper.route.d.ts.map +0 -1
  100. package/dist/fractions/fractions/approveWrapper.route.js +0 -92
  101. package/dist/fractions/fractions/index.d.ts +0 -72
  102. package/dist/fractions/fractions/index.d.ts.map +0 -1
  103. package/dist/fractions/fractions/index.js +0 -9
  104. package/dist/fractions/platforms/initNid.route.d.ts +0 -28
  105. package/dist/fractions/platforms/initNid.route.d.ts.map +0 -1
  106. package/dist/fractions/platforms/initNid.route.js +0 -32
  107. package/dist/issuance/erc721/nextTokenId.d.ts +0 -19
  108. package/dist/issuance/erc721/nextTokenId.d.ts.map +0 -1
  109. package/dist/issuance/erc721/nextTokenId.js +0 -79
  110. package/dist/next/fractions/lending/purchase/directPurchase.route.d.ts +0 -33
  111. package/dist/next/fractions/lending/purchase/directPurchase.route.d.ts.map +0 -1
  112. package/dist/next/fractions/lending/purchase/directPurchase.route.js +0 -34
  113. package/dist/next/fractions/platforms/deployNftFractionsMarket.routes.d.ts +0 -39
  114. package/dist/next/fractions/platforms/deployNftFractionsMarket.routes.d.ts.map +0 -1
  115. package/dist/next/fractions/platforms/deployNftFractionsMarket.routes.js +0 -40
  116. package/dist/next/fractions/platforms/deployNftFractionsMarket.schema.d.ts +0 -26
  117. package/dist/next/fractions/platforms/deployNftFractionsMarket.schema.d.ts.map +0 -1
  118. package/dist/next/fractions/platforms/deployNftFractionsMarket.schema.js +0 -24
  119. package/dist/next/fractions/sales/purchase.routes.d.ts +0 -27
  120. package/dist/next/fractions/sales/purchase.routes.d.ts.map +0 -1
  121. package/dist/next/fractions/sales/purchase.routes.js +0 -37
@@ -1,79 +0,0 @@
1
- import { describeRoute } from "hono-openapi";
2
- import { resolver, validator } from "hono-openapi";
3
- import { zeroAddress } from "viem";
4
- import { getContractEvents } from "viem/actions";
5
- import { z } from "zod";
6
- import { abis } from "@evergonlabs/tmi-factories-sdk";
7
- import { getPublicClient } from "../../common/blockchain.js";
8
- import { createController } from "../../common/controller.js";
9
- import { AddressSchema } from "../../common/index.js";
10
- import { FactoryChainIdQuery } from "../common/factories.js";
11
- const QuerySchema = z.object({
12
- chainId: FactoryChainIdQuery.openapi({
13
- param: {
14
- name: "chainId",
15
- in: "query",
16
- },
17
- }),
18
- tokenAddress: AddressSchema.openapi({
19
- param: {
20
- name: "tokenAddress",
21
- in: "query",
22
- },
23
- description: "ERC721 contract address",
24
- }),
25
- });
26
- const ResponseSchema = z.object({
27
- nextTokenId: z.string().openapi({
28
- description: "Next available token ID (max minted tokenId + 1, or '0' if none minted)",
29
- example: "42",
30
- }),
31
- totalMinted: z.number().int().nonnegative().openapi({
32
- description: "Total number of tokens minted (Transfer events from address(0))",
33
- example: 41,
34
- }),
35
- });
36
- export const NextTokenIdErc721 = createController({
37
- build: (factory) => factory.createApp().get("/", describeRoute({
38
- summary: "Get next ERC721 token ID",
39
- description: "Scans all Transfer events from address(0) (mints) for the given ERC721 contract and returns the next available token ID (highest minted ID + 1). If no tokens have been minted, returns '0'.",
40
- tags: ["Issuance"],
41
- responses: {
42
- 200: {
43
- description: "Returns the next token ID and total minted count",
44
- content: {
45
- "application/json": {
46
- schema: resolver(ResponseSchema),
47
- },
48
- },
49
- },
50
- },
51
- }), validator("query", QuerySchema), async (c) => {
52
- const params = c.req.valid("query");
53
- const client = getPublicClient(params.chainId, c.env.config);
54
- const mintEvents = await getContractEvents(client, {
55
- address: params.tokenAddress,
56
- abi: abis.erc721PausableRecoverableUpgradeableAbi,
57
- eventName: "Transfer",
58
- args: {
59
- from: zeroAddress,
60
- },
61
- fromBlock: "earliest",
62
- toBlock: "latest",
63
- });
64
- if (mintEvents.length === 0) {
65
- return c.json({
66
- nextTokenId: "0",
67
- totalMinted: 0,
68
- });
69
- }
70
- const maxTokenId = mintEvents.reduce((max, event) => {
71
- const tokenId = event.args.tokenId;
72
- return tokenId > max ? tokenId : max;
73
- }, 0n);
74
- return c.json({
75
- nextTokenId: (maxTokenId + 1n).toString(),
76
- totalMinted: mintEvents.length,
77
- });
78
- }),
79
- });
@@ -1,33 +0,0 @@
1
- export declare const DirectPurchaseRequestSchema: import("zod").ZodObject<{
2
- market: import("zod").ZodPipe<import("zod").ZodString & import("zod").ZodType<`0x${string}`, string, import("zod/v4/core").$ZodTypeInternals<`0x${string}`, string>>, import("zod").ZodTransform<`0x${string}`, `0x${string}`>>;
3
- campaignId: import("zod").ZodPipe<import("zod/v4/core").$ZodBranded<import("zod").ZodString, "Int256", "out">, import("zod").ZodTransform<bigint, string & import("zod").$brand<"Int256">>>;
4
- chainId: import("zod").ZodPipe<import("zod").ZodTransform<unknown, unknown>, import("zod").ZodUnion<[import("zod").ZodLiteral<1 | 11155111 | 31337 | 72080>, import("zod").ZodLiteral<1 | 11155111 | 31337 | 72080>, ...import("zod").ZodLiteral<1 | 11155111 | 31337 | 72080>[]]>>;
5
- amountToBuy: import("zod/v4/core").$ZodBranded<import("zod").ZodString, "Int256", "out">;
6
- }, import("zod/v4/core").$strip>;
7
- export declare const DirectPurchaseV0: import("../../../../common/controller.js").IController<import("hono/hono-base").HonoBase<import("../../../../common/context.js").AppContext, {
8
- "/": {
9
- $post: {
10
- input: {
11
- json: {
12
- market: string;
13
- campaignId: string;
14
- chainId: unknown;
15
- amountToBuy: string;
16
- };
17
- };
18
- output: {
19
- data: `0x${string}`;
20
- to: `0x${string}`;
21
- details: {
22
- functionName: string;
23
- address: `0x${string}`;
24
- abi: any[];
25
- args: any[];
26
- };
27
- };
28
- outputFormat: "json";
29
- status: import("hono/utils/http-status").ContentfulStatusCode;
30
- };
31
- };
32
- }, "/", "/">>;
33
- //# sourceMappingURL=directPurchase.route.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directPurchase.route.d.ts","sourceRoot":"","sources":["../../../../../src/next/fractions/lending/purchase/directPurchase.route.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,2BAA2B;;;;;gCAGtC,CAAC;AAkBH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;aAU3B,CAAC"}
@@ -1,34 +0,0 @@
1
- import { describeRoute } from "hono-openapi";
2
- import { resolver, validator } from "hono-openapi";
3
- import { buildDirectPurchaseTx } from "@evergonlabs/tmi-protocol-fractions-sdk/next";
4
- import { Int256Json } from "@evergonlabs/tmi-utils/models";
5
- import { createController } from "../../../../common/controller.js";
6
- import { FractionsChainId, SaleIdSchema, toTransaction, TransactionSchema } from "../../../../common/index.js";
7
- export const DirectPurchaseRequestSchema = SaleIdSchema.extend({
8
- chainId: FractionsChainId,
9
- amountToBuy: Int256Json,
10
- });
11
- const route = describeRoute({
12
- summary: "Make a purchase",
13
- description: "Returns transaction data for making a purchase",
14
- tags: ["Buy-back"],
15
- responses: {
16
- 200: {
17
- description: "Returns transaction data for making a purchase",
18
- content: {
19
- "application/json": {
20
- schema: resolver(TransactionSchema),
21
- },
22
- },
23
- },
24
- },
25
- });
26
- export const DirectPurchaseV0 = createController({
27
- build: (factory) => factory
28
- .createApp()
29
- .post("/", route, validator("json", DirectPurchaseRequestSchema.openapi("PurchaseRequestSchema")), async (c) => {
30
- const { chainId, market, campaignId, amountToBuy } = c.req.valid("json");
31
- const tx = buildDirectPurchaseTx(chainId, market, campaignId, BigInt(amountToBuy));
32
- return c.json(toTransaction(tx));
33
- }),
34
- });
@@ -1,39 +0,0 @@
1
- /**
2
- * Controller for deploying an NFT Fractions market
3
- */
4
- export declare const DeployNftFractionsMarketV0: import("../../../common/controller.js").IController<import("hono/hono-base").HonoBase<import("../../../common/context.js").AppContext, {
5
- "/": {
6
- $post: {
7
- input: {
8
- json: {
9
- chainId: unknown;
10
- adminAddress: string;
11
- acceptedFundingTokens: string[];
12
- ownerAddress?: string | undefined;
13
- compilotSignerAddress?: string | undefined;
14
- cap?: {
15
- maxHardCap: string;
16
- } | undefined;
17
- fee?: {
18
- percent: number;
19
- collectorAddress: string;
20
- feeAdmin: string;
21
- } | undefined;
22
- };
23
- };
24
- output: {
25
- data: `0x${string}`;
26
- to: `0x${string}`;
27
- details: {
28
- functionName: string;
29
- address: `0x${string}`;
30
- abi: any[];
31
- args: any[];
32
- };
33
- };
34
- outputFormat: "json";
35
- status: import("hono/utils/http-status").ContentfulStatusCode;
36
- };
37
- };
38
- }, "/", "/">>;
39
- //# sourceMappingURL=deployNftFractionsMarket.routes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deployNftFractionsMarket.routes.d.ts","sourceRoot":"","sources":["../../../../src/next/fractions/platforms/deployNftFractionsMarket.routes.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkBrC,CAAC"}
@@ -1,40 +0,0 @@
1
- import { describeRoute } from "hono-openapi";
2
- import { resolver, validator } from "hono-openapi";
3
- import { createNftFractionsPlatform } from "@evergonlabs/tmi-protocol-fractions-sdk/next";
4
- import { createController } from "../../../common/controller.js";
5
- import { DEFAULT_COMPILOT_SIGNER, toTransaction, TransactionSchema } from "../../../common/index.js";
6
- import { DeployNftFractionsMarketRequestSchema } from "./deployNftFractionsMarket.schema.js";
7
- const route = describeRoute({
8
- summary: "Deploy an NFT Fractions market",
9
- description: "Returns transaction data for deploying an NFT Fractions market with ComPilot gating. " +
10
- "This market type supports wrapping ERC-721 tokens and fractionalizing them into ERC-20 compatible tokens.",
11
- tags: ["NFT Fractions"],
12
- responses: {
13
- 200: {
14
- description: "Returns transaction data for deploying an NFT Fractions market",
15
- content: {
16
- "application/json": {
17
- schema: resolver(TransactionSchema),
18
- },
19
- },
20
- },
21
- },
22
- });
23
- /**
24
- * Controller for deploying an NFT Fractions market
25
- */
26
- export const DeployNftFractionsMarketV0 = createController({
27
- build: (factory) => factory.createApp().post("/", route, validator("json", DeployNftFractionsMarketRequestSchema), async (c) => {
28
- const { chainId, adminAddress, ownerAddress, compilotSignerAddress, cap, fee, acceptedFundingTokens } = c.req.valid("json");
29
- const tx = createNftFractionsPlatform({
30
- chainId: chainId,
31
- adminAddress: adminAddress,
32
- ownerAddress: ownerAddress ?? adminAddress,
33
- compilotSignerAddress: compilotSignerAddress ?? DEFAULT_COMPILOT_SIGNER,
34
- fee: fee ?? null,
35
- maxHardCap: cap ? cap.maxHardCap : null,
36
- acceptedFundingTokens: acceptedFundingTokens,
37
- });
38
- return c.json(toTransaction(tx));
39
- }),
40
- });
@@ -1,26 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Cap configuration schema for market limits
4
- */
5
- export declare const CapConfigSchema: z.ZodObject<{
6
- maxHardCap: z.ZodPipe<z.core.$ZodBranded<z.ZodString, "Int256", "out">, z.ZodTransform<bigint, string & z.core.$brand<"Int256">>>;
7
- }, z.core.$strip>;
8
- /**
9
- * Request schema for deploying an NFT Fractions market
10
- */
11
- export declare const DeployNftFractionsMarketRequestSchema: z.ZodObject<{
12
- chainId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodUnion<[z.ZodLiteral<11155111 | 31337 | 72080>, z.ZodLiteral<11155111 | 31337 | 72080>, ...z.ZodLiteral<11155111 | 31337 | 72080>[]]>>;
13
- adminAddress: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
14
- ownerAddress: z.ZodOptional<z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>>;
15
- compilotSignerAddress: z.ZodOptional<z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>>;
16
- cap: z.ZodOptional<z.ZodObject<{
17
- maxHardCap: z.ZodPipe<z.core.$ZodBranded<z.ZodString, "Int256", "out">, z.ZodTransform<bigint, string & z.core.$brand<"Int256">>>;
18
- }, z.core.$strip>>;
19
- fee: z.ZodOptional<z.ZodObject<{
20
- percent: z.ZodNumber;
21
- collectorAddress: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
22
- feeAdmin: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
23
- }, z.core.$strip>>;
24
- acceptedFundingTokens: z.ZodArray<z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>>;
25
- }, z.core.$strip>;
26
- //# sourceMappingURL=deployNftFractionsMarket.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deployNftFractionsMarket.schema.d.ts","sourceRoot":"","sources":["../../../../src/next/fractions/platforms/deployNftFractionsMarket.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;GAEG;AACH,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;iBAcC,CAAC"}
@@ -1,24 +0,0 @@
1
- import { z } from "zod";
2
- import { AddressSchema, NextFractionsChainId } from "../../../common/index.js";
3
- import { Int256BigInt } from "../../../common/int256.js";
4
- import { FeeConfigSchema } from "../../../fractions/platforms/deployMarket.schema.js";
5
- /**
6
- * Cap configuration schema for market limits
7
- */
8
- export const CapConfigSchema = z.object({
9
- maxHardCap: Int256BigInt(z.bigint().min(BigInt(1))).describe("Maximum hard cap for the market"),
10
- });
11
- /**
12
- * Request schema for deploying an NFT Fractions market
13
- */
14
- export const DeployNftFractionsMarketRequestSchema = z
15
- .object({
16
- chainId: NextFractionsChainId.describe("Chain ID where the market will be deployed"),
17
- adminAddress: AddressSchema.describe("Address of the market administrator"),
18
- ownerAddress: AddressSchema.optional().describe("Address of the market owner. Defaults to adminAddress if not provided"),
19
- compilotSignerAddress: AddressSchema.optional().describe("ComPilot signer address. Uses platform default if not provided"),
20
- cap: CapConfigSchema.optional().describe("Optional cap configuration"),
21
- fee: FeeConfigSchema.optional().describe("Optional fee configuration"),
22
- acceptedFundingTokens: z.array(AddressSchema).describe("Accepted funding token addresses"),
23
- })
24
- .openapi("DeployNftFractionsMarketRequestSchema");
@@ -1,27 +0,0 @@
1
- export declare const PurchaseNextV0: import("../../../common/controller.js").IController<import("hono/hono-base").HonoBase<import("../../../common/context.js").AppContext, {
2
- "/": {
3
- $post: {
4
- input: {
5
- json: {
6
- chainId: unknown;
7
- market: string;
8
- campaignId: string;
9
- amountToBuy: string;
10
- };
11
- };
12
- output: {
13
- data: `0x${string}`;
14
- to: `0x${string}`;
15
- details: {
16
- functionName: string;
17
- address: `0x${string}`;
18
- abi: any[];
19
- args: any[];
20
- };
21
- };
22
- outputFormat: "json";
23
- status: import("hono/utils/http-status").ContentfulStatusCode;
24
- };
25
- };
26
- }, "/", "/">>;
27
- //# sourceMappingURL=purchase.routes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"purchase.routes.d.ts","sourceRoot":"","sources":["../../../../src/next/fractions/sales/purchase.routes.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;aAOzB,CAAC"}
@@ -1,37 +0,0 @@
1
- import { describeRoute } from "hono-openapi";
2
- import { resolver, validator } from "hono-openapi";
3
- import { z } from "zod";
4
- import { buildDirectPurchaseTx } from "@evergonlabs/tmi-protocol-fractions-sdk/next";
5
- import { createController } from "../../../common/controller.js";
6
- import { AddressSchema, NextFractionsChainId, toTransaction, TransactionSchema } from "../../../common/index.js";
7
- import { Int256BigInt } from "../../../common/int256.js";
8
- const PurchaseRequestSchema = z
9
- .object({
10
- chainId: NextFractionsChainId,
11
- market: AddressSchema.describe("Address of the market"),
12
- campaignId: Int256BigInt().describe("Campaign ID"),
13
- amountToBuy: Int256BigInt().describe("Amount of fractions to buy"),
14
- })
15
- .openapi("NextPurchaseRequestSchema");
16
- const route = describeRoute({
17
- summary: "Make a purchase (next)",
18
- description: "Returns transaction data for purchasing fractions on a next-gen market (no discount).",
19
- tags: ["NFT Fractions"],
20
- responses: {
21
- 200: {
22
- description: "Returns transaction data for making a purchase",
23
- content: {
24
- "application/json": {
25
- schema: resolver(TransactionSchema),
26
- },
27
- },
28
- },
29
- },
30
- });
31
- export const PurchaseNextV0 = createController({
32
- build: (factory) => factory.createApp().post("/", route, validator("json", PurchaseRequestSchema), async (c) => {
33
- const { chainId, market, campaignId, amountToBuy } = c.req.valid("json");
34
- const tx = buildDirectPurchaseTx(chainId, market, campaignId, amountToBuy);
35
- return c.json(toTransaction(tx));
36
- }),
37
- });