Class GpaBuilder<Account, Fields>
Type Parameters
-
Account extends object = RpcAccount
-
Fields extends object = {}
Properties
Protected
Readonly
context
Readonly
options
Readonly
programId
Methods
addFilter
- addFilter(...filters: RpcDataFilter[]): GpaBuilder<Account, Fields>
-
Returns GpaBuilder<Account, Fields>
deserializeUsing
- deserializeUsing<T>(callback: GpaBuilderMapCallback<T>): GpaBuilder<T, Fields>
-
get
- get(options?: RpcGetProgramAccountsOptions): Promise<RpcAccount[]>
-
getAndMap
- getAndMap<T>(callback: GpaBuilderMapCallback<T>, options?: RpcGetProgramAccountsOptions): Promise<T[]>
-
Returns Promise<T[]>
getDataAsPublicKeys
- getDataAsPublicKeys(options?: RpcGetProgramAccountsOptions): Promise<PublicKey<string>[]>
-
Returns Promise<PublicKey<string>[]>
getDeserialized
- getDeserialized(options?: RpcGetProgramAccountsOptions): Promise<Account[]>
-
Returns Promise<Account[]>
Protected
getField
- getField<K>(fieldName: K, forcedOffset?: number): [number, Serializer<Fields[K], Fields[K]>]
-
Type Parameters
-
K extends string | number | symbol
Parameters
-
fieldName: K
-
Optional
forcedOffset: number
Returns [number, Serializer<Fields[K], Fields[K]>]
getPublicKeys
- getPublicKeys(options?: RpcGetProgramAccountsOptions): Promise<PublicKey<string>[]>
-
Returns Promise<PublicKey<string>[]>
registerFields
- registerFields<T>(fields: GpaBuilderFieldSerializers<T, T>): GpaBuilder<Account, T>
-
registerFieldsFromStruct
- registerFieldsFromStruct<T>(structFields: StructToSerializerTuple<T, T>): GpaBuilder<Account, T>
-
reset
- reset(): GpaBuilder<Account, Fields>
-
Returns GpaBuilder<Account, Fields>
slice
- slice(offset: number, length: number): GpaBuilder<Account, Fields>
-
Parameters
-
offset: number
-
length: number
Returns GpaBuilder<Account, Fields>
sliceField
- sliceField(field: keyof Fields, offset?: number): GpaBuilder<Account, Fields>
-
Parameters
-
field: keyof Fields
-
Optional
offset: number
Returns GpaBuilder<Account, Fields>
sortUsing
- sortUsing(callback: GpaBuilderSortCallback): GpaBuilder<Account, Fields>
-
Returns GpaBuilder<Account, Fields>
where
- where(offset: number, data: string | number | bigint | boolean | PublicKey<string> | Uint8Array): GpaBuilder<Account, Fields>
-
Parameters
-
offset: number
-
data: string | number | bigint | boolean | PublicKey<string> | Uint8Array
Returns GpaBuilder<Account, Fields>
whereField
- whereField<K>(field: K, data: Fields[K], offset?: number): GpaBuilder<Account, Fields>
-
Type Parameters
-
K extends string | number | symbol
Parameters
-
field: K
-
data: Fields[K]
-
Optional
offset: number
Returns GpaBuilder<Account, Fields>
whereSize
- whereSize(dataSize: number): GpaBuilder<Account, Fields>
-
Returns GpaBuilder<Account, Fields>
withoutData
- withoutData(): GpaBuilder<Account, Fields>
-
Returns GpaBuilder<Account, Fields>
Builder for
getProgramAccounts
RPC requests.