Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 1.91 KB

README.md

File metadata and controls

75 lines (50 loc) · 1.91 KB

@talisman-connect

This is the monorepo for the Talisman Connect project.

This project aims to provide the components necessary for Dapp developers to be able to quickly connect to wallets in the Polkadot and Kusama ecosystems.

Quick Start

Install the package:

npm i --save @talisman-connect/wallets

Example

import { getWallets } from '@talisman-connect/wallets';

// returns a list of all the extensions currently installed in the window
assert(window.injectedWeb3, "No wallets installed.")
const supportedWallets = getWallets();

// choose one of the extensions from the list
// this can be done through a UI component...
const walletToUse = supportedWallets['Talisman'] // example

// enable the wallet
const wallet = await walletToUse.enable('my dapp')

// sign a message
try {
  const signer = wallet.signer;

  // NOTE: Trigger the extension popup
  const { signature } = await signer.signRaw({
    type: 'payload',
    data: 'Some data to sign...',
    address: account.address,
  });
} catch (err) {
  // Handle error...
}

});

Packages

For Dapps with an existing wallet connection UIs:

For Dapps without an existing wallet connection UI:

Generic UIs that can be used for any Dapps:

Setup

NOTE: We recommend yarn

yarn
yarn start

Run app on localhost:4200.

This is a playground Dapp that showcases the WalletSelect Modal which uses the packages listed above.

Troubleshooting

Check out our Troubleshooting instructions