{"_id":"@cygnus-wealth/asset-valuator","_rev":"4-412e52ab4311ad53bd574790a29a2b9f","name":"@cygnus-wealth/asset-valuator","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@cygnus-wealth/asset-valuator","version":"0.1.0","keywords":["crypto","asset","valuation","price","bitcoin","ethereum"],"author":{"name":"Cygnus Wealth"},"license":"MIT","_id":"@cygnus-wealth/asset-valuator@0.1.0","maintainers":[{"name":"linuxninja39","email":"jacob@s56.net"}],"dist":{"shasum":"983e51ed4c234577f3df8ae843a757cb35f861cf","tarball":"https://registry.npmjs.org/@cygnus-wealth/asset-valuator/-/asset-valuator-0.1.0.tgz","fileCount":12,"integrity":"sha512-FFXh5LFiocgrpUstleT3Sfls6rDntLrdULGDjVbrECne2eoajTK1LbQMv9CAAyZ8+Wv5S1G42TCvnHB9TGT1QQ==","signatures":[{"sig":"MEQCIBC2DbezWXK9L8VcA8+LJlkNJDrw23msrBGq8ztg796pAiBvV1rzm0YewlbpECczCeXSvBK5vO5UZXTVhRq1pi1kjQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12883},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"fd2daccbcc3562f9068d55d1e3bf1d9e539ad467","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"linuxninja39","email":"jacob@s56.net"},"_npmVersion":"11.4.2","description":"Asset valuation library for retrieving and converting cryptocurrency prices","directories":{},"_nodeVersion":"24.4.1","dependencies":{"axios":"^1.11.0","@cygnus-wealth/data-models":"^0.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.5","eslint":"^9.32.0","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/node":"^24.1.0","@typescript-eslint/parser":"^8.38.0","@typescript-eslint/eslint-plugin":"^8.38.0"},"_npmOperationalInternal":{"tmp":"tmp/asset-valuator_0.1.0_1753645346560_0.9037715800037753","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cygnus-wealth/asset-valuator","version":"0.1.1","keywords":["crypto","asset","valuation","price","bitcoin","ethereum"],"author":{"name":"Cygnus Wealth"},"license":"MIT","_id":"@cygnus-wealth/asset-valuator@0.1.1","maintainers":[{"name":"linuxninja39","email":"jacob@s56.net"}],"dist":{"shasum":"041a56c0433a775a20da5f1f810ae4a2892fbf70","tarball":"https://registry.npmjs.org/@cygnus-wealth/asset-valuator/-/asset-valuator-0.1.1.tgz","fileCount":12,"integrity":"sha512-OEbo8jtqj1he6L0FYKzwsXAsBaq4ydUnpQqxeb3yQpi6Le9a/D8QfJPo9epQDDnRhdEQE3ZV9MojQlP6XdtL0A==","signatures":[{"sig":"MEYCIQDR4Cg8oc7gWvnT73Ye7+BfvLUw9lHeuqEEnsYSFnMYOwIhALZrqAJk4YMydb2Wku6ZpX1aT7J0Y6FSzWvpQOK3YiUI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15038},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"a2cbf9a53318f1a98b138a67ed2571eea3bd25cf","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"linuxninja39","email":"jacob@s56.net"},"_npmVersion":"11.4.2","description":"Asset valuation library for retrieving and converting cryptocurrency prices","directories":{},"_nodeVersion":"24.4.1","dependencies":{"axios":"^1.11.0","@cygnus-wealth/data-models":"^0.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.5","eslint":"^9.32.0","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/node":"^24.1.0","@typescript-eslint/parser":"^8.38.0","@typescript-eslint/eslint-plugin":"^8.38.0"},"_npmOperationalInternal":{"tmp":"tmp/asset-valuator_0.1.1_1753722010834_0.778880198186837","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cygnus-wealth/asset-valuator","version":"0.2.0","keywords":["crypto","asset","valuation","price","bitcoin","ethereum"],"author":{"name":"Cygnus Wealth"},"license":"MIT","_id":"@cygnus-wealth/asset-valuator@0.2.0","maintainers":[{"name":"linuxninja39","email":"jacob@s56.net"}],"dist":{"shasum":"b19b2e03391a78b5f9e3e6ccaa3c5434e9710ee3","tarball":"https://registry.npmjs.org/@cygnus-wealth/asset-valuator/-/asset-valuator-0.2.0.tgz","fileCount":22,"integrity":"sha512-UTQqS+0V4d2zNO9R6V/asyDrHDJzlfhpLrN6Iz0Q+YgU1GK3y8do8qXAqf2pirc2oMzj9R9GVRV9EwaxuA4a0Q==","signatures":[{"sig":"MEQCIBO2aksQI0US6ZM8AupMEF/pqLPXGVNvLvdulx8OuzSOAiA8BsO464YbkozyKLGpO9UO/pPSyocQO+2cxKhGLPfL1A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38744},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"699eed193e04c7b5dbf9e8dbec6bc61bf6ec28a6","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"linuxninja39","email":"jacob@s56.net"},"_npmVersion":"11.4.2","description":"Asset valuation library for retrieving and converting cryptocurrency prices","directories":{},"_nodeVersion":"24.4.1","dependencies":{"axios":"^1.11.0","@cygnus-wealth/data-models":"^0.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","jest":"^30.0.5","eslint":"^9.32.0","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/node":"^24.1.0","@typescript-eslint/parser":"^8.38.0","@typescript-eslint/eslint-plugin":"^8.38.0"},"_npmOperationalInternal":{"tmp":"tmp/asset-valuator_0.2.0_1754245308581_0.3296971889012892","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@cygnus-wealth/asset-valuator","version":"0.3.0","description":"Asset valuation library for retrieving and converting cryptocurrency prices","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"jest","lint":"eslint src --ext .ts","prepublishOnly":"npm run build"},"keywords":["crypto","asset","valuation","price","bitcoin","ethereum"],"author":{"name":"Cygnus Wealth"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Cygnus-Wealth/asset-valuator.git"},"publishConfig":{"access":"public"},"type":"module","engines":{"node":">=16"},"dependencies":{"@cygnus-wealth/data-models":"^1.0.0","axios":"^1.11.0"},"devDependencies":{"@types/jest":"^30.0.0","@types/node":"^24.1.0","@typescript-eslint/eslint-plugin":"^8.38.0","@typescript-eslint/parser":"^8.38.0","eslint":"^9.32.0","jest":"^30.0.5","ts-jest":"^29.4.0","tsx":"^4.7.0","typescript":"^5.8.3"},"gitHead":"316046e076cdf51eaf06cd39520d5efad719e695","_id":"@cygnus-wealth/asset-valuator@0.3.0","bugs":{"url":"https://github.com/Cygnus-Wealth/asset-valuator/issues"},"homepage":"https://github.com/Cygnus-Wealth/asset-valuator#readme","_nodeVersion":"20.20.0","_npmVersion":"11.10.0","dist":{"integrity":"sha512-EkR7+jxnQKAF3I6b9Q87aMyf3A0EJXE7Mvaz0r+uZgrv5+TXRVmUpIns4ihC7eoHA9Y432rMlT62ldVcjw33HA==","shasum":"32fcbbbb6679844df3f6a44197d8fa41fe229c4e","tarball":"https://registry.npmjs.org/@cygnus-wealth/asset-valuator/-/asset-valuator-0.3.0.tgz","fileCount":24,"unpackedSize":41184,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cygnus-wealth%2fasset-valuator@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDiX5n+YwEbqzULS9P5pM/u6P82YwJfc8RVTm3jlTMmnwIgAN3iF22Uvkg//r11m9ReLtOeJRou2Oe8saWddvfSD7s="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:04a4bf9c-faf3-4edd-b615-bac9ff52320e"}},"directories":{},"maintainers":[{"name":"linuxninja39","email":"jacob@s56.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/asset-valuator_0.3.0_1771029736647_0.03882968412186116"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-27T19:42:26.508Z","modified":"2026-02-14T00:42:17.224Z","0.1.0":"2025-07-27T19:42:26.767Z","0.1.1":"2025-07-28T17:00:11.011Z","0.2.0":"2025-08-03T18:21:48.760Z","0.3.0":"2026-02-14T00:42:16.916Z"},"author":{"name":"Cygnus Wealth"},"license":"MIT","keywords":["crypto","asset","valuation","price","bitcoin","ethereum"],"description":"Asset valuation library for retrieving and converting cryptocurrency prices","maintainers":[{"name":"linuxninja39","email":"jacob@s56.net"}],"readme":"# @cygnus-wealth/asset-valuator\n\nA TypeScript library for retrieving and converting cryptocurrency asset prices.\n\n## Installation\n\n```bash\nnpm install @cygnus-wealth/asset-valuator\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport { AssetValuator } from '@cygnus-wealth/asset-valuator';\n\nconst valuator = new AssetValuator();\n\n// Get the USD price of ETH\nconst ethPrice = await valuator.getPrice('ETH', 'USD');\nconsole.log(ethPrice);\n// { base: 'ETH', quote: 'USD', price: 3000, timestamp: Date }\n\n// Convert 2 BTC to USD\nconst usdValue = await valuator.convert({\n  from: 'BTC',\n  to: 'USD',\n  amount: 2\n});\nconsole.log(usdValue); // 100000 (assuming BTC = $50,000)\n\n// Get ETH price in BTC\nconst ethInBtc = await valuator.convert({\n  from: 'ETH',\n  to: 'BTC'\n});\nconsole.log(ethInBtc); // 0.06 (assuming ETH = $3,000, BTC = $50,000)\n```\n\n### Fetching Multiple Prices\n\n```typescript\nconst prices = await valuator.getPrices(['BTC', 'ETH', 'BNB'], 'USD');\nconsole.log(prices);\n// [\n//   { base: 'BTC', quote: 'USD', price: 50000, timestamp: Date },\n//   { base: 'ETH', quote: 'USD', price: 3000, timestamp: Date },\n//   { base: 'BNB', quote: 'USD', price: 300, timestamp: Date }\n// ]\n```\n\n### Data Model Integration\n\nConvert prices to @cygnus-wealth/data-models format:\n\n```typescript\nimport { DataModelConverter } from '@cygnus-wealth/asset-valuator';\n\nconst ethPrice = await valuator.getPrice('ETH', 'USD');\nconst assetValue = DataModelConverter.toAssetValueModel(ethPrice);\nconsole.log(assetValue);\n// {\n//   assetSymbol: 'ETH',\n//   currency: 'USD',\n//   value: 3000,\n//   timestamp: Date\n// }\n```\n\n### Cache Management\n\n```typescript\n// Set cache timeout (default: 60 seconds)\nvaluator.setCacheTimeout(30000); // 30 seconds\n\n// Clear cache\nvaluator.clearCache();\n```\n\n### Custom Price Provider\n\nYou can implement your own price provider:\n\n```typescript\nimport { PriceProvider, AssetValuator } from '@cygnus-wealth/asset-valuator';\n\nclass CustomProvider implements PriceProvider {\n  async fetchPrice(symbol: string, currency?: string) {\n    // Your implementation\n  }\n\n  async fetchMultiplePrices(symbols: string[], currency?: string) {\n    // Your implementation\n  }\n}\n\nconst valuator = new AssetValuator(new CustomProvider());\n```\n\n## API Reference\n\n### AssetValuator\n\n- `getPrice(base: string, quote?: string): Promise<AssetPrice>`\n- `convert(options: ConversionOptions): Promise<number>`\n- `getPrices(symbols: string[], quote?: string): Promise<AssetPrice[]>`\n- `setCacheTimeout(milliseconds: number): void`\n- `clearCache(): void`\n\n### Types\n\n```typescript\ninterface AssetPrice {\n  base: string;\n  quote: string;\n  price: number;\n  timestamp: Date;\n}\n\ninterface ConversionOptions {\n  from: string;\n  to: string;\n  amount?: number;\n}\n```\n\n## License\n\nMIT","readmeFilename":"README.md","homepage":"https://github.com/Cygnus-Wealth/asset-valuator#readme","repository":{"type":"git","url":"git+https://github.com/Cygnus-Wealth/asset-valuator.git"},"bugs":{"url":"https://github.com/Cygnus-Wealth/asset-valuator/issues"}}