Mint an NFT to a Wallet

To mint an NFT directly to a Playfix wallet, send a POST request to the wallet/erc721/tokens endpoint, calling the :mint method, and passing the wallet name in the request body.

Mint an NFT to a Wallet

POST https://api.playfix.io/wallet/erc721/tokens:mint

Headers

Name
Type
Description

Authorization*

String

Bearer <your_access_token>

Request Body

Name
Type
Description

wallet*

String

Name of the wallet that will hold the newly minted NFT. This should be the value of name from a previously created wallet. It begins with "wallets/" followed by a ULID.

password*

String

The 32-character long password to the wallet. This should be the password entered when creating the wallet.

contractAddress*

String

NFT Contract Address.

tokenId*

String

This is the unique number assigned to the NFT item when the NFT collection contract is deployed.

{
  "transactionHash": "0xee0b6d2c894ac4e537d84ac4be61e2967a7132b119c03ba6be2c0c837a01ab42"
}

Example cURL API Call

curl --request POST \
  --url 'https://api.playfix.io/wallet/erc721/tokens:mint' \
  --header 'Authorization: Bearer <your_access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "wallet": "<wallet_name>",
    "contractAddress": "<nft_contract_address>",
    "tokenId": "<token_id>",
    "password": "<wallet_password>"
  }'

Example Python API Call

import requests
import json

payload = {
    "wallet": "<wallet_name>",
    "contractAddress": "<nft_contract_address>",
    "tokenId": "<token_id>",
    "password": "<wallet_password>"
    }

r = requests.post(
    "https://api.playfix.io/wallet/erc721/tokens:mint",
    headers = {
        "Authorization": "Bearer <your_access_token>",
        "Accept": "application/json",
        "Content-Type": "application/json"
        },
    data = json.dumps(payload)
    )

print(r.text)

Request Body

  • wallet - Name of the wallet to mint the NFT to. This should the value of name from a previously created wallet. It begins with "wallets/", followed by a ULID.

  • contractAddress - The NFT item's contract address.

  • tokenId - The unique number assigned to the NFT item when the NFT collection contract is deployed.

  • password - The 32-character long password to the wallet. This should be the password entered when creating the wallet.

Response

{
  "transactionHash": "0xee0b6d2c894ac4e537d84ac4be61e2967a7132b119c03ba6be2c0c837a01ab42"
}

Last updated