Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Wallet

Hierarchy

  • Wallet

Index

Properties

addresses

addresses: () => Promise<AsObject>

Get all wallet addresses associated with the current user.

returns

A list of wallet addresses.

Type declaration

balance

balance: (address: string) => Promise<AsObject>

Get the balance for a wallet address.

param

The address to get the balance for.

returns

The address balance.

Type declaration

    • Parameters

      • address: string

      Returns Promise<AsObject>

newAddress

newAddress: (name: string, type?: "bls" | "secp256k1" | undefined, makeDefault?: boolean | undefined) => Promise<AsObject>

Create a new wallet address associates with the current user.

param

A human readable name for the address.

param

Address type, defaults to bls.

param

Specify if the new address should become the default address for this user, defaults to false.

returns

Information about the newly created address.

Type declaration

    • (name: string, type?: "bls" | "secp256k1" | undefined, makeDefault?: boolean | undefined): Promise<AsObject>
    • Parameters

      • name: string
      • Optional type: "bls" | "secp256k1" | undefined
      • Optional makeDefault: boolean | undefined

      Returns Promise<AsObject>

sendFil

sendFil: (from: string, to: string, amount: bigint) => Promise<AsObject>

Send FIL from an address associated with the current user to any other address.

param

The address to send FIL from.

param

The address to send FIL to.

param

The amount of FIL to send.

Type declaration

    • (from: string, to: string, amount: bigint): Promise<AsObject>
    • Parameters

      • from: string
      • to: string
      • amount: bigint

      Returns Promise<AsObject>

signMessage

signMessage: (address: string, message: Uint8Array) => Promise<AsObject>

Sign a message with the specified address.

param

The address used to sign the message.

param

The message to sign.

returns

The signature.

Type declaration

    • (address: string, message: Uint8Array): Promise<AsObject>
    • Parameters

      • address: string
      • message: Uint8Array

      Returns Promise<AsObject>

verifyMessage

verifyMessage: (address: string, message: Uint8Array, signature: Uint8Array | string) => Promise<AsObject>

Verify a signed message.

param

The address that should have signed the message.

param

The message to verify.

param

The signature to verify.

returns

Whether or not the signature is valid for the provided address and message.

Type declaration

    • (address: string, message: Uint8Array, signature: Uint8Array | string): Promise<AsObject>
    • Parameters

      • address: string
      • message: Uint8Array
      • signature: Uint8Array | string

      Returns Promise<AsObject>

Generated using TypeDoc