Getting started
Covering the basics from authentication to creating your first wallet
Last updated
Covering the basics from authentication to creating your first wallet
Last updated
In this guide, we will explain how to access your testnet assets that you receive when you sign up for the trial of Walletify-API, as well as creating your first user and wallet, and performing a crypto transaction. We will walk you through several endpoints to help you get started with the Walletify-API.
We will cover the following topics:
You need a Quantum business account, if you don't have one, register in our , or follow our step-by-step guide, uantum.
You need your Client ID and Client Secret which can be obtained from the as shown below.
📘
All the API calls for this guide run on a sandbox environment. You can test and experiment with API calls without causing any harm to the actual blockchain or data.
You will need your access credentials (Client ID and Client Secret) to obtain a bearer token
and authorize all API calls. These credentials are necessary for authentication purposes.
📘
Please note that the base path for all Walletify API endpoints in this guide specifically is
https://api-wallet-sandbox.quantum.io
, which is the sandbox environment.
As soon as you sign up for a trial subscription with the Walletify-API, a MATIC testnet wallet is created automatically for you which includes the following testnet assets:
1 MATIC Token
100 Quantum Test Tokens (ERC20)
1 NFT
These assets are automatically added to your wallet, and linked to a user (Initial Test User) for you to start testing and playing around with the API endpoints.
👍123456 is the default PIN for your user that is used to access your wallet. More on this later in the guide.
userId
and signingMethodId
In this first API call, we will retrieve all users. A user can have multiple wallets linked to them. As explained at the start, the MATIC wallet, which is created automatically with the assets is also linked to a user. When you call this endpoint it will only return one user (let's call this User #1 or First User).
Firstly, we want to retrieve the userId
, which is the unique ID of your user.
Secondly, we want to retrieve the signingMethodId
, which is used to access the wallets linked to the user.
📘
Call the following endpoint to retrieve all users:
HTTP
includeSigningMethods
Query
Flag that indicates to show the signing method details of the users or not.
Boolean
true
📘Save the following params for later use:
result.id
which is theuserId
result.signingMethods.id
which is thesigningMethodId
JSON
walletId
and wallet address
Next, we will retrieve all wallets linked to a specific user. When you call this endpoint it will only return one wallet, which is your MATIC wallet.
Call the following endpoint to retrieve all wallets:
HTTP
userId
Query
Filter wallets by user ID. Add your userId
which you got from the previous endpoint.
String
👍The response body shows the
balance
param as 1, indicating you have one MATIC token.
📘Save the following params for later use:
result.id
which is thewalletId
result.address
which is the walletaddress
JSON
Next, we will call the following endpoint to receive the ERC20 token balance of your wallet:
HTTP
{walletId}
Path
The ID
of your wallet, which you got from the previous endpoint.
String
✅
HTTP
👍The response body shows the
balance
param as 100, indicating you have 100 ERC20 tokens.
JSON
Next, we will call the following endpoint to get NFTs in your wallet:
HTTP
{walletId}
Path
The ID
of the wallet, which you got from the previous endpoint.
String
✅
👍The response body will show your NFT.
JSON
👍
Now that you have accesed your user, wallet, and it's funds, the next part will talk about the basics of how you can actually create users, signing methods, and wallets from scratch.
Keep in mind that after completing Steps 3-5, you will have:
Two users
Two wallets
The next thing you need to do is create a second user. Each user created can represent one of your end-users.
📘
Use the following endpoint to create a user:
HTTP
reference
Body
A free-form text to specify a reference for the user you create. It can help group specific users.
String
❌
JSON
📘
result.id
: This is the User ID, of your second user.
JSON
Next, we're going to create a PIN
signing method for the user we just created. There are other signing methods as well, but the very first one should be PIN
. Signing methods allow your users to access and interact with their wallets and perform transactions. Each user can access their wallets using their own signing method.
📘
Use the following endpoint to create a signing method for your user.
HTTP
{userId}
Path
The ID of the user for whom to create the signing method for
String
✅
type
Body
The type of signing method to create for this user. Allowed values: PIN, BIOMETRIC, EMERGENCY_CODE
String
✅
value
Body
The value of the signing method. For PIN
, the value should be 6 digits. For EMERGENCY_CODE
, the value should be 25 characters, or you can leave it blank to autogenerate the code with the correct entropy.
String
❌
JSON
📘
result.id
: This is the Signing Method ID, of your second user.Each user has a unique signing method ID
JSON
The next step is creating a wallet for your user. We will include the userId
in the request body, and this way the wallet will be created and linked to the specific user. The user can then access the wallet with their signing method.
Since you are currently using the API calls in a sandbox environment, the wallets will be created on a testnet chain. In this example, we will create the wallet on the Polygon (MATIC) Blockchain.
📘
Use the following endpoint to create a wallet for your second user:
HTTP
Signing-Method
Header
id:value
id
: This is the ID of the user's signing method
value
: This is the value of the user's signing method
c992826c-6311-4896-9c74-8a5f1644f9c7:123456
secretType
Specifies the blockchain on which you wish to create your wallet
String
✅
userId
The ID of the user you want to link to this wallet.
String
❌
pincode
(deprecated)
Serves as the password to access your wallet. Please remember it and keep it secure to ensure the protection of your wallet and its contents.
String
❌
JSON
Save the following parameters from the response body. They will be used later in the guide.
result.id
This ID is utilized to uniquely identify the wallet.
result.address
This is the public wallet address. You can provide this address to others to receive payments or initiate transfers to this wallet.
result.secretType
This is the blockchain name on which your wallet is created.
JSON
👍You have successfully created a wallet 🎉.
The first wallet with testnet assets is linked to the first user (Initial test user), and the second wallet that you created is linked to the second user (Second Test User).
The PIN code of the first user (123456) will be used to access the first wallet with testnet assets.
The PIN code of your second user will be used to access the second wallet, which is empty.
Next, we will transfer the testnet funds from your first wallet (which has testnet assets) to your second wallet (which is empty).
At this point, you should have the first wallet containing testnet funds, while the second wallet remains empty. We will run another endpoint to transfer some funds (20 ERC20 tokens) from the first wallet to the second one.
Use the following endpoint to initiate an ERC20 token transfer:
HTTP
Signing-Method
Header
id:value
id
: This is the ID of the first user's signing method
value
: This is the value of the first user's signing method
c992826c-6311-4896-9c74-8a5f1644f9c7:123456
pincode
(Deprecated)
Serves as the password to access your wallet. Please remember it and keep it secure to ensure the protection of your wallet and its contents.
String
❌
transactionRequest
The JSON object for the transaction request data
Object
✅
type
Type of transfer. In the example a normal TOKEN_TRANSFER
String
✅
walletId
The wallet ID of the first wallet (The wallet that is initiating the transfer)
String
✅
to
The address
of the destination wallet where the funds will be transferred to. In this case, it refers to the address
of the second wallet.
String
✅
value
The amount mentioned here refers to the quantity of ERC20 tokens that you intend to transfer
Integer
✅
secretType
Specifies the blockchain of the transaction
String
✅
tokenAddress
The token address of the ERC20 token that you want to transfer
String
✅
JSON
In the response, you will find a tranasactionHash
, which can be used to follow up on the status of that specific transaction.
📘Save the
transactionHash
for later use in this guide.
JSON
The "success": true
in response body indicates that the transfer request was submitted successfully. It does not mean the fund transfer was completed. Since this transfer call is being made on a sandbox environment and testnet blockchain, it's important to note that the funds may arrive instantly. This may not be the case with mainnet blockchain transactions as they can take some time.
To verify whether a transfer has been completed, it is necessary to check the transaction status. This status will provide information on whether the transfer was successful or if it encountered any issues, resulting in a failure.
📘Mainnet Blockchain transactions are never immediate. They require time for processing, and the duration can vary depending on the specific blockchain network.
To confirm whether a specific transaction was successful or not, you can check its status using the provided endpoint. To obtain the status of the transaction, please provide the required information. Set the secretType
as "MATIC" and enter the transactionHash
that you had saved earlier.
HTTP
From the response body, you can see that the status is "SUCCEEDED"
. This indicates that the transaction was successfully executed and completed.
✅Funds have been sent from the first wallet to the second.
JSON
Check balance after transfer
Let's use the same endpoint once again to check the balance of your second wallet. Please provide the id
(walletId
) of your second wallet to retrieve the updated balance information.
HTTP
👍The response body shows the
balance
as 20, indicating it has 20 ERC20 tokens.
JSON
👍Following are a few basic guides that you should try next to experiment with your testnet assets:
There are several ways to run API calls, but for this guide, you can use the or to execute the different endpoints.
Learn how to and authenticate API calls.
Read more about and .
Read more about .
Read more about .
Explore further.
Schedule a with our team to explore tailored solutions or dive in and start building right away on our .