Skip to content

Add Solana and Bitcoin support#1

Open
machito wants to merge 9 commits into
mainfrom
machito/solana-bitcoin-nodes
Open

Add Solana and Bitcoin support#1
machito wants to merge 9 commits into
mainfrom
machito/solana-bitcoin-nodes

Conversation

@machito
Copy link
Copy Markdown
Collaborator

@machito machito commented Mar 25, 2026

No description provided.

@machito machito requested a review from gvsturm-ai March 25, 2026 00:48
Comment thread nodes/QuicknodeRpc/QuicknodeRpc.node.ts
Comment thread credentials/QuicknodeEvmApi.credentials.ts Outdated
Keep credential name as quicknodeApi (not quicknodeEvmApi) and all EVM
parameter names at their v1 values (operation, address, block, txHash,
from, to, data, value, rpcMethod, rpcParams) so existing saved workflows
continue to resolve credentials and parameters without silent fallbacks.

Bump typeVersion to [1,2] with defaultVersion:2 and fall back chain to
'evm' so v1 workflows (no chain field) still route correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread nodes/QuicknodeRpc/QuicknodeRpc.node.ts
return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(address);
}
function isValidSolanaSignature(sig: string): boolean {
return /^[1-9A-HJ-NP-Za-km-z]{87,88}$/.test(sig);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signature validation regex rejects valid shorter signatures

Medium Severity

isValidSolanaSignature uses {87,88} for the base58 length check, but a 64-byte Ed25519 signature can base58-encode to 86 characters (or fewer) when the underlying byte array has leading zero bytes. The first byte of a signature (the least significant byte of the R point's y-coordinate) is ~uniformly distributed, giving roughly a 1-in-256 chance of a leading zero byte, which can produce an 86-character encoding. This causes the getTransaction operation to reject valid signatures with no workaround besides the custom RPC fallback.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Copy Markdown

@gvsturm-ai gvsturm-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, clean expansion to Solana and Bitcoin with solid input validation and consistent patterns across all three chains. Ship it! 🚀

machito and others added 3 commits March 25, 2026 11:46
…ction

Solana's RPC rejects the 'processed' commitment level for getBlock and
getTransaction. Split into a separate solanaBlockTxCommitment parameter
(finalized/confirmed only) shown for those two operations, keeping
solanaCommitment (all three levels) for getBalance, getAccountInfo, and
getSlot which support processed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isValidBitcoinTxid and isValidBitcoinBlockHash had byte-for-byte identical
implementations. Extracted to isValid64CharHex with named aliases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace Number(BigInt)/1e18 and /1e9 with BigInt division to avoid
  float precision loss on large ETH/Gwei/SOL values
- Wrap BigInt(response.result) in try/catch for malformed RPC responses
- Use isValidEvmTxHash() in getBlock case instead of inline duplicate regex
- Tighten data field validation to require even-length hex pairs
  (/^0x([a-fA-F0-9]{2})*$/ instead of /^0x[a-fA-F0-9]*$/)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

const whole = lamportsBig / BigInt('1000000000');
const frac = lamportsBig % BigInt('1000000000');
resultData.balanceSol = `${whole}.${frac.toString().padStart(9, '0')}`;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solana balance conversion lacks defensive try-catch

Medium Severity

The Solana getBalance result processing performs BigInt(lamports) and property access on response.result.value without a try-catch, unlike the EVM getBalance and getGasPrice conversions which both wrap their BigInt conversions in try-catch with a /* malformed result — raw result still returned */ comment. If response.result.value is unexpectedly null, undefined, or non-numeric, the Solana path throws, losing the successfully-fetched raw result already stored in resultData. The EVM path gracefully survives and still returns the raw result.

Additional Locations (1)
Fix in Cursor Fix in Web

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.

2 participants