Skip to main content

From generating an NFT to selling at a fixed price.

Through this tutorial, you will be able to go through a basic fixed price transaction of using an NFT on the Rinkeby network.

0.Prerequistes

  1. An access token is needed, which is provided by contacting Kyuzan Inc.
  2. An access token to the Rinkeby network is needed using Fortmatic
  3. #how-to-get-eth-for-rinkebytest-envを参考に Rinkeby の ETH を取得する

1.Installation

% npm i @kyuzan/mint-sdk-js

2. Initializing the SDK

import { MintSDK } from '@kyuzan/mint-sdk-js'
const sdk = new MintSDK({
'YOUR_ACCESS_KEY',
[4],
{
fortmatic: {
key: 'YOUR_FORTMATIC_KEY',
},
}
})

3. Acquiring the item list

Item List
const items = sdk.getItems();

3. Getting each item information and past transaction data individually

Item List
const item = sdk.getItemById("hoo");

Getting past transaction history data

Item List
const itemLogs = sdk.getItemLogs("hoo");

4. Bidding on an Item

To bit on an item, it is necessary for the User to connect their wallet.

Wallet connection

Item List
await sdk.isWalletConnect(); // false
await sdk.connectWallet();
await sdk.isWalletConnect(); // true

Bidding

Item List
await sdk.sendTxBuyItem("itemId", "jp");

The second parameter must be the User's current country of residence, which is necessary for consumption tax procedures. Asking the users country of residence can be done through UI provided in the frontend.

5. Recieving the Item using MINT

Item List
const tokens = await sdk.getTokensByAddress("0x11111...");