XRPLF / xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser
https://xrpl.org/
1.2k stars 510 forks source link

"getTransactions" method on RippleAPI with Clio server #2354

Closed some-dev closed 1 year ago

some-dev commented 1 year ago

I am encountering an issue while using the getTransactions method on the RippleAPI library in conjunction with a Clio server. The goal is to retrieve transactions for a specific Ripple account. However, the code snippet provided below fails with the following error message:

const rippleApi = new RippleAPI({
    server: 'wss://s2.ripple.com'
})

const tx = await rippleApi.getTransactions("rLKKAHHiVoiFGcmaRkxXoD93J84ZUvDh4e",
    {
        minLedgerVersion: 80497237,
        maxLedgerVersion: 80760943,
        earliestFirst: true,
        types: [
            "payment"
        ],
    })

fails with This is a clio server. clio only serves validated data. If you want to talk to rippled, include \'ledger_index\':\'current\' in your request

Issue

The getTransactions method fails to retrieve transactions when using a Clio server, and it requires the inclusion of the 'ledger_index':'current' parameter in the request to interact with the rippled server.

Expected Behavior

I expect the getTransactions method to work seamlessly with the Clio server and correctly pass the 'ledger_index':'current' parameter in the request to retrieve transactions.

Any guidance on how to modify the code to make the "getTransactions" method work with the Clio server and include the required 'ledger_index':'current' parameter would be greatly appreciated.

ckniffen commented 1 year ago

RippleApi is no longer supported please use the latest xrpl package.

ckniffen commented 1 year ago

@some-dev I found a workaround. If you request limit: 100 it will work.

https://replit.com/@ckniffen/UnacceptableFineLogin#index.js

some-dev commented 1 year ago

thanks for rapid response, il apply this workaround and will plan migration to the newer api