@wuwei-labs/srsly
Version:
[](https://www.npmjs.com/package/ts-sdk-example)
53 lines • 3.02 kB
TypeScript
/**
* 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 ReadonlyUint8Array } from '@solana/kit';
import { type PaymentFrequency, type PaymentFrequencyArgs } from '../types';
export declare const CONTRACT_STATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
export declare function getContractStateDiscriminatorBytes(): ReadonlyUint8Array;
export type ContractState = {
discriminator: ReadonlyUint8Array;
version: number;
toClose: boolean;
rate: bigint;
durationMin: bigint;
durationMax: bigint;
paymentsFeq: PaymentFrequency;
fleet: Address;
gameId: Address;
currentRentalState: Address;
owner: Address;
ownerTokenAccount: Address;
ownerProfile: Address;
bump: number;
};
export type ContractStateArgs = {
version: number;
toClose: boolean;
rate: number | bigint;
durationMin: number | bigint;
durationMax: number | bigint;
paymentsFeq: PaymentFrequencyArgs;
fleet: Address;
gameId: Address;
currentRentalState: Address;
owner: Address;
ownerTokenAccount: Address;
ownerProfile: Address;
bump: number;
};
export declare function getContractStateEncoder(): Encoder<ContractStateArgs>;
export declare function getContractStateDecoder(): Decoder<ContractState>;
export declare function getContractStateCodec(): Codec<ContractStateArgs, ContractState>;
export declare function decodeContractState<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<ContractState, TAddress>;
export declare function decodeContractState<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<ContractState, TAddress>;
export declare function fetchContractState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<ContractState, TAddress>>;
export declare function fetchMaybeContractState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<ContractState, TAddress>>;
export declare function fetchAllContractState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<ContractState>[]>;
export declare function fetchAllMaybeContractState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<ContractState>[]>;
export declare function getContractStateSize(): number;
//# sourceMappingURL=contractState.d.ts.map