1.3.0 • Published 4 years ago
@barakatech/qafnft-metamask-plugin v1.3.0
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-pluginCredentials
- 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;
datarepresents result of your process.messagerepresents error message. If an error occured it won't be empty, otherwise it will be null.errorrepresents 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);
}
})