Repository navigation
fix(providers): align WalletAPI schemas with actual response format - #174
Merged
Merged
Conversation
- ETH WalletAPI: Update schemas to handle {success, result} wrapper
- Balance: {success: boolean, result: string}
- History: {success: boolean, result: {status, result: [...]}}
- Tron WalletAPI: Update balance schema for {success, result} wrapper
- Balance: {success: boolean, result: string}
- Etherscan: Add missing Balance and Amount imports
All 100 provider tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
根据 spec 调查,WalletAPI 实际返回的格式与代码中的 Schema 不匹配:
ETH WalletAPI
{success: true, result: "236..."}而不是直接返回字符串{success: true, result: {status: "1", result: [...]}}而不是{status, result}Tron WalletAPI
{success: true, result: "..."}而不是直接返回字符串Etherscan Provider
Balance和Amount的导入修复内容
WalletApiBalanceSchema和WalletApiHistorySchema以处理{success, result}包装WalletApiBalanceSchema以处理{success, result}包装Balance和Amount导入其他发现
NOTOK表示没有交易是预期行为测试
所有 100 个 provider 测试通过。