On-chain read/write methods accept a market as a numeric id (
bigint | number) or its
PublicKey PDA. Oracle (indexer) methods accept a PublicKey | string. Amounts are in
base units — use uiToBaseUnits / baseUnitsToUi.PnpClient
Also exposed as properties:
network, connection, programId, program (the underlying
anchor Program), provider, commitment, wallet?, criteriaApiUrl, oracleApiUrl.
"mainnet" | "devnet"
required
Target network. Set automatically by the
.mainnet() / .devnet() presets.Keypair | AnchorWallet
A Node
Keypair or browser wallet adapter. Omit for a read-only client.string
Override the network default RPC endpoint.
Connection
Provide a preconfigured
@solana/web3.js connection instead of rpcUrl.Commitment
default:"confirmed"
Transaction commitment level.
string
Override the settlement-criteria server base URL.
string
Override the indexer API base URL (include the
/api prefix).client.p2p — parimutuel (V3)
client.amm — Pythagorean (V2)
client.oracle — indexer reads
ResolvableStatus = "checking" | "resolvable" | "unresolvable".
waitForResolvable options: { apiUrl?, intervalMs? (3000), timeoutMs? (120000) }.
Helper functions
Numeric & units
Numeric & units
toBN(value) => BNtoBig(value) => bigintu64le(value) => Buffer— 8-byte little-endianuiToBaseUnits(amount, decimals) => bigint—uiToBaseUnits(100, 6) === 100_000000nbaseUnitsToUi(amount, decimals) => number
Token & ATA
Token & ATA
getTokenProgramForMint(connection, mint) => Promise<PublicKey>— classic vs Token-2022ata(mint, owner, tokenProgram?) => PublicKey— associated token address- Constants:
TOKEN_PROGRAM_ID,TOKEN_2022_PROGRAM_ID,ASSOCIATED_TOKEN_PROGRAM_ID
PDAs (pda.* namespace)
PDAs (pda.* namespace)
Each is
(programId, id) => PublicKey unless noted:pda.globalConfigPda(programId)pda.marketV2Pda,pda.marketV2ExtensionPdapda.marketV3Pda,pda.yesMintV3Pda,pda.noMintV3Pda,pda.marketV3ExtensionPda,pda.marketV3GatePdapda.creatorFeeTreasuryPda(...),pda.reserveVault(...)
Settlement-criteria signing
Settlement-criteria signing
buildSettlementCriteriaMessage(params) => stringsha256Hex(input) => stringrandomNonce() => string
Networks & IDL
Networks & IDL
resolveNetwork(cluster) => NetworkConfigNETWORKS—{ mainnet, devnet }getIdl(cluster) => Idl,PNP_IDL_MAINNET,PNP_IDL_DEVNET,IDL_PROGRAM_ADDRESS
Constants
Key types
P2PMarket
Decoded + computed snapshot returned byp2p.getMarket. Token amounts are bigint base units.
AmmMarket
Shared enums
Full type list
Every exported param/result/type is enumerated in the repo’s
FUNCTIONS.md.