Sync SDK types and RPC methods with arch-network 0.6.1#12
Open
hoffmabc wants to merge 4 commits intoSaturnBTC:mainfrom
Open
Sync SDK types and RPC methods with arch-network 0.6.1#12hoffmabc wants to merge 4 commits intoSaturnBTC:mainfrom
hoffmabc wants to merge 4 commits intoSaturnBTC:mainfrom
Conversation
- 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>
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.
Summary
RUNTIME_TX_SIZE_LIMITfrom 1024 to 10240 (10KB) and addsMAX_TX_BATCH_SIZE = 100to match arch-network 0.6.1 constantsProcessedTransactionStatusby renamingprocessingtoqueued, addsinner_instructions_listfield andInnerInstructiontypes toProcessedTransactionBlocktype by removing staletransactions_count/merkle_rootfields, correctsbitcoin_block_heighttype from string to number, and addsFullBlocktypeAccountInfoWithPubkeytype forgetMultipleAccountsresponsesAccountFilterto use discriminated union (DataSize/DataContent) matching Rust enum instead ofmemcmpinterfaceSystemInstructionenum discriminant ordering: insertsSignInputat index 4, shiftsTransferto 5,Allocateto 6. Adds seed-based variants (CreateAccountWithSeed,AllocateWithSeed,AssignWithSeed,TransferWithSeed). Removes deprecated nonce instructions that are commented out in RustgetBestFinalizedBlockHash,getFullBlockByHash,getFullBlockByHeight,getNetworkPubkey,checkPreAnchorConflictProviderinterface andMaestroclass with all new method signaturesTest plan
sendTransactionworks with updatedRUNTIME_TX_SIZE_LIMITgetProcessedTransactioncorrectly deserializesinner_instructions_listfieldgetBlock/getBlockByHeightwork with updated Block typegetFullBlockByHash/getFullBlockByHeightreturn FullBlock with transaction detailsgetBestFinalizedBlockHashreturns finalized block hashgetNetworkPubkeyreturns network public keygetProgramAccountsworks with newAccountFilterformatgetMultipleAccountsreturnsAccountInfoWithPubkeyobjects