Conversation
WalkthroughAdds two transaction-related API methods and corresponding client types. Implements sim_getTransactionByHash with optional full flag and conditional localnet/studionet decoding, and gen_getTransactionStatus for status retrieval. Updates transactionActions to import studionet and expose getStudioTransactionByHash and getTransactionStatus. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App
participant Client as GenLayerClient
participant Actions as transactionActions
participant RPC as RPC Provider
participant Decoder as decodeLocalnetTransaction
App->>Client: getStudioTransactionByHash({hash, full?})
Client->>Actions: getStudioTransactionByHash({hash, full?})
Actions->>RPC: sim_getTransactionByHash([hash, full?])
alt Chain is localnet/studionet
RPC-->>Actions: tx (raw)
Actions->>Decoder: decodeLocalnetTransaction(tx)
Decoder-->>Actions: tx (decoded)
Actions-->>Client: GenLayerTransaction (decoded)
else Other chains
RPC-->>Actions: tx (raw)
Actions-->>Client: GenLayerTransaction (raw)
end
Client-->>App: Promise<GenLayerTransaction>
sequenceDiagram
autonumber
actor App
participant Client as GenLayerClient
participant Actions as transactionActions
participant RPC as RPC Provider
App->>Client: getTransactionStatus({hash})
Client->>Actions: getTransactionStatus({hash})
Actions->>RPC: gen_getTransactionStatus([hash])
RPC-->>Actions: TransactionStatus
Actions-->>Client: TransactionStatus
Client-->>App: Promise<TransactionStatus>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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 |
Fixes #DXP-678
What
getStudioTransactionByHashmethod totransactionActionsto fetch transactions by hash for thestudionetandlocalnetchain.getTransactionStatusmethod totransactionActionsto retrieve the status of a transaction.GenLayerMethodtype to includesim_getTransactionByHashandgen_getTransactionStatusmethods.GenLayerClienttype to includegetStudioTransactionByHashandgetTransactionStatusmethods.Why
To support fetching transaction details and status.
Testing done
Tested both method by calling them on all chains.
Decisions made
Checks
Reviewing tips
This PR depends on this studio PR genlayerlabs/genlayer-studio#1319
User facing release notes
Added support for fetching transaction details and statuses for the
studionetandlocalnetchain.Summary by CodeRabbit