@generalprotocols/price-oracle
Advanced tools
Comparing version 2.0.0 to 2.1.0-development.3250186713
{ | ||
"name": "@generalprotocols/price-oracle", | ||
"version": "2.0.0", | ||
"version": "2.1.0-development.3250186713", | ||
"description": "Library for creating, parsing, signing, verifying and transferring PriceOracle messages.", | ||
"main": "dist/main/", | ||
"module": "dist/module/", | ||
"typings": "dist/typings/", | ||
"type": "module", | ||
"main": "dist/index.cjs.js", | ||
"module": "dist/index.mjs.js", | ||
"typings": "dist/index.d.ts", | ||
"browser": { | ||
"OracleNetwork": false, | ||
"zeromq": false | ||
}, | ||
"sideEffects": false, | ||
"scripts": { | ||
"build": "npm run clean && npm run compile && npm run rollup && npm run post-processing", | ||
"build": "npm run clean && npm run compile && npm run rollup", | ||
"compile": "tsc", | ||
"clean": "del dist", | ||
"post-processing": "npm run remove-source-typing && npm run rename-zeromq && npm run rename-namespace", | ||
"jest": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest", | ||
"remove-source-typing": "del dist/*.d.ts", | ||
"rename-zeromq": "replace '../node_modules/zeromq/lib/index.js' 'zeromq' dist/typings/index.d.ts", | ||
"rename-namespace": "replace 'namespace' 'declare namespace' dist/typings/index.d.ts", | ||
"docs": "jsdoc -c jsdoc.json", | ||
"lint": "eslint .", | ||
"rollup": "rollup -c", | ||
"spellcheck": "cspell '**'", | ||
"test": "npm run build && c8 ava --timeout='60s' tests/*.js" | ||
"test": "npm run build && JEST_JUNIT_OUTPUT_NAME=unit-tests.xml npm run jest -- --selectProjects unit", | ||
"test:e2e": "npm run build && JEST_JUNIT_OUTPUT_NAME=e2e-tests.xml npm run jest -- --runInBand --selectProjects e2e " | ||
}, | ||
@@ -41,4 +48,4 @@ "repository": { | ||
"dependencies": { | ||
"@bitauth/libauth": "^1.18.1", | ||
"debug": "^4.3.1", | ||
"@bitauth/libauth": "^2.0.0-alpha.6", | ||
"debug": "^4.3.3", | ||
"json-arraybuffer-reviver": "^1.0.0", | ||
@@ -50,15 +57,19 @@ "zeromq": "^6.0.0-beta.6" | ||
"@generalprotocols/eslint-config": "git+https://gitlab.com/GeneralProtocols/eslint-config.git", | ||
"@types/debug": "^4.1.5", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"ava": "^3.15.0", | ||
"c8": "^7.7.1", | ||
"cspell": "^5.3.12", | ||
"@types/debug": "^4.1.7", | ||
"@types/jest": "^29.2.0", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"better-docs": "2.3.2", | ||
"cspell": "^5.17.0", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.25.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"docdash": "^1.2.0", | ||
"eslint": "^7.32.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"jest": "^29.2.2", | ||
"jest-junit": "^12.3.0", | ||
"jsdoc": "3.6.10", | ||
"replace": "^1.2.1", | ||
"rollup": "^2.46.0", | ||
"rollup-plugin-dts": "^1.4.14", | ||
"rollup": "^2.53.0", | ||
"rollup-plugin-dts": "^3.0.2", | ||
"typescript": "^4.2.4" | ||
} | ||
} |
@@ -5,2 +5,16 @@ # PriceOracle Libraries | ||
## Best Practices For Price Oracle Consumers | ||
Smart contracts can involve amounts of money ranging from tiny test amounts to large fortunes, and lock times from minutes to years. | ||
Below are some minimal considerations before you make a contract that depends on a price oracle. | ||
- As a starting point, never make large or long contracts with a price oracle that is in beta or that you have not done due diligence on. | ||
- Does the price oracle commit to strictly following the [specification](https://gitlab.com/GeneralProtocols/priceoracle/specification), and do you trust the commitment? | ||
- Does the price oracle commit to operation for the time period of my contract, and do you trust the commitment? | ||
- Do you trust the price oracle to maintain its security and not expose its signing key? | ||
Price oracle [metadata](https://gitlab.com/GeneralProtocols/priceoracle/specification#oracle-information-messages) answers most due diligence questions in a technical sense, but you must also consider the larger picture of how much trust you place in a price oracle's commitments. | ||
## Installation | ||
@@ -22,3 +36,3 @@ | ||
// Import the Price Oracle library. | ||
import { OracleData, OracleNetwork, OracleProtocol } from '@generalprotocols/price-oracle`; | ||
import { OracleData, OracleNetwork, OracleProtocol } from '@generalprotocols/price-oracle'; | ||
``` | ||
@@ -32,3 +46,3 @@ | ||
// Create an oracle price message from parts. | ||
const message = await OracleData.createPriceMessage(price, blockHeight, blockHash, blockSequence, oracleSequence, timestamp); | ||
const message = await OracleData.createPriceMessage(messageTimestamp, messageSequence, priceSequence, priceValue); | ||
@@ -35,0 +49,0 @@ // Parse an oracle price message into parts. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
157932
2946
0
149
Yes
18
6
1
1
- Removed@bitauth/libauth@1.19.1(transitive)
Updateddebug@^4.3.3