@evergonlabs/tmi-protocol-api 0.10.0-rc.0 → 0.10.0-rc.2
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 +430 -72
- package/dist/app.d.ts.map +1 -1
- package/dist/client.d.ts +465 -77
- package/dist/client.d.ts.map +1 -1
- package/dist/common/roles/erc1155-token-roles.d.ts +8 -0
- package/dist/common/roles/erc1155-token-roles.d.ts.map +1 -0
- package/dist/common/roles/erc1155-token-roles.js +13 -0
- package/dist/common/roles/exports.d.ts +1 -0
- package/dist/common/roles/exports.d.ts.map +1 -1
- package/dist/common/roles/exports.js +1 -0
- package/dist/fractions/index.d.ts +71 -71
- package/dist/fractions/index.d.ts.map +1 -1
- package/dist/fractions/index.js +0 -2
- package/dist/fractions/platforms/deployMarket.routes.js +4 -4
- package/dist/fractions/platforms/initCompilot.routes.js +1 -1
- package/dist/fractions/platforms/initNid.route.js +1 -1
- package/dist/fractions/sales/approveSale.route.js +1 -1
- package/dist/fractions/sales/approveWrapper.route.d.ts +88 -0
- package/dist/fractions/sales/approveWrapper.route.d.ts.map +1 -0
- package/dist/fractions/sales/approveWrapper.route.js +92 -0
- package/dist/fractions/sales/completeSale.route.js +1 -1
- package/dist/fractions/sales/createFractions.route.js +1 -1
- package/dist/fractions/sales/getFractionSaleStatistics.route.js +1 -1
- package/dist/fractions/sales/getVaultAddress.js +1 -1
- package/dist/fractions/sales/getWithdrawEvent.js +1 -1
- package/dist/fractions/sales/index.d.ts +71 -1
- package/dist/fractions/sales/index.d.ts.map +1 -1
- package/dist/fractions/sales/index.js +5 -1
- package/dist/fractions/sales/parseFractionsCreatedEvent.js +1 -1
- package/dist/fractions/sales/purchase.route.js +1 -1
- package/dist/fractions/sales/purchaseStatistics.route.js +1 -1
- package/dist/fractions/sales/receiveFundsAfterNonFunded.route.js +2 -2
- package/dist/fractions/sales/receiveNonPurchasedWrappedAssets.route.js +1 -1
- package/dist/fractions/sales/recoverFractions.js +1 -1
- package/dist/fractions/sales/rejectFractions.js +1 -1
- package/dist/fractions/sales/searchActivity.route.js +1 -1
- package/dist/fractions/sales/searchSales/searchSales.js +1 -1
- package/dist/fractions/sales/searchWithdrawal.route.js +1 -1
- package/dist/fractions/sales/setFeeCapLimit.js +1 -1
- package/dist/fractions/sales/unlockWrappedAssets.route.js +1 -1
- package/dist/fractions/sales/vesting/claimStatistics.route.js +1 -1
- package/dist/fractions/sales/vesting/claimVestedTokens.route.js +1 -1
- package/dist/fractions/sales/vesting/editCliff.route.js +1 -1
- package/dist/fractions/sales/vesting/parseClaimVestedTokensEvent.js +1 -1
- package/dist/fractions/sales/withdraw.route.js +1 -1
- package/dist/fractions/statistics/networkStatistics.route.js +4 -4
- package/dist/issuance/common/factories.base.d.ts +12 -12
- package/dist/issuance/erc1155/burn.d.ts +34 -0
- package/dist/issuance/erc1155/burn.d.ts.map +1 -0
- package/dist/issuance/erc1155/burn.js +40 -0
- package/dist/issuance/erc1155/default/deploy.d.ts +34 -0
- package/dist/issuance/erc1155/default/deploy.d.ts.map +1 -0
- package/dist/issuance/erc1155/default/deploy.js +54 -0
- package/dist/issuance/erc1155/default/initialize.d.ts +34 -0
- package/dist/issuance/erc1155/default/initialize.d.ts.map +1 -0
- package/dist/issuance/erc1155/default/initialize.js +39 -0
- package/dist/issuance/erc1155/default/parseDeployEvent.d.ts +21 -0
- package/dist/issuance/erc1155/default/parseDeployEvent.d.ts.map +1 -0
- package/dist/issuance/erc1155/default/parseDeployEvent.js +75 -0
- package/dist/issuance/erc1155/gated/deploy.d.ts +36 -0
- package/dist/issuance/erc1155/gated/deploy.d.ts.map +1 -0
- package/dist/issuance/erc1155/gated/deploy.js +62 -0
- package/dist/issuance/erc1155/gated/initialize.d.ts +36 -0
- package/dist/issuance/erc1155/gated/initialize.d.ts.map +1 -0
- package/dist/issuance/erc1155/gated/initialize.js +45 -0
- package/dist/issuance/erc1155/gated/parseDeployEvent.d.ts +21 -0
- package/dist/issuance/erc1155/gated/parseDeployEvent.d.ts.map +1 -0
- package/dist/issuance/erc1155/gated/parseDeployEvent.js +75 -0
- package/dist/issuance/erc1155/grantRole.d.ts +33 -0
- package/dist/issuance/erc1155/grantRole.d.ts.map +1 -0
- package/dist/issuance/erc1155/grantRole.js +42 -0
- package/dist/issuance/erc1155/index.d.ts +361 -0
- package/dist/issuance/erc1155/index.d.ts.map +1 -0
- package/dist/issuance/erc1155/index.js +38 -0
- package/dist/issuance/erc1155/mint.d.ts +34 -0
- package/dist/issuance/erc1155/mint.d.ts.map +1 -0
- package/dist/issuance/erc1155/mint.js +40 -0
- package/dist/issuance/erc1155/recover.d.ts +36 -0
- package/dist/issuance/erc1155/recover.d.ts.map +1 -0
- package/dist/issuance/erc1155/recover.js +41 -0
- package/dist/issuance/erc1155/renounceRole.d.ts +33 -0
- package/dist/issuance/erc1155/renounceRole.d.ts.map +1 -0
- package/dist/issuance/erc1155/renounceRole.js +42 -0
- package/dist/issuance/erc1155/revokeRole.d.ts +33 -0
- package/dist/issuance/erc1155/revokeRole.d.ts.map +1 -0
- package/dist/issuance/erc1155/revokeRole.js +42 -0
- package/dist/issuance/erc1155/setApprovalForAll.d.ts +32 -0
- package/dist/issuance/erc1155/setApprovalForAll.d.ts.map +1 -0
- package/dist/issuance/erc1155/setApprovalForAll.js +40 -0
- package/dist/issuance/erc1155/setBaseURI.d.ts +30 -0
- package/dist/issuance/erc1155/setBaseURI.d.ts.map +1 -0
- package/dist/issuance/erc1155/setBaseURI.js +37 -0
- package/dist/issuance/erc1155/setTokenURI.d.ts +32 -0
- package/dist/issuance/erc1155/setTokenURI.d.ts.map +1 -0
- package/dist/issuance/erc1155/setTokenURI.js +39 -0
- package/dist/issuance/erc1155/tag.d.ts +4 -0
- package/dist/issuance/erc1155/tag.d.ts.map +1 -0
- package/dist/issuance/erc1155/tag.js +2 -0
- package/dist/issuance/erc20/approve.d.ts.map +1 -1
- package/dist/issuance/erc20/approve.js +2 -1
- package/dist/issuance/erc20/burn.d.ts.map +1 -1
- package/dist/issuance/erc20/burn.js +2 -1
- package/dist/issuance/erc20/default/deploy.d.ts.map +1 -1
- package/dist/issuance/erc20/default/deploy.js +2 -1
- package/dist/issuance/erc20/default/initialize.d.ts.map +1 -1
- package/dist/issuance/erc20/default/initialize.js +2 -1
- package/dist/issuance/erc20/default/parseDeployEvent.d.ts.map +1 -1
- package/dist/issuance/erc20/default/parseDeployEvent.js +2 -1
- package/dist/issuance/erc20/gated/deploy.d.ts.map +1 -1
- package/dist/issuance/erc20/gated/deploy.js +2 -1
- package/dist/issuance/erc20/gated/initialize.d.ts.map +1 -1
- package/dist/issuance/erc20/gated/initialize.js +2 -1
- package/dist/issuance/erc20/gated/parseDeployEvent.d.ts.map +1 -1
- package/dist/issuance/erc20/gated/parseDeployEvent.js +2 -1
- package/dist/issuance/erc20/gatedSimple/deploy.d.ts.map +1 -1
- package/dist/issuance/erc20/gatedSimple/deploy.js +2 -1
- package/dist/issuance/erc20/gatedSimple/getInitData.d.ts.map +1 -1
- package/dist/issuance/erc20/gatedSimple/getInitData.js +2 -1
- package/dist/issuance/erc20/gatedSimple/parseDeployEvent.d.ts.map +1 -1
- package/dist/issuance/erc20/gatedSimple/parseDeployEvent.js +2 -1
- package/dist/issuance/erc20/grantRole.d.ts.map +1 -1
- package/dist/issuance/erc20/grantRole.js +2 -1
- package/dist/issuance/erc20/mint.d.ts.map +1 -1
- package/dist/issuance/erc20/mint.js +2 -1
- package/dist/issuance/erc20/recover.d.ts.map +1 -1
- package/dist/issuance/erc20/recover.js +2 -1
- package/dist/issuance/erc20/renounceRole.d.ts.map +1 -1
- package/dist/issuance/erc20/renounceRole.js +2 -1
- package/dist/issuance/erc20/revokeRole.d.ts.map +1 -1
- package/dist/issuance/erc20/revokeRole.js +2 -1
- package/dist/issuance/erc20/tag.d.ts +4 -0
- package/dist/issuance/erc20/tag.d.ts.map +1 -0
- package/dist/issuance/erc20/tag.js +2 -0
- package/dist/issuance/erc20/transfer.d.ts.map +1 -1
- package/dist/issuance/erc20/transfer.js +2 -1
- package/dist/issuance/erc20/transferFrom.d.ts.map +1 -1
- package/dist/issuance/erc20/transferFrom.js +2 -1
- package/dist/issuance/erc721/approve.d.ts.map +1 -1
- package/dist/issuance/erc721/approve.js +3 -2
- package/dist/issuance/erc721/burn.d.ts.map +1 -1
- package/dist/issuance/erc721/burn.js +3 -2
- package/dist/issuance/erc721/default/deploy.d.ts.map +1 -1
- package/dist/issuance/erc721/default/deploy.js +6 -5
- package/dist/issuance/erc721/default/initialize.d.ts.map +1 -1
- package/dist/issuance/erc721/default/initialize.js +3 -2
- package/dist/issuance/erc721/default/parseDeployEvent.d.ts.map +1 -1
- package/dist/issuance/erc721/default/parseDeployEvent.js +3 -2
- package/dist/issuance/erc721/gated/deploy.d.ts.map +1 -1
- package/dist/issuance/erc721/gated/deploy.js +6 -5
- package/dist/issuance/erc721/gated/initialize.d.ts.map +1 -1
- package/dist/issuance/erc721/gated/initialize.js +3 -2
- package/dist/issuance/erc721/gated/parseDeployEvent.d.ts.map +1 -1
- package/dist/issuance/erc721/gated/parseDeployEvent.js +3 -2
- package/dist/issuance/erc721/grantRole.d.ts.map +1 -1
- package/dist/issuance/erc721/grantRole.js +3 -2
- package/dist/issuance/erc721/index.d.ts +0 -1
- package/dist/issuance/erc721/index.d.ts.map +1 -1
- package/dist/issuance/erc721/mint.d.ts +0 -2
- package/dist/issuance/erc721/mint.d.ts.map +1 -1
- package/dist/issuance/erc721/mint.js +6 -7
- package/dist/issuance/erc721/nextTokenId.d.ts +19 -0
- package/dist/issuance/erc721/nextTokenId.d.ts.map +1 -0
- package/dist/issuance/erc721/nextTokenId.js +79 -0
- package/dist/issuance/erc721/recover.d.ts.map +1 -1
- package/dist/issuance/erc721/recover.js +3 -2
- package/dist/issuance/erc721/renounceRole.d.ts.map +1 -1
- package/dist/issuance/erc721/renounceRole.js +3 -2
- package/dist/issuance/erc721/revokeRole.d.ts.map +1 -1
- package/dist/issuance/erc721/revokeRole.js +3 -2
- package/dist/issuance/erc721/setBaseURI.d.ts.map +1 -1
- package/dist/issuance/erc721/setBaseURI.js +3 -2
- package/dist/issuance/erc721/setTokenURI.d.ts.map +1 -1
- package/dist/issuance/erc721/setTokenURI.js +3 -2
- package/dist/issuance/erc721/tag.d.ts +4 -0
- package/dist/issuance/erc721/tag.d.ts.map +1 -0
- package/dist/issuance/erc721/tag.js +2 -0
- package/dist/issuance/erc721/transferFrom.d.ts.map +1 -1
- package/dist/issuance/erc721/transferFrom.js +3 -2
- package/dist/issuance/index.d.ts +359 -1
- package/dist/issuance/index.d.ts.map +1 -1
- package/dist/issuance/index.js +2 -0
- package/dist/issuance/proxy/deploy.d.ts.map +1 -1
- package/dist/issuance/proxy/deploy.js +3 -2
- package/dist/issuance/proxy/tag.d.ts +4 -0
- package/dist/issuance/proxy/tag.d.ts.map +1 -0
- package/dist/issuance/proxy/tag.js +2 -0
- package/dist/issuance/proxy/upgrade.d.ts.map +1 -1
- package/dist/issuance/proxy/upgrade.js +2 -1
- package/package.json +16 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recover.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/recover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"recover.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/recover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAC;AAmBH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;aAcvB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { Int256BigInt } from "../../common/int256.js";
|
|
8
|
+
import { erc20Tag } from "./tag.js";
|
|
8
9
|
export const RecoverErc20RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
from: AddressSchema.openapi({ description: "Address to recover tokens from" }),
|
|
@@ -14,7 +15,7 @@ export const RecoverErc20RequestSchema = z.object({
|
|
|
14
15
|
const recoverRoute = describeRoute({
|
|
15
16
|
summary: "Recover Gated ERC20",
|
|
16
17
|
description: "Returns transaction data for recovering a gated ERC20 token from one address to another (RECOVER_ROLE required)",
|
|
17
|
-
tags: [
|
|
18
|
+
tags: [erc20Tag.tag],
|
|
18
19
|
responses: {
|
|
19
20
|
200: {
|
|
20
21
|
description: "Returns transaction data for recovering a gated ERC20",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renounceRole.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/renounceRole.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAqB,cAAc,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"renounceRole.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/renounceRole.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAqB,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG5F,eAAO,MAAM,8BAA8B;;;;iBAOzC,CAAC;AAkBH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;aAc5B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { convertRoleToHash, Erc20GatedRole } from "../../common/roles/erc20-gated-roles.js";
|
|
8
|
+
import { erc20Tag } from "./tag.js";
|
|
8
9
|
export const RenounceRoleErc20RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
role: z.nativeEnum(Erc20GatedRole).openapi({
|
|
@@ -16,7 +17,7 @@ export const RenounceRoleErc20RequestSchema = z.object({
|
|
|
16
17
|
const renounceRoleRoute = describeRoute({
|
|
17
18
|
summary: "Renounce Role on Gated ERC20",
|
|
18
19
|
description: "Returns transaction data for renouncing a role on a gated ERC20 token contract",
|
|
19
|
-
tags: [
|
|
20
|
+
tags: [erc20Tag.tag],
|
|
20
21
|
responses: {
|
|
21
22
|
200: {
|
|
22
23
|
description: "Returns transaction data for renouncing a role",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokeRole.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/revokeRole.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAqB,cAAc,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"revokeRole.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/revokeRole.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAqB,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG5F,eAAO,MAAM,4BAA4B;;;;iBAOvC,CAAC;AAkBH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;aAc1B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { convertRoleToHash, Erc20GatedRole } from "../../common/roles/erc20-gated-roles.js";
|
|
8
|
+
import { erc20Tag } from "./tag.js";
|
|
8
9
|
export const RevokeRoleErc20RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
role: z.nativeEnum(Erc20GatedRole).openapi({
|
|
@@ -16,7 +17,7 @@ export const RevokeRoleErc20RequestSchema = z.object({
|
|
|
16
17
|
const revokeRoleRoute = describeRoute({
|
|
17
18
|
summary: "Revoke Role on Gated ERC20",
|
|
18
19
|
description: "Returns transaction data for revoking a role on a gated ERC20 token contract",
|
|
19
|
-
tags: [
|
|
20
|
+
tags: [erc20Tag.tag],
|
|
20
21
|
responses: {
|
|
21
22
|
200: {
|
|
22
23
|
description: "Returns transaction data for revoking a role",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/tag.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;CAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/transfer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/transfer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AAkBH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;aAcxB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { Int256BigInt } from "../../common/int256.js";
|
|
8
|
+
import { erc20Tag } from "./tag.js";
|
|
8
9
|
export const TransferErc20RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
to: AddressSchema,
|
|
@@ -13,7 +14,7 @@ export const TransferErc20RequestSchema = z.object({
|
|
|
13
14
|
const transferRoute = describeRoute({
|
|
14
15
|
summary: "Transfer Gated ERC20",
|
|
15
16
|
description: "Returns transaction data for transferring a gated ERC20 token to another address",
|
|
16
|
-
tags: [
|
|
17
|
+
tags: [erc20Tag.tag],
|
|
17
18
|
responses: {
|
|
18
19
|
200: {
|
|
19
20
|
description: "Returns transaction data for transferring a gated ERC20",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferFrom.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/transferFrom.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"transferFrom.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc20/transferFrom.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,8BAA8B;;;;;iBAKzC,CAAC;AAmBH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;aAc5B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { Int256BigInt } from "../../common/int256.js";
|
|
8
|
+
import { erc20Tag } from "./tag.js";
|
|
8
9
|
export const TransferFromErc20RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
from: AddressSchema.openapi({ description: "Address to transfer tokens from" }),
|
|
@@ -14,7 +15,7 @@ export const TransferFromErc20RequestSchema = z.object({
|
|
|
14
15
|
const transferFromRoute = describeRoute({
|
|
15
16
|
summary: "TransferFrom Gated ERC20",
|
|
16
17
|
description: "Returns transaction data for transferring a gated ERC20 token from one address to another (requires approval)",
|
|
17
|
-
tags: [
|
|
18
|
+
tags: [erc20Tag.tag],
|
|
18
19
|
responses: {
|
|
19
20
|
200: {
|
|
20
21
|
description: "Returns transaction data for transferring a gated ERC20",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/approve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"approve.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/approve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AAkBH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;aAcxB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { Int256BigInt } from "../../common/int256.js";
|
|
8
|
+
import { erc721Tag } from "./tag.js";
|
|
8
9
|
export const ApproveErc721RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
to: AddressSchema.openapi({ description: "Address to approve" }),
|
|
@@ -13,7 +14,7 @@ export const ApproveErc721RequestSchema = z.object({
|
|
|
13
14
|
const approveRoute = describeRoute({
|
|
14
15
|
summary: "Approve ERC721",
|
|
15
16
|
description: "Returns transaction data for approving an address to transfer a specific ERC721 token",
|
|
16
|
-
tags: [
|
|
17
|
+
tags: [erc721Tag.tag],
|
|
17
18
|
responses: {
|
|
18
19
|
200: {
|
|
19
20
|
description: "Returns transaction data for approving an ERC721 token",
|
|
@@ -30,7 +31,7 @@ export const ApproveErc721 = createController({
|
|
|
30
31
|
const { tokenAddress, to, tokenId } = c.req.valid("json");
|
|
31
32
|
return c.json(toTransaction({
|
|
32
33
|
address: tokenAddress,
|
|
33
|
-
abi: abis.
|
|
34
|
+
abi: abis.erc721AutoIdPausableRecoverableUpgradeableAbi,
|
|
34
35
|
functionName: "approve",
|
|
35
36
|
args: [to, BigInt(tokenId)],
|
|
36
37
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"burn.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/burn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"burn.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/burn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAkBH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;aAcrB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { Int256BigInt } from "../../common/int256.js";
|
|
8
|
+
import { erc721Tag } from "./tag.js";
|
|
8
9
|
export const BurnErc721RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
tokenId: Int256BigInt(z.bigint().nonnegative()),
|
|
@@ -12,7 +13,7 @@ export const BurnErc721RequestSchema = z.object({
|
|
|
12
13
|
const burnRoute = describeRoute({
|
|
13
14
|
summary: "Burn ERC721",
|
|
14
15
|
description: "Returns transaction data for burning an ERC721 token",
|
|
15
|
-
tags: [
|
|
16
|
+
tags: [erc721Tag.tag],
|
|
16
17
|
responses: {
|
|
17
18
|
200: {
|
|
18
19
|
description: "Returns transaction data for burning an ERC721 token",
|
|
@@ -29,7 +30,7 @@ export const BurnErc721 = createController({
|
|
|
29
30
|
const { tokenAddress, tokenId } = c.req.valid("json");
|
|
30
31
|
return c.json(toTransaction({
|
|
31
32
|
address: tokenAddress,
|
|
32
|
-
abi: abis.
|
|
33
|
+
abi: abis.erc721AutoIdPausableRecoverableUpgradeableAbi,
|
|
33
34
|
functionName: "burn",
|
|
34
35
|
args: [BigInt(tokenId)],
|
|
35
36
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/default/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/default/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,yBAAyB;;;;;;;iBAOpC,CAAC;AA6BH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;aAc5B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../../common/index.js";
|
|
7
7
|
import { FactoryChainId, getFactories } from "../../common/factories.js";
|
|
8
|
+
import { erc721Tag } from "../tag.js";
|
|
8
9
|
export const DeployErc721RequestSchema = z.object({
|
|
9
10
|
chainId: FactoryChainId.Schema,
|
|
10
11
|
tokenName: z.string().nonempty().openapi({ description: "Name of the NFT collection" }),
|
|
@@ -19,15 +20,15 @@ const deployErc721Route = describeRoute({
|
|
|
19
20
|
|
|
20
21
|
Returns transaction data for deploying a new ERC721 token via the factory contract.
|
|
21
22
|
|
|
22
|
-
Calls deployAndInitializeProxy on the
|
|
23
|
+
Calls deployAndInitializeProxy on the ERC721AutoIdPausableRecoverableFactory to atomically deploy and initialize a new token proxy.
|
|
23
24
|
|
|
24
25
|
The deployed token supports:
|
|
25
|
-
- mint(to
|
|
26
|
+
- mint(to) - Mint token with auto-generated ID (MINTER_ROLE gated)
|
|
26
27
|
- burn(tokenId) - Burn token (owner, approved, or MINTER_ROLE)
|
|
27
28
|
- setBaseURI(uri) - Set base URI (URI_SETTER_ROLE gated)
|
|
28
29
|
- setTokenURI(tokenId, uri) - Set token-specific URI (URI_SETTER_ROLE gated)
|
|
29
30
|
- setContractURI(uri) - Set contract metadata URI (URI_SETTER_ROLE gated)`,
|
|
30
|
-
tags: [
|
|
31
|
+
tags: [erc721Tag.tag],
|
|
31
32
|
responses: {
|
|
32
33
|
200: {
|
|
33
34
|
description: "Returns transaction data for deploying an ERC721 token via factory",
|
|
@@ -44,8 +45,8 @@ export const CreateErc721Token = createController({
|
|
|
44
45
|
const { chainId, tokenName, tokenSymbol, baseURI, defaultTokenAdmin, minter } = c.req.valid("json");
|
|
45
46
|
const factory = getFactories(chainId);
|
|
46
47
|
return c.json(toTransaction({
|
|
47
|
-
address: factory.
|
|
48
|
-
abi: abis.
|
|
48
|
+
address: factory.ERC721AutoIdPausableRecoverableFactory,
|
|
49
|
+
abi: abis.erc721AutoIdPausableRecoverableFactoryAbi,
|
|
49
50
|
functionName: "deployAndInitializeProxy",
|
|
50
51
|
args: [tokenName, tokenSymbol, baseURI, defaultTokenAdmin, minter],
|
|
51
52
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/default/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/default/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,6BAA6B;;;;;;;iBAOxC,CAAC;AAkBH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;aAclC,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
5
5
|
import { createController } from "../../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../../common/index.js";
|
|
7
|
+
import { erc721Tag } from "../tag.js";
|
|
7
8
|
export const InitializeErc721RequestSchema = z.object({
|
|
8
9
|
tokenAddress: AddressSchema,
|
|
9
10
|
name: z.string().nonempty().openapi({ description: "Name of the NFT collection" }),
|
|
@@ -15,7 +16,7 @@ export const InitializeErc721RequestSchema = z.object({
|
|
|
15
16
|
const initializeRoute = describeRoute({
|
|
16
17
|
summary: "Initialize ERC721",
|
|
17
18
|
description: "Returns transaction data for initializing an ERC721 token proxy contract",
|
|
18
|
-
tags: [
|
|
19
|
+
tags: [erc721Tag.tag],
|
|
19
20
|
responses: {
|
|
20
21
|
200: {
|
|
21
22
|
description: "Returns transaction data for initializing an ERC721 token",
|
|
@@ -32,7 +33,7 @@ export const InitializeDefaultErc721 = createController({
|
|
|
32
33
|
const { tokenAddress, name, symbol, baseURI, defaultAdmin, minter } = c.req.valid("json");
|
|
33
34
|
return c.json(toTransaction({
|
|
34
35
|
address: tokenAddress,
|
|
35
|
-
abi: abis.
|
|
36
|
+
abi: abis.erc721AutoIdPausableRecoverableUpgradeableAbi,
|
|
36
37
|
functionName: "initialize",
|
|
37
38
|
args: [name, symbol, baseURI, defaultAdmin, minter],
|
|
38
39
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseDeployEvent.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/default/parseDeployEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseDeployEvent.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/default/parseDeployEvent.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;aAoDxC,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { createController } from "../../../common/controller.js";
|
|
|
9
9
|
import { HttpError } from "../../../common/http-error.js";
|
|
10
10
|
import { AddressSchema, HashSchema } from "../../../common/index.js";
|
|
11
11
|
import { FactoryChainIdQuery } from "../../common/factories.js";
|
|
12
|
+
import { erc721Tag } from "../tag.js";
|
|
12
13
|
const QuerySchema = z.object({
|
|
13
14
|
chainId: FactoryChainIdQuery.openapi({
|
|
14
15
|
param: {
|
|
@@ -27,7 +28,7 @@ export const ParseDefaultErc721DeployEvent = createController({
|
|
|
27
28
|
build: (factory) => factory.createApp().get("/", describeRoute({
|
|
28
29
|
summary: "Get ERC721 TokenProxyConfigured Event",
|
|
29
30
|
description: `Gets the transaction by hash and parses emitted logs.\n\nProvided transaction must be a transaction emitted by the ERC721 factory \`deployAndInitializeProxy\` action`,
|
|
30
|
-
tags: [
|
|
31
|
+
tags: [erc721Tag.tag],
|
|
31
32
|
responses: {
|
|
32
33
|
200: {
|
|
33
34
|
description: "Returns parsed event log",
|
|
@@ -51,7 +52,7 @@ export const ParseDefaultErc721DeployEvent = createController({
|
|
|
51
52
|
hash: params.hash,
|
|
52
53
|
});
|
|
53
54
|
const [event] = parseEventLogs({
|
|
54
|
-
abi: abis.
|
|
55
|
+
abi: abis.erc721AutoIdPausableRecoverableFactoryAbi,
|
|
55
56
|
eventName: "TokenProxyConfigured",
|
|
56
57
|
logs: receipt.logs,
|
|
57
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/gated/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/gated/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,8BAA8B;;;;;;;;iBAUzC,CAAC;AA8BH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiBjC,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { createController } from "../../../common/controller.js";
|
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../../common/index.js";
|
|
7
7
|
import { DEFAULT_COMPILOT_SIGNER } from "../../../common/models/compilot.js";
|
|
8
8
|
import { FactoryChainId, getFactories } from "../../common/factories.js";
|
|
9
|
+
import { erc721Tag } from "../tag.js";
|
|
9
10
|
export const DeployGatedErc721RequestSchema = z.object({
|
|
10
11
|
chainId: FactoryChainId.Schema,
|
|
11
12
|
tokenName: z.string().nonempty().openapi({ description: "Name of the NFT collection" }),
|
|
@@ -23,16 +24,16 @@ const deployGatedErc721Route = describeRoute({
|
|
|
23
24
|
|
|
24
25
|
Returns transaction data for deploying a new gated ERC721 token via the factory contract.
|
|
25
26
|
|
|
26
|
-
Calls deployAndInitializeProxy on the
|
|
27
|
+
Calls deployAndInitializeProxy on the ERC721AutoIdGatedPausableRecoverableFactory to atomically deploy and initialize a new token proxy with whitelist gating.
|
|
27
28
|
|
|
28
29
|
The deployed token supports:
|
|
29
|
-
- mint(to
|
|
30
|
+
- mint(to) - Mint token with auto-generated ID (MINTER_ROLE gated)
|
|
30
31
|
- burn(tokenId) - Burn token (owner, approved, or MINTER_ROLE)
|
|
31
32
|
- setBaseURI(uri) - Set base URI (URI_SETTER_ROLE gated)
|
|
32
33
|
- setTokenURI(tokenId, uri) - Set token-specific URI (URI_SETTER_ROLE gated)
|
|
33
34
|
- setContractURI(uri) - Set contract metadata URI (URI_SETTER_ROLE gated)
|
|
34
35
|
- Whitelist gating via gatingSigner for transfer verification`,
|
|
35
|
-
tags: [
|
|
36
|
+
tags: [erc721Tag.tag],
|
|
36
37
|
responses: {
|
|
37
38
|
200: {
|
|
38
39
|
description: "Returns transaction data for deploying a gated ERC721 token via factory",
|
|
@@ -51,8 +52,8 @@ export const CreateGatedErc721Token = createController({
|
|
|
51
52
|
const { chainId, tokenName, tokenSymbol, baseURI, defaultTokenAdmin, minter, gatingSigner } = c.req.valid("json");
|
|
52
53
|
const factory = getFactories(chainId);
|
|
53
54
|
return c.json(toTransaction({
|
|
54
|
-
address: factory.
|
|
55
|
-
abi: abis.
|
|
55
|
+
address: factory.ERC721AutoIdGatedPausableRecoverableFactory,
|
|
56
|
+
abi: abis.erc721AutoIdGatedPausableRecoverableFactoryAbi,
|
|
56
57
|
functionName: "deployAndInitializeProxy",
|
|
57
58
|
args: [tokenName, tokenSymbol, baseURI, defaultTokenAdmin, minter, gatingSigner ?? DEFAULT_COMPILOT_SIGNER],
|
|
58
59
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/gated/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/gated/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,kCAAkC;;;;;;;;iBAU7C,CAAC;AAkBH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAchC,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../../common/index.js";
|
|
7
7
|
import { DEFAULT_COMPILOT_SIGNER } from "../../../common/models/compilot.js";
|
|
8
|
+
import { erc721Tag } from "../tag.js";
|
|
8
9
|
export const InitializeGatedErc721RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
name: z.string().nonempty().openapi({ description: "Name of the NFT collection" }),
|
|
@@ -19,7 +20,7 @@ export const InitializeGatedErc721RequestSchema = z.object({
|
|
|
19
20
|
const initializeRoute = describeRoute({
|
|
20
21
|
summary: "Initialize Gated ERC721",
|
|
21
22
|
description: "Returns transaction data for initializing a gated ERC721 token proxy contract",
|
|
22
|
-
tags: [
|
|
23
|
+
tags: [erc721Tag.tag],
|
|
23
24
|
responses: {
|
|
24
25
|
200: {
|
|
25
26
|
description: "Returns transaction data for initializing a gated ERC721 token",
|
|
@@ -36,7 +37,7 @@ export const InitializeGatedErc721 = createController({
|
|
|
36
37
|
const { tokenAddress, name, symbol, baseURI, defaultAdmin, minter, gatingSigner } = c.req.valid("json");
|
|
37
38
|
return c.json(toTransaction({
|
|
38
39
|
address: tokenAddress,
|
|
39
|
-
abi: abis.
|
|
40
|
+
abi: abis.erc721AutoIdWhitelistGatedPausableRecoverableUpgradeableAbi,
|
|
40
41
|
functionName: "initialize",
|
|
41
42
|
args: [name, symbol, baseURI, defaultAdmin, minter, gatingSigner ?? DEFAULT_COMPILOT_SIGNER],
|
|
42
43
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseDeployEvent.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/gated/parseDeployEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseDeployEvent.d.ts","sourceRoot":"","sources":["../../../../src/issuance/erc721/gated/parseDeployEvent.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;aAoDtC,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { createController } from "../../../common/controller.js";
|
|
|
9
9
|
import { HttpError } from "../../../common/http-error.js";
|
|
10
10
|
import { AddressSchema, HashSchema } from "../../../common/index.js";
|
|
11
11
|
import { FactoryChainIdQuery } from "../../common/factories.js";
|
|
12
|
+
import { erc721Tag } from "../tag.js";
|
|
12
13
|
const QuerySchema = z.object({
|
|
13
14
|
chainId: FactoryChainIdQuery.openapi({
|
|
14
15
|
param: {
|
|
@@ -27,7 +28,7 @@ export const ParseGatedErc721DeployEvent = createController({
|
|
|
27
28
|
build: (factory) => factory.createApp().get("/", describeRoute({
|
|
28
29
|
summary: "Get Gated ERC721 TokenProxyConfigured Event",
|
|
29
30
|
description: `Gets the transaction by hash and parses emitted logs.\n\nProvided transaction must be a transaction emitted by the Gated ERC721 factory \`deployAndInitializeProxy\` action`,
|
|
30
|
-
tags: [
|
|
31
|
+
tags: [erc721Tag.tag],
|
|
31
32
|
responses: {
|
|
32
33
|
200: {
|
|
33
34
|
description: "Returns parsed event log",
|
|
@@ -51,7 +52,7 @@ export const ParseGatedErc721DeployEvent = createController({
|
|
|
51
52
|
hash: params.hash,
|
|
52
53
|
});
|
|
53
54
|
const [event] = parseEventLogs({
|
|
54
|
-
abi: abis.
|
|
55
|
+
abi: abis.erc721AutoIdGatedPausableRecoverableFactoryAbi,
|
|
55
56
|
eventName: "TokenProxyConfigured",
|
|
56
57
|
logs: receipt.logs,
|
|
57
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantRole.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/grantRole.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAgC,eAAe,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"grantRole.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/grantRole.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAgC,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAG3G,eAAO,MAAM,4BAA4B;;;;iBAOvC,CAAC;AAkBH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;aAc1B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
7
|
import { convertErc721TokenRoleToHash, Erc721TokenRole } from "../../common/roles/erc721-factory-roles.js";
|
|
8
|
+
import { erc721Tag } from "./tag.js";
|
|
8
9
|
export const GrantRoleErc721RequestSchema = z.object({
|
|
9
10
|
tokenAddress: AddressSchema,
|
|
10
11
|
role: z.nativeEnum(Erc721TokenRole).openapi({
|
|
@@ -16,7 +17,7 @@ export const GrantRoleErc721RequestSchema = z.object({
|
|
|
16
17
|
const grantRoleRoute = describeRoute({
|
|
17
18
|
summary: "Grant Role on ERC721",
|
|
18
19
|
description: "Returns transaction data for granting a role on the ERC721 token contract",
|
|
19
|
-
tags: [
|
|
20
|
+
tags: [erc721Tag.tag],
|
|
20
21
|
responses: {
|
|
21
22
|
200: {
|
|
22
23
|
description: "Returns transaction data for granting a role",
|
|
@@ -33,7 +34,7 @@ export const GrantRoleErc721 = createController({
|
|
|
33
34
|
const { tokenAddress, role, account } = c.req.valid("json");
|
|
34
35
|
return c.json(toTransaction({
|
|
35
36
|
address: tokenAddress,
|
|
36
|
-
abi: abis.
|
|
37
|
+
abi: abis.erc721AutoIdPausableRecoverableUpgradeableAbi,
|
|
37
38
|
functionName: "grantRole",
|
|
38
39
|
args: [convertErc721TokenRoleToHash(role), account],
|
|
39
40
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAuB3B,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const MintErc721RequestSchema: z.ZodObject<{
|
|
3
3
|
tokenAddress: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
|
|
4
4
|
to: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
|
|
5
|
-
tokenId: z.ZodPipe<z.core.$ZodBranded<z.ZodString, "Int256", "out">, z.ZodTransform<bigint, string & z.core.$brand<"Int256">>>;
|
|
6
5
|
}, z.core.$strip>;
|
|
7
6
|
export declare const MintErc721: import("../../common/controller.js").IController<import("hono/hono-base").HonoBase<import("../../common/context.js").AppContext, {
|
|
8
7
|
"/": {
|
|
@@ -11,7 +10,6 @@ export declare const MintErc721: import("../../common/controller.js").IControlle
|
|
|
11
10
|
json: {
|
|
12
11
|
tokenAddress: string;
|
|
13
12
|
to: string;
|
|
14
|
-
tokenId: string;
|
|
15
13
|
};
|
|
16
14
|
};
|
|
17
15
|
output: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/mint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/mint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAmBH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;aAcrB,CAAC"}
|
|
@@ -4,16 +4,15 @@ import { z } from "zod";
|
|
|
4
4
|
import { abis } from "@evergonlabs/tmi-factories-sdk";
|
|
5
5
|
import { createController } from "../../common/controller.js";
|
|
6
6
|
import { AddressSchema, toTransaction, TransactionSchema } from "../../common/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { erc721Tag } from "./tag.js";
|
|
8
8
|
export const MintErc721RequestSchema = z.object({
|
|
9
9
|
tokenAddress: AddressSchema,
|
|
10
10
|
to: AddressSchema.openapi({ description: "Address to mint the token to" }),
|
|
11
|
-
tokenId: Int256BigInt(z.bigint().nonnegative()),
|
|
12
11
|
});
|
|
13
12
|
const mintRoute = describeRoute({
|
|
14
13
|
summary: "Mint ERC721",
|
|
15
|
-
description: "Returns transaction data for minting an ERC721 token (MINTER_ROLE required)",
|
|
16
|
-
tags: [
|
|
14
|
+
description: "Returns transaction data for minting an ERC721 token with an auto-generated token ID (MINTER_ROLE required)",
|
|
15
|
+
tags: [erc721Tag.tag],
|
|
17
16
|
responses: {
|
|
18
17
|
200: {
|
|
19
18
|
description: "Returns transaction data for minting an ERC721 token",
|
|
@@ -27,12 +26,12 @@ const mintRoute = describeRoute({
|
|
|
27
26
|
});
|
|
28
27
|
export const MintErc721 = createController({
|
|
29
28
|
build: (factory) => factory.createApp().post("/", mintRoute, validator("json", MintErc721RequestSchema), async (c) => {
|
|
30
|
-
const { tokenAddress, to
|
|
29
|
+
const { tokenAddress, to } = c.req.valid("json");
|
|
31
30
|
return c.json(toTransaction({
|
|
32
31
|
address: tokenAddress,
|
|
33
|
-
abi: abis.
|
|
32
|
+
abi: abis.erc721AutoIdPausableRecoverableUpgradeableAbi,
|
|
34
33
|
functionName: "mint",
|
|
35
|
-
args: [to
|
|
34
|
+
args: [to],
|
|
36
35
|
}));
|
|
37
36
|
}),
|
|
38
37
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const NextTokenIdErc721: import("../../common/controller.js").IController<import("hono/hono-base").HonoBase<import("../../common/context.js").AppContext, {
|
|
2
|
+
"/": {
|
|
3
|
+
$get: {
|
|
4
|
+
input: {
|
|
5
|
+
query: {
|
|
6
|
+
chainId: string | string[];
|
|
7
|
+
tokenAddress: string | string[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
output: {
|
|
11
|
+
nextTokenId: string;
|
|
12
|
+
totalMinted: number;
|
|
13
|
+
};
|
|
14
|
+
outputFormat: "json";
|
|
15
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}, "/", "/">>;
|
|
19
|
+
//# sourceMappingURL=nextTokenId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextTokenId.d.ts","sourceRoot":"","sources":["../../../src/issuance/erc721/nextTokenId.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;aAsD5B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
});
|