QafNft Metamask Plugin
A utility library for QaftNft services. You can easily integrate QafNft services without any Metamask or web-3 knowledge.
Installation
npm install @barakatech/qafnft-metamask-plugin
Credentials
- You can get service informations and base url from https://docs.qafnft.com
- Please send an email to get your API credentials
Usage
import QafNftPlugin from '@barakatech/qafnft-metamask-plugin';
const qafNftPlugin = new QafNftPlugin(baseUrl, apiKey, apiSecret, gameId);
Callback Usage
- In some of our functions, we expect you to send a callback functions as a parameter. We send a three parameters in callback functions;
-
data
represents result of your process. -
message
represents error message. If an error occured it won't be empty, otherwise it will be null. -
error
represents an error occured or not. It can be true or false.
-
import QafNftPlugin from '@barakatech/qafnft-metamask-plugin';
const qafNftPlugin = new QafNftPlugin(baseUrl, apiKey, apiSecret, gameId);
qafNftPlugin.initWeb3Context((data, message, error) => {
if (error) {
console.log(message);
} else {
console.log(data);
}
})