{"_id":"@blocktorch/0xdragon","_rev":"3-2c156708e4d77ec2ed02004938ee26aa","name":"@blocktorch/0xdragon","dist-tags":{"latest":"2.1.0"},"versions":{"2.0.0":{"name":"@blocktorch/0xdragon","version":"2.0.0","description":"Track web3 transactions in any JS project","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"fmt":"prettier --write src tests","fmt:check":"prettier --check src tests","lint":"eslint src tests","prepare":"husky install","prepublishOnly":"tsc","release":"npm version patch && npm publish . && git push && git push --tags","semantic-release":"semantic-release","test":"npx jest --watchAll --runInBand  --verbose"},"repository":{"type":"git","url":"git+https://github.com/blocktorch-xyz/dragon.git"},"keywords":["web3","ethereum","blockchain"],"author":{"name":"Amine Afia","email":"[amine@blocktorch.xyz](mailto:amine@blocktorch.xyz)","url":"mailto:amine@blocktorch.xyz"},"license":"MIT","bugs":{"url":"https://github.com/blocktorch-xyz/dragon/issues"},"homepage":"https://github.com/blocktorch-xyz/dragon#readme","dependencies":{"axios":"^1.3.4","axios-retry":"^3.4.0","detect-browser":"^5.3.0","uuid":"^9.0.0"},"devDependencies":{"@commitlint/cli":"^17.5.1","@commitlint/config-conventional":"^17.4.4","@semantic-release/commit-analyzer":"^9.0.2","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","eslint":"^8.36.0","eslint-config-prettier":"^8.8.0","ethers":"^5.7.2","husky":"^8.0.3","jest":"^29.5.0","jest-junit":"^15.0.0","prettier":"^2.8.7","semantic-release":"^21.0.0","ts-jest":"^29.0.5","typescript":"^5.0.2"},"publishConfig":{"access":"public","pkgRoot":"."},"jest":{"preset":"ts-jest","reporters":["default","jest-junit"]},"gitHead":"c27ec9a0af5e6240307c39113a2e2572039d81de","_id":"@blocktorch/0xdragon@2.0.0","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-1f7lAVfveaHrd0jecM8ESxl4PX+WhSBITmu9Ol19Ezwi/MzX8VKO/pmKBFNaFoU1qrdWgmHTADLeSgPwa5at9w==","shasum":"5c97de64cfeca275aebafb7da61c8f3d2c65ce44","tarball":"https://registry.npmjs.org/@blocktorch/0xdragon/-/0xdragon-2.0.0.tgz","fileCount":48,"unpackedSize":53872,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBr493Vo1gBY0MfHczSlbz4dFS4zyl6VMTxa4nLeAKiqAiEAonH0LflWRRFq2ZZHSCP/Ep1PxnxHL7Lp3/DcPI1iNAo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS6wiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2uA//WLSpd3u9ushqh0yyRZpOJvrrCXSjIP1tcrctCqnK2+IFisT/\r\n751ZH/895Q/I+h860sABYOYAjBLbB4uQQeOSuw/Y4egRjZP2mDf3XYRZzOD5\r\nEwm9gEz2Kh/tR5l8FEsS2wBQbeg7UXPtdwLDw654D9w1oxQe/96Jh8Z8+O6e\r\n8hY/O6Sl2/KrjpkcXWmz4W1Bz8NKWCxJmXgfqQ+4OV8TTaLf6+oHKjNjbdsS\r\ny66DAgpZ7hJMoXR1upfNBJCU6nNQQq34f8HowWdUtvJmBQjbZ0DxH8MfV+33\r\nVvh0rjJALZ4WEnX+c0uoATAyS5TTMsNFvFfr5gCbnIhZeUqLp7ttmIwdB/lJ\r\nfHDMpb+hazSsCSFnMjGdI0AYpQiqBvm4e7mygtvT7kgY0QYCrBZdk3NVUgcJ\r\nF84R3appucSxbVbFO4S1e3yXR5Hq4GMiMfyPZHGI/8YAFUA7RNLPag+3MuBS\r\nv+h1EZ5KtxSvHpt2+q5kz+Pu++qexPlMCkAApAL+Lu1xKXWf8fOqUOZ7+DnZ\r\niPIFAgYzfKX6BoXyJ9+GMKW47U5xl7lJu9l+QERz8OE75Awan2Sj9dBjrLeV\r\nYNoDYYlyEo+XRdshMblbOOmD8bJV820qzzaBGe1Dck/KcwTSpGESqW2EI4nW\r\nXdKj0iVT8wm3qzL0dGKEvy9BqJLKZoTMMX8=\r\n=20oV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blocktorch","email":"access@blocktorch.xyz"},"directories":{},"maintainers":[{"name":"blocktorch","email":"access@blocktorch.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/0xdragon_2.0.0_1682680866257_0.6477345773746883"},"_hasShrinkwrap":false},"2.1.0":{"name":"@blocktorch/0xdragon","version":"2.1.0","description":"Track web3 transactions in any JS project","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"fmt":"prettier --write src tests","fmt:check":"prettier --check src tests","lint":"eslint src tests","prepare":"husky install","prepublishOnly":"tsc","release":"npm version patch && npm publish . && git push && git push --tags","semantic-release":"semantic-release","test":"npx jest --watchAll --runInBand  --verbose"},"repository":{"type":"git","url":"git+https://github.com/blocktorch-xyz/dragon.git"},"keywords":["web3","ethereum","blockchain"],"author":{"name":"Amine Afia","email":"[amine@blocktorch.xyz](mailto:amine@blocktorch.xyz)","url":"mailto:amine@blocktorch.xyz"},"license":"MIT","bugs":{"url":"https://github.com/blocktorch-xyz/dragon/issues"},"homepage":"https://github.com/blocktorch-xyz/dragon#readme","dependencies":{"axios":"^1.3.4","axios-retry":"^3.4.0","detect-browser":"^5.3.0","uuid":"^9.0.0"},"devDependencies":{"@commitlint/cli":"^17.5.1","@commitlint/config-conventional":"^17.4.4","@semantic-release/commit-analyzer":"^9.0.2","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","eslint":"^8.36.0","eslint-config-prettier":"^8.8.0","ethers":"^5.7.2","husky":"^8.0.3","jest":"^29.5.0","jest-junit":"^15.0.0","prettier":"^2.8.7","semantic-release":"^21.0.0","ts-jest":"^29.0.5","typescript":"^5.0.2"},"publishConfig":{"access":"public","pkgRoot":"."},"jest":{"preset":"ts-jest","reporters":["default","jest-junit"]},"gitHead":"5dd153d3e1f5c1b71ec27db6f7109e62d210779b","_id":"@blocktorch/0xdragon@2.1.0","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-ayU7U6iY6e/gmF+sC4HMTyh1Juzn1uQ3RFe2IkWsfU5/Xr4ZTmyOXkyH8btOp+2kdjg4MfCJy1eQYLdWBehJmw==","shasum":"43cad96a2776e3ae1b71efdfb0a07520c7cf988b","tarball":"https://registry.npmjs.org/@blocktorch/0xdragon/-/0xdragon-2.1.0.tgz","fileCount":48,"unpackedSize":54810,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHz07+1rfXkMFJhy9vtwZvvRvT4o0h0pivKmmtTkwhBiAiEA7aK1DggNEIArTPa2/v93EEIqr0fTTqeaHzIz76Zy/Ok="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkU1vuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeFA/+MAqBrgTrij8nsTSb15VkgSum3/lv3iXkKEbknUvCtgwIBP7H\r\nhLCKvJn7SO3gQD7pZyY4R9+YhdK/5jUIY8S4gQFDwb8uaUi+5QlxXZ6k2ZMy\r\nRdiCOf2pSJo2iQ3SACb7SuMgCjLCwoBMDEMt9aUSI+VFcCoIto7uM11fumnf\r\nsbwkfhrXRgzF1rB6nzWtcOu5dzldhR+YL095r5AIef++BTWjUC0/E6URrDo/\r\nZ4sHYcdhBhVW2kPmQie2aCi0wDvess3oyui4ozxQc01zPNjPB0/KfLVlm6bu\r\n/Fw0jx3s5zV4si87e0WzyIH13s87k0cLEfjfKIZM+3QmZp74oBOy2yX3qT1B\r\ncwLoocUqsX9nPthibS7mE+i8eWFezoWkPRTicuAYqSHNNC+tCLMJnJt5q38t\r\nN+4GMxZpHtBEOxAQnmUgCTOFkoaf7P1v3TsC2dTkickyTm9WA/cMjEpY5vEZ\r\nVT2Asj9LwleIegirLAaEc1FxXc36IoFT127SDtG/neHtTNzNpMoo/4LiCD2w\r\n6B2Z+zOq19X0a0JnBeWQkWLtgfpVWzREkH09vWzTYsirJB8qmoHHcoI8V+Nf\r\nU/DWFww1bQsrzo6yHiH4urgL/yKkk6FsZT384InLlRLDv7ohvQ2SqseeXqW8\r\naUI7WKH0iCx20G6nxQa1aGcYzSgLTjxtUoc=\r\n=ZAjJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blocktorch","email":"access@blocktorch.xyz"},"directories":{},"maintainers":[{"name":"blocktorch","email":"access@blocktorch.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/0xdragon_2.1.0_1683184622229_0.16091351429207634"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-03T12:37:09.600Z","1.0.1":"2023-04-03T12:37:09.811Z","modified":"2023-05-04T07:17:02.639Z","2.0.0":"2023-04-28T11:21:06.405Z","2.1.0":"2023-05-04T07:17:02.494Z"},"maintainers":[{"name":"blocktorch","email":"access@blocktorch.xyz"}],"description":"Track web3 transactions in any JS project","homepage":"https://github.com/blocktorch-xyz/dragon#readme","keywords":["web3","ethereum","blockchain"],"repository":{"type":"git","url":"git+https://github.com/blocktorch-xyz/dragon.git"},"author":{"name":"Amine Afia","email":"[amine@blocktorch.xyz](mailto:amine@blocktorch.xyz)","url":"mailto:amine@blocktorch.xyz"},"bugs":{"url":"https://github.com/blocktorch-xyz/dragon/issues"},"license":"MIT","readme":"\n# :dragon_face: Blocktorch Dragon SDK :dragon_face:\n\nTrack failing and successful web3 client transactions and get insights about your customers!\n\n## Installation\n\n`npm install @blocktorch/0xdragon`\n\n## Usage\n\n### SDK initialization\nYou can get your project ID and api key from the Blocktorch app on the Settings page :rocket:\n```nodejs\nimport { Dragon } from '@blocktorch/0xdragon'\nconst dragon = new Dragon({\n\tprojectId: <your-project-id>,\n\tapiKey: <your-blocktorch-api-key>\n})\n```\nIn the constructor you can also specify additional options:\n- `contractName` (_string_) - default identifier for what the transactions are interacting with. Default is \"unknown\"\n- `chainId` (_number_) - chain ID of the application\n- `http` (_object_):\n  - `maxRetries` (_number_) - number of times failed SDK requests are retried\n  - `delay` (_number_) - number of times failed SDK requests are retried\n  - `exponentialBackoff` (_boolean_) - Whether to allow exponential backoff or not\n***\n### init(options?)\nInitialize the tracking of a single transaction\n```nodejs\nconst id = dragon.init()\n```\nYou can override options per transaction.\n- `contract` (_string_) - identifier for what the transaction is interacting with\n- `chainId`  (_number_) - id of the blockchain\n***\n### success(id, transaction)\nTrack the transaction as a success. Should be done after the transaction is accepted on chain.\n```nodejs\nawait dragon.success(id, transaction)\n```\n***\n### error(id, error)\nTrack the transaction as an error\n```nodejs\nawait dragon.error(id, error)\n```\n ***\n ### wrap(fn, options?)\n If you are using ethers@5 or any other compatible libraries you can use a helper function to wrap your whole transaction and it will detect success or failure itself.\n It will wait until the transaction receipt is received to mark it as a success.\n ```nodejs\nawait dragon.wrap(\n\tcontract.doSmth({ value:  ethers.utils.parseEther(\"0.1\") })\n)\n```\n You can also specify the following options:\n- `contract` (_string_) - identifier for what the transaction is interacting with\n- `chainId`  (_number_) - id of the blockchain\n***\n:dragon_face::dragon_face::dragon_face::dragon_face::dragon_face:\n\n[Check out Blocktorch](https://www.blocktorch.xyz)\n","readmeFilename":"README.md"}