Validate

Ownership validation enables the developer to check if the purchaser is holding an NFT from a specified collection. The transaction will fail if the purchaser does not have the NFT and succeed if they do.

How it Works

  1. Developer specifies an NFT collection or an SPL mint address for an SFT as the verification target. mtnAPI uses the index API to query all the NFTs and SFTs in the user's wallet.

  2. mtnAPI verifies whether an NFT belongs to a collection or an SFT belongs to a specific SPL token address.

  3. If mtnAPI validates the above, there is a program with instruction included in the transaction that verifies NFT or SFT collection on-chain to provide a trusted solution.

Use Case

Let's use a concert as an example where NFTs and SFTs could be used and how they would be different.

For SFTs, assume the user holds an SFT granting them general admission to the event. mtnAPI would verify that the user has the specified SPL address of the SFT and verify it on the blockchain. In the case of NFTs, assume the user holds an NFT that includes a specific row and seat number. The verification process is similar, with the only difference being validating the user is holding an NFT of a specific collection.

The POST request will return the desired discounted payment transaction

POST https://api.mtnapi.com/validate

Query Parameters

NameTypeDescription

amount*

String

The payment amount in USDC.

wallet*

String

The public key (wallet address) of the merchant being paid.

devMode

String

Set to TRUE to enable dev mode, otherwise set to FALSE. Dev mode will enable error codes to be sent back for transaction failures.

The default value is set to FALSE.

decimal

String

Set to TRUE to enable human-readable values (i.e USDC, SOL, etc...), or set to FALSE to use SPL base unit quantity (i.e lamport).

The default is set to TRUE.

inputType

String

The token (ticker symbol) provided by the customer as payment and is accepted by the merchant.

The default value is set to SOL.

collection*

String

The public key of NFT collection.

discount*

String

The discount applied to the payment. Discount is specified in percentages (i.e 20% should be specified as 0.20)

Request Body

NameTypeDescription

account*

String

The public key of the payer's wallet.

{
    "transaction": "<transaction>"
}

GET https://api.mtnapi.com/validate

Query Parameters

NameTypeDescription

amount*

String

The payment amount in USDC.

wallet*

String

The public key (wallet address) of the merchant being paid.

devMode

String

Set to TRUE to enable dev mode, otherwise set to FALSE. Dev mode will enable error codes to be sent back for transaction failures.

The default value is set to FALSE.

cluster

String

Specify Solana devnet or mainnet cluster.

The default value is set to MAINNET.

decimal

String

Set to TRUE to enable human-readable values (i.e USDC, SOL, etc...), or set to FALSE to use SPL base unit quantity (i.e lamport).

The default is set to TRUE

inputType

String

The token (ticker symbol) provided by the customer as payment. If the input parameter is specified, the output parameter must also be specified.

The default value is set to SOL.

collection*

String

The pubkey of nft collection.

discount*

String

The discount applied to the payment. Discount is specified in percentages (i.e 20% should be specified as 0.20)

Request Body

NameTypeDescription

account*

String

The public key of the payer's wallet.

{
    label: "<Name of the merchant>",
    icon: "https://mtnphotobooth7afc22e0692f4205b848b9c01e02200e211757-dev.s3.amazonaws.com/public/2022-03-25+11.20.17.jpg"
}

Last updated