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

Latest build is not working #1

Closed
3 tasks
jpgarcia opened this issue Jan 30, 2021 · 1 comment
Closed
3 tasks

Latest build is not working #1

jpgarcia opened this issue Jan 30, 2021 · 1 comment
Labels
bug Something isn't working enhancement New feature or request released

Comments

@jpgarcia
Copy link
Owner

The build seems to be broken:

Apparently there are some lodash dependencies that are missing in the package.json

  • Remove the @types/lodash dependency
  • Add @types lodash deps for specific packages
  • Require lodash utils from specific packages in query.ts

On the other side I found that in some cases the API could failed and return an error code as part of the Axios response but not throwing at all that's why we should catch this type of errors and throw properly:

Here are some examples of API errors:

{
  status: '0',
  message: 'NOTOK',
  result: 'Error! Invalid address format'
}
{
  status: '0',
  message: 'NOTOK',
  result: 'Error! Invalid contract address format'
}

We must also provide a way to write headers or override Axios configuration as well as be able to obtain the raw axios response for debugging / post request processing support. A proposed interface could be like this

type RequestConfig = {
  axiosConfig?: AxiosRequestConfig
  rawAxiosResponse?: boolean
}

account.getBnbBalance(address: string, config: RequestConfig)
@jpgarcia jpgarcia added bug Something isn't working enhancement New feature or request labels Jan 30, 2021
jpgarcia pushed a commit that referenced this issue Jan 30, 2021
- improve return types
- add axios config support
- allow return axios raw response

fix #1
jpgarcia pushed a commit that referenced this issue Jan 30, 2021
# [1.1.0](v1.0.0...v1.1.0) (2021-01-30)

### Bug Fixes

* fix lodash dependencies ([9c5098b](9c5098b)), closes [#1](#1)

### Features

* improve api ([48e4d77](48e4d77)), closes [#1](#1)
@jpgarcia
Copy link
Owner Author

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request released
Projects
None yet
Development

No branches or pull requests

1 participant