Token Negotiator
  • Introduction
  • Quick Start
    • Getting Started with NFT's
    • Getting Started with Fungible Tokens
    • Getting Started with Off Chain Tokens
  • Learn
    • Installation
    • Supported Chains
    • Supported Wallets
    • Supported Attestations
    • Event Hooks
    • Issuer Configurations
      • Issuer Configuration EVM
      • Issuer Configuration Solana
      • Issuer Configuration Flow
      • Issuer Configuration Ultra
      • Issuer Configuration Socios
      • Issuer Configuration Off Chain
    • Active Negotiation (UI)
      • Custom Views
      • View Navigation
      • Theme
      • Configuration Options
    • Passive Negotiation (no UI)
      • Wallet Connection
    • Token Authentication
      • Off Chain Authentication
      • On Chain Token Authentication (evm)
    • Smart Contract and wallet Interaction
      • Sign message
    • Off Chain Token Issuers
  • Reference
  • Articles
  • Videos
  • Showcase
  • Contribution
  • Support
  • Migrating from version 2x to 3x
  • Github Examples
Powered by GitBook
On this page

Migrating from version 2x to 3x

Migrating your current installation to version 3x

These are a list of changes that must be applied to migrate from a version 2x of Token Negotiator to version 3x.

'tokens' passive mode hook has been deprecated

For Passive mode installations. The event hook 'tokens' has been changed to 'tokens-selected' to align with active mode.

migration steps:

  • Update use of 'tokens' hook to 'selected-tokens'.

  • Align your changes with this data structure

data: object
  selectedTokens: object
    issuer: string
      tokens: array
        token: Object

Example usage

negotiator.on("tokens-selected", (issuerTokens) => {
  ['devcon', 'edcon'].forEach((issuer) => {
     console.log(issuerTokens.selectedTokens[issuer].tokens)
  });
});

Off-Chain Token / Attestation storage Migration (for off-chain token issuers only)

The outlet (constructor) has been updated to support multiple issuers within the new interface below. Please update your configuration to use the following input data structure.

 const outlet = new Outlet({ 
    issuers: issuerConfigs, 
    whitelistDialogRenderer(permissionTxt: string, acceptBtn: string, denyBtn: string) => { ... }
 });

example usage:

const outletConfig: OutletInterface = {
  issuers: issuerConfigs,
  whitelistDialogRenderer: (
    permissionTxt: string,
    acceptBtn: string,
    denyBtn: string
  ) => {
    return `
      <div class="tn-auth-box">
        <div class="tn-auth-heading">
          <img alt="devcon" src="devcon_logo.svg" style="width: 150px;" />
        </div>
        <div class="tn-auth-content">
          <p>${permissionTxt}</p>
          ${acceptBtn} 
          ${denyBtn}
        </div>
      </div>
    `;
  }
};

The attestation management has also been optimised to use a new format when storing data. Please utilise the method below to migrate active users attestations to the new format.

migrateLegacyTokenStorage(tokenStorageKey:string)

example usage:

const outlet = new Outlet(outletConfig);

outlet.ticketStorage.migrateLegacyTokenStorage("devconnectTokens");

PreviousSupportNextGithub Examples

Last updated 1 year ago

For support and any questions please reach out to us on or via sayhi@smarttokenlabs.com

discord