Wallets and Users
Endpoints cover creating new wallets, retrieving wallet credentials, fetching NFTs in a wallet, etc.
How we do it: Each unique wallet public key on Rareful is tied to one unique user id. This is the UserWallet we will be referring to below.
Good to know: Wallet address and public key mean the same thing!
Creating and Storing UserWallets
Create a new user-wallet, or retrieve an existing one if the user id already has a wallet
POST
https://api.rareful.io/v1/createOrFindUserWallet
Creates a new wallet or returns existing one
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type*
String
application/json (Required)
Request Body
user_id
string
A unique identifier for the user. For example an email address, a uuid, etc. This allows you to incorporate your existing user management system into Rareful. If provided, the wallet is generated and stored with this user id. In other routes you can retrieve wallet credentials with only a user id. If none is provided, one is generated and returned to you.
is_custodial
Bool
If True, the generated wallet will be custodial, and the private key will be securely stored on the Rareful server. Otherwise, the private key of the new wallet will be returned once, and it will be your responsibility to store it. If not provided, the default value is true.
force_create
Bool
If True, a new user will always be created, and any existing user-wallet will be replaced. Take care! This could result in a private key being lost.
Good to know: If a user id is passed in that already has an associated wallet address the existing address will be returned unless you force a create.
Find wallet credentials for one of your users
POST
https://api.rareful.io/v1/findUserWallet
Fetches a user's associated wallet
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type*
String
application/json (Required)
Request Body
user_id*
String
One of your users that has an existing wallet with Rareful (Required)
Fetch NFTs that are owned by one of your user's wallets.
POST
https://api.rareful.io/v1/getUserWalletNFTs
Fetch a UserWallet's NFTs
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type
String
application/json (Required)
Request Body
public_key*
String
The NFT owner's wallet address. Must be provided if user_id is not provided.
blockchain
String
The blockchain the NFTs are on. Options are ["binance", "polygon"], if none provided all NFTs across blockchains are fetched.
user_id*
String
Your user's unique id. Must be provided if public_key is not provided.
Fetch NFTs from one of your user's wallets that are currently for sale
POST
https://api.rareful.io/v1/getUserWalletNFTsForSale
Fetch NFTs that are for sale from a specific wallet
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type*
String
application/json (Required)
Request Body
public_key*
String
The NFT owner's wallet address. Must be provided if user_id is not provided
network
String
The network/blockchain the NFTs are on. Options are ["binance", "polygon"]. Defaults to "polygon"
user_id
String
Your user's unique id. Must be provided if public_key is not provided
Retrieve the private key of a custodial wallet
POST
https://api.rareful.io/v1/unlockUserWallet
Pass in a user id or public key to find their associated private key
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
SECRET_API_KEY*
String
Your SECRET_API Key can found on the dashboard, and will be used to authenticate high sensitivity requests (Required)
Content-Type*
String
application/json (Required)
Request Body
user_id*
String
Your user's unique id. Must be provided if public_key is not provided
public_key
String
The NFT owner's wallet address. Must be provided if user_id is not provided
Warning! Ensure the unlockUserWallet route is secure, as it provides access to the private keys of your users.
Updates the wallet (private/public keys) for one of your users
POST
https://api.rareful.io/v1updateUserWalletKeys
Find and updates a user's wallet keys
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type
String
application/json (Required)
Request Body
public_key*
String
The new public key
user_id*
String
Your user's unique id whose wallet you want to update
force_update
Bool
If True, any exists private key will be overwritten. (Defaults to False)
private_key
String
The new private key
Updates the user ID for a UserWallet
POST
https://api.rareful.io/v1updateUserWalletId
Find and updates a user wallet's ID
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type
String
application/json (Required)
Request Body
public_key*
String
The public key (address) you want to update (Required)
user_id*
String
The new user ID (Required)
force_update
Bool
If True, if there is any existing user with the same UID, they will be overwritten
Remove a UserWallet from the Rareful Server
POST
https://api.rareful.io/v1/deleteUserWallet
Finds and deletes a UserWallet. Custodial users (private key stored) will not be deleted unless force_delete is passed as True.
Headers
API_KEY*
String
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
Content-Type
String
application/json (Required)
Request Body
public_key*
String
The NFT owner's wallet address. Must be provided if user_id is not provided
user_id*
String
Your user's unique id. Must be provided if public_key is not provided
force_delete
Bool
If True, the user will be deleted even if they have a stored private key
Last updated