Skip to content

Sync SDK types and RPC methods with arch-network 0.6.1#12

Open
hoffmabc wants to merge 4 commits intoSaturnBTC:mainfrom
hoffmabc:fix/sync-with-arch-network-0.6.1
Open

Sync SDK types and RPC methods with arch-network 0.6.1#12
hoffmabc wants to merge 4 commits intoSaturnBTC:mainfrom
hoffmabc:fix/sync-with-arch-network-0.6.1

Conversation

@hoffmabc
Copy link

@hoffmabc hoffmabc commented Feb 17, 2026

Summary

  • Updates RUNTIME_TX_SIZE_LIMIT from 1024 to 10240 (10KB) and adds MAX_TX_BATCH_SIZE = 100 to match arch-network 0.6.1 constants
  • Fixes ProcessedTransactionStatus by renaming processing to queued, adds inner_instructions_list field and InnerInstruction types to ProcessedTransaction
  • Fixes Block type by removing stale transactions_count/merkle_root fields, corrects bitcoin_block_height type from string to number, and adds FullBlock type
  • Adds AccountInfoWithPubkey type for getMultipleAccounts responses
  • Fixes AccountFilter to use discriminated union (DataSize/DataContent) matching Rust enum instead of memcmp interface
  • Fixes SystemInstruction enum discriminant ordering: inserts SignInput at index 4, shifts Transfer to 5, Allocate to 6. Adds seed-based variants (CreateAccountWithSeed, AllocateWithSeed, AssignWithSeed, TransferWithSeed). Removes deprecated nonce instructions that are commented out in Rust
  • Adds 5 new RPC methods: getBestFinalizedBlockHash, getFullBlockByHash, getFullBlockByHeight, getNetworkPubkey, checkPreAnchorConflict
  • Updates Provider interface and Maestro class with all new method signatures

Test plan

  • Verify sendTransaction works with updated RUNTIME_TX_SIZE_LIMIT
  • Verify getProcessedTransaction correctly deserializes inner_instructions_list field
  • Verify getBlock / getBlockByHeight work with updated Block type
  • Verify getFullBlockByHash / getFullBlockByHeight return FullBlock with transaction details
  • Verify getBestFinalizedBlockHash returns finalized block hash
  • Verify getNetworkPubkey returns network public key
  • Verify system instruction builders produce correct byte layouts matching Rust bincode format
  • Verify getProgramAccounts works with new AccountFilter format
  • Verify getMultipleAccounts returns AccountInfoWithPubkey objects

hoffmabc and others added 4 commits February 17, 2026 15:12
- Update RUNTIME_TX_SIZE_LIMIT from 1024 to 10240 (10KB)
- Add MAX_TX_BATCH_SIZE constant (100)
- Fix ProcessedTransactionStatus: rename 'processing' to 'queued'
- Add inner_instructions_list field to ProcessedTransaction
- Add InnerInstruction, InnerInstructions, InnerInstructionsList types
- Fix Block type: remove stale fields, fix bitcoin_block_height type
- Add FullBlock type for full block responses
- Add AccountInfoWithPubkey type
- Fix AccountFilter to match Rust enum (DataSize/DataContent)
- Fix SystemInstruction enum discriminants: insert SignInput at 4, shift Transfer to 5, Allocate to 6
- Add seed-based system instructions: CreateAccountWithSeed, AllocateWithSeed, AssignWithSeed, TransferWithSeed
- Remove deprecated nonce system instructions
- Add new RPC methods: getBestFinalizedBlockHash, getFullBlockByHash, getFullBlockByHeight, getNetworkPubkey, checkPreAnchorConflict
- Update Provider interface and Maestro class with new methods
- Update index.ts exports for all new types

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a standalone test harness that validates all SDK RPC methods against
a live arch-network node. Run with: npm run test:rpc -- <RPC_URL>

Tests cover: block chain queries, full blocks, transactions, accounts,
program accounts, network info, faucet, and cross-method consistency.
Optionally accepts TEST_PUBKEY, TEST_PROGRAM_ID, TEST_TXID env vars
for account-specific tests. Set VERBOSE=true for detailed output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Three bugs fixed:
- postData: `if (params)` dropped falsy values like `0`, changed to `if (params !== undefined)`
- getBlock: server uses parse_block_params expecting array, wrapped hash in `[blockHash]`
- getBlockByHeight: sending `null` for optional filter rejected by server, omit when absent

Test harness updated to handle actual server response format (Hash serialized
as byte arrays) and race conditions on live testnet.

Co-authored-by: Cursor <cursoragent@cursor.com>
The server returns Pubkey/Hash fields as plain number arrays (serialized
[u8; 32]) rather than Uint8Array instances. Updated getMultipleAccounts
test to accept both formats.

Co-authored-by: Cursor <cursoragent@cursor.com>
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