Skip to content

Release 0.3.0: expanded GraphQL selection sets + types#9

Merged
dkijania merged 3 commits into
mainfrom
release/0.3.0
May 28, 2026
Merged

Release 0.3.0: expanded GraphQL selection sets + types#9
dkijania merged 3 commits into
mainfrom
release/0.3.0

Conversation

@dkijania

Copy link
Copy Markdown
Collaborator

Expand the SDK's query selection sets and TS types so downstream consumers (notably mina-mcp-server) can get rid of their duplicate query strings and use SDK typed methods exclusively.

What changed

Additive only — every new field is optional on the response types. Existing callers continue to work unchanged.

getDaemonStatus()

  • numAccounts, highestUnvalidatedBlockLengthReceived, ledgerMerkleRoot, chainId, catchupStatus, blockProductionKeys, coinbaseReceiver, addrsAndPorts

getAccount() (and _WITH_TOKEN)

  • tokenSymbol, votingFor, receiptChainHash, timing (vesting schedule), permissions (all per-action auth predicates), zkappState, provedState, zkappUri, balance.blockHeight

getBestChain() (BlockInfo)

  • epoch, previousStateHash, blockCreator, coinbaseReceiver (mapped from the daemon's misspelled coinbaseReceiever field), stakingEpochData.epochLength, date, utcDate, snarkedLedgerHash, stagedLedgerHash, userCommands

getBlock() (Block)

  • coinbaseReceiverConsensus (mapped from consensusState.coinbaseReceiever)

getPooledUserCommands()

  • source, receiver, memo, failureReason

sendPayment() / sendDelegation() (SubmittedCommand)

  • kind, source, receiver, amount, fee, memo

Test plan

  • npm run typecheck — clean
  • npm test — 27/27 pass
  • npm run check:drift against compatible-latest-lightnet in --strict — 15/15 ok, 0 drift
  • End-to-end smoke test against lightnet — verified new fields surface (permissions.send = "Signature", timing vesting schedule populated, coinbaseReceiver resolved from typo'd field, etc.)

Follow-up

PR against mina-mcp-server to swap its hand-rolled QUERIES.x + graphql.query() calls for typed client.getX() methods, then delete the duplicate query module.

🤖 Generated with Claude Code

dkijania and others added 3 commits May 28, 2026 21:12
Expand QUERY_DAEMON_STATUS, QUERY_ACCOUNT(_WITH_TOKEN), QUERY_BEST_CHAIN,
QUERY_BLOCK, QUERY_POOLED_USER_COMMANDS, MUTATION_SEND_PAYMENT, and
MUTATION_SEND_DELEGATION to surface the full set of fields downstream
consumers (notably mina-mcp-server) need.

Additive only — every new field is optional on the response types, so
existing callers continue to work unchanged.

Types added:
- DaemonStatus: numAccounts, highestUnvalidatedBlockLengthReceived,
  ledgerMerkleRoot, chainId, catchupStatus, blockProductionKeys,
  coinbaseReceiver, addrsAndPorts
- AccountData: tokenSymbol, votingFor, receiptChainHash, timing,
  permissions, zkappState, provedState, zkappUri, balance.blockHeight
- BlockInfo (bestChain): epoch, previousStateHash, blockCreator,
  coinbaseReceiver (mapped from the daemon's typo'd 'coinbaseReceiever'),
  stakingEpochData, blockchainState fields, userCommands
- Block: coinbaseReceiverConsensus (from typo'd consensus-state field)
- PooledUserCommand: source, receiver, memo, failureReason
- SubmittedCommand: kind, source, receiver, amount, fee, memo on
  send_payment / send_delegation responses

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Currency holds its value as a BigInt internally. Without a toJSON
method, JSON.stringify(account) throws 'Do not know how to serialize
a BigInt' as soon as a balance field is reached. Downstream consumers
(notably mina-mcp-server tools that send entire AccountData payloads
to the LLM via JSON.stringify) hit this.

toJSON returns the nanomina value as a string — same shape the GraphQL
API uses on the wire, so the JSON-roundtrip stays lossless.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The daemon's setVerificationKey is a richer VerificationKeyPermission
object, not a plain AccountAuthRequired string like the other
permissions. The previous selection just asked for the object root,
which the daemon returned as {} (since no sub-fields were named) —
silently dropping the actual auth predicate.

Select { auth, txnVersion } so callers see the real values, and
expose a new SetVerificationKeyPermission type alongside the existing
string fields on AccountPermissions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dkijania dkijania merged commit edad785 into main May 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant