Zilliqa

Properties

boltX.zilliqa.wallet.isBoltX

Note: Non-BoltX providers may also set this property to true.

  • true if the Zilliqa provider belongs to Bolt-X

boltX.zilliqa.wallet.isConnected

  • true if there is an active communication between extension and boltX and the user's Zilliqa account is loaded (permission granted by user)

boltX.zilliqa.wallet.isUnlocked

  • true if the user's Bolt-X extension is unlocked

boltX.zilliqa.wallet.isEnable

  • true if boltX.zilliqa.isConnected is true and the extension wallet is unlocked

  • The method is provided to standardise with zilPay's wallet provider

boltX.zilliqa.wallet.defaultAccount

  • The user's current Zilliqa address or null if wallet is not unlocked or permissions is not granted by user

  • The defaultAccount is of the following format:

interface Account {
    bech32: string,
    base16: string;
}

boltX.zilliqa.wallet.accounts

  • The Mapping of base16 addresses to user's zilliqa address

  • Only returns mapping with one address for now.

  • The accounts is of the following format:

interface Accounts {
    [base16]: {
        bech32: string,
        base16: string;
    }
}

boltX.zilliqa.wallet.net

  • mainnet or testnet

boltX.zilliqa.wallet.node

  • The current node URL

  • Usually default mainnet or testnet URL

Methods

boltX.zilliqa.wallet.connect()

Requests user permission to connect the Zilliqa provider to the extension and requests user's Zilliqa address

  • Returns boolean indicating whether the wallet is connected

boltX.zilliqa.wallet.sendTransaction(tx)

Call popup to sign Transaction & send transaction request to the network.

  • Returns the pending transaction object

  • Throws an error when rejected or transaction broadcast/signing failed

boltX.zilliqa.wallet.sign(message)

Call popup to sign message.

  • Returns the message signature and the user's public key

return {
    signature: string; 
    pubKey: string
}

boltX.zilliqa.wallet.verify(msg, signature, pubKey)

Verifies if the signature is generated from the given message. pubKey is optional and will default to the user's public key if undefined

  • Returns true if it matches, false otherwise

Events

The boltX.zilliqa.wallet object inherits the eventEmitter methods and emits the following events.

walletLocked

  • Emitted when wallet gets locked.

walletUnlocked

  • Emitted when wallet gets unlocked.

connected

  • Emitted when wallet is connected to Bolt-X extension

disconnected

  • Emitted when loses connection with Bolt-X extension

accountsChanged

  • Emits the new defaultAccount when account change is detected

networkChanged

  • Emits the new network type ('mainnet' | 'testnet') when network change is detected

Last updated