Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gateway_balances introduces breaking change to API V1 due to invalidHotWallet return code (Version: 2.3.0) #1825

Open
nkramer44 opened this issue Jan 13, 2025 · 0 comments · May be fixed by #1830
Labels
bug Something isn't working compatibility
Milestone

Comments

@nkramer44
Copy link

Issue Description

The rippled implementation of gateway_balances does not return invalidHotWallet as an error if one of the addresses provided in hotwallet does not have a trustline with account, but instead simply does not include a balance for the address in its response.

Clio, however, returns the invalidHotWallet error code when an address in hotwallet does not have a trustline with account. Although this is the correct behavior according to the xrpl.org documentation, this discrepancy between rippled and Clio should be considered a breaking change in the v1 API.

Steps to Reproduce

Call gateway_balances on rippled and provide a hot wallet that does not have a trustline to the issuer:

curl --location 'https://xrplcluster.com' \
--header 'Content-Type: application/json' \
--data '{
    "method": "gateway_balances",
    "params": [
        {
            "account": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
            "hotwallet": [
                "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ"
            ],
            "ledger_index": "validated",
            "strict": true
        }
    ]
}'

This returns

{
    "result": {
        "account": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
        "ledger_hash": "108D37806941E711921120F53597F50403638EDACC4D64792879AF8F1DC8ECA6",
        "ledger_index": 93435385,
        "obligations": {
            "524C555344000000000000000000000000000000": "21995883.29000014"
        },
        "status": "success",
        "validated": true
    }
}

If you run the same RPC against https://s1.ripple.com which is Clio, Clio returns this

{
    "result": {
        "error": "invalidHotWallet",
        "error_code": 5004,
        "error_message": "Invalid hot wallet.",
        "status": "error",
        "type": "response",
        "request": {
            "method": "gateway_balances",
            "params": [
                {
                    "account": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
                    "hotwallet": [
                        "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ"
                    ],
                    "ledger_index": "validated",
                    "strict": true
                }
            ]
        }
    },
    "warnings": [
        {
            "id": 2001,
            "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
        }
    ]
}

Expected Result

Clio should return a successful response to gateway_balances even if one of the hotwallet does not have a trustline with account. Hot wallets that do not have a trustline to account should not be included in the response's balances array.

Actual Result

Clio returns invalidHotWallet error code

Environment

N/A

Supporting Files

@nkramer44 nkramer44 added the bug Something isn't working label Jan 13, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Clio Jan 13, 2025
@godexsoft godexsoft added this to the Future milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

2 participants