{"_id":"@aurora-is-near/aurora-oracle","_rev":"2-4525200992fb5f282c8c9cf43a6b849e","name":"@aurora-is-near/aurora-oracle","dist-tags":{"latest":"1.1.2"},"versions":{"1.1.2":{"name":"@aurora-is-near/aurora-oracle","version":"1.1.2","keywords":[],"author":"","license":"UNLICENSED","_id":"@aurora-is-near/aurora-oracle@1.1.2","maintainers":[{"name":"chris-aurora","email":"chris.gutkowski@aurora.dev"},{"name":"aurorasec","email":"security@aurora.dev"},{"name":"aurealis","email":"diego.figueroa@aurora.dev"},{"name":"alexmendes","email":"alexanderhmendes@gmail.com"}],"bin":{"aurora-oracle":"bin/cli.js"},"dist":{"shasum":"8e606adabfb67445afefa007e69b4e35f0595c9f","tarball":"https://registry.npmjs.org/@aurora-is-near/aurora-oracle/-/aurora-oracle-1.1.2.tgz","fileCount":34,"integrity":"sha512-Y+t3xB44XS3YwnFGXgbxdzGJW/nND9sjROmYa6KL/T2BdiR/PUQM+zP3zvgiZ8zeZJ+vYc57RAIHtcWiIv3QxA==","signatures":[{"sig":"MEUCIBczSLjbK09ZS9fXE+Sn/GL3yiL0WLwxeRcmFOwAibgaAiEAhsQmOLYcMqO/YAOFw2XR21l6s0HMQzoJPFIUmvey8D4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":164606},"main":"index.js","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"engines":{"node":">=20.8.1"},"gitHead":"e4301597128315f7e7432b2f092ff76ffca5c9b6","scripts":{"lint":"yarn lint:ts && yarn lint:sol","test":"hardhat test","compile":"hardhat compile","lint:ts":"eslint --ext .ts","lint:fix":"yarn lint:js --fix && yarn lint:sol --fix","lint:sol":"solhint 'contracts/**/*.sol' && prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'","tpro:deploy":"hardhat --network tpro deploy","auroraTestnet:deploy":"hardhat --network auroraTestnet deploy"},"_npmUser":{"name":"alexmendes","actor":{"name":"alexmendes","type":"user","email":"alexanderhmendes@gmail.com"},"email":"alexanderhmendes@gmail.com"},"_npmVersion":"10.8.1","description":"An oracle contract that is updated with configured USD price tokens.","directories":{},"_nodeVersion":"22.17.0","dependencies":{"dotenv":"^16.4.5","ethers":"^6.13.0","hardhat":"^2.21.0","commander":"^12.1.0","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^2.2.0","@openzeppelin/contracts":"^5.0.2","@nomiclabs/hardhat-ethers":"^2.2.3","@nomiclabs/hardhat-waffle":"^2.0.6","@nomiclabs/hardhat-solhint":"^3.1.0","@nomicfoundation/hardhat-ethers":"^3.0.6","@nomicfoundation/hardhat-verify":"^2.0.8","@nomicfoundation/hardhat-toolbox":"^5.0.0","@nomicfoundation/hardhat-ignition":"^0.15.4","@nomicfoundation/hardhat-chai-matchers":"^2.0.7","@nomicfoundation/hardhat-ignition-ethers":"^0.15.4","@nomicfoundation/hardhat-network-helpers":"^1.0.11"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4","husky":"^9.0.11","eslint":"^8.57.0","solhint":"^5.0.1","prettier":"^3.3.2","typechain":"^8.3.2","@commitlint/cli":"^19.3.0","semantic-release":"^24.0.0","solidity-coverage":"^0.8.12","@typechain/hardhat":"^9.1.0","@typechain/ethers-v6":"^0.5.1","prettier-plugin-solidity":"^1.3.1","@aurora-is-near/eslint-config":"^1.5.3","@pythnetwork/pyth-sdk-solidity":"^2.4.1","@commitlint/config-conventional":"^19.2.2","@aurora-is-near/semantic-release-config":"^1.5.3"},"_npmOperationalInternal":{"tmp":"tmp/aurora-oracle_1.1.2_1752089130402_0.22257657341976755","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-07-09T19:25:30.298Z","modified":"2026-05-12T13:01:28.670Z","1.1.2":"2025-07-09T19:25:30.599Z"},"license":"UNLICENSED","keywords":[],"description":"An oracle contract that is updated with configured USD price tokens.","maintainers":[{"email":"chris.gutkowski@aurora.dev","name":"chris-aurora"},{"email":"security@aurora.dev","name":"aurorasec"},{"email":"alexanderhmendes@gmail.com","name":"alexmendes"}],"readme":"# Aurora Oracle\n\nAn oracle contract that is updated with configured USD price tokens.\nA [backend process](https://github.com/aurora-is-near/be-aurora-oracle)\ncollects those prices from the CoinGecko API.\n\nThis repository enforces semantic commit messages. For more details and examples\nsee the [Conventional Commits Specification](https://www.conventionalcommits.org).\n\n## Usage\n\n### Get price of a pair\n\nTo get the price of tokenA against tokenB with decimals of tokenB call\nthe following function:\n\n```solidity\ngetPairRate(string memory tokenA, string memory tokenB, uint8 decimalsTokenB) \n```\n\nWhere tokenA and tokenB are the symbols of the tokens (CAPITAL). Only allowed\ntokens allowed as inputs for this function.\n\nFor example, to get the price of ETH against BTC. BTC has 8 decimals:\n\n```solidity\ngetPairRate(\"ETH\",\"BTC\",8)\n```\n\nOr, to get the price of TPRO against USDC. USDC has 6 decimals:\n\n```solidity\ngetPairRate(\"TPRO\",\"USDC\",6)\n```\n\n### Get list of all oracle allowed tokens\n\nTo get all allowed token symbols:\n\n```solidity\ngetAllTokenSymbols()\n```\n\n## Contract\n\nThe Solidity contract is available at [contracts/AuroraOracle.sol](./contracts/AuroraOracle.sol).\n\nThe [Contract ABI](https://docs.soliditylang.org/en/latest/abi-spec.html)\nis available at [abi/oracleContractABI.json](./abi/oracleContractABI.json).\n\n## Scripts\n\n```text\nscripts/00_replaceOwner.js\nscripts/01_getPairRate.js\nscripts/02_getAllowedSymbols.js\nscripts/04_getPairRateFullTest.js\n```\n\n## Testing\n\nTo run the [Hardhat](https://hardhat.org/) tests\n\n```tet\nyarn test\n```\n\n## Deployment\n\nThis repository is distributed as private GitHub Package so that we\ncan deploy it from another process (e.g. via the\n[be-aurora-oracle](https://github.com/aurora-is-near/be-aurora-oracle)).\n\nTo install the package you will need to\n[authenticate to GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages), then:\n\nTo deploy the contract a given network:\n\n```text\nnpx @aurora-is-near/oracle deploy <NETWORK> --private-key <AURORA-PRIVATE-KEY>\n```\n\nFor example:\n\n```text\nnpx @aurora-is-near/oracle deploy tpro --private-key abc-123\n```\n\nThe available networks are defined in the [hardhat.config.js](./hardhat.config.js) file.\n\nYou can also set the private key via the `AURORA_PRIVATE_KEY` environment variable.\n\n## Adding a network\n\nOnce a new network is added to the [hardhat.config.js](./hardhat.config.js) file\nand the change is merged into the `main` branch the release process will run and\na new version will be deployed. Once this new version is available we should be\nable to trigger the deployment script for that network, as above.\n","readmeFilename":"README.md"}