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

'Type' filter seems to be ignored on API request #2611

Open
YordanPavlov opened this issue Jan 3, 2024 · 4 comments
Open

'Type' filter seems to be ignored on API request #2611

YordanPavlov opened this issue Jan 3, 2024 · 4 comments

Comments

@YordanPavlov
Copy link

Hello,
I am using the XRP Client library and providing the 'type' property as a filter. It seems to be ignored though. Here is my code:

const xrpl = require('xrpl');

const api = new xrpl.Client('wss://s2.ripple.com', { timeout: 10000 });

async function main() {
  await api.connect();

  const result = await api.request({
    command: 'ledger',
    ledger_index: 84917024,
    transactions: true,
    expand: true,
    type: 'nft_page'
  });
  console.log(JSON.stringify(result));
  await api.disconnect();
}

main();

My response is not any different if I provide or not the:

type: 'nft_page

filter.

As a reference here is the request definition:

https://github.com/XRPLF/xrpl.js/blob/main/packages/xrpl/src/models/methods/ledger.ts#L72

Let me know if I am using it wrong. Thanks!

@ckniffen
Copy link
Collaborator

ckniffen commented Jan 3, 2024

@mvadari you recently added this field but i don't see it documented on xrpl.org and it doesn't work with the websocket tool either. Does the ledger command use a subset of the type accepted by ledger_entry?

@mvadari
Copy link
Collaborator

mvadari commented Jan 3, 2024

It's in the rippled code, but I don't really understand what it's doing.

@ckeshava
Copy link
Collaborator

@ckniffen The type field is documented in the last portion of the "Request Format" section of the ledger_data command: https://xrpl.org/ledger_data.html#request-format

The type filter pertains to account_objects, ledger_data and the ledger command. It has not been implemented correctly (or documented) in the ledger command. I'm working on fixing that in the rippled code.

ltORACLE is missing (amongst the list of ledger state objects) in the javascript code, this was added today to the rippled codebase.

@cindyyan317
Copy link

It has not been implemented correctly (or documented) in the ledger command.

The rippled's code might be correct. The server behind s2 is Clio which does not support "type" parameter. Documented here -> https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants