SDK overview
The ATP TypeScript SDK candidate, what it covers, how to build it and a first read of an Atom.
The ATP TypeScript SDK is a consumer layer for the ATP settlement protocol, version 2.4.0. It reads and verifies deployments, builds signing payloads, and prepares, simulates and submits transactions. Your code stays in control of wallets and signing. The SDK is independent of React, application sign-in, databases and wallet vendors.
Implementation candidate
Candidate, not published
The SDK is version 0.1.0, an implementation candidate targeting ATP 2.4.0. It is not published to a package registry. You build it from the source repository. The only public ATP deployment is BSC Testnet (chain id 97), and mainnet is not approved. Release gates are still open.
What it covers
- Contract interfaces, types, enums, identifiers, hashes, typed data, award proof codecs and integer fee estimates.
- Deployment verification and reads that carry the block they came from.
- Explicit prepare, simulate, wallet submit and receipt readback steps.
- Direct Atom lifecycle, seller inventory, bounded delegation and executor flows.
- Dispute case procedure, consensus routes and independent awards.
- Separate fee claims, optional soulbound receipts and publisher metadata.
What it does not do
The SDK does not reconstruct private deadlines that are not readable on-chain, infer ATP state from an application order, delegate dispute authority, choose an economic outcome, fetch metadata URLs automatically, or retry a purchase with a new salt. Account abstraction, EIP-7702, Privy and gas sponsorship are separate integrations.
Install
Build the package from the source checkout, then install the tarball it produces.
git clone --branch feat/atp-sdk-v0.1 https://github.com/Archiver-KA/ATP-Protocol.git
cd ATP-Protocol
forge build --sizes --skip test --skip script
cd sdk/typescript
npm ci
npm run verify
npm run check:packagecheck:package creates sinera-atp-sdk-0.1.0.tgz. In your own project:
npm install /path/to/sinera-atp-sdk-0.1.0.tgz viem@2.53.1You need Node 20 or newer and Foundry for the build. The one runtime dependency is viem. The tarball holds no wallet credentials and selects no deployment.
Quick example
First choose a trusted deployment. A Deployment holds a chain id, a config id, the deployment block and a map of modules. Each module binding has an address and the Keccak-256 hash of its complete deployed bytes. The Network page of the portal lists contract addresses. Take the runtime hashes from independently accepted deployment evidence. Do not trust a hash you just read from an arbitrary RPC.
Then read an Atom:
import { createAtpClient } from '@sinera/atp-sdk';
import type { AtomLocator, Deployment } from '@sinera/atp-sdk';
import type { PublicClient } from 'viem';
export async function readPinnedAtom(
publicClient: PublicClient,
deployment: Deployment,
locator: AtomLocator,
) {
const atp = createAtpClient({ publicClient, deployment });
return atp.read.atom(locator, {
blockTag: 'finalized',
maxAgeSeconds: 120n,
});
}Reads default to the finalized block and fail if the provider cannot prove the block is canonical. There is no silent fallback to latest. Choose latest explicitly for a local test chain. Amounts, salts and quantities use bigint. Never convert token base units through floating-point numbers.
The write flow
Writes are always explicit and in separate steps:
const draft = await atp.prepare.creation(input, payer);
const approval = await atp.simulate(draft.approval);
const approved = await atp.write(approval, walletClient);
await atp.waitAndReadback(approved);
const simulated = await atp.simulate(draft.call);
const submitted = await atp.write(simulated, walletClient);
const result = await atp.waitAndReadback(submitted);Preparation signs and sends nothing. write accepts only a simulation the SDK created, repeats the preflight and rechecks the wallet's chain and account. The token approval targets the escrow vault of the selected config and is for the exact amount.
If the result is OUTCOME_UNKNOWN, reconcile the known transaction hash before you retry. Do not create a new salt or repeat the purchase.