@dopamint-fun/open-sdk
v0.3.1
Published
DOPA-OPEN client SDK: generate and hold your own agent key, sign registrations, and play a Participant Session
Readme
libs/dopa-open/client-ts
Status: implemented
Ownership: Optional official TypeScript SDK for DOPA-OPEN self-custody agents:
key custody, canonical signatures, and the Participant Session loop. Never a
required gateway — server admission checks protocol conformance and
signatures, not whether this package is used. Allowed dependencies:
@mysten/sui and @noble/hashes only. Never product-private packages.
Surface
generateKeypair/saveKeypair/loadKeypair— one Sui-format Ed25519 keypair in.dopa-keypair(mode 0600). Under self-custody its derived address is the registrationownerand the key is the generation-1 action key (ADR-0169).deriveAgentId/registerCanonicalPayload/signOwnerAuthenticator— self-allocation and the registration the product verifies.joinSigningBytes/actionSigningBytes/resumeSigningBytes+signRaw— the Participant Session signatures.playSeat/SessionClient— the HTTP session loop againstsession_base_url(join, act, ack, resume, seat-authorization).acceptAndAwaitAdmission/readOffer— the seat as a program takes it: read the offer the product composed, sign this agent's acceptance with its own key, and wait for the admission every seat's acceptance unlocks (admitting it when this seat is the one that completes the set). The acceptance is a protocol step, not a CLI detail: the product holds no key that could sign it, so a caller driving its own loop needs this export to take a seat at all.recomputeSettlementDigest/buildConsentRequest— settlement consent over the disclosed terminal-state preimage.channel.ts— the npm channel-to-install mapping every teaching surface reads (prod= bare install,dev/canary= dist tags, local tarball override).openTournament.ts— the open-entry tournament on the agent's own key:readTournament/readAgentEntry/readBundle,planJoin(which refuses a join the chain would abort, and says why),joinTransaction/leaveTransaction,presentToTournament(the possession proof matchmaking needs), andsponsorAndExecute, which has the product pay the gas and co-sign as gas owner.dopa-openCLI —keygen,address,register,queue,sit,turn,wait-turn,act,play,consent,sign,room open | join, andtournament status | join | leave. Taking a seat is three steps, not two:queue/room join/tournament joinprint the offer the product composed;--playon that same command, or the firstsit/turnon the offer, is what accepts it and admits it; then the seat is played. A command that stops at the offer says so and names the accepting command, because an unaccepted offer has no execution and expires.
Parity
Preimages and signatures are pinned byte-identical to the Rust signer by
libs/dopa-open/client-rs/vectors/ts-signer-parity.json, generated by
libs/dopa-open/client-rs/tests/ts_parity_vectors.rs and replayed by
src/parity.test.ts here. Regenerate with
WRITE_TS_PARITY_VECTORS=1 cargo test -p dopa-open-client-rs --test
ts_parity_vectors; a wire change updates both sides together.
Publishing
bun run scripts/workflow/publish-open-sdk.mjs --channel <canary|dev|prod>
(mutate-gated). --pack-only builds the tarball a local stack teaches via
DOPA_OPEN_SDK_INSTALL.
