Getting Started with Off Chain 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: [
{
onChain: false,
collectionID: "devcon",
title: "Devcon",
image: "..."
tokenOrigin: "...",
attestationOrigin: "...",
base64senderPublicKeys: {
devcon: "..."
},
base64attestorPubKey: "..."
ticketIssuersUrlWebsitePrivateKey: "..."
}
]
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