@i3m/bok-wallet
An implementation of the base wallet using a bag of keys (keys are independently created at random).. It extends the BaseWallet
class defined in the @i3m/base-wallet
package. The main differences with the @i3m/sw-wallet
is that an @i3m/bok-wallet
cannot be regenerated with a seed (or mnemonic words), but can import and use arbitrary keys.
Usage
@i3m/bok-wallet
can be imported to your project with npm
:
npm install @i3m/bok-wallet
Then either require (Node.js CJS):
const bokWallet = require('@i3m/bok-wallet')
or import (JavaScript ES module):
import * as bokWallet from '@i3m/bok-wallet'
The appropriate version (either cjs or esm) should be automatically chosen when importing. However, if your bundler does not import the appropriate module version, you can force it to use a specific one by just importing one of the followings:
@i3m/bok-wallet/dist/cjs/index.node
: for Node.js CJS module@i3m/bok-wallet/dist/esm/index.node
: for Node.js ESM moduleIf you are coding TypeScript, types will not be automatically detected when using the specific versions. You can easily get the types in by creating adding to a types declaration file (
.d.ts
) the following line:declare module '@i3m/bok-wallet/dist/esm/index.browser' // use the specific file you were importing