Swig TS — API References
    Preparing search index...

    Class SessionBasedAuthorityAbstract

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    data: Uint8Array
    expirySlot: bigint

    Slot when the session expires

    id: Uint8Array

    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.

    maxDuration: bigint

    Max duration on a session

    roleId: null | number
    session: boolean = true

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

    sessionKey: PublicKey

    Ed25519 based Public Key as Session key

    signer: Uint8Array

    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.

    Accessors

    Methods

    • Creates a Swig instruction for initializing a new entity on-chain.

      Parameters

      • args: { actions: Actions; id: Uint8Array; payer: PublicKey }

        The parameters required to create the Swig instruction.

        • actions: Actions

          A container holding the set of actions to include. *

        • id: Uint8Array

          32-bytes Uint8Array.

        • payer: PublicKey

          The public key of the account paying for the transaction.

      Returns TransactionInstruction

      The serialized instruction for creating the Swig.

    • Creates an CreateSession Instructon

      Parameters

      • args: {
            newSessionKey: PublicKey;
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            sessionDuration?: bigint;
            swigAddress: PublicKey;
        }

        The parameters required to create the Swig instruction.

        • newSessionKey: PublicKey

          Ed25519 Public key of the Session key

        • Optionaloptions?: InstructionDataOptions
        • payer: PublicKey

          The public key of the swig payer.

        • roleId: number

          The ID of the role signing the instruction.

        • OptionalsessionDuration?: bigint

          Session duration in slots

        • swigAddress: PublicKey

          The public key of the swig

      Returns Promise<TransactionInstruction>

      AddAuthority Instruction.

    • Creates an RemoveAuthority Instructon

      Parameters

      • args: {
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            roleIdToRemove: number;
            swigAddress: PublicKey;
        }

        The parameters required for RemoveAuthority instruction.

        • Optionaloptions?: InstructionDataOptions
        • payer: PublicKey

          The public key of the swig payer.

        • roleId: number

          The ID of the role signing the instruction.

        • roleIdToRemove: number

          ID of the role to remove

        • swigAddress: PublicKey

          The public key of the swig

      Returns Promise<TransactionInstruction>

      RemoveAuthority Instruction.

    • Creates a Sign instruction for signing provided instructions with the Swig

      Parameters

      • args: {
            innerInstructions: TransactionInstruction[];
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            swigAddress: PublicKey;
        }

        The parameters required to create the Swig instruction.

        • innerInstructions: TransactionInstruction[]

          The instructions the Swig is to sign.

        • Optionaloptions?: InstructionDataOptions
        • payer: PublicKey

          The public key of the swig payer.

        • roleId: number

          The ID of the role signing the instruction.

        • swigAddress: PublicKey

          The public key of the swig

      Returns Promise<TransactionInstruction>

      Sign Instruction.

    • Parameters

      • args: {
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            swigAddress: PublicKey;
            swigId: Uint8Array;
        }

      Returns Promise<TransactionInstruction>

    • Parameters

      • args: {
            innerInstructions: TransactionInstruction[];
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            subAccount: PublicKey;
            swigAddress: PublicKey;
        }

      Returns Promise<TransactionInstruction>

    • Parameters

      • args: {
            enabled: boolean;
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            subAccount: PublicKey;
            swigAddress: PublicKey;
        }

      Returns Promise<TransactionInstruction>

    • Parameters

      • args: {
            amount: bigint;
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            subAccount: PublicKey;
            swigAddress: PublicKey;
        }

      Returns Promise<TransactionInstruction>

    • Parameters

      • args: {
            amount: bigint;
            mint: PublicKey;
            options?: InstructionDataOptions;
            payer: PublicKey;
            roleId: number;
            subAccount: PublicKey;
            swigAddress: PublicKey;
            tokenProgram?: PublicKey;
        }

      Returns Promise<TransactionInstruction>