Swig TS — API References
    Preparing search index...

    A lightweight wrapper around authority data that provides typed access and conversion to SDK types.

    import { AuthorityType } from '@swig-wallet/coder';

    const authority = new AuthorityInfo(
    AuthorityType.Ed25519,
    publicKeyBytes
    );

    console.log(authority.isSession()); // false
    console.log(authority.isEd25519()); // true

    // Convert to CreateAuthorityInfo for wallet operations
    const info = authority.toCreateAuthorityInfo();
    Index

    Constructors

    • Creates a new AuthorityInfo.

      Parameters

      • type: AuthorityType

        The authority type enum

      • id: Uint8Array

        The authority identifier as bytes

      • OptionalmaxDurationSlots: bigint | null

        Maximum session duration (for session types)

      Returns AuthorityInfo

    Properties

    id: Uint8Array

    The authority identifier as raw bytes

    isEd25519: () => boolean

    Returns true if this is an Ed25519 authority (token or session).

    isSecp256k1: () => boolean

    Returns true if this is a Secp256k1 authority (token or session).

    isSecp256r1: () => boolean

    Returns true if this is a Secp256r1 authority (token or session).

    isSession: () => boolean

    Returns true if this is a session authority type.

    maxDurationSlots: bigint | null

    Maximum session duration in slots (only for session types)

    toCreateAuthorityInfo: () => CreateAuthorityInfo

    Converts this authority data to a CreateAuthorityInfo object that can be used for wallet operations.

    Type Declaration

    The authority type (enum from coder)