{"_id":"@authereum/bn-notify","_rev":"4-13d9b1e6b26800dc6c53f13278f5467b","name":"@authereum/bn-notify","dist-tags":{"beta":"0.0.1-beta.0","latest":"0.0.1-beta.0"},"versions":{"0.0.1-beta.0":{"name":"@authereum/bn-notify","version":"0.0.1-beta.0","main":"dist/cjs/index.js","module":"dist/esm/index.js","devDependencies":{"rollup":"^1.12.0","rollup-plugin-commonjs":"^10.0.0","rollup-plugin-json":"^4.0.0","rollup-plugin-livereload":"^1.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-node-builtins":"^2.1.2","rollup-plugin-svelte":"^5.0.3","rollup-plugin-terser":"^4.0.4","rollup-plugin-babel":"^4.3.3","rollup-plugin-node-globals":"^1.4.0","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","babel-eslint":"^7.1.1","babel-plugin-external-helpers":"^6.18.0"},"dependencies":{"bignumber.js":"^9.0.0","bn-sdk":"github:blocknative/bn-sdk#master","lodash.debounce":"^4.0.8","ow":"^0.13.2","regenerator-runtime":"^0.13.3","svelte":"^3.5.4","svelte-i18n":"^1.1.2-beta","uuid":"^3.3.3"},"scripts":{"prepare":"echo todo","prepare:1":"rollup -c","build":"npm run prepare","publish-module":"npm publish --tag beta --access public","dist-tag":"npm dist-tag add \"@authereum/bn-notify@$(jq -r .version <package.json)\" latest"},"gitHead":"bf3379b42e1cc2a4f3ea2a9656fc0697adc26d3f","description":"## Build","_id":"@authereum/bn-notify@0.0.1-beta.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-sk7bcJ5uBmT9HsDxote6+bLaauDbkbAB7ecdeNG1Eebda+D3F2k3E6mlabUYLLP4WtbAWdKwjxFhLIibX5p8Kg==","shasum":"f072acf0ab3b06749f5c0d70fe279bb19f7726f5","tarball":"https://registry.npmjs.org/@authereum/bn-notify/-/bn-notify-0.0.1-beta.0.tgz","fileCount":4,"unpackedSize":191060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlvEUCRA9TVsSAnZWagAAeREP/2Xuw+n631CQSNc70kDE\niYX54DaDVOjjPTIpoUkpiJ5+uHpknMvYl8zpfHBFtKhulKl0Q1h+h26r7X1m\nwPJAcKzzBRPp28D6mk31UFBvmfG5eBclqZycb5HDnnLrTxc0ds/KcypwOnBt\n2V9EP98fD6HYAwzb1ObT1wvd8IrwC6FARQ8QnTJDUMAGQiLsFqTs+5MG3dLX\nBNQ82z1ySQ4omqmXnUDNILnKdY6cNKAHAqOw2uCdAQCV2OWmeQxx1NtkAdjY\nPJfv5NMTpPRIRQWqd70uBMGNnwz608s4qkNDbxZKcr9ofIu6YulqjD44oNXs\n2dJBVnCPd4/TXHklYejtkusabgElxEhMcUYYThKHcvfZl11byF89nV0yEynv\nj4tYY+rb80GaS1LBy/+IItOExYj3nMWviNi7+Tk5k5K7pAzYn229kCltfMJt\nRKGHhdiSYbqGx3giw23I7EkWoOOEFkKQW27nCD3am47PVP8wVAhqCmo/giZN\nMWL5b1maL/ogL1WBT1ig9XEJFyKjEyXxolRs9Bu0hGRsOqN8w4Q33hPREy6u\nT3oCtbbDljro1veyrd0PzLs7RxYC13lL02cET0D69/zxjz01hWjz3k8sKOL+\n0NdU6+5MdaCbnHiWNA7mUJ0qsduVKaHzDs1750Sx3LMQ5k99RyXCZ624Kddq\nF2Mh\r\n=opOi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHCXLDOhWSZH3Iv9nkyHc/ZipqziOQQzGt+Yq15/x9MuAiEA1boazMK0YENlEkpYljalXLouUDumLAubThrxSQ7UqAg="}]},"maintainers":[{"name":"rstormsf","email":"rstormsf@gmail.com"},{"name":"cwhinfrey","email":"cwhinfrey@gmail.com"},{"name":"shanefontaine","email":"shane6fontaine@gmail.com"},{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bn-notify_0.0.1-beta.0_1570173204001_0.6404804831846214"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-04T07:13:23.773Z","0.0.1-beta.0":"2019-10-04T07:13:24.193Z","modified":"2022-04-04T16:31:37.079Z"},"maintainers":[{"email":"cwhinfrey@gmail.com","name":"cwhinfrey"},{"email":"shane6fontaine@gmail.com","name":"shanefontaine"},{"email":"hello@miguelmota.com","name":"miguelmota"}],"description":"## Build","readme":"# Notify\n\n## Build\n\n- Clone the repo\n- Run `npm install` to install the dependencies\n- `npm run build`\n\n## Usage\n\n### Initialize\n\n```javascript\nconst notify = Notify.init({\n  dappId: String, // Your api key - Head to https://www.blocknative.com/ to get a free key\n  networkId: Number, // The id of the network your dapp runs on\n  transactionEvents: Function // callback that is called for every transaction event with the transaction object and the result from the emitter for that transaction\n})\n```\n\n### Notifications\n\nregister a hash of a transaction to receive notifications for pending and confirmed statuses:\n\n```javascript\nconst { emitter } = notify.hash(hash)\n```\n\nto receive notifications for the full lifecycle of a transaction:\n\n```javascript\nconst { emitter, result } = notify.transaction({\n  sendTransaction: Function, // A function to call to send the transaction\n  // if sendTransaction not provided, then an object with id is returned to be passed to notify.hash after you have initiated the transaction yourself\n  estimateGas: Function, // A function to call to estimate the gas limit for this transaction (if not passed no sufficient balance check)(must return a string)\n  gasPrice: Function, // A funtion to get the current gas price (if not passed, no sufficient balance check)(must return a string)\n  balance: String, // The users' current balance (if not passed, no sufficient balance check)(must return a string)\n  txDetails: {\n    // if not passed no duplicate transaction check\n    to: String, // the address the transaction is being sent to\n    value: Number || String // the value of the transaction\n  }\n})\n```\n\n`result` is a promise that resolves with the `id` of the transaction or rejects with an error if there was an error initiating the transaction. The `id` is useful for when you would like to initiate the transaction yourself and didn't pass a `sendTransaction` function in to `transaction`. You can then send the transaction yourself, receive the hash, and then call `notify.hash(hash, id)`. By passing in the `id` to `hash` you enable notify to link the preflight notifications to the post send transaction notifications, ensuring a consistent UX.\n\n#### Emitter\n\nThe `emitter` object returned is used to listen for transaction events:\n\n```javascript\nemitter.on(\"txRepeat\", transaction => {\n  // return false for no notification\n  // no return (or return undefined) to show default notification\n  // return custom transaction object to show custom transaction, can return all or one of the following parameters:\n  return {\n    type: String, // ['hint' (gray), 'pending' (yellow), 'success' (green), 'error' (red)]\n    message: String, // The message you would like to display\n    autoDismiss: Number // The number of milliseconds before the notification automatically hides or false for no autodismiss\n  }\n})\n\n// You can also use the `all` event to register a listener for all events for that transaction. The `all` listener will only be called if there isn't a listener defined for the particular event:\n\nemitter.on(\"all\", transaction => {\n  // called on every event that doesn't have a listener defined on this transaction\n})\n```\n\n#### Event Codes\n\nThe following event codes are valid events to listen to on the transaction emitter:\n\n- `txRequest`: Transaction has been initiated and is waiting approval from the user\n- `txRepeat`: Transaction has the same value and to address, so may be a repeat transaction\n- `txAwaitingApproval`: A previous transaction is awaiting approval\n- `txConfirmReminder`: Transaction has not been confirmed after timeout\n- `txStallPending`: Transaction has not been received in the txPool after timeout\n- `txStallConfirmed`: Transaction has been in the txPool for longer than the timeout\n- `txError`: An error has occured with the transaction\n- `txSendFail`: The user rejected the transaction\n- `txUnderpriced`: The gas was set too low for the transaction to complete\n- `txPool`: Transaction is in the mempool and is pending\n- `txConfirmed`: Transaction has been mined\n- `txFailed`: Transaction has failed\n- `txSpeedUp`: A new transaction has been submitted with the same nonce and a higher gas price, replacing the original transaction\n- `txCancel`: A new transaction has been submitted with the same nonce, a higher gas price, a value of zero and sent to an external address (not a contract)\n- `txDropped`: Transaction was dropped from the mempool without being added to a block\n\n### Configuration\n\nThere are some configuration options available:\n\n```javascript\nnotify.config({\n  darkMode: Boolean, // (default: false)\n  mobilePosition: String, // 'top', 'bottom' (default: 'top')\n  desktopPosition: String, // 'bottomLeft', 'bottomRight', 'topLeft', 'topRight' (default: 'bottomRight')\n  txApproveReminderTimeout: Number, // (default: 20000)\n  txStallPendingTimeout: Number, // (default: 20000)\n  txStallConfirmedTimeout: Number // (default: 90000)\n})\n```\n","readmeFilename":"README.md"}