Release 0.3.0: expanded GraphQL selection sets + types#9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,addrsAndPortsgetAccount()(and_WITH_TOKEN)tokenSymbol,votingFor,receiptChainHash,timing(vesting schedule),permissions(all per-action auth predicates),zkappState,provedState,zkappUri,balance.blockHeightgetBestChain()(BlockInfo)epoch,previousStateHash,blockCreator,coinbaseReceiver(mapped from the daemon's misspelledcoinbaseReceieverfield),stakingEpochData.epochLength,date,utcDate,snarkedLedgerHash,stagedLedgerHash,userCommandsgetBlock()(Block)coinbaseReceiverConsensus(mapped fromconsensusState.coinbaseReceiever)getPooledUserCommands()source,receiver,memo,failureReasonsendPayment()/sendDelegation()(SubmittedCommand)kind,source,receiver,amount,fee,memoTest plan
npm run typecheck— cleannpm test— 27/27 passnpm run check:driftagainstcompatible-latest-lightnetin--strict— 15/15 ok, 0 driftpermissions.send = "Signature",timingvesting schedule populated,coinbaseReceiverresolved from typo'd field, etc.)Follow-up
PR against
mina-mcp-serverto swap its hand-rolledQUERIES.x+graphql.query()calls for typedclient.getX()methods, then delete the duplicate query module.🤖 Generated with Claude Code