Tweed's Interactive Modal Integration

Integration guidelines for NFT Checkout feature

Specify whether you want to be paid out in fiat or in crypto in the NFT_INFO object.

You must fill out either priceInCrypto or priceInCents for each Token.

You can only be paid out in crypto or in fiat for each Token, not a combination of both for each Token. You can, however, have a mixture of Tokens paid out in crypto and Tokens paid out in fiat. See Payout Setup for more details.

export type NftPurchaseBackendPayload = {
    priceInCents?: number;         //Will be shown to the user + calculated fees
    priceInCrypto?: string;        //Will be converted to fiat and shown to the user in USD
    tokenContractAddress?: string; //For settlement in ERC20 tokens
    description: string;           //The description of the token
    contractAddress: string;       //The address of the token
    chain: string;                 //The chain where the token lives on
    fiatCurrencyId: string;        
    nftId: string;                 //The ID of the Token, this is not the on chain NFTID 
    tokenUri: string;              //The thumbnail of the Token
    title: string;                 //The title of the Token
    abi: string | Record<string, any> | Array<Record<string, any>>; //How the mint function looks like, can be a string or and actual ABI JSON
    customMintParams?: Record<string, any>; //A JSON with the actual oarameters that will get passed to the contract
};

Smart Contract Prerequisites

We don't have any limitations on how your contract looks or how many arguments your mint function uses.

There are only two prerequisites:

  1. Our claimer needs to have a minter role in the contract.

  2. In case you want to get settled in native crypto currency, the mint function needs to be payable.

The abi parameter should contain the name of the function and its arguments declerations, similar to the following example: safeMint(sendTo address, tokenId uint256, tokenUri string). The arguments needs to get populated into thecustomMintParams object like so:

customMintParams : {
    sendTo: <THE_WALLET_ADDRESS_VAR>,
    tokenId: <YOUR_TOKEN_ID_VAR>,
    tokenUri: <YOUR_TOKEN_URI_VAR>
}

Tezos integration consideration

  1. In the abi parameter of the NFT_INFO only the function name is needed without the list of params

  2. The customMintParams parameter will hold the list of arguments the function in the abi gets and translate them to their michelson representation

  3. For ex:

abi: "buy_nft"
customMintParams: {
    wallet_address: <WALLET_ADDRESS>,
    nft_uri: <NFT_URI>
}

Last updated