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

node client as blockchain-provider #90

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

ThierryM1212
Copy link

Provide client for node running with the extra indexes.
It implements the blockchain-providers standard interface and several node REST API end points.
Returns the blockchain objects typed for fleet SDK when applicable.

Copy link

changeset-bot bot commented Nov 19, 2023

⚠️ No Changeset found

Latest commit: 17e851e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@arobsn arobsn left a comment

Choose a reason for hiding this comment

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

Note that it's not an exhaustive review as the requested changes are big enough.

Comment on lines 102 to 112
/**
* Limit the number of outputs when applicable.
* @default 0
*/
limit?: number;

/**
* Amount of result to skip from the begining.
* @default 0
*/
offset?: number;
Copy link
Member

Choose a reason for hiding this comment

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

Limit and offset should not be accepted by getBoxes

Comment on lines 41 to 55
export function getErgoNodeProvider(
url: URL | string,
parser: ResponseParser = JSON,
fetcher: Fetcher = fetch,
headers: Headers = DEFAULT_HEADERS
): ErgoNodeProvider {
const nodeOptions: RequestOptions = {
url: url,
parser: parser,
fetcher: fetcher,
headers: headers
};

return new ErgoNodeProvider(nodeOptions);
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this functions is necessary, new ErgoNodeProvider(...) should be enougth

@ThierryM1212
Copy link
Author

Thanks, I've made the requested changes to align the getBoxes behavior and implements the streamBoxes.
The helper method is also removed and the contructor improved to include the default values.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9f02ca0) 100.00% compared to head (17e851e) 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##            master       #90     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files          104       107      +3     
  Lines        15184     17755   +2571     
  Branches      1394      1492     +98     
===========================================
+ Hits         15184     17755   +2571     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

3 participants