UNPKG

@wuwei-labs/srsly

Version:

[![npm version](https://img.shields.io/npm/v/ts-sdk-example.svg)](https://www.npmjs.com/package/ts-sdk-example)

74 lines 4.3 kB
/** * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun codama to update it. * * @see https://github.com/codama-idl/codama */ import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type Option, type OptionOrNullable, type ReadonlyUint8Array } from '@solana/kit'; import { type ClockData, type ClockDataArgs, type ExecContext, type ExecContextArgs, type SerializableInstruction, type SerializableInstructionArgs, type Trigger, type TriggerArgs } from '../types'; export declare const THREAD_DISCRIMINATOR: Uint8Array<ArrayBuffer>; export declare function getThreadDiscriminatorBytes(): ReadonlyUint8Array; export type Thread = { discriminator: ReadonlyUint8Array; /** The owner of this thread. */ authority: Address; /** The bump, used for PDA validation. */ bump: number; /** The cluster clock at the moment the thread was created. */ createdAt: ClockData; /** The context of the thread's current execution state. */ execContext: Option<ExecContext>; /** The number of lamports to payout to workers per execution. */ fee: bigint; /** The id of the thread, given by the authority. */ id: ReadonlyUint8Array; /** The instructions to be executed. */ instructions: Array<SerializableInstruction>; /** The name of the thread. */ name: string; /** The next instruction to be executed. */ nextInstruction: Option<SerializableInstruction>; /** Whether or not the thread is currently paused. */ paused: boolean; /** The maximum number of execs allowed per slot. */ rateLimit: bigint; /** The triggering event to kickoff a thread. */ trigger: Trigger; }; export type ThreadArgs = { /** The owner of this thread. */ authority: Address; /** The bump, used for PDA validation. */ bump: number; /** The cluster clock at the moment the thread was created. */ createdAt: ClockDataArgs; /** The context of the thread's current execution state. */ execContext: OptionOrNullable<ExecContextArgs>; /** The number of lamports to payout to workers per execution. */ fee: number | bigint; /** The id of the thread, given by the authority. */ id: ReadonlyUint8Array; /** The instructions to be executed. */ instructions: Array<SerializableInstructionArgs>; /** The name of the thread. */ name: string; /** The next instruction to be executed. */ nextInstruction: OptionOrNullable<SerializableInstructionArgs>; /** Whether or not the thread is currently paused. */ paused: boolean; /** The maximum number of execs allowed per slot. */ rateLimit: number | bigint; /** The triggering event to kickoff a thread. */ trigger: TriggerArgs; }; export declare function getThreadEncoder(): Encoder<ThreadArgs>; export declare function getThreadDecoder(): Decoder<Thread>; export declare function getThreadCodec(): Codec<ThreadArgs, Thread>; export declare function decodeThread<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Thread, TAddress>; export declare function decodeThread<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Thread, TAddress>; export declare function fetchThread<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Thread, TAddress>>; export declare function fetchMaybeThread<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Thread, TAddress>>; export declare function fetchAllThread(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Thread>[]>; export declare function fetchAllMaybeThread(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Thread>[]>; //# sourceMappingURL=thread.d.ts.map