@palliora.org/chainsdk wraps Palliora’s network calls: account and keyring helpers, guardian coordination, data availability, compute agreements, staking, and token transfers. This page organizes its actual exported surface by area. For the full picture of any one call’s behavior, the package’s own README and source are the final word, this page is a map, not a replacement for reading the code when something matters.
Install and configure
init() once, before anything else, and pass every value your app needs. The SDK reads no environment variables on its own:
Required options are checked lazily: an app that never touches artifact storage doesn’t need the AWS options, but reading one that was never set always throws rather than silently falling back.
init() merges on repeat calls, so you can supply configuration in stages.
Testnet endpoint
wss://staging.manas-rpc.palliora.org is the endpoint used throughout these docs and confirmed working end to end, guardian coordination, threshold decryption, and real inference all tested against it. The SDK’s own default points at wss://manas-rpc.palliora.org (no staging. prefix), which has not been independently confirmed for the full guardian/compute flow, use the staging endpoint explicitly unless you have reason to believe otherwise.
Accounts and keyring
//Bob account so scripts run without setup. Never use it for real funds. Add your own signer for anything real: keyring.addFromUri("//Alice"), keyring.addFromUri(mnemonic), or:
Token amounts
PALI has 18 decimals. Always convert to atomic units before sending a network amount:Guardians
Data availability
submitTEDataWithCipher plus registerDataAgreement, see Store data.
Compute
createAgreement(contract, account, oracleQuoteId?) is the low-level call everything else wraps. estimateMinFee({ computeRate, inputContractId? }) returns the fee floor the network enforces; getFeeParams() returns the live network parameters it derives from. See Fees and Incentives for what those parameters mean.
Ready-made helpers for common cases:
For anything these don’t cover, build the
ComputeContract object yourself and call createAgreement directly.
Getting the result
Compute results land later as acompute.result extrinsic, not as the return value of the submit call. Poll with scanForBlockEvent matching your agreement’s ID:
watchForSubmissionReceipt(requestId, timeoutMs?) does the same scan internally and resolves { extrinsicHash, blockHeight, extrinsicIndex }, simpler when you just need proof of settlement, not the decoded content.
Staking
Token transfers
fundAccount’s signer is always the keyring’s first (dev) pair, the account argument is the recipient, not the signer.
Other useful exports
signAndSend(tx, account, opts?), the low-level submit helper everything funnels through.getGuardianAddress(),setIdentity(account, { display }),joinValidator(account, commission).hexToUint8Array(hex),decodeField(base64, expectedLength?),generateRandomBytes(length?).- Crypto helpers (
gen_shared_key,gen_stretched_key,encrypt,decrypt) for hybrid-encryption and threshold-encryption-adjacent work, see Encrypted Compute for how these fit together. - An indexer client (
src/indexer/) with typed read-only wrappers for blocks, contracts, artifacts, extrinsics, transfers, and guardians, see Compute Artifacts: publish and run for the artifact-discovery calls.