{"id":46638221,"url":"https://github.com/tetherto/wdk-pricing-provider","last_synced_at":"2026-03-08T02:13:11.525Z","repository":{"id":342659396,"uuid":"907497245","full_name":"tetherto/wdk-pricing-provider","owner":"tetherto","description":"Utility module providing cache-aware cryptocurrency pricing lookups.","archived":false,"fork":false,"pushed_at":"2026-03-06T18:31:02.000Z","size":216,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-03-06T21:52:43.687Z","etag":null,"topics":["crypto-prices","fiat","market-data","pricing","wdk"],"latest_commit_sha":null,"homepage":"https://docs.wdk.tether.io/tools/price-rates","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-23T18:03:43.000Z","updated_at":"2026-02-24T14:21:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/wdk-pricing-provider","commit_stats":null,"previous_names":["tetherto/wdk-pricing-provider"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/wdk-pricing-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-pricing-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-pricing-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-pricing-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-pricing-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/wdk-pricing-provider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-pricing-provider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30242406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto-prices","fiat","market-data","pricing","wdk"],"created_at":"2026-03-08T02:13:10.956Z","updated_at":"2026-03-08T02:13:11.505Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tetherto/wdk-pricing-provider\n\nSimple, cache-aware pricing provider utilities for WDK-based apps and the [WDK UI Kit](https://github.com/tetherto/wdk-uikit-react-native). It defines two core building blocks: `PricingClient` (an abstract fetcher that you implement) and `PricingProvider` (a wrapper that adds caching and a unified API).\n\n## 🔍 About WDK\n\nThis module is part of the WDK (Wallet Development Kit) ecosystem, which helps developers build secure, non-custodial wallets and related services.\n\nFor more on the WDK project, visit [docs.wallet.tether.io](https://docs.wallet.tether.io).\n\n## ✨ Features\n\n- Minimal, composable pricing abstraction\n- Pluggable client model (`PricingClient`)\n- Built-in caching via `PricingProvider`\n- Last price and historical price helpers\n\n## ⬇️ Installation\n\n```bash\nnpm install wdk-pricing-provider\n```\n\n## 🚀 Quick Start\n\n```javascript\nimport { PricingProvider } from \"@tetherto/wdk-pricing-provider\";\nimport { BitfinexPricingClient } from \"@tetherto/wdk-pricing-bitfinex-http\";\n\n// Create a concrete PricingClient implementation\nconst client = new BitfinexPricingClient();\n\n// Wrap the client with a cache-enabled provider\nconst provider = new PricingProvider({\n  client,\n  cacheTTL: 60 * 60 * 1000, // 1 hour cache in ms\n});\n\n// Get latest price\nconst currentPrice = await provider.getLastPrice(\"BTC\", \"USD\");\n\n// Get historical price\nconst historicalPrice = await provider.getHistoricalPrice({\n  from: \"BTC\",\n  to: \"USD\",\n  start: 1709906400000, // Optional, Start date for historical interval\n  end: 1709913600000, // Optional, End date for historical interval\n});\n```\n\n## 📚 API Reference\n\n### PricingProvider\n\n```javascript\nnew PricingProvider(options);\n```\n\nParameters:\n\n- `options.client`: Instance of your `PricingClient` implementation\n- `options.cacheTTL` (number, optional): Cache time for last price lookups in ms\n\nMethods:\n\n- `getLastPrice(base: string, quote: string): Promise\u003cnumber\u003e`\n- `getHistoricalPrice({ from, to, start?, end? }): Promise\u003cnumber\u003e`\n\n### PricingClient (abstract)\n\nYou implement this interface for your data source (e.g., Bitfinex, Coinbase, etc.). At a minimum, provide methods that `PricingProvider` uses to fetch spot and historical prices.\n\n## 🔍 Usage Examples\n\nFor detailed usage examples, please check the included test files `index.test.js` and `index.integration.test.js` in this repository.\n\n## 🔗 Related Projects\n\n- Bitfinex HTTP client: [wdk-pricing-bitfinex-http](https://github.com/tetherto/wdk-pricing-bitfinex-http)\n\n## 🛠️ Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Lint\nnpm run lint\nnpm run lint:fix\n\n# Tests\nnpm test\n```\n\n## 📜 License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 🆘 Support\n\nFor support, please open an issue on the GitHub repository.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-pricing-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fwdk-pricing-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-pricing-provider/lists"}