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

feat(ocean-api-client): add ocean-api client core #909

Merged
merged 3 commits into from
Dec 23, 2021

Conversation

fuxingloh
Copy link
Contributor

What this PR does / why we need it:

DeFiChain Ocean API, next^2 generation API for building scalable Native DeFi Apps.

This is the foundational setup for Ocean API development integration into Jellyfish. Have been working on it for the past 3 weeks chipping off integration and migrating code slowly. This PR introduces 4 key concepts/packages with separation of concerns. Although the implementation example is small, they are fully featured working and tested.

Motivation

As part of #580 consolidation efforts. We had multiple projects that were extensions of the jellyfish project. The separated projects allowed us to move quickly initially but proves to be a bottleneck when it comes to development.

By including Ocean API development with jellyfish, it creates a better synergy of DeFiChain open source development across concerns. Singular versioning, source of truth, documentation of entirety of defichain via jellyfish.defichain.com.

@defichain/ocean-api-client

Provides the protocol core for communicating between client and server. Within ocean-api-client, it contains a shared response and exception structure.

The official JS client for ocean-api. As the development of ocean-api client and server are closely intertwined, this allows the project to move iteratively together. With them packaged together within the same repo, the server and client can be released together. This allows us to be the consumer of our own client implementation. Testing each server endpoint directly with ocean-api-client, dogfooding at the maximum.

@codeclimate
Copy link

codeclimate bot commented Dec 22, 2021

Code Climate has analyzed commit addbfd6 and detected 0 issues on this pull request.

View more on Code Climate.

@netlify
Copy link

netlify bot commented Dec 22, 2021

✔️ Deploy Preview for jellyfish-defi ready!

🔨 Explore the source changes: addbfd6

🔍 Inspect the deploy log: https://app.netlify.com/sites/jellyfish-defi/deploys/61c2e48995cd880007f7ee42

😎 Browse the preview: https://deploy-preview-909--jellyfish-defi.netlify.app

@fuxingloh fuxingloh changed the title feat(ocean-api): ocean-api-client core feat(ocean-api-client): add ocean-api client core Dec 22, 2021
@codecov
Copy link

codecov bot commented Dec 22, 2021

Codecov Report

Merging #909 (addbfd6) into main (981ae67) will decrease coverage by 0.50%.
The diff coverage is 80.99%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #909      +/-   ##
==========================================
- Coverage   96.62%   96.11%   -0.51%     
==========================================
  Files         134      141       +7     
  Lines        4384     4505     +121     
  Branches      570      584      +14     
==========================================
+ Hits         4236     4330      +94     
- Misses        148      175      +27     
Impacted Files Coverage Δ
packages/ocean-api-client/src/OceanApiClient.ts 56.60% <56.60%> (ø)
packages/ocean-api-client/src/ApiResponse.ts 100.00% <100.00%> (ø)
...ckages/ocean-api-client/src/errors/ApiException.ts 100.00% <100.00%> (ø)
...an-api-client/src/errors/ApiValidationException.ts 100.00% <100.00%> (ø)
...ges/ocean-api-client/src/errors/ClientException.ts 100.00% <100.00%> (ø)
...es/ocean-api-client/src/errors/TimeoutException.ts 100.00% <100.00%> (ø)
packages/ocean-api-client/src/index.ts 100.00% <100.00%> (ø)
...ellyfish-transaction/src/script/dftx/dftx_token.ts 76.74% <0.00%> (-23.26%) ⬇️
...ellyfish-transaction-signature/src/tx_signature.ts 90.80% <0.00%> (-3.45%) ⬇️
packages/jellyfish-transaction/src/tx_composer.ts 78.33% <0.00%> (-1.67%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 981ae67...addbfd6. Read the comment docs.

@fuxingloh fuxingloh merged commit 6a0ffc4 into main Dec 23, 2021
@fuxingloh fuxingloh deleted the fuxingloh/ocean-api-client branch December 23, 2021 05:00
canonbrother pushed a commit that referenced this pull request Jun 1, 2022
* Added getFutureSwapBlock rpc to whitelist

Signed-off-by: Suraj Auwal <[email protected]>

* Fixed incorrect casing.

Signed-off-by: Suraj Auwal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants