Options
All
  • Public
  • Public/Protected
  • All
Menu

Manages address labels in order to improve logging and provide them to tools like the solana explorer.

Hierarchy

  • AddressLabels

Index

Properties

addLabel: AddLabel = ...

Adds the provided label for the provided key. If the label collides with an existing label, for a different key it will be suffixed with a number.

addLabelIfUnknown: AddLabel = ...

Adds the provided label for the provided key unless a label for that key was added previously.

addLabels: AddLabels = ...

Adds labels for all {@link KeyLike}s it finds on the provided object If the label collides with an existing label, for a different key it will be suffixed with a number.

Accessors

Methods

  • addLabelsFromText(labels: string[], text: string, opts?: { accountsOnly?: boolean; transactionsOnly?: boolean }): Promise<void>
  • Parameters

    • labels: string[]
    • text: string
    • opts: { accountsOnly?: boolean; transactionsOnly?: boolean } = {}
      • Optional accountsOnly?: boolean
      • Optional transactionsOnly?: boolean

    Returns Promise<void>

  • clear(): Promise<void>
  • getRemoteLabelAddresses(): Promise<Record<string, string>>
  • Resolves all labeled addresses from the amman relay and updates the local labels.

    Returns Promise<Record<string, string>>

    knownLabes all known labels after the update

  • isKeyOf(key: KeyLike): { $spec: string }
  • resolve(keyOrAddress: KeyLike): undefined | string
  • Resolves a known label for the provided key or address

    Parameters

    • keyOrAddress: KeyLike

    Returns undefined | string

    label for the address or undefined if not found

  • resolveKeypairs(pairs: Object | (Keypair | Signer)[]): { key: string; label: string }[]
  • Resolves the {@link PublicKey}s for the given signers/keypairs.

    Parameters

    • pairs: Object | (Keypair | Signer)[]

    Returns { key: string; label: string }[]

    resolvedKeys which are labels for known public keys or the public key

  • resolveLabel(search: string): string[]
  • resolveRemoteAddress(address: KeyLike): Promise<undefined | string>
  • Resolves a known label for the provided key or address querying the amman relay if it isn't found in the cache.

    Parameters

    • address: KeyLike

    Returns Promise<undefined | string>

    label for the address or undefined if not found

  • resolveRemoteLabel(label: string): Promise<string[]>
  • Resolves an address for the provided label querying the amman relay if it isn't found in the cache.

    Parameters

    • label: string

    Returns Promise<string[]>

    addresses labeled with the {@link label}

  • setInstance(knownLabels: Record<string, string>, logLabel?: (msg: string) => void, ammanClient?: AmmanClient): AddressLabels

Generated using TypeDoc