@koii-network/kikusui

1.3.13 • Public • Published

Kikusui

The wallet provider for Koii Network's Finnie

Table of Contents

Initialization

Run npm i @koii-network/kikusui to install Kikusui package

// Import the following: 

import Finnie from "@koii-network/kikusui/src/index"

// After importing, run the init method to check to see that the user has installed finnie

const finnie = new Finnie();
finnie.init();

// If the finnie extension is detected you can check if a user 
// has already been connected by checking if finnie isConnected(boolean)

if (finnie.isConnected)

// If finnie.isConnected === true, the user's address can be accessed via the userAddress property

const address = finnie.userAddress;

Connect the User to Finnie

You should only initiate user connection per user request (e.g. button click). Do not initiate on page load.

const isConnected = await finnie.connect();

// If a user is successfully connected
isConnected = "Successfully connected the user. Use the userAddress property to access their address.";
// Refer to initialization instructions to access the address.

// If a user rejects the connection
isConnected = "Failed to connect: User rejected connection."

Send a Koii Tip

// You can transfer Koii to another wallet with a target address(string) and an amount(integer) 

finnie.sendTip(address, amount);

Vote / Mark an NFT NSFW

// If a user encounters an NFT they deem unsafe for work, they can vote for that NFT to be marked NSFW

finnie.voteNSFW(id: string): {message: "Successfully voted for NSFW", status: 200} || {message: "NFTId is missing", status: 412}

// Once an NFT receives 10 unique votes, it will be officially marked NSFW

Disconnect

const disconnected = finnie.disconnect();

// If a user is successfully disconnected
disconnected = "Succesfully disconnected."

// If a user is already disconnected and tries to disconnect
disconnected = "Not able to disconnect, no user is connected."

Technologies

Mocha Chai

Authors

Jackson McGuire GH Ellie Azaveda GH Ahmad Kayyali GH
J. McGuire E. Azaveda A. Kayyali

Package Sidebar

Install

npm i @koii-network/kikusui

Weekly Downloads

3

Version

1.3.13

License

ISC

Unpacked Size

28.6 kB

Total Files

12

Last publish

Collaborators

  • koii-network