feat: change token version enum to string in the rpc request#145
feat: change token version enum to string in the rpc request#145raul-oliveira merged 2 commits intomasterfrom
Conversation
a36c5ed to
c8a510c
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughIntroduces a string-based TokenVersionString enum and Zod schema for RPC inputs, defaults version to DEPOSIT, updates schemas/types to use the string representation, extends createToken flow to compute/send deposit for DEPOSIT tokens, and updates tests to the new representation and behaviors. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant RPC as RPC Method (createToken)
participant Utils as tokensUtils
participant Prompt
participant Wallet
Client->>RPC: send createToken(params with version string or omitted)
RPC->>Utils: if version == DEPOSIT -> getDepositAmount(amount)
Utils-->>RPC: depositAmount
RPC->>Prompt: show confirmation (fee, deposit if DEPOSIT)
Prompt-->>Client: user confirms
Client->>RPC: confirmation response
RPC->>Wallet: createNewToken(..., tokenVersion: internal enum, deposit?)
Wallet-->>RPC: tx created / error
RPC-->>Client: response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Motivation
To improve developer experience integrating with rpc-lib it was decided to change from interger enums to string describing the token type
Acceptance Criteria
createNanoContractCreateTokenTransactionrequest should acceptdepositandfeeas available token typesChecklist
master, confirm this code is production-ready and can be included in future releases as soon as it gets mergedSummary by CodeRabbit
Refactor
New Features
Tests