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: Koios token support #438

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kozer
Copy link
Contributor

@kozer kozer commented Dec 5, 2024

Fixes #439

Add token support to Koios provider

Proposed Changes

Based on the Koios API specs, Koios can take in the request, an optional auth token. This PR aims to add token support to the Koios provider implementation:

  • Added support for authorization tokens in request headers
  • Updated the internal methods to properly pass token through the request chain
  • Added test coverage for token handling
  • Maintained backward compatibility for non-authenticated requests

Implementation Details

During the implementation we made the following changes:

  • Added optional token parameter to Koios constructor
  • Created getHeadersWithToken utility to handle token header construction
  • Updated internal HTTP methods to accept and forward headers
  • Added test coverage for both token and non-token scenarios

Testing Instructions

  • Run the full test suite to verify all existing functionality remains intact
  • Try making authenticated requests through the Koios provider
  • Verify that the new test cases for token handling pass
  • Check that both authenticated and non-authenticated requests work as expected

Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 636aaa1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@lucid-evolution/provider Patch
@lucid-evolution/lucid Patch

Not sure what this means? Click here to learn what changesets are.

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

@kozer kozer changed the title Add: Koios token in request Add: Koios token support Dec 5, 2024
@kozer
Copy link
Contributor Author

kozer commented Dec 6, 2024

Hi, @hadelive!
Is the changeset file correct?
Also I have noticed that some tests are failing. What your team thinks on resolving this ( as I see it happens in other PRs as well ). Should we move to mocking to avoid hitting the network? What do you think?

@hadelive
Copy link
Collaborator

hadelive commented Dec 7, 2024

No
The errors come from the Maestro provider.

@kozer
Copy link
Contributor Author

kozer commented Dec 11, 2024

No

The errors come from the Maestro provider.

Is there something else that needs to be done so the pr can be merged? Thanks!
cc: @hadelive

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.

Add authorization token support to Koios provider
2 participants