js-conflux-sdk
Conflux Doc
  • Home
  • Introduction
  • QuickStart
  • Overview
  • Contrast with web3.js
  • Guides
    • Providers
    • How to Connect Fluent
    • CIP37 Address
    • Account
    • Sending Transaction
    • Interact with Contract
    • Sign methods
    • Error Handling
    • Batch RPC
  • API
    • Conflux
    • PoS
    • TxPool
    • Provider
    • Drip
    • Transaction
    • Wallet
  • Release notes
  • v2.0 Changes
  • FAQs
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API

Wallet

PreviousTransactionNextRelease notes

Last updated 2 years ago

Was this helpful?

Wallet

Wallet to manager accounts.

Kind: global class

    • ⇒ boolean

    • ⇒ boolean

    • ⇒ any

    • ⇒ Account

    • ⇒ PrivateKeyAccount

    • ⇒ PrivateKeyAccount

    • ⇒ PrivateKeyAccount

new Wallet(networkId)

Param
Type

networkId

number

wallet.setNetworkId(networkId)

Set network id

Param
Type

networkId

number

wallet.has(address) ⇒ boolean

Check if address exist

Param
Type

address

string

wallet.delete(address) ⇒ boolean

Drop one account by address

Param
Type

address

string

wallet.clear()

Drop all account in wallet

wallet.set(address, account) ⇒ any

Param
Type
Description

address

any

Key of account, usually is address

account

any

Account instance

wallet.get(address) ⇒ Account

Param
Type

address

string

wallet.addPrivateKey(privateKey) ⇒ PrivateKeyAccount

Param
Type
Description

privateKey

string | Buffer

Private key of account

wallet.addRandom([entropy]) ⇒ PrivateKeyAccount

Param
Type
Description

[entropy]

string | Buffer

Entropy of random account

wallet.addKeystore(keystore, password) ⇒ PrivateKeyAccount

Param
Type
Description

keystore

object

Keystore version 3 object.

password

string | Buffer

Password for keystore to decrypt with.

Kind: instance method of

Kind: instance method of

Kind: instance method of

Kind: instance method of

Kind: instance method of

Kind: instance method of

Kind: instance method of

Kind: instance method of

Kind: instance method of

Wallet
new Wallet(networkId)
.setNetworkId(networkId)
.has(address)
.delete(address)
.clear()
.set(address, account)
.get(address)
.addPrivateKey(privateKey)
.addRandom([entropy])
.addKeystore(keystore, password)
Wallet
Wallet
Wallet
Wallet
Wallet
Wallet
Wallet
Wallet
Wallet