@subwallet-connect/blocto
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@subwallet-connect/blocto

Wallet module for connecting Blocto SDK to web3-onboard

See Blocto Developer Docs

Install

npm i @subwallet-connect/blocto

Usage

import Onboard from '@subwallet-connect/core'
import bloctoModule from '@subwallet-connect/blocto'

// initialize the module with options
const blocto = bloctoModule()

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

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

Build Environments

For build env configurations and setups please see the Build Env section here

Webpack 4

Node built-ins are automatically bundled in v4 so that portion is handled automatically.

Blocto support will require a Babel to compile from es6 if not already supported. See config for Babel and Webpack4 as follows

npm i --save-dev @babel/cli @babel/core @babel/node @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chaining @babel/plugin-syntax-bigint @babel/register

AND

npm i babel-loader

babel.config.js

module.exports = api => {
  api.cache(true)

  const plugins = [
    '@babel/plugin-proposal-optional-chaining',

    '@babel/plugin-proposal-nullish-coalescing-operator',

    '@babel/plugin-syntax-bigint'
  ]

  return { plugins }
}

webpack.config.js

config.module.rules = [
  ...otherModuleRules,

  {
    test: /\.js$/,

    exclude: _ => !/node_modules\/(@web3auth|@ethereumjs)/.test(_),

    loader: 'babel-loader'
  }
]

Package Sidebar

Install

npm i @subwallet-connect/blocto

Weekly Downloads

57

Version

1.0.4

License

MIT

Unpacked Size

10.2 kB

Total Files

6

Last publish

Collaborators

  • anhmtv