RPC query helpers for escrow operations Convenience wrappers around RPC endpoints

Constructors

Methods

  • Get all escrows claimable by a Demos address Checks which Web2 identities the address has proven

    Parameters

    • demos: Demos

      Demos SDK instance

    • address: string

      Demos address to check

    Returns Promise<ClaimableEscrow[]>

    Array of claimable escrows

    const claimable = await EscrowQueries.getClaimableEscrows(
    demos,
    myAddress
    )
    console.log(`You have ${claimable.length} claimable escrows`)
  • Query escrow balance for a specific social identity

    Parameters

    • demos: Demos

      Demos SDK instance

    • platform: string

      Social platform

    • username: string

      Username on that platform

    Returns Promise<EscrowBalance>

    Escrow balance information

    const escrow = await EscrowQueries.getEscrowBalance(
    demos,
    "twitter",
    "@bob"
    )
    console.log(`Escrow balance: ${escrow.balance} DEM`)
  • Get all escrows sent by a specific address Useful for seeing where you've sent funds

    Parameters

    • demos: Demos

      Demos SDK instance

    • sender: string

      Sender's Demos address

    Returns Promise<SentEscrow[]>

    Array of sent escrows

    const sent = await EscrowQueries.getSentEscrows(
    demos,
    myAddress
    )
    console.log(`You've sent escrows to ${sent.length} identities`)