Commit baedd32
committed
fix(rpc-bridge): correct parameter formatting for Solana RPC calls
**Problem:**
OVSM scripts calling RPC methods with named parameters were failing because the
RPC bridge was sending parameters in the wrong format. For example:
- OVSM code: `getSignaturesForAddress(address: "...", limit: 5)`
- Was sending: `["address", 5]`
- Expected format: `["address", {"limit": 5}]`
**Root Cause:**
The OVSM evaluator passes named parameters as separate positional arguments,
discarding the parameter names. The RPC bridge was treating these as plain
positional args instead of building the required Solana RPC config object.
**Solution:**
Enhanced RPC bridge execute() method to:
1. Detect when multiple positional args are passed (named params from OVSM)
2. Use first arg as primary parameter (address/signature/slot)
3. Package remaining args into a config object with appropriate field names
4. Support common patterns like limit, before (for pagination)
**Tests Performed:**
✅ Simple RPC call with limit parameter
✅ Pagination with limit + before parameters
✅ WHILE loop pagination with dynamic before values
✅ NOW() tool integration for time-based filtering
**Impact:**
- Fixes RPC bridge parameter format issue
- Unblocks AI-generated OVSM scripts for blockchain analysis
- Enables complex pagination patterns in OVSM
- Supports all Solana RPC methods requiring config objects
**Files Changed:**
- src/utils/rpc_bridge.rs: Enhanced parameter handling logic1 parent 658afbc commit baedd32
1 file changed
+46
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | | - | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
62 | | - | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | | - | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
73 | 111 | | |
74 | 112 | | |
75 | 113 | | |
| |||
98 | 136 | | |
99 | 137 | | |
100 | 138 | | |
101 | | - | |
102 | | - | |
103 | 139 | | |
104 | 140 | | |
105 | 141 | | |
| |||
0 commit comments