Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Lamports

Hierarchy

  • Tx
    • Lamports

Index

Constructors

constructor

  • new Lamports(nodeUrl: string): Lamports

Properties

connection

connection: Connection

nodeUrl

nodeUrl: string

Methods

airdrop

  • airdrop(lamports: number | bigint, dstAddress: string): Promise<string>
  • (For devnet/testnet only) Airdrop SOL

    Parameters

    • lamports: number | bigint
    • dstAddress: string

    Returns Promise<string>

getLamports

  • getLamports(address: string): Promise<number>
  • Get the current lamports in balance

    Parameters

    • address: string

    Returns Promise<number>

transfer

  • transfer(lamports: number | bigint, dstAddress: string, wallet: WalletInterface): Promise<string>
  • Transfer lamports

    Parameters

    • lamports: number | bigint

      Number of lamports

    • dstAddress: string

      Destination address

    • wallet: WalletInterface

      Payer wallet

    Returns Promise<string>

    Transaction id

unwatch

  • unwatch(watchId: number): Promise<void>
  • Unwatch the current watcher

    Parameters

    • watchId: number

      Watch id

    Returns Promise<void>

watch

  • watch(address: string, callback: (error: null | string, lamports: null | number) => void): number | void
  • Watch changes on a specific address

    Parameters

    • address: string
    • callback: (error: null | string, lamports: null | number) => void

      Callback of changes

        • (error: null | string, lamports: null | number): void
        • Parameters

          • error: null | string
          • lamports: null | number

          Returns void

    Returns number | void

    A watch id for the current watcher

Generated using TypeDoc