Account Fetchers
The SDK provides fetcher functions to read and parse on-chain account data into typed objects.
Protocol Config
getProtocolConfig
Fetch the protocol configuration.
import { getProtocolConfig, protocolConfigPda } from '@tixprotocol/sdk';
const [protocolConfigPubkey] = protocolConfigPda();
const config = await getProtocolConfig(connection, protocolConfigPubkey);
console.log(`USDC Mint: ${config.usdcMint.toBase58()}`);
console.log(`Authority: ${config.authority.toBase58()}`);
console.log(`Permit Fee: ${config.permitFeeMinor} minor units`);
console.log(`Transfer Fee: ${config.p2pTransferFeeMinor} minor units`);
console.log(`Resale Fee: ${config.resaleFeeBps} bps`);Returns:
interface ProtocolConfig {
usdcMint: PublicKey;
defaultRoyaltyVault: PublicKey;
authority: PublicKey;
usdcDecimals: number;
permitFeeMinor: bigint;
p2pTransferFeeMinor: bigint;
resaleFeeBps: number;
}Integrator
getIntegrator
Fetch an integrator account.
Returns:
Check Integrator Status
Event
getEvent
Fetch an event account.
Returns:
Check Event Capacity
Permit
getPermit
Fetch a specific permit from a page.
Returns:
Check Permit Status
Get Multiple Permits
Listing
getListing
Fetch a listing account.
Returns:
Check Listing Validity
Error Handling
Account Not Found
Null Checks
Batch Fetching
Fetch All Event Data
Last updated