NFT Wallets

Create NFT Wallet

POST https://api.nfty.dev/v1/accounts

This endpoint creates a new NFT Wallet and returns the address so you can associate it with a user in your app. You can optionally pass in a user_identifier (such as email or username) and we will keep track of the association as well.

Headers

Request Body

{"address":"0xfB0f5901044756FF25bcb1f91b5fc2E7b1b5c8c1",
 "user_identifier":"user@email.com"}

Example Request:

curl --request POST \
     --url https://api.nfty.dev/v1/accounts \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ==' \
     --data '{
       "user_identifier": "user@email.com"
       }'

Example Response:

{"address":"0x7eeef5e7ba91bbf9dc548fc786526cbba716e5d4",
 "user_identifier":"user@email.com"}

Get NFT Wallet Address for User

GET https://api.nfty.dev/v1/accounts/user/:user_identifier

This endpoint returns the NFT wallet address for a given user_identifier. This wallet address is needed for most other API calls that interact with the wallet. The user_identifer must have been associated with a wallet owned by your app during creation. If you did not associate a user_identifier, then you will not need to use this API.

Path Parameters

Headers

{"address":"0xe04d1df40973172a28f37045444df49cb9d88208"}

Example Request:

curl --request GET \
     --url https://api.nfty.dev/v1/accounts/user/user@email%2Ecom \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ=='

Example Response:

{"address":"0x5da2770b7decc2b03487f23af148455770919f6e"}

List NFT Wallet Contents

GET https://api.nfty.dev/v1/accounts/:address/(:contract_address)/(:token_id)

This endpoint returns the NFT items currently in the NFT Wallet. You can optionally filter by the contract_address and token_id as well. The address must be associated with a wallet owned by your app.

Path Parameters

Query Parameters

Headers

{
"address":"0xe04d1df40973172a28f37045444df49cb9d88208",
"assets_count": 2,
"pending_assets_count": 0,
"assets":
 [
  {"token_id":3,"contract":"0x67fc09ae09c2964b289128347d8d080028e7ecea","type":"ERC721","token_url":"https://nfty.com/3","unlockable_content":"hidden text viewable by the NFT owner, such as a url or special access code"},
  {"token_id":3,"contract":"0xf4e1074006928685a6ca3403d495f891eece7944","type":"ERC1155","token_url":"https://nfties.com/3","unlockable_content":"hidden text viewable by the NFT owner, such as a url or special access code","amount":95}
 ]
}

Example Request:

curl --request GET \
     --url https://api.nfty.dev/v1/accounts/0x5da2770b7decc2b03487f23af148455770919f6e \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ=='

Example Response:

{"address":"0x5da2770b7decc2b03487f23af148455770919f6e",
 "assets_count": 4,
 "pending_assets_count": 0,
 "assets":
  [
   {"token_id":1,"contract":"0x67fc09ae09c2964b289128347d8d080028e7ecea","type":"ERC721","token_url":"https://nfty.com/1"},
   {"token_id":1,"contract":"0xf4e1074006928685a6ca3403d495f891eece7944","type":"ERC1155","token_url":"https://nfties.com/1","amount":1},
   {"token_id":2,"contract":"0xf4e1074006928685a6ca3403d495f891eece7944","type":"ERC1155","token_url":"https://nfties.com/2","amount":2},
   {"token_id":3,"contract":"0xf4e1074006928685a6ca3403d495f891eece7944","type":"ERC1155","token_url":"https://nfties.com/3","amount":5}
  ]
}

List NFT Asset History

GET https://api.nfty.dev/v1/accounts/:address/asset_history/:contract/(:token_id)

This endpoint returns the deposit and withdrawal history within this NFT Wallet for items from the given contract and optional token id and type. The address must be associated with a wallet owned by your app.

Path Parameters

Query Parameters

Headers

[
 {"token_id":3,"type":"deposit","timestamp":"2021-08-23T12:10:46.000Z"},
 {"token_id":3,"type":"withdrawal","timestamp":"2021-08-24T11:19:46.000Z"},
 {"token_id":4,"type":"deposit","timestamp":"2021-08-25T10:29:46.000Z"}
]

or, filtered by token_id: 3

[
 {"token_id":3,"type":"deposit","timestamp":"2021-08-23T12:10:46.000Z"},
 {"token_id":3,"type":"withdrawal","timestamp":"2021-08-24T11:19:46.000Z"}
]

or, filtered by type=withdrawal

[
 {"token_id":3,"type":"withdrawal","timestamp":"2021-08-24T11:19:46.000Z"}
]

Example Request:

curl --request GET \
     --url https://api.nfty.dev/v1/accounts/0x5da2770b7decc2b03487f23af148455770919f6e/asset_history/0xf4e1074006928685a6ca3403d495f891eece7944 \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ=='

Example Response:

[
 {"token_id":1,"type":"deposit","amount":1,"timestamp":"2021-08-25T12:19:46.000Z"},
 {"token_id":2,"type":"deposit","amount":2,"timestamp":"2021-08-25T12:19:46.000Z"},
 {"token_id":3,"type":"deposit","amount":10,"timestamp":"2021-08-25T12:19:46.000Z"},
 {"token_id":3,"type":"withdrawal","amount":5,"timestamp":"2021-08-25T12:19:46.000Z"}
]

Last updated