XRPLF / xrpl-dev-portal

Source code for xrpl.org including developer documentation
https://xrpl.org
Other
512 stars 1k forks source link

Invalid parameters account_lines #1346

Closed virtumbe closed 1 year ago

virtumbe commented 2 years ago

I'm trying to access via the marker, several account lines for getting the balances linked to an issuer address. It works fine sometimes, but than it stops working and complaints about invalid parameters. Am I missing something? And why is it sometimes working and sometimes not?

async function partialPayment() {

  for (let i = 0; i < 10; i++) {

  const client = new xrpl.Client("wss://xrplcluster.com")
  await client.connect()

    const response = await client.request({
        "command": "account_lines",
        "account": "12345678910",
        "ledger_index": ledger,
        "limit": 200,
        "marker": marker,
      })

    var marker = response['result']['marker']
    var ledger = response['result']['ledger_current_index']

 console.log(marker)
  console.log(ledger)

  await client.disconnect()

}

One of the errors I get:

{"error":"invalidParams","error_code":31,"error_message":"Invalid parameters.","id":16,"request":{"account":"12345678910","command":"account_lines","id":16,"ledger_index":69987844,"limit":200,"marker":"5C9E1CB2D47A0E0E5EA5AFD4FE793B5DD0B3F9BAE54BAC24AA594CDF5D189930,82"},"status":"error","type":"response"}

mDuo13 commented 2 years ago

I've heard some discussion that there is a bug with the custom frontend software that xrplcluster.com runs in front of the API. Markers are generally¹ not portable across different servers, so if your follow-up requests get forwarded to a different underlying server, it returns an invalidParams error like you're seeing. I'm not 100% sure that's the cause of your issue but it seems likely.

¹account_tx is a special case where the marker is guaranteed to be portable across servers.