Skip to content

Polkadot‐Js

Thiendekaco edited this page Mar 6, 2024 · 1 revision

@subwallet-connect/polkadot-js

Utilizing the Web3-Onboard's evm wallet integration framework, we have constructed and expanded the connectivity mechanism to accommodate extensions designed for Polkadot{.js}'s substrate accounts.

Install

npm install @subwallet-connect/core @subwallet-connect/talisman

Usage

import Onboard from '@subwallet-connect/core'
import PolkadotJsModule from '@subwallet-connect/polkadot-js'

// initialize the module
const polkadotjs= PolkadotJsModule ()

const onboard = Onboard({
  // ... other Onboard options
  wallets: [
    polkadotjs,
    //... other wallets
  ]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)

For Substrate extension wallet types, we will also provide signer and metadata to enable interface implementations. Currently, we do not plan to offer requests via the method for this type of wallet.

  export interface WalletModule {
  //...other property
  type : 'evm' | 'substrate'

  signer ?: Signer

  metadata ?: InjectedMetadata
}
Clone this wiki locally