Reading Whirlpool Accounts
The SDK provides the following methods to fetch and parse data from Whirlpool accounts on-chain.
Fetching Accounts
The Typescript SDK has types setup to help you parse the corresponding accounts on-chain.
[link to data type]
1. Account Fetcher
Use the AccountFetcher class's get functions to fetch and parse the Whirlpool account that you need. Note that this class also provides caching options.
2. Parsing fetched AccountInfo data
If you already have the Buffer from fetching the AccountInfo, use the Parsables classes in the SDK to parse account buffer data into readable types.
3. Whirlpool Client
If you are already using WhirlpoolClient, you can fetch the data from the Whirlpool
or Position
class directly.
Deriving Account Addresses
Almost all Whirlpools accounts are Program Derived Addresses. Use the PDAUtil class to derive the required addresses to access on-chain accounts.
Last updated