Swig TS — API References
    Preparing search index...

    Class Ed25519SessionAuthority

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    data: Uint8Array
    session: boolean

    Indicates if Authority is Session-based or not. true if Authority is Session-based

    Accessors

    • get address(): Uint8Array<ArrayBufferLike>

      The address that identifies this Authority.

      For Ed25519/ProgramExec: the public key bytes. For Secp256k1: the 20-byte Ethereum address derived from the public key. For Secp256r1: the compressed public key bytes.

      Returns Uint8Array<ArrayBufferLike>

    • get addressString(): string

      String representation of the authority address.

      For Ed25519/ProgramExec: base58 encoded. For Secp256k1/Secp256r1: unprefixed hex.

      Returns string

    • get expirySlot(): bigint

      Slot when the session expires

      Returns bigint

    • get id(): Uint8Array<ArrayBufferLike>

      This is the ID for the Authority.

      This would usually the data that represents the Authority

      For TokenBasedAuthority, it is either a Ed25519 or Secp256k1 Public Key.

      For SessionBasedAuthority, It could be public key bytes, groth16 proof etc.

      Returns Uint8Array<ArrayBufferLike>

      Use address instead

    • get maxDuration(): bigint

      Max duration on a session

      Returns bigint

    • get sessionKey(): SolPublicKey

      Ed25519 based Public Key as Session key

      Returns SolPublicKey

    • get signer(): Uint8Array<ArrayBufferLike>

      This is the Signer ID for the Authority.

      This would usually the public key bytes that identifies the signer on behalf of the authority,

      For TokenBasedAuthority, it is either a Ed25519 or Secp256k1 Public Key.

      For SessionBasedAuthority, it is the Session Key.

      Returns Uint8Array<ArrayBufferLike>

      Use signerAddress instead

    • get signerAddress(): Uint8Array<ArrayBufferLike>

      The address that identifies the signer acting on behalf of this Authority.

      For TokenBasedAuthority: same as address. For SessionBasedAuthority: the session key bytes.

      Returns Uint8Array<ArrayBufferLike>

    Methods

    • Creates a CloseSwig instruction that closes the swig account and wallet address PDA, transferring all remaining lamports to the destination.

      Requires All or ManageAuthority permission. Both the swig account and wallet address PDA must have only rent-exempt minimum lamports (no excess SOL).

      The account is resized to 1 byte with a ClosedSwigAccount discriminator to prevent rehydration attacks.

      Parameters

      Returns Promise<SwigInstructionContext>

    • Check if the given address bytes match this authority's address.

      Parameters

      • address: Uint8Array

      Returns boolean