NFT

NFT Functions

Get balance

Description

Returns a list of NFTs owned by the user for the supported blockchains, filtered by the blockchainIds

Parameters

NameTypeRequiredDefaultDescription

blockchainIds

String[]

defaultBlockchainIds

Blockchain ids

userId

String

✔️

User id

Return type

Promise<{
  [blockchainId: string]: {
    tokenAddress: string,
    tokenMedia: {  gateway: string, raw: string}[],
    tokenTitle: string
    tokenId: string
  }[]
}>

Usage Example

const nftBalance = await sdk.nft.getBalance({ userId: '123' })

Response Example

{
  "ethereum": [
    {
      "contractAddress": "0x36436b6326a893d600aa9ad99317cc9d53b430c5",
      "media": [
        {
          "gateway": "https://storage.googleapis.com/nftimagebucket/tokens/0x36436b6326a893d600aa9ad99317cc9d53b430c5/preview/956.png",
          "raw": "https://storage.googleapis.com/nftimagebucket/tokens/0x36436b6326a893d600aa9ad99317cc9d53b430c5/preview/956.png"
        }
      ],
      "tokenId": "123",
      "title": "Calvaria"
    }
  ],
  "polygon": []
}

Get transactions

Description

Returns a list of NFT transactions for the supported blockchains, filtered by the blockchainIds

Parameters

NameTypeRequiredDefaultDescription

blockchainIds

String[]

defaultBlockchainIds

Blockchain ids

userId

String

✔️

User id

Return type

Promise<{
  [blockchainId: string]: [{
    createdAt: string,
    direction: string,
    fromAddress: string,
    id: string,
    status: string,
    toAddress: string,
    tokenMetadata: {
        tokenAddress: string
        tokenId: string
        tokenMedia: {
            gateway: string
            raw: string
          }[],
        tokenTitle: string
      }
  }]
}>

Usage Example

const transactions = await sdk.nft.getTransactions({ userId: '123' })

Response Example

{
  "ethereum": [
    {
      "createdAt": "2022-11-15T12:55:23.000Z",
      "id": "0x8e6598a271aed1dc4b1e7930207c98a2527eda49c2b6caed7dd73c23a0071648",
      "toAddress": "0x15b895d74582daea01be8e5be264243d8c9d7bb1",
      "fromAddress": "0xc1af9c48fb30fa29b0d4b1332c63c5e71e636f62",
      "direction": "incoming",
      "status": "complete",
      "tokenMetadata": {
        "tokenAddress": "0x36436b6326a893d600aa9ad99317cc9d53b430c5",
        "tokenId": "956",
        "tokenMedia": [
          {
            "gateway": "https://storage.googleapis.com/nftimagebucket/tokens/0x36436b6326a893d600aa9ad99317cc9d53b430c5/preview/956.png",
            "raw": "https://storage.googleapis.com/nftimagebucket/tokens/0x36436b6326a893d600aa9ad99317cc9d53b430c5/preview/956.png"
          }
        ],
        "tokenTitle": "Calvaria"
      }
    }
  ],
  "polygon": []
}

buyWithFiat

Please refer to the payment link section

Last updated