Conversation
|
Caution Review failedThe pull request is closed. WalkthroughUpdates NEAR network RPC endpoints to use fastnear.com providers and adds NEAR blockchain support to the non-EVM payment executor by implementing a new case that delegates to the generic JSON-RPC pay handler. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/utilities/validateUint8Array.ts (1)
7-10: Hex-string handling is correct; be explicit about the accepted formatThe new branch cleanly supports naked hex strings (no
0xprefix,[0-9a-fA-F]+, even length) and returns aBuffer/Uint8Array, which fits the existing use ofBuffer.fromlater in the function.Two behavioral nuances to be aware of:
- Any input that happens to be an even-length hex-only string will now be converted to bytes instead of passed through as a string.
- Hex strings with a
0xprefix or embedded whitespace will not be converted and will still flow through unchanged.If upstream payloads might use
0x-prefixed hex or if there are other hex-looking string fields that should remain strings, consider:
- Adding tests that lock in the desired behavior for those shapes, and
- Optionally normalizing (e.g., stripping
0x) inside this branch if that matches how callers encode payloads.sdk/localsdk/multichain/configs/chainProviders.ts (1)
37-38: NEAR RPC endpoints update is consistent with existing mappingSwitching NEAR mainnet/testnet to the fastnear URLs is consistent with how other chains are wired here (hardcoded, public RPC endpoints). From a code perspective this looks fine.
Given these are third‑party RPCs, you may want (later) to:
- Keep the domain in config/env so it’s easy to rotate if limits or availability change.
- Ensure any monitoring/alerts you have around RPC health include these new hosts.
src/features/multichain/routines/executors/pay.ts (1)
87-89: NEAR routing mirrors existing non‑EVM JSON‑RPC chainsThe new
"near"case cleanly follows the existing pattern (egld/ibc/solana/ton/btc), reusinggenericJsonRpcPaywithmultichain.NEARand the precomputedrpcUrl. That keeps the branching logic consistent and leverages the shared send path, includingvalidateIfUint8Arrayfor the payload.It’d be good to add at least one NEAR path test (or e2e/integration check) alongside the other non‑EVM chains to ensure:
operation.chain/operation.subchainvalues line up with the newchainProviders.nearentries, andmultichain.NEAR.create(rpcUrl)+sendTransactionbehave as expected with the converted payload shape.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
sdk/localsdk/multichain/configs/chainProviders.ts(1 hunks)src/features/multichain/routines/executors/pay.ts(1 hunks)src/utilities/validateUint8Array.ts(1 hunks)
|



PR Type
Enhancement
Description
Update NEAR RPC endpoints to use FastNEAR service
Add NEAR chain support to pay operation handler
Enhance hex string validation in Uint8Array utility
Diagram Walkthrough
File Walkthrough
chainProviders.ts
Update NEAR RPC endpoints to FastNEARsdk/localsdk/multichain/configs/chainProviders.ts
rpc.near.orgtorpc.fastnear.comrpc.testnet.near.orgtotest.rpc.fastnear.compay.ts
Add NEAR chain payment execution supportsrc/features/multichain/routines/executors/pay.ts
genericJsonRpcPaywithmultichain.NEARand RPC URL for NEARtransactions
validateUint8Array.ts
Support hex string to Uint8Array conversionsrc/utilities/validateUint8Array.ts
Buffer.from(input,"hex")Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.