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: dummy pricing provider #58

Merged
merged 2 commits into from
Aug 29, 2024
Merged

feat: dummy pricing provider #58

merged 2 commits into from
Aug 29, 2024

Conversation

0xnigir1
Copy link
Collaborator

🤖 Linear

Closes ZKS-212

Description

Implement DummyPricingProvider

  • return fixed price of 1 for every token
  • to be used in testnet or local

@0xnigir1 0xnigir1 requested review from 0xkenj1 and 0xyaco August 28, 2024 16:30
Copy link

linear bot commented Aug 28, 2024

0xyaco
0xyaco previously approved these changes Aug 28, 2024

import { Address } from "@zkchainhub/shared";

import { DummyPricingProvider } from "../../../src/providers/dummy.provider";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might want to add a .js?

*/
export class DummyPricingProvider implements IPricingProvider {
async getTokenPrices(addresses: Address[]): Promise<PriceResponse> {
return Promise.resolve(Object.fromEntries(addresses.map((address) => [address, 1])));
Copy link
Collaborator

Choose a reason for hiding this comment

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

i was wondering if we should return undefined here, lets leave it as it is, and if we need a refactor it wouldn't take to much time

@0xnigir1 0xnigir1 merged commit dd33a59 into dev Aug 29, 2024
6 checks passed
@0xnigir1 0xnigir1 deleted the feat/dummy-pricing-provider branch August 29, 2024 15:56
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.

3 participants