Skip to content

Latest commit

 

History

History
3947 lines (2691 loc) · 56.5 KB

reference.md

File metadata and controls

3947 lines (2691 loc) · 56.5 KB

Reference

client.nft({ ...params }) -> void

📝 Description

Transfer NFTs from one wallet to another wallet. Intended for wallets created with userId option.

API scope required: wallets:nfts.transfer

🔌 Usage

await client.nft();

⚙️ Parameters

request: Crossmint.NftRequest

requestOptions: CrossmintClient.RequestOptions

Headless

client.headless.createOrder({ ...params }) -> Crossmint.CreateOrderResponse

📝 Description

Creates a new order that can be used to complete a headless checkout.

🔌 Usage

await client.headless.createOrder({
    payment: {
        method: Crossmint.EvmPaymentMethods.ArbitrumSepolia,
        currency: Crossmint.EvmPaymentCurrency.Eth,
    },
    lineItems: {
        collectionLocator: "crossmint:<collectionId>",
    },
});

⚙️ Parameters

request: Crossmint.CreateOrderRequest

requestOptions: Headless.RequestOptions

client.headless.getOrder(orderId) -> Crossmint.OrderObject

📝 Description

Get specific order by ID

🔌 Usage

await client.headless.getOrder("orderId");

⚙️ Parameters

orderId: string

This is the identifier for the order with UUID format.

Example: 9c82ef99-617f-497d-9abb-fd355291681b

requestOptions: Headless.RequestOptions

client.headless.editOrder(orderId, { ...params }) -> Crossmint.OrderObject

📝 Description

Edit an existing order. You can update the recipient, the payment method, and/or the locale.

🔌 Usage

await client.headless.editOrder("orderId");

⚙️ Parameters

orderId: string

This is the identifier for the order with UUID format.

Example: 9c82ef99-617f-497d-9abb-fd355291681b

request: Crossmint.OrderDto

requestOptions: Headless.RequestOptions

NfTs

client.nfTs.batchMintNft(collectionId, { ...params }) -> Crossmint.BatchMintResponse

📝 Description

Mint multiple NFTs with a single call and deliver them to a web3 wallet or an email address

API scope required nfts.create

🔌 Usage

await client.nfTs.batchMintNft("default-solana", {
    nfts: [{}],
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.BatchMintNftRequest

requestOptions: NfTs.RequestOptions

client.nfTs.mintStatusList(collectionId, { ...params }) -> Crossmint.NftObjectEvm[]

📝 Description

Get a list of all the NFTs in a given collection.

API scope required: nfts.read

🔌 Usage

await client.nfTs.mintStatusList("default-solana", {
    page: 1.1,
    perPage: 20,
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.MintStatusListRequest

requestOptions: NfTs.RequestOptions

client.nfTs.mintNft(collectionId, { ...params }) -> Crossmint.MintNftResponse

📝 Description

Mint your NFTs and deliver them to a web3 wallet or an email address

API scope required: nfts.create

🔌 Usage

await client.nfTs.mintNft("default-solana", {
    metadata: {
        name: "Crossmint Example NFT",
        image: "https://www.crossmint.com/assets/crossmint/logo.png",
        description: "My NFT created via the mint API!",
    },
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.MintNftRequest

requestOptions: NfTs.RequestOptions

client.nfTs.mintSft(collectionId, { ...params }) -> Crossmint.MintSftResponse

📝 Description

Mint your SFTs and deliver them to a web3 wallet or an email address

API scope required: nfts.create

🔌 Usage

await client.nfTs.mintSft("default-solana", {
    templateId: "silver-pass",
    recipient: "email:[email protected]:polygon",
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.MintSftRequest

requestOptions: NfTs.RequestOptions

client.nfTs.mintStatus(collectionId, id) -> Crossmint.MintStatusSolana200

📝 Description

Get the status and associated information for a mint operation.

API scope required: nfts.read

🔌 Usage

await client.nfTs.mintStatus("default-solana", "id");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

id: string — Unique ID of the minted NFT returned in the mint response

requestOptions: NfTs.RequestOptions

client.nfTs.mintNftIdempotent(collectionId, id, { ...params }) -> Crossmint.MintNftIdempotentResponse

📝 Description

This pathway allows you to mint NFTs and guarantee idempotency to ensure you never double mint for the same NFT.

API scope required: nfts.create

🔌 Usage

await client.nfTs.mintNftIdempotent("default-solana", "my-idempotency-key", {
    recipient: "email:[email protected]:polygon",
    metadata: {
        name: "Crossmint Example NFT",
        image: "https://www.crossmint.com/assets/crossmint/logo.png",
        description: "My NFT created via the mint API!",
    },
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

id: string — Custom ID of the NFT, which is used as an idempotency key

request: Crossmint.MintNftIdempotentRequest

requestOptions: NfTs.RequestOptions

client.nfTs.burnNft(collectionId, id) -> Crossmint.BurnNftResponse

📝 Description

Burn a minted NFT.

API scope required: nfts.delete

🔌 Usage

await client.nfTs.burnNft("default-solana", "id");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

id: string — Unique ID of the minted NFT returned in the mint response

requestOptions: NfTs.RequestOptions

client.nfTs.editNft(collectionId, id, { ...params }) -> Crossmint.EditNftResponse

📝 Description

Edit a minted NFT's metadata on IPFS.

If you are using a custom baseURI, invoking this will overwrite the specific tokenURI for the edited token.

API scope required: nfts.update

🔌 Usage

await client.nfTs.editNft("default-solana", "id", {
    metadata: {
        name: "Crossmint Example NFT",
        image: "https://www.crossmint.com/assets/crossmint/logo.png",
        description: "My NFT created via the mint API!",
    },
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

id: string — Unique ID of the minted NFT returned in the mint response

request: Crossmint.EditNftRequest

requestOptions: NfTs.RequestOptions

client.nfTs.burnNftByLocator(locator) -> Crossmint.BurnNftResponse

📝 Description

Burn a minted NFT using a Crossmint NFT locator.

API scope required: nfts.delete

🔌 Usage

await client.nfTs.burnNftByLocator("polygon:0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045:52");

⚙️ Parameters

locator: string — The locator of the NFT, which includes the blockchain, contract address, and token ID.

requestOptions: NfTs.RequestOptions

client.nfTs.editNftByLocator(locator, { ...params }) -> Crossmint.EditNftResponse

📝 Description

Edit a minted NFT's metadata using a Crossmint NFT locator.

API scope required: nfts.update

🔌 Usage

await client.nfTs.editNftByLocator("polygon:0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045:52", {
    metadata: {
        name: "Crossmint Example NFT",
        image: "https://www.crossmint.com/assets/crossmint/logo.png",
        description: "My NFT created via the mint API!",
    },
    reuploadLinkedFiles: true,
});

⚙️ Parameters

locator: string — The locator of the NFT, which includes the blockchain, contract address, and token ID.

request: Crossmint.EditNftByLocatorRequest

requestOptions: NfTs.RequestOptions

NftCollections

client.nftCollections.listCollections() -> Crossmint.ListCollectionsResponse

📝 Description

List all collections created under the current Crossmint project

API scope required: collections.read

🔌 Usage

await client.nftCollections.listCollections();

⚙️ Parameters

requestOptions: NftCollections.RequestOptions

client.nftCollections.createCollection({ ...params }) -> Crossmint.CreateCollectionResponse

📝 Description

Create a collection that you can mint NFTs/SFTs from

API scope required: collections.create

🔌 Usage

await client.nftCollections.createCollection({
    chain: Crossmint.CreateCollectionBodyChain.Aptos,
    metadata: {
        name: "Sample NFT Collection",
        description: "This is a sample NFT collection",
    },
});

⚙️ Parameters

request: Crossmint.CreateCollectionBody

requestOptions: NftCollections.RequestOptions

client.nftCollections.collectionInfo(collectionId) -> Crossmint.GetCollectionResponse

📝 Description

Get information about a specific collection.

API scope required: collections.read

🔌 Usage

await client.nftCollections.collectionInfo("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

requestOptions: NftCollections.RequestOptions

client.nftCollections.createCollectionCustom(collectionId, { ...params }) -> Crossmint.CreateCollectionResponse

📝 Description

Create a collection that you can mint NFTs/SFTs from. This API is idempotent, if you call it multiple times with the same ID, only one will be created.

API scope required: collections.create

🔌 Usage

await client.nftCollections.createCollectionCustom("default-solana", {
    chain: Crossmint.CreateCollectionBodyChain.Aptos,
    metadata: {
        name: "Sample NFT Collection",
        description: "This is a sample NFT collection",
    },
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.CreateCollectionBody

requestOptions: NftCollections.RequestOptions

client.nftCollections.updateCollection(collectionId, { ...params }) -> Crossmint.UpdateCollectionResponse

📝 Description

Update the sales details of a collection

API scope required: collections.update

🔌 Usage

await client.nftCollections.updateCollection("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.UpdateCollectionRequest

requestOptions: NftCollections.RequestOptions

client.nftCollections.getRoyaltyInformation(collectionId) -> Crossmint.GetRoyaltyInformationResponse

📝 Description

Fetch the royalty configuration for a collection, from its current state in the blockchain.

This API is only supported on EVM chains.

If you call GET too soon after PUT/DELETE, you may not yet see your latest changes, as they can take a few seconds to record on the blockchain.

API scope required: collections.read

🔌 Usage

await client.nftCollections.getRoyaltyInformation("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

requestOptions: NftCollections.RequestOptions

client.nftCollections.editRoyaltyInformation(collectionId, { ...params }) -> void

📝 Description

Configure royalties for all NFTs in a collection.

This API is only supported for EVM chains and implements the EIP-2981 standard.

API scope required: collections.update

🔌 Usage

await client.nftCollections.editRoyaltyInformation("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.EditRoyaltyInformationRequest

requestOptions: NftCollections.RequestOptions

client.nftCollections.disableRoyaltyInformation(collectionId) -> void

📝 Description

Remove all royalties from a given collection. No new NFT sales will yield royalties to the creator.

This API is only supported on EVM Chains.

API scope required: collections.update

🔌 Usage

await client.nftCollections.disableRoyaltyInformation("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

requestOptions: NftCollections.RequestOptions

client.nftCollections.getBaseUri(collectionId) -> Crossmint.GetBaseUriResponse

📝 Description

Get the Base URI of a collection as it appears on-chain.

API scope required: collections.read

🔌 Usage

await client.nftCollections.getBaseUri("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

requestOptions: NftCollections.RequestOptions

client.nftCollections.setBaseUri(collectionId, { ...params }) -> void

📝 Description

Update the Base URI of a collection. Setting the baseURI enables excluding the metadata param when minting. Tokens minted without the metadata param will have a tokenURI of:

{BASE_URI}/{TOKEN_ID}

This API is currently only supported on EVM Chains.

API scope required: collections.update

🔌 Usage

await client.nftCollections.setBaseUri("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.SetBaseUriRequest

requestOptions: NftCollections.RequestOptions

client.nftCollections.getTransferability(collectionId) -> Crossmint.GetTransferabilityResponse

📝 Description

Get the transferable status of a collection.

This API is only supported on EVM chains.

You must contact sales to gain access to this API.

API scope required: collections.read

🔌 Usage

await client.nftCollections.getTransferability("default-solana");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

requestOptions: NftCollections.RequestOptions

client.nftCollections.setTransferability(collectionId, { ...params }) -> void

📝 Description

Update the transferable status of a collection.

This API is only supported on EVM chains. You must contact sales to gain access to this API.

API scope required: collections.update

🔌 Usage

await client.nftCollections.setTransferability("default-solana", {
    value: true,
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.SetTransferabilityRequest

requestOptions: NftCollections.RequestOptions

NftTemplates

client.nftTemplates.getAllTemplates(collectionId, { ...params }) -> Crossmint.TemplateResponse[]

📝 Description

Get all of the templates for a collection

API scope required: nfts.read

🔌 Usage

await client.nftTemplates.getAllTemplates("default-solana", {
    page: 1.1,
    perPage: 20,
});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

request: Crossmint.GetAllTemplatesRequest

requestOptions: NftTemplates.RequestOptions

client.nftTemplates.createTemplate(collectionId, { ...params }) -> Crossmint.TemplateResponse

📝 Description

Create a token template, that NFTs or SFTs may be minted from

API scope required: nfts.create

🔌 Usage

await client.nftTemplates.createTemplate("idempotent-collection-name", {});

⚙️ Parameters

collectionId: string — The ID of the named collection, used to create new tokens

request: Crossmint.CreateTemplateBody

requestOptions: NftTemplates.RequestOptions

client.nftTemplates.getTemplate(collectionId, templateId) -> Crossmint.TemplateResponse

📝 Description

Fetch the contents of a token template.

API scope required: nfts.read

🔌 Usage

await client.nftTemplates.getTemplate("default-solana", "templateId");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

templateId: string — The template ID

requestOptions: NftTemplates.RequestOptions

client.nftTemplates.createTemplateIdempotent(collectionId, templateId, { ...params }) -> Crossmint.TemplateResponse

📝 Description

Create a token template with preconfigured metadata

API scope required: nfts.create

🔌 Usage

await client.nftTemplates.createTemplateIdempotent("default-solana", "templateId", {});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

templateId: string — The template ID

request: Crossmint.CreateTemplateBody

requestOptions: NftTemplates.RequestOptions

client.nftTemplates.deleteTemplate(collectionId, templateId) -> void

📝 Description

Delete a Token template.

API scope required: nfts.delete

🔌 Usage

await client.nftTemplates.deleteTemplate("default-solana", "templateId");

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

templateId: string — The template ID

requestOptions: NftTemplates.RequestOptions

client.nftTemplates.editTemplate(collectionId, templateId, { ...params }) -> void

📝 Description

Edit a Token template.

API scope required: nfts.update

🔌 Usage

await client.nftTemplates.editTemplate("default-solana", "templateId", {});

⚙️ Parameters

collectionId: string

This is the identifier for the collection related to the request. Every project has default collections: default-solana and default-polygon.

The create-collection API will result in collections with UUID formatted collectionId. Example: 9c82ef99-617f-497d-9abb-fd355291681b

The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request. Example: your-custom-identifer

templateId: string — The template ID

request: Crossmint.EditTemplateRequest

requestOptions: NftTemplates.RequestOptions

Actions

client.actions.getActionStatus(actionId) -> Crossmint.GetActionStatusResponse

📝 Description

Use this API to poll for the status of asynchonous actions such as NFT mints, transfers, etc.

API scope required: nfts.create

🔌 Usage

await client.actions.getActionStatus("actionId");

⚙️ Parameters

actionId: string — The actionId.

requestOptions: Actions.RequestOptions

Registration

client.registration.registerNftCollection({ ...params }) -> void

📝 Description

Register your NFT collection with Crossmint

This API is subject to change as it is currently in its alpha form.

🔌 Usage

await client.registration.registerNftCollection({
    chain: Crossmint.RegisterNftCollectionRequestChain.Solana,
    contractType: Crossmint.RegisterNftCollectionRequestContractType.CandyMachine,
    args: {
        candyMachineId: "candyMachineId",
    },
    metadata: {
        title: "title",
        description: "description",
        imageUrl: "imageUrl",
    },
    ownership: Crossmint.RegisterNftCollectionRequestOwnership.External,
    category: Crossmint.RegisterNftCollectionRequestCategory.Loyalty,
    scopes: [Crossmint.RegisterNftCollectionRequestScopesItem.PaymentsCreditCard],
});

⚙️ Parameters

request: Crossmint.RegisterNftCollectionRequest

requestOptions: Registration.RequestOptions

client.registration.updateNftCollection({ ...params }) -> void

📝 Description

Update your collection information registered on Crossmint

This API is subject to change as it is currently in its alpha form.

🔌 Usage

await client.registration.updateNftCollection({
    clientId: "clientId",
    metadata: {
        title: "title",
        imageUrl: "imageUrl",
    },
});

⚙️ Parameters

request: Crossmint.UpdateNftCollectionRequest

requestOptions: Registration.RequestOptions

Checkout

client.checkout.mint({ ...params }) -> Crossmint.CheckoutMintSuccess

📝 Description

API scope required: nfts.checkout Begin the checkout process for a mint This API is subject to change as it is currently in its alpha form.

🔌 Usage

await client.checkout.mint({
    clientId: "clientId",
    userId: "userId",
});

⚙️ Parameters

request: Crossmint.CheckoutMintRequest

requestOptions: Checkout.RequestOptions

QuotePrice

client.quotePrice.quote({ ...params }) -> Crossmint.QuoteResponse

📝 Description

Get the price of a transaction hosted through Crossmint, inclusive of all fees.

This API is subject to change as it is currently in its alpha form.

🔌 Usage

await client.quotePrice.quote({
    nativePrice: "nativePrice",
    quoteCurrency: Crossmint.QuoteRequestQuoteCurrency.Usd,
});

⚙️ Parameters

request: Crossmint.QuoteRequest

requestOptions: QuotePrice.RequestOptions

VerifiableCredentials

client.verifiableCredentials.verifyCredential({ ...params }) -> Crossmint.VerifyCredentialResponse

📝 Description

Verify that a credential is valid.

API scope required credentials.read

🔌 Usage

await client.verifiableCredentials.verifyCredential({
    credential: {
        key: "value",
    },
});

⚙️ Parameters

request: Crossmint.VerifyCredentialRequest

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.vcCreateTemplate({ ...params }) -> string

📝 Description

Create a template (similar to an nft collection) for issuing verifiable credentials.

API scope required credentials:template.create

🔌 Usage

await client.verifiableCredentials.vcCreateTemplate({
    metadata: {
        name: "Verifiable Credential",
        description: "The owner of this credential is authorized.",
    },
    credentials: {
        type: "degreeForMastersStudent",
    },
});

⚙️ Parameters

request: Crossmint.VcCreateTemplateRequest

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.getVc(collectionId, id) -> Record

📝 Description

Get a verifiable credential by the ID associated with the minted NFT.

This ID will have the format: <UUID>. For example: d7eb777b-e9b4-4f34-ab5f-ce199111166a

API scope required credentials.read. This endpoint will not work with a client side API key.

🔌 Usage

await client.verifiableCredentials.getVc("collectionId", "id");

⚙️ Parameters

collectionId: string — Collection id (template id)

id: string — UUID of the NFT returned in the NFT creation response. Format is: <UUID>

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.getVcById(id) -> Record

📝 Description

Get a verifiable credential by the ID associated with it.

This ID will have the format: urn:uuid:<UUID>. For example: urn:uuid:64f9877d-a19a-4205-8d61-f8c2abed5766

API scope required credentials.read. This enpoint will work also with a client side API key.

🔌 Usage

await client.verifiableCredentials.getVcById("id");

⚙️ Parameters

id: string — Unique ID of the credential as returned in the NFT creation response. Format is: urn:uuid:<UUID>

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.revokeCredential(id) -> Crossmint.BurnNftResponse

📝 Description

Revoke a verifiable credential by the credential ID. This involves burning the associated nft.

This ID will have the format: urn:uuid:<UUID>. For example: urn:uuid:64f9877d-a19a-4205-8d61-f8c2abed5766

API scope required credentials.create.

🔌 Usage

await client.verifiableCredentials.revokeCredential("id");

⚙️ Parameters

id: string — Unique ID of the credential as returned in the NFT creation response. Format is: urn:uuid:<UUID>

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.getVcByLocator(nftLocator) -> Record

📝 Description

Get a verifiable credential by the NFT locator.

This locator will have the format: <chain>:<contract_address>:<tokenId>. For example: polygon:0x1234abcde...:1

API scope required credentials.read. This enpoint will work also with a client side API key.

🔌 Usage

await client.verifiableCredentials.getVcByLocator("nftLocator");

⚙️ Parameters

nftLocator: string — NFT on chain locator, in the format of <chain>:<contract_address>:<tokenId>

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.issueVc(templateId, { ...params }) -> Crossmint.IssueVcResponse

📝 Description

Issue a verifiable credential. Deliver to a web3 wallet or email address.

API scope required credentials.create

🔌 Usage

await client.verifiableCredentials.issueVc("default", {
    recipient: "polygon:0x1234abcde... or email:<email_address>:polygon",
    credential: {
        subject: {
            subjectName: "foo",
            subjectAge: 20,
            claim: "bar",
        },
    },
});

⚙️ Parameters

templateId: string — Template id of a credential enabled collection

request: Crossmint.IssueVcRequest

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.createType({ ...params }) -> Crossmint.CreateTypeResponse

📝 Description

Create a type with a random UUID. This is how you define a custom schema.

API scope required credentials.create

🔌 Usage

await client.verifiableCredentials.createType({
    credentialSubjectSchema: [
        {
            name: "username",
            type: "string",
        },
        {
            name: "courses_completed",
            type: "uint64",
        },
        {
            name: "courses",
            type: "Course[]",
        },
    ],
});

⚙️ Parameters

request: Crossmint.CreateTypeRequest

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.getType(typeName) -> Crossmint.GetTypeResponse

📝 Description

Get the schema of a given type by name

API scope required credentials.read

🔌 Usage

await client.verifiableCredentials.getType("typeName");

⚙️ Parameters

typeName: string — The name of the type

requestOptions: VerifiableCredentials.RequestOptions

client.verifiableCredentials.createTypeIdempotent(typeName, { ...params }) -> Crossmint.CreateTypeIdempotentResponse

📝 Description

Create a type with a given name. This is how you define a custom schema.

API scope required credentials.create

🔌 Usage

await client.verifiableCredentials.createTypeIdempotent("typeName", {
    credentialSubjectSchema: [
        {
            name: "username",
            type: "string",
        },
        {
            name: "courses_completed",
            type: "uint64",
        },
        {
            name: "courses",
            type: "Course[]",
        },
    ],
});

⚙️ Parameters

typeName: string — The name of the type

request: Crossmint.CreateTypeIdempotentRequest

requestOptions: VerifiableCredentials.RequestOptions

Wallet

client.wallet.fetchWallet({ ...params }) -> Crossmint.Wallet[]

📝 Description

Fetch the addresses of a user's Crossmint custodial wallets

API scope required: wallets.read

🔌 Usage

await client.wallet.fetchWallet();

⚙️ Parameters

request: Crossmint.FetchWalletRequest

requestOptions: Wallet.RequestOptions

client.wallet.createWallet({ ...params }) -> Crossmint.CreateWalletResponse

📝 Description

Create a new Crossmint custodial wallet for a user

API scope required: wallets.create

🔌 Usage

await client.wallet.createWallet({
    email: "email",
    chain: Crossmint.AllChains.Arbitrum,
});

⚙️ Parameters

request: Crossmint.CreateWalletRequest

requestOptions: Wallet.RequestOptions

client.wallet.fetchContentFromWallet(identifier, { ...params }) -> Crossmint.FetchContentFromWalletResponse

📝 Description

Fetch the NFTs in a provided wallet

API scope required: wallets:nfts.read

🔌 Usage

await client.wallet.fetchContentFromWallet("identifier", {
    page: "page",
    perPage: "perPage",
});

⚙️ Parameters

identifier: string — The wallet identifier in the format of <chain>:<address>, email:<email_address>:<chain> or userId:<userId>:<chain>.

request: Crossmint.FetchContentFromWalletRequest

requestOptions: Wallet.RequestOptions

Sign

client.sign.message(chain, address, { ...params }) -> Crossmint.SignMessageResponse

📝 Description

Sign a message using a custodial wallet's key

API scope required: wallets:messages.sign

🔌 Usage

await client.sign.message(Crossmint.EvmChains.Arbitrum, "address", {
    message: "message",
});

⚙️ Parameters

chain: Crossmint.EvmChains — The blockchain network you are using.

address: string — The wallet address you want to sign the message with

request: Crossmint.SignMessageRequest

requestOptions: Sign.RequestOptions