Getting Started with Fungible Tokens
Quick Set Up
npm i @tokenscript/token-negotiator<div class="overlay-tn"></div>import { Client } from "@tokenscript/token-negotiator";
import "@tokenscript/token-negotiator/dist/theme/style.css";
// configure
const negotiator = new Client({
type: "active",
issuers: [
{
contract: "0x107065a122f92636a1358a70a0efe0f1a080a7e5",
onChain: true,
fungible: true,
collectionID: "USX",
chain: "matic",
},
],
uiOptions: {
openingHeading: "Open a new world of perks, benefits and opportunities with your token.",
issuerHeading: "Get discount with token",
repeatAction: "try again",
theme: "light",
position: "bottom-right",
},
});
// invoke
negotiator.negotiate();
// event hooks
negotiator.on("tokens-selected", ({ selectedTokens, selectedIssuerKeys }) => {
console.log('owner tokens', selectedTokens);
});
Join the Community
Last updated