Hierarchy (view full)

Constructors

Properties

address?: string
connected: boolean = false
name: string = ""
network: Network
provider: string
rpc_url: string = ""
signer: any = null
wallet: ECPairInterface
networks: __module = bitcoin.networks

Methods

  • Generate a private key for the BTC chain

    Parameters

    • Optionalseed: Buffer<ArrayBufferLike>

      The seed to generate the private key from (optional)

    Returns string

    The private key as a WIF string

  • Alias

    Creates a signed transaction to transfer default chain currency

    Parameters

    • address: string
    • amount: string

      The amount to transfer

    • OptionaloverrideFeeRate: number
    • addNoise: boolean = false

    Returns Promise<string>

    The signed transaction

    prepareTransfer

  • Creates a list of signed transactions to transfer default chain currency

    Parameters

    • payments: IPayOptions[]

      A list of transfers to prepare

    • OptionaloverrideFeeRate: number
    • addNoise: boolean = false

    Returns Promise<string[]>

    An ordered list of signed transactions

  • Creates a signed transaction to transfer default chain currency

    Type Parameters

    Parameters

    • this: T
    • receiver: string

      The receiver's address

    • amount: string

      The amount to transfer

    • Optionaloptions: Options

      Options

    Returns Promise<Awaited<ReturnType<T["preparePays"]>>[number]>

    The signed transaction

  • Creatthis.provider = new JsonRpcProvider(this.rpc_url)es a list of signed transactions to transfer default chain currency

    Type Parameters

    Parameters

    Returns Promise<Awaited<ReturnType<T["preparePays"]>>>

    An ordered list of signed transactions

  • Signs a message using the connected wallet

    Parameters

    • message: string

      The message to sign

    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<string>

    The signed message

  • Signs a list of transactions using the connected wallet. The transaction nonce is incremented for each transaction in order of appearance.

    Parameters

    • psbts: Psbt[]

    Returns Promise<string[]>

  • Verifies a message using the connected wallet

    Parameters

    • message: string

      The message to verify

    • signature: string

      The signature to verify

    • address: string

    Returns Promise<boolean>

    A boolean indicating if the message was verified

  • Creates a new instance of this sdk

    Type Parameters

    Parameters

    • this: (new (rpc_url: string, network: Network) => T)
        • new (rpc_url, network): T
        • Parameters

          • rpc_url: string
          • network: Network

          Returns T

    • rpc_url: string

      The RPC URL

    • network: Network = BITCOIN_CONSTANTS.DEFAULT_NETWORK

    Returns Promise<T>

    The sdk instance connected to the RPC provider