Key API Services
The Key API Services are the core of what you will need to create new contracts, and mint and transfer tokens.
Some Examples of what you can do with the key API Services:
Create a contract to mint tokens
Create your own token collections
mint your own tokens
transfer tokens between wallets
How can i use the key services?
Here is how you can mint your first token:
Check if your wallet has some balance and if not transfer some to it
Contracts Create your first contract draft and then publish it
Categories Subcategories Check if the existing categories and subcategories are what you need to create your token, if not, then create your own!
Token CollectionsCreate a token collection draft describing the details you want your tokens to have
Token Collections Publish the collection!!!
How to instantiate the Key SDK
To instantiate the Key SDK, you must create the ID SDK before and pass it as argument into the Key SDK instantiation. Because of this accomplishment, you don't need to worry about the authentication layer using commerce SDK. The ID SDK will do this job for you and send the credentials to each request if you're authenticated - specially if autoRefresh is set as true.
// Some codeimport { W3blockIdSDK } from '@w3block/sdk-id';
import { W3blockKeySDK } from '@w3block/sdk-key';
const idSdk = new W3blockIdSDK({
baseURL: 'https://api-id.pixway.io',
autoRefresh: true,
});
// Authenticate using idSdk with your credentials
// example: idSdk.authenticate({email: ..., password: ..., tenantId: ...})
const sdk = new W3blockKeySDK({
idSdk,
baseUrl: 'https://api.pixway.io'
});
Last updated