Constructors

Properties

client: LuzidGrpcClient

Methods

  • Creates a snapshot of the accounts specified.

    Parameters

    • snapshotName: string

      the name to give the snapshot

    • accounts: string[]

      the accounts to include in the snapshot

    • opts: {
          commitment?: "processed" | "confirmed" | "finalized";
          description?: string;
          group?: string;
      } = {}

      optional parameters to control the snapshot creation

      • Optional commitment?: "processed" | "confirmed" | "finalized"

        the commitment used to determine the account state included in the snapshot

      • Optional description?: string

        description of the snapshot

      • Optional group?: string

        group of the snapshot

    Returns Promise<RpcCreateSnapshotResult>

    the id of the snapshot and the number of accounts included

  • Deletes the snapshot with the given id if it exists.

    Parameters

    • snapshotId: string

      the id of the snapshot to delete

    Returns Promise<string>

    the id of the deleted snapshot

  • Deletes all globally stored snaphots.

    Parameters

    • Optional filter: SnapshotFilter

      optional filter to apply to the snapshots returned

    Returns Promise<string[]>

    the ids of the deleted snapshots

  • Returns the pubkeys of accounts that can be snapshotted.

    Parameters

    • opts: {
          commitment?: "processed" | "confirmed" | "finalized";
          includeProgramAccounts?: boolean;
      } = {}

      optional parameters to configure which accounts are included

      • Optional commitment?: "processed" | "confirmed" | "finalized"

        the commitment the accounts must have reached

      • Optional includeProgramAccounts?: boolean

        whether to include program accounts

    Returns Promise<RpcSnapshotableAccount[]>

  • Lists all snapshots that have been created with Luzid.

    Parameters

    • Optional filter: SnapshotFilter

      optional filter to apply to the snapshots returned

    Returns Promise<RpcSnapshotMetadata[]>

  • Restores accounts from the snapshot that was updated most recently.

    Parameters

    • Optional opts: {
          accounts?: string[];
          commitment?: "processed" | "confirmed" | "finalized";
          deleteSnapshotAfterRestore?: boolean;
          filter?: SnapshotFilter;
      }

      optional parameters to control the restore process

      • Optional accounts?: string[]

        the accounts to restore, not provided all accounts inside the snapshot will be restored

      • Optional commitment?: "processed" | "confirmed" | "finalized"

        the commitment the restore transaction must reach before this method returns

      • Optional deleteSnapshotAfterRestore?: boolean

        whether to delete the snapshot after it was restored (default: false)

      • Optional filter?: SnapshotFilter

        optional filter to limit the snapshots that are considered when finding the last updated snapshot

    Returns Promise<Successful<RpcSnapshotRestoreResult>>

  • Restores accounts from a snapshot.

    Parameters

    • snapshotId: string

      the id of the snapshot to retrieve accounts from

    • Optional opts: {
          accounts?: string[];
          commitment?: "processed" | "confirmed" | "finalized";
          deleteSnapshotAfterRestore?: boolean;
      }

      optional parameters to control the restore process

      • Optional accounts?: string[]

        the accounts to restore, not provided all accounts inside the snapshot will be restored

      • Optional commitment?: "processed" | "confirmed" | "finalized"

        the commitment the restore transaction must reach before this method returns

      • Optional deleteSnapshotAfterRestore?: boolean

        whether to delete the snapshot after it was restored (default: false)

    Returns Promise<Successful<RpcSnapshotRestoreResult>>

  • Returns the information of all accounts that are in a snapshot.

    • **snapshotId - the id of the snapshot to retrieve accounts from

    The returned accounts have the following properties:

    Parameters

    • snapshotId: string

    Returns Promise<RpcSnapshotAccountSummary[]>

Generated using TypeDoc