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

Add nfts_by_issuer data type #2694

Merged
merged 9 commits into from
Jun 11, 2024
Merged

Add nfts_by_issuer data type #2694

merged 9 commits into from
Jun 11, 2024

Conversation

Kassaking7
Copy link
Contributor

@Kassaking7 Kassaking7 commented May 15, 2024

High Level Overview of Change

Title

Context of Change

Following https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/clio-methods/nfts_by_issuer/ & https://ripplelabs.atlassian.net/jira/software/projects/DEFI/boards/760?assignee=712020%3Aff4deb34-7fc1-428e-a2ee-354e1ddba309&selectedIssue=DEFI-127

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update HISTORY.md?

  • Yes
  • No, this change does not impact library users

Test Plan

@khancode khancode requested review from mvadari, khancode, pdp2121 and justinr1234 and removed request for mvadari and khancode May 16, 2024 15:40
export interface NFTsByIssuerRequest
extends BaseRequest,
LookupByLedgerRequest {
method: 'nfts_by_issuer'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be command instead of method since JS library deals with websocket client

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/clio-methods/nfts_by_issuer/ , it's weird that only this page the field is "method" instead of "command". I can change it to "command" for sure.

Copy link
Collaborator

@shawnxie999 shawnxie999 May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command is used when the connection is websocket, eg. your JS script opens a websocket connection. Whereas method field is used when the connection is http (eg. curl command)

For example, you could use this in the cmdline to query against ur local clio server,
curl 127.0.0.1:51233 -d '{"method":"nfts_by_issuer", "params": [{"issuer": "rfXeQv31yWMrhhPxMHZRzQqhw5mQrcuici"}]}'

*
* @category Requests
*/
export interface NFTsByIssuerRequest
Copy link
Collaborator

@pdp2121 pdp2121 May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interface should be imported into the index file of methods, then client to be available for public use and matched with the response. You could follow the same steps of other methods (i.e AccountChannels)

@pdp2121
Copy link
Collaborator

pdp2121 commented May 16, 2024

Could you add a test file for this new method? Cheers :)

@Kassaking7
Copy link
Contributor Author

Could you add a test file for this new method? Cheers :)

I'm not sure if this could be tested. I think the lib currently doesn't support integration test for Clio?

@Kassaking7 Kassaking7 requested a review from pdp2121 May 17, 2024 17:13
@shawnxie999
Copy link
Collaborator

@pdp2121 the library doesn't support test for clio, which is the reason why nft_info and nft_history don't have test cases.

Copy link
Collaborator

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than the unnecessary change in HISTORY.md :)
Good job

Copy link
Collaborator

@pdp2121 pdp2121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good job!

Copy link
Collaborator

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@pdp2121 pdp2121 merged commit d3b03a5 into XRPLF:main Jun 11, 2024
15 checks passed
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

Successfully merging this pull request may close these issues.

4 participants