node client as blockchain-provider#90
node client as blockchain-provider#90ThierryM1212 wants to merge 19 commits intofleet-sdk:masterfrom
Conversation
Node client
Node client to blockchain-providers
|
arobsn
left a comment
There was a problem hiding this comment.
Note that it's not an exhaustive review as the requested changes are big enough.
| /** | ||
| * Limit the number of outputs when applicable. | ||
| * @default 0 | ||
| */ | ||
| limit?: number; | ||
|
|
||
| /** | ||
| * Amount of result to skip from the begining. | ||
| * @default 0 | ||
| */ | ||
| offset?: number; |
There was a problem hiding this comment.
Limit and offset should not be accepted by getBoxes
getBoxesis meant to fetch all queried boxes over all pagesstreamBoxesis meant to fetch and yeld query pages by pages, thus querying logic should be implemented bystreamBoxes(abstractinglimitandoffset), andgetBoxeswill simply call it until the end of stream, see GraphQL implementation as a reference: https://github.com/fleet-sdk/fleet/blob/master/packages/blockchain-providers/src/ergo-graphql/ergoGraphQLProvider.ts#L169-L176
| 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); | ||
| } |
There was a problem hiding this comment.
I don't think this functions is necessary, new ErgoNodeProvider(...) should be enougth
…boxes, remove the get node helper function
|
Thanks, I've made the requested changes to align the getBoxes behavior and implements the streamBoxes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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.