Relying on the recent GPA beet-solana
feature, solita now generates a method on
each account struct to obtain a GPA builder for it.
Example
The below method is added to the AuctionHouse account.
export class AuctionHouse implements AuctionHouseArgs {
// [ .. ]
/**
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
* to fetch accounts matching filters that can be specified on that builder.
*
* @param programId - the program that owns the accounts we are filtering
*/
static gpaBuilder(
programId: web3.PublicKey = new web3.PublicKey(
'hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk'
)
) {
return beetSolana.GpaBuilder.fromStruct(programId, auctionHouseBeet)
}
// [ .. ]
}
Caveats
requires latest beet: 0.4.0 and beet-solana: 0.3.0 to be used in the project whose
generated code includes that feature
Summary
Relying on the recent GPA beet-solana feature, solita now generates a method on each account struct to obtain a GPA builder for it.
Example
The below method is added to the
AuctionHouse
account.Caveats
beet: 0.4.0
andbeet-solana: 0.3.0
to be used in the project whose generated code includes that feature