0.0.4-beta.1 • Published 5 months ago

@kanalabs/kana-widget-v2 v0.0.4-beta.1

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

license npm latest package npm downloads Follow on Twitter

Installation

Kana Widget is available as a npm package.

npm:

npm install @kanalabs/kana-widget-v2

yarn:

yarn add @kanalabs/kana-widget-v2

pnpm:

pnpm add @kanalabs/kana-widget-v2

Getting Started with Kana Widget

Here is an example of a basic app using Kana Widget:

import { KanaWidget, WidgetConfig } from "@kanalabs/kana-widget-v2";
export const WidgetPage = () => {
  const widgetConfig: WidgetConfig = {
  // Required: The unique SDK key provided by the developer. This key is essential for the widget to function properly.
  // If you haven't received a key yet, please contact the development team to obtain one.
  sdkKey: "Your dApp/company SDK key",

  };
  return (
    <KanaWidget config={widgetConfig} />
  );
};

Configure Widget

This is the example with all the available configurations:

import { KanaWidget, AptosDexsFilter, BridgeOption, Chain, WidgetConfig } from "@kanalabs/kana-widget-v2";

const widgetConfig: WidgetConfig = {
  // Required: The unique SDK key provided by the development team. This key is essential for the widget to function properly.
  // If you haven't received a key yet, please contact the development team to obtain one.
  sdkKey: "Your dApp/company SDK key",

  //Optional: The name of your dApp or company using this widget.
  integrator:"Your dApp/company name",

  //Optional: Configures the blockchain chains that will be used as source and target for transactions.
  chains: {
    sourceChain: [Chain.Aptos, Chain.Solana, Chain.Ethereum],
    targetChain: [Chain.Aptos, Chain.Solana, Chain.Ethereum],
  },

  //Optional: Configuration for decentralized exchanges (DEXs) to be used within the widget, 
  // categorized by blockchain.
  dexs: {
    aptos: [AptosDexsFilter.Pontem], // List of DEXs to be used on the Aptos blockchain.
  },

  //Optional: Configuration for bridges that are supported by the widget for cross-chain transactions.
  bridges: [BridgeOption.CCTP, BridgeOption.Wormhole], // List of bridge options.

  //Optional: Determines whether a guided tour or walkthrough is available for users of the widget. 
  // Set to 'false' to disable the tour.
  tour: false, 
  
  // Optional: Configure custom blockchain network providers if you wish to use your own instead of default settings.
  Provider: {
    aptosProvider: `https://aptos-mainnet.nodereal.io/v1/${NODEREAL_KEY}/v1`,
    solanaProvider: `https://greatest-frequent-owl.solana-mainnet.quiknode.pro/${SOLANA_QUICKNODE_KEY}`,
    polygonProvider: `https://polygon-mainnet.nodereal.io/v1/${NODEREAL_KEY}`,
    binanceProvider: `https://bsc-mainnet.nodereal.io/v1/${NODEREAL_KEY}`,
    ethereumProvider: `https://eth-mainnet.nodereal.io/v1/${NODEREAL_KEY}`,
    arbitrumProvider: `https://open-platform.nodereal.io/${NODEREAL_KEY}/arbitrum-nitro/`,
    avalancheProvider: `https://open-platform.nodereal.io/${NODEREAL_KEY}/avalanche-c/ext/bc/C/rpc`,
    zkSyncProvider: `https://open-platform.nodereal.io/${NODEREAL_KEY}/zksync`,
    suiProvider: "https://sui-mainnet-rpc.nodereal.io", 
  },
};

export const WidgetPage = () => {
  return <KanaWidget config={widgetConfig} />;
};

Troubleshooting

If you are facing any issue like

BREAKING CHANGE: webpack<5 used to include polyfills for node.js core modules by default.

Please add custom webpack settings to config-overrides.js. For further details regarding custom webpack settings refer here.

Documentation

Kana Widget Documentation

0.0.4-beta.21

5 months ago

0.0.4-beta.20

6 months ago

0.0.4-beta.10

8 months ago

0.0.4-beta.11

8 months ago

0.0.4-beta.9

9 months ago

0.0.4-beta.12

8 months ago

0.0.4-beta.13

8 months ago

0.0.4-beta.14

8 months ago

0.0.4-beta.15

7 months ago

0.0.4-beta.16

7 months ago

0.0.4-beta.17

6 months ago

0.0.4-beta.0

12 months ago

0.0.4-beta.18

6 months ago

0.0.4-beta.2

12 months ago

0.0.4-beta.19

6 months ago

0.0.4-beta.1

12 months ago

0.0.4-beta.4

11 months ago

0.0.4-beta.3

12 months ago

0.0.4-beta.6

11 months ago

0.0.4-beta.5

11 months ago

0.0.4-beta.8

9 months ago

0.0.4-beta.7

10 months ago

0.0.4

1 year ago

0.0.3-beta.0

1 year ago

0.0.2-beta.7

1 year ago

0.0.2-beta.8

1 year ago

0.0.3

1 year ago

0.0.2-beta.3

1 year ago

0.0.2-beta.4

1 year ago

0.0.2-beta.5

1 year ago

0.0.2-beta.6

1 year ago

0.0.2-beta.0

1 year ago

0.0.2-beta.1

1 year ago

0.0.2-beta.2

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago