{"_id":"@openzeppelin/defender-relay-client","_rev":"40-57b712f4eab5d22f17f691168abc2eb9","name":"@openzeppelin/defender-relay-client","dist-tags":{"rc":"1.54.0-rc.0","latest":"1.54.6"},"versions":{"1.45.0":{"name":"@openzeppelin/defender-relay-client","version":"1.45.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.45.0","maintainers":[{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"00e5476b4c348ed44fbc7630899ece53bde5d5e9","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.45.0.tgz","fileCount":34,"integrity":"sha512-7Ec0dGRGJwFS5lIKqFqQEKS8hvzWqM7Bp2ANSXNaaPwmqW9OQ1UFpEHBEFgN57S32LoeWcY+pXUwkoXm6TtVIQ==","signatures":[{"sig":"MEUCIBL+3CMIb8BlfSVzOQ4B6V8GOQiCmApfo/V4+WOzuHtRAiEA5GF0itfDCI+B78/ehcmpizZzmRsenSPncgvYdHsDFTI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":217100},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^0.21.2","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.45.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.45.0_1686610969553_0.34673735877582423","host":"s3://npm-registry-packages"}},"1.46.0":{"name":"@openzeppelin/defender-relay-client","version":"1.46.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.46.0","maintainers":[{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"4c937edfd049a7b8a5fa3f15e63d6c9d44cc5d37","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.46.0.tgz","fileCount":34,"integrity":"sha512-tkbNkdEaLZV0np32vX7c7/ExEuoWfyA4Q5WZzF7G09SWmbS38dvrBqRevT4bLDLgZcSvC0WU5jqBpQk1pqI8pw==","signatures":[{"sig":"MEUCIGhJPBH34orSQXpkpI+MoRG3Ujg1d3dk1BFdUBSYBxsCAiEAhI3CHRijlYSW2XB30xqkSy5yJ5S58h2jNK0roP1mmoQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":216194},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^0.21.2","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.46.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.46.0_1686722815309_0.805973040717636","host":"s3://npm-registry-packages"}},"1.47.0":{"name":"@openzeppelin/defender-relay-client","version":"1.47.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.47.0","maintainers":[{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"7c9bbedbed44d8deaa8a2e19a6a807dbb017929b","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.47.0.tgz","fileCount":34,"integrity":"sha512-JuGh4jEVfUWW/dZdXvaRTE1tkVQvO/vfYa/tMRW4E4zqyiGMvAxMU3JGpr3/XIlKs/VQYfr+eAbgH+Oas1ynIw==","signatures":[{"sig":"MEUCIQDzdGFzytAmyeVgA/Hit1lHPs2CFmtOk4cSY2WNgLGDHwIgZPmuB1QOgsxRbXTzwZ3gtdMQ+yUVerK6KZQG7dFqSvg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119822},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"12d67c544a12ff299c02fad3c8c1848e164e0e5b","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.47.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.47.0_1689178037588_0.08387923973036315","host":"s3://npm-registry-packages"}},"1.47.1":{"name":"@openzeppelin/defender-relay-client","version":"1.47.1","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.47.1","maintainers":[{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"5f62b3862d9e5b3122070bd897c1d03fb40736c3","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.47.1.tgz","fileCount":70,"integrity":"sha512-qH8lyixj8n5+1b12t/inGkyYxeF8l5I/g27VNf6UIbRKOlTcOjrrKuZ+pKJYBELyffoi+EBGb1TZsfDwvVrstw==","signatures":[{"sig":"MEQCIAgbEH5NMXEJWSQO9Vmm8epU2e3bie47shRI31tBCzQAAiB102izQicQ1c1Hp2Z+KX4Avo5oz2ytqAtinRsdjwsbJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190416},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"There are 2 modules included in this package:","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.47.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.47.1_1690545249982_0.7915102753748153","host":"s3://npm-registry-packages"}},"1.48.0":{"name":"@openzeppelin/defender-relay-client","version":"1.48.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.48.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"369e9840142db45c2f946d36eac9e9c86214d1d9","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.48.0.tgz","fileCount":35,"integrity":"sha512-PugfOGToP37wBIsdOF+oRP9wpi69kItv3yTUylMgU8373fTfHXxZuad5YXL7yKgEPMVWRkeNYVtGyKJHTA28Uw==","signatures":[{"sig":"MEQCID690Emfy8eQF2nR8w5Er1ewI0zsDGXyv+7yeMi14KhrAiBWVut1Nzt+NQy0dkm1osKNP3Ay5uh0HbZ8rgtulPBpEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120936},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/7.1.4/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.48.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.48.0_1691666409648_0.06257205874853922","host":"s3://npm-registry-packages"}},"1.49.0":{"name":"@openzeppelin/defender-relay-client","version":"1.49.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.49.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"b45aec310a3f90341f64eebef460e9b118186496","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.49.0.tgz","fileCount":70,"integrity":"sha512-aRPiL+DTfL7IBgRTsCbxiNpI3Yc/npM0XVy7FexE2X3EUevoJXaCKn+8q7+a44KVh05fmaMRHHqpBt68M+kiSg==","signatures":[{"sig":"MEUCIBa5jkXybLu+FA2BD6bFdQjdhVhxfGQPBrwGSi6ROtSaAiEApwQRLeIMLy3se7Z9DyjgE6Hxk4ZKM66TmfDMNtiMOJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":193767},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"There are 2 modules included in this package:","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.49.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.49.0_1696865695708_0.10710560576958694","host":"s3://npm-registry-packages"}},"1.50.0":{"name":"@openzeppelin/defender-relay-client","version":"1.50.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.50.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"78882b79818b4c67d0af40088937d07007ac8d45","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.50.0.tgz","fileCount":70,"integrity":"sha512-s8Sg45rhEpn5QN91UAUtskMeTvHO7GjUyuPU2w1lwc0D5NWkO/7FbNEdNVEFr28WMCv8vue3mNVJpri6cjOs/Q==","signatures":[{"sig":"MEUCIEcTA6vHh5pjn0Cf/Vd+DnRk2ZqTBEgaNqHXewkXudvhAiEA8u6PpmQEuOSuUROD1afxfd9XzSU80MgAZhFCUlDzfGM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":197899},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"There are 2 modules included in this package:","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.50.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.50.0_1698213222518_0.8828356727788471","host":"s3://npm-registry-packages"}},"1.51.0":{"name":"@openzeppelin/defender-relay-client","version":"1.51.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.51.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"d2b59e2421faa0c8db1ccded5192571d4ad52085","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.51.0.tgz","fileCount":70,"integrity":"sha512-oPl8EC1162DDqF9tx4hzSjXLBTP//pGpaIcb9RTjO0Zs0EwuoWW39uN7YvoomMGo6k5Z+JI9YCdBknazSvahIg==","signatures":[{"sig":"MEQCIAFMCMpgZ4LYy3nDU4Huy8D22FNbJspF93yImO56eFwQAiAsBIz9B3HHcLYARtep9lwcJWVrBTdMmJvcmDYo6ysGvg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":197899},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"There are 2 modules included in this package:","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.51.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.51.0_1699377999079_0.6907645451631843","host":"s3://npm-registry-packages"}},"1.52.0":{"name":"@openzeppelin/defender-relay-client","version":"1.52.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.52.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"77fee451332bfa08d80108531bebc1ff910e1ba1","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.52.0.tgz","fileCount":34,"integrity":"sha512-9W4/LrtAjKKjoplegjc8Jy/ALjhuAaCOZJsxckCwKcKozT5Opjt2UQojoOTlv/hKd7qOrA9Uca9OS2LkUa9cqg==","signatures":[{"sig":"MEQCIDr08s5FsEpIBoYjtGULlHb7R5jXK6zmBDGppSfWlPUIAiB6+SPpxSZnp2KZ9LBqJz9O2ghvVrjceQITukjAQtQqpw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125370},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"3ed4bed14249f4d412d118d3067e6128c41bb76d","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.52.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.52.0_1699580173682_0.29660744681064566","host":"s3://npm-registry-packages"}},"1.52.0-rc.0":{"name":"@openzeppelin/defender-relay-client","version":"1.52.0-rc.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.52.0-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"d55de1fc862bdba8ead31641f1575f36d7ebe070","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.52.0-rc.0.tgz","fileCount":35,"integrity":"sha512-w68Q/07MPuWPmd+rIR3uv/+qV4Pch6lxbcOCDTOND95lrH7E0ZLk9tUq6eQZyp86Y/NWp0UyPq+vDnnjyCgFhA==","signatures":[{"sig":"MEUCIQD7Zwo31T+GqEcYY1haqsHvxLj4zbyUV7+LO8E8UooG3wIgMfE7tF6yIh1gaEvc0xKH8X1kAmV1e8N/l6kdaVE4sWk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126494},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.52.0-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.52.0-rc.0_1700116500469_0.11860286427423561","host":"s3://npm-registry-packages"}},"1.52.0-rc.1":{"name":"@openzeppelin/defender-relay-client","version":"1.52.0-rc.1","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.52.0-rc.1","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"bfb768e7e83194cc840951eec9e81aa1eee695b5","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.52.0-rc.1.tgz","fileCount":35,"integrity":"sha512-kobNVipTFSmr/022l+wwAasVLz56Be1YkovC0FBrjc1AuDzwAAFwmAldXt63h2ZCmsR/YO+99QkXfxdUzMWCIQ==","signatures":[{"sig":"MEUCIGTxwrqj5fL8lV5TlVHmDm6Q2PAMi/Q1mc+Xjt3eDR/VAiEAyqTonaYSrIU++9eB6Q7mznwq8tN/+pGIB7/6ysMbXzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.52.0-rc.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":126601},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.52.0-rc.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.52.0-rc.1_1700133453316_0.7630525859967632","host":"s3://npm-registry-packages"}},"1.52.0-rc.2":{"name":"@openzeppelin/defender-relay-client","version":"1.52.0-rc.2","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.52.0-rc.2","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"3e1eecf91cc2e253ce1d9191339ca0121db13119","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.52.0-rc.2.tgz","fileCount":35,"integrity":"sha512-E075ZdJ2w5GLnd/0ZXBX2VqAp0OcWBjovPuar62GiHCsiK0FsSKX167/ioCG7Y6wdmYI4YWtWOVQ19XjLPsRZw==","signatures":[{"sig":"MEUCIQCGlHYgwIL4dXwpCsUbJ8EYnig4l661UUcG/9XRYlNGPwIgeQHvvvCQ6AuQ9+dv/HI/iK1Rs+klQHdhPj0t8MuDzcY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.52.0-rc.2","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":126601},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.52.0-rc.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.52.0-rc.2_1700135227567_0.7213629775945256","host":"s3://npm-registry-packages"}},"1.52.0-rc.3":{"name":"@openzeppelin/defender-relay-client","version":"1.52.0-rc.3","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.52.0-rc.3","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"6c5652308902b0984cce2c180bab35435f7cdd17","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.52.0-rc.3.tgz","fileCount":35,"integrity":"sha512-lj7Iim2S92wQz/tXTpGnSGhCYOJmnjLuLHP/AN4BcoRj4q96p33jvUmAKWsZ4Mj3C5Xcsyz2hmq4GK3Hyt8y2Q==","signatures":[{"sig":"MEUCIG1jbmFy8UKEIMcPe16fSSDMbNEPp5Z9PkaKX60VFHmvAiEA6m4jugbubs0DrKCFln+8yaCx14kyjtMjqcfIQTs98Y0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.52.0-rc.3","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":126601},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"ae9f6d4fedfe98d19a663cd803aa0ea900cc4b29","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.52.0-rc.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.52.0-rc.3_1700139753582_0.5360452263069262","host":"s3://npm-registry-packages"}},"1.52.1-rc.0":{"name":"@openzeppelin/defender-relay-client","version":"1.52.1-rc.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.52.1-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"0126ea5a86ed723bf4bf66b828cdd0705dbb423e","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.52.1-rc.0.tgz","fileCount":3,"integrity":"sha512-PBR7J+HlanlZFnh8r4W7Tj1hH+j77zipaYfVPcvs7AKa0pFJ2/ajHqa/8EggxsZHp15BAUbtngGm23nGlv2Fyg==","signatures":[{"sig":"MEUCIQCBh7X+UEIcOkzwIbvzfGEKIG6kPeyMPdvKgW23n5lROgIgOJYYDoO67MtLhn7rkpr8lBhl38w0oVyeGVlLR6DcpVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.52.1-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":19151},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"75f2dd88ddd843a57b592a47885b3d1e653cbc94","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.52.1-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.52.1-rc.0_1700405078176_0.22546029707851334","host":"s3://npm-registry-packages"}},"1.53.0-rc.0":{"name":"@openzeppelin/defender-relay-client","version":"1.53.0-rc.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.53.0-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"8ddbba2fff851e108c3fcf0cd19c6ef00a42fb6b","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.53.0-rc.0.tgz","fileCount":3,"integrity":"sha512-Om8ZNPGsnHFa0SZh9AklC5FfGYauIruDoLfAhvjpKIJhZMUhY3P4hKCe+XFcezPase7YyKup9WDeJEYXaR0QXw==","signatures":[{"sig":"MEYCIQDATKqham7scBYRiGNxBpDp6LAl5O0huQjq/J6QBNuCcAIhAI0cwi2YJ5bk/57Q8s/4DN/z0nb8BRjh538SyxqpxZfn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.53.0-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":19151},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"1df9d1d1b44ceeced693bb24444d4edc1effa3e0","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.2/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.53.0-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.53.0-rc.0_1701162940652_0.9441416397257156","host":"s3://npm-registry-packages"}},"1.54.0-rc.0":{"name":"@openzeppelin/defender-relay-client","version":"1.54.0-rc.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.0-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"8642617b6f1fb27f1fc38286488d5322bc04f789","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.0-rc.0.tgz","fileCount":3,"integrity":"sha512-xYGVZsi0MPeJT2+u9z189ZVKwMaA3nrXyIITVz/5HYc1yxulJVAv5xwkMVMvtiwL1bryaEeNTE95Q7sH2+cn6g==","signatures":[{"sig":"MEUCIQDjc+f07MlGsqQ3SaJH/m3/BekAH4PztolcmGpD2j0cCQIgDN+14SfhjLF20SifDxVT5nxZOQXXaJbJDWXbYkCra9w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.54.0-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":19151},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'goerli',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","gitHead":"f5a404590be2debd3a98bb7cd02820a3b035ab2c","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/8.0.0/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.0-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.0-rc.0_1701822122585_0.2757753275376744","host":"s3://npm-registry-packages"}},"1.54.0":{"name":"@openzeppelin/defender-relay-client","version":"1.54.0","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"bb177e2bd4048a95ecccfc43a0176aa089612056","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.0.tgz","fileCount":3,"integrity":"sha512-zx6bt4zDA9msuPzO2yjaVwGRJ9aFcFyqPcrbRQgzbKkT4pNFWc8BIno3zyfmT5q7lrag7aCHaDqtrJrUNKy8vw==","signatures":[{"sig":"MEUCIQDUCw1eTsCjuSSJ6wLn1EE6KPQjeGG8LIFmjXBMWlcW2QIgV4pIEJgyD1WSV5FwseqwrbGnqlaQ5LHFIgQd0OHsddY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-relay-client@1.54.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":19141},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"035dacd398375dc70295063aba5ce81f76b90f55","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/8.0.0/node@v16.20.0+x64 (linux)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.0_1701985019440_0.34737262775223154","host":"s3://npm-registry-packages"}},"1.54.1":{"name":"@openzeppelin/defender-relay-client","version":"1.54.1","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.1","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"5dcd83873dabdd4067c1cf017357ccb9452d64aa","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.1.tgz","fileCount":34,"integrity":"sha512-v8VK0OEPfeK81EfzfQA8ieWrXPXY38EA3fXcOrBBFkFTDMJib2zno7Ust9gnyjItvd1o5MyCY1VdxEtamAwyHw==","signatures":[{"sig":"MEQCIDS6Of3j3suRCmjXiiHHdCAgOXNyjyAvctu9Nj+AxbTSAiB31N62uQ9FPTdXihM6FzvV51OZBjETnHXlfufwxGaxnw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123264},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"ff20768e5718ebff4bccc199508834bb7219f7c1","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.1_1702021215449_0.6775453178801258","host":"s3://npm-registry-packages"}},"1.54.2":{"name":"@openzeppelin/defender-relay-client","version":"1.54.2","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.2","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"82f4258eab5000a7dae87b15b528bcb4b966de96","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.2.tgz","fileCount":34,"integrity":"sha512-S93RRaywwfNMbHtbRWisw7ZKBCzHtdoPkNC4K8QaZ8usbJQP74v6unOFJ19s62iVi++6UO5QqqUkxdcFsfe7Dg==","signatures":[{"sig":"MEUCIAoIW4yYBF6buVY2/0zhSOKMTnYW8SQbFHTrKaSfwrC/AiEAmsDt3DkDw5xvm//sQKUlAdzyeYqB6O/nlq+MohspW7Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":128094},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a4f42ccd3773997da730ed215a2600dc94aefd43","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.1+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"16.20.1","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.2_1715802967684_0.2724377837455838","host":"s3://npm-registry-packages"}},"1.54.3":{"name":"@openzeppelin/defender-relay-client","version":"1.54.3","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.3","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"bca193d3df44356b99adb78592b6c5c3622fe7e1","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.3.tgz","fileCount":72,"integrity":"sha512-7x3DkL2lTBQnuMnHRqS+7AqxVMr6KJtK4GAeYK4kYNJezXzjGHn3OSgf6g/IlFCAOJTjMFQTcKusj+Gr2dnSUQ==","signatures":[{"sig":"MEUCIDgmF/jPlabsNrB5NCNMcSHiArcIO+voCeDiQDXJy2e5AiEApLT11UN/8/lDhH+jJWdHxh7nvrZvb428mVxCrpul1Oc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":199068},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"https://github.com/OpenZeppelin/defender-client.git","type":"git"},"description":"There are 2 modules included in this package:","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.3_1716053436597_0.4062641187415197","host":"s3://npm-registry-packages"}},"1.54.4":{"name":"@openzeppelin/defender-relay-client","version":"1.54.4","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.4","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"613c75436fcd15e53c3ae20df7a4288081559f0a","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.4.tgz","fileCount":72,"integrity":"sha512-AgPw4FY7RK9ZaWpPEIqeayBPIlOg/ltvviiBc+bV5fXWXdJQ77iw8Lbv7KrS9pZ21TcgblbRtE3T1epq21tbrg==","signatures":[{"sig":"MEUCIH4b7sEEhOzBmKAX9tJP1T86Xk2AJM5LE80evnEWC+5aAiEA6dfLjPWdUl5yQAlzhpLXFqT8xHs41taHV2w7BU/OUNA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":198828},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a7c4808dd11e708df42d110de230c264061c72c3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"https://github.com/OpenZeppelin/defender-client.git","type":"git"},"description":"There are 2 modules included in this package:","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.4_1716188996289_0.051200104152824055","host":"s3://npm-registry-packages"}},"1.54.5":{"name":"@openzeppelin/defender-relay-client","version":"1.54.5","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.5","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"444323f2ee1312d981b40e0360d01f760407a4ef","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.5.tgz","fileCount":34,"integrity":"sha512-tie1bz5QA69aGIGKpY4rswb9qlc963BYDkeN49F9IL3E6fP/h9eTmQlbLCGjGcV04uLT8RgPZr2dtwD09dvD1Q==","signatures":[{"sig":"MEUCIFRtvdKL20tpTFtW+vTZY4NGTOYR0g4Jyu00MMgARXtAAiEAls47lmISw1Gd2uaWQXv+2FPtoXVe7svOos7NHKvuBnA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":129684},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"0fc43da796268b8c75d70179c7ea649b160dfd06","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v20.11.1+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"20.11.1","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.5_1716415322823_0.00701658102860625","host":"s3://npm-registry-packages"}},"1.54.6":{"name":"@openzeppelin/defender-relay-client","version":"1.54.6","author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-relay-client@1.54.6","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"c61ba575d9a890ab985a430420444edcedbb4eff","tarball":"https://registry.npmjs.org/@openzeppelin/defender-relay-client/-/defender-relay-client-1.54.6.tgz","fileCount":34,"integrity":"sha512-eLmR8RPqkwo8TIFVLdyi0GhHZAF+5pDHR1iI2uP4YVyknUl6s5yIz+OsGCX539WA2HgJtp6ct2ufBaEQ4tIaCA==","signatures":[{"sig":"MEUCIQD0tKKmPi1iFK3sEcN1sCjLDqam7pLGyQsXPf3We0pUcgIgAzgFFO7zqgP6Oe+Z3O1eBB5u7y4dtWYIeQDmav/zliY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127931},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"9eea3f7d413b8647b20e7b77a1c4ecd4186e4ed3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v20.11.1+arm64 (darwin)","description":"There are 2 modules included in this package:","directories":{},"_nodeVersion":"20.11.1","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","amazon-cognito-identity-js":"^6.0.1","@openzeppelin/defender-base-client":"1.54.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","jest-mock-extended":"^1.0.15","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"peerDependencies":{"web3-core":"^1.8.2","web3-core-helpers":"^1.8.2","@ethersproject/hash":"^5.6.1","@ethersproject/providers":"^5.6.8","@ethersproject/transactions":"^5.6.2","@ethersproject/abstract-signer":"^5.6.2","@ethersproject/abstract-provider":"^5.6.1"},"_npmOperationalInternal":{"tmp":"tmp/defender-relay-client_1.54.6_1716451907506_0.15845392363159805","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-06-12T23:02:49.464Z","modified":"2026-09-24T16:19:18.616Z","1.45.0":"2023-06-12T23:02:49.774Z","1.46.0":"2023-06-14T06:06:55.509Z","1.47.0":"2023-07-12T16:07:17.813Z","1.47.1":"2023-07-28T11:54:10.150Z","1.48.0":"2023-08-10T11:20:09.867Z","1.49.0":"2023-10-09T15:34:55.957Z","1.50.0":"2023-10-25T05:53:42.715Z","1.51.0":"2023-11-07T17:26:39.411Z","1.52.0":"2023-11-10T01:36:13.960Z","1.52.0-rc.0":"2023-11-16T06:35:00.715Z","1.52.0-rc.1":"2023-11-16T11:17:33.604Z","1.52.0-rc.2":"2023-11-16T11:47:07.756Z","1.52.0-rc.3":"2023-11-16T13:02:33.789Z","1.52.1-rc.0":"2023-11-19T14:44:38.332Z","1.53.0-rc.0":"2023-11-28T09:15:40.871Z","1.54.0-rc.0":"2023-12-06T00:22:02.771Z","1.54.0":"2023-12-07T21:36:59.628Z","1.54.1":"2023-12-08T07:40:15.649Z","1.54.2":"2024-05-15T19:56:08.025Z","1.54.3":"2024-05-18T17:30:36.751Z","1.54.4":"2024-05-20T07:09:56.460Z","1.54.5":"2024-05-22T22:02:03.048Z","1.54.6":"2024-05-23T08:11:47.695Z"},"bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"author":{"name":"Igor Yalovoy","email":"igor@openzeppelin.com"},"license":"MIT","homepage":"https://github.com/OpenZeppelin/defender-client#readme","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"description":"There are 2 modules included in this package:","maintainers":[{"email":"collins.wekesa@openzeppelin.com","name":"collins-oz"},{"email":"tirumerla@gmail.com","name":"tirumerla"},{"email":"son.dinh@openzeppelin.com","name":"son-oz"}],"readme":"# Defender Relay Client & Signer\n\nThere are 2 modules included in this package:\n\n1. Defender Relay Client\n\n- Execute create, read, and update operations across all relayers within an account (and associated relayer keys)\n- Authenticates with bearer token generated using Team API Key/Secret (available when Team API Key is created)\n\n2. Defender Relay Signer\n\n- Execute send, sign, and other operations using a specific relayer\n- Authenticates with bearer token generated using Relayer API Key/Secret (available when relayer is created)\n\n# End Of Support Notice\n\nWe will no longer be maintaining or supporting any additional releases for defender-client. Please migrate to defender-sdk as soon as possible to get all the benefits of defender 2.0 and more.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-relay-client\n```\n\n```bash\nyarn add @openzeppelin/defender-relay-client\n```\n\n## Relay Client\n\nDefender Relay Client enables creating, reading, and updating relayers and their associated API keys.\n\n### Usage\n\nTo get started, instantiate `RelayClient`:\n\n```js\nimport { RelayClient } from '@openzeppelin/defender-relay-client';\nconst relayClient = new RelayClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n#### Create\n\nCreate a new relayer:\n\n```js\nconst requestParameters = {\n  name: 'MyNewRelayer',\n  network: 'sepolia',\n  minBalance: BigInt(1e17).toString(),\n  policies: {\n    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],\n  },\n};\n\nawait relayClient.create(requestParameters);\n```\n\nCreate its associated API key:\n\n```js\nawait relayClient.createKey('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Read\n\nFetch data for a single relayer:\n\n```js\nawait relayClient.get('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nAll relayers in your account:\n\n```js\nawait relayClient.list();\n```\n\nAll API keys associated with an individual relayer:\n\n```js\nawait relayClient.listKeys('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\n#### Update\n\n```js\nawait relayClient.update('58b3d255-e357-4b0d-aa16-e86f745e63b9', { name: 'Test 2' });\n```\n\n#### Delete\n\n```js\nawait relayClient.deleteKey('58b3d255-e357-4b0d-aa16-e86f745e63b9', 'j3bru93-k32l-3p1s-pp56-u43f675e92p1');\n```\n\n_Note: second argument to `deleteKey` is the `keyId` (contains hyphens), not the `apiKey`. This can be fetched via the `listKeys` method above and is also available in the response on key creation._\n\nDeletion of a relayer (not just a key) is only available via the Defender console.\n\n## Relay Signer\n\nDefender Relay Signer lets you send transactions to any supported network using private relayers. Each relayer has its own secure private key, and a set of API keys. You can send transactions via your relayers by POSTing to the Defender HTTP API, or using this library.\n\nThis library also includes an [ethers.js](https://docs.ethers.io/v5/) signer and a [web3.js](https://web3js.readthedocs.io/) provider, that uses the Relay to sign and broadcast its transactions.\n\n### Usage\n\nStart by creating a new relayer using either the Defender console or API for a network of your choice. Write down the API key and secret. Then use them to create a new `Relayer` instance in your code:\n\n```js\nimport { Relayer } from '@openzeppelin/defender-relay-client';\nconst relayer = new Relayer({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\nAnd use the relayer instance to send a transaction:\n\n```js\nconst tx = await relayer.sendTransaction({\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x16345785d8a0000',\n  data: '0x5af3107a',\n  speed: 'fast',\n  gasLimit: 100000,\n});\n```\n\nThe `sendTransaction` call returns once the transaction has been _signed_ by the relayer. To monitor the transaction status, see [Querying](#Querying) below.\n\n#### Speed\n\nInstead of the usual `gasPrice` or `maxFeePerGas`/`maxPriorityFeePerGas`, the Relayer may also accept a `speed` parameter that can be one of `safeLow`, `average`, `fast`, or `fastest`. These values are mapped to actual gas prices when the transaction is sent or resubmitted and vary depending on the state of the network.\n\nIf `speed` is provided, the transaction would be priced according to the `EIP1559Pricing` relayer policy.\n\nNOTE: Mainnet gas prices and priority fees are calculated based on the values reported by [EthGasStation](https://ethgasstation.info/), [EtherChain](https://etherchain.org/tools/gasPriceOracle), [GasNow](https://www.gasnow.org/), [BlockNative](https://docs.blocknative.com/gas-platform), and [Etherscan](https://etherscan.io/gastracker). In Polygon and its testnet, the [gas station](https://gasstation-mainnet.matic.network/v2) is used. In other networks, gas prices are obtained from a call to `eth_gasPrice` or `eth_feeHistory` to the network.\n\n#### Return data\n\nThe returned transaction object `tx` will have the following shape:\n\n```ts\ninterface RelayerTransactionBase {\n  transactionId: string; // Defender transaction identifier\n  hash: string; // Ethereum transaction hash\n  to: string;\n  from: string;\n  value?: string;\n  data?: string;\n  speed: 'safeLow' | 'average' | 'fast' | 'fastest';\n  gasLimit: number;\n  nonce: number;\n  status: 'pending' | 'sent' | 'submitted' | 'inmempool' | 'mined' | 'confirmed' | 'failed';\n  chainId: number;\n  validUntil: string;\n}\n\ninterface RelayerLegacyTransaction extends RelayerTransactionBase {\n  gasPrice: number;\n}\n\ninterface RelayerEIP1559Transaction extends RelayerTransactionBase {\n  maxPriorityFeePerGas: number;\n  maxFeePerGas: number;\n}\n\ntype RelayerTransaction = RelayerLegacyTransaction | RelayerEIP1559Transaction;\n```\n\n### Querying transactions\n\nThe `relayer` object also has a `query` function that returns a transaction object as described above. This method receives the `transactionId`, **not** the transaction `hash`:\n\n```js\nconst latestTx = await relayer.query(tx.transactionId);\n```\n\nAlternatively, the `relayer` can also be used to `list` the latest transactions sent, optionally filtering by status and creation time.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n});\n```\n\nWe have added support for pagination to the `list` operation. To enable pagination, you can set the `usePagination` parameter to true.\n\n```js\nconst since = await relayer.list({\n  since: new Date(Date.now() - 60 * 1000),\n  status: 'pending', // can be 'pending', 'mined', or 'failed'\n  limit: 5,\n  usePagination: true,\n  sort: 'desc', // available only in combination with pagination\n  next: '', // optional: include when the response has this value to fetch the next set of results\n});\n```\n\nThe `list` function now accepts several parameters to facilitate pagination, such as limit, usePagination, sort, and next. The sort parameter is available only when pagination is enabled, and the next parameter is optional, used to fetch the next set of results when included in the response.\n\nWhen using pagination by setting `usePagination` to `true`, the format of the response will be different from the default.\nThe response will be an object containing two properties: `items` and `next`. The items property is an array of `RelayerTransaction` objects, representing the fetched list of transactions. The next property is an optional string. If present, it can be used as the value for the next parameter in a subsequent request to retrieve the next set of transactions.\n\n```js\n{ items: RelayerTransaction[]; next?: string }\n```\n\nDefender will update the transaction `status` every minute, marking it as `confirmed` after 12 confirmations. The transaction information will be stored for 30 days.\n\n#### Why querying?\n\nThe `query` function is important to monitor the transaction status, since Defender may choose to _resubmit the transaction with a different gas price_, effectively changing its hash. This means that, if you monitor your transaction only via `getTransactionReceipt(tx.hash)` calls to a node, you may not get the latest info if it was replaced.\n\nDefender may replace a transaction by increasing its gas price if it has not been mined for a period of time, and the gas price costs have increased since the transaction was originally submitted. Also, in a case where a transaction consistently fails to be mined, Defender may replace it by a _no-op_ (a transaction with no value or data) in order to advance the sender account nonce.\n\n### Relayer Status\n\nTo gain better insight into the current status of a relayer, you can use the `getRelayerStatus` method. This method provides real-time information about a relayer, such as its nonce, transaction quota, and the number of pending transactions.\n\nTo get the current status of a relayer:\n\n```js\nconst status = await relayer.getRelayerStatus('58b3d255-e357-4b0d-aa16-e86f745e63b9');\n```\n\nThe response will be of the shape:\n\n```js\nexport interface RelayerStatus {\n  relayerId: string; // Unique identifier for the relayer\n  name: string; // Name of the relayer\n  nonce: number; // Current relayer nonce\n  address: string; // Address of the relayer\n  numberOfPendingTransactions: number; // Number of transactions: pending|sent|submitted|inmempool\n  paused: boolean; // If the relayer is paused or not\n  pendingTxCost?: string; // The total cost of all pending transactions, if available\n  txsQuotaUsage: number; // Used transaction quota for the relayer\n  rpcQuotaUsage: number; // Used RPC quota for the relayer\n  lastConfirmedTransaction?: {\n    // Details of the last confirmed transaction\n    hash: string,\n    status: string,\n    minedAt: string,\n    sentAt: string,\n    nonce: number,\n  };\n}\n```\n\nThis method can be particularly helpful in monitoring and managing your relayer resources more effectively.\n\n### Replacing transactions\n\nYou can use the relayer methods `replaceTransactionById` or `replaceTransactionByNonce` to replace a transaction given its nonce or transactionId (not hash) if it has not been mined yet. You can use this to increase the speed of a transaction, or replace your tx by an empty value transfer (with a gas limit of 21000) to cancel a transaction that is no longer valid.\n\n```js\n// Cancel a transaction with nonce 42 by sending a zero-value transfer to replace it\nconst tx = await relayer.replaceTransactionByNonce(42, {\n  to: '0x6b175474e89094c44da98b954eedeac495271d0f',\n  value: '0x00',\n  data: '0x',\n  speed: 'fastest',\n  gasLimit: 21000,\n});\n```\n\nYou can also replace by nonce using the `ethers.js` and `web3.js` adapters listed below.\n\n### Signing\n\nYou can sign any hex string (`0x123213`) according to the [EIP-191 Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191) (prefixed by `\\x19Ethereum Signed Message:\\n`) using a `sign` method of the relayer. Pay attention, that the message has to be a **hex string**.\n\n```js\nconst signResponse = await relayer.sign({ message: msg });\n```\n\nAlso, you can sign typed data according to the [EIP-712 Specification](https://eips.ethereum.org/EIPS/eip-712) using a `signTypedData` method of the relayer by providing both the `domainSeparator` and the `hashStruct(message)` as parameters. Heads up that both are hashes so they should be 32-bytes long.\n\n```js\nconst signTypedDataResponse = await relayer.signTypedData({\n  domainSeparator,\n  hashStructMessage,\n});\n```\n\n#### Return data\n\nOnce your data is signed, the following response will be returned:\n\n```js\nexport interface SignedMessagePayload {\n  sig: Hex;\n  r: Hex;\n  s: Hex;\n  v: number;\n}\n```\n\n### Network calls\n\nYou can also use Defender for making arbitrary JSON RPC calls to the network via the `call` method. All JSON RPC methods are supported, except for event filters and websocket subscriptions.\n\n```js\nconst balance = await relayer.call('eth_getBalance', ['0x6b175474e89094c44da98b954eedeac495271d0f', 'latest']);\n```\n\n### Ethers.js\n\nYou can use the `defender-relay-client` with [ethers.js v5](https://github.com/ethers-io/ethers.js/) directly. The package exports a `DefenderRelaySigner` [signer](https://docs.ethers.io/v5/api/signer/) that is used to send transactions, and a `DefenderRelayProvider` [provider](https://docs.ethers.io/v5/api/providers/) that is used to make calls to the network through Defender.\n\nMake sure to have `ethers` installed in your project, and initialize a new defender signer instance like:\n\n```js\nconst { DefenderRelayProvider, DefenderRelaySigner } = require('@openzeppelin/defender-relay-client/lib/ethers');\nconst { ethers } = require('ethers');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials);\nconst signer = new DefenderRelaySigner(credentials, provider, { speed: 'fast' });\n```\n\nYou can then use it to send any transactions, such as executing a contract function. The `tx` object returned will be a regular ethers.js `TransactionResponse` object, with the addition of Defender's `transactionId` field.\n\n```js\nconst erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);\nconst tx = await erc20.functions.transfer(beneficiary, (1e18).toString());\nconst mined = await tx.wait();\n```\n\nThe `signMessage` method is supported as well, allowing to sign an arbitrary data with a relayer key.\n\n```js\nconst signed = await signer.signMessage('Funds are safu!');\n```\n\nThe `_signTypedData` method is also supported to sign [EIP712](https://eips.ethereum.org/EIPS/eip-712) messages\n\n```js\nconst signedEIP712Message = await signer._signTypedData(domain, types, value);\n```\n\n#### Limitations\n\nThe current implementation of the `DefenderRelaySigner` for ethers.js has the following limitations:\n\n- Due to validations set up in `ethers.js`, it is not possible to specify the transaction `speed` for an individual transaction when sending it. It must be set during the signer construction, and will be used for all transactions sent through it.\n- A `wait` on the transaction to be mined will only wait for the current transaction hash (see [Querying](#Querying)). If Defender Relayer replaces the transaction with a different one, this operation will time out. This is ok for fast transactions, since Defender only reprices after a few minutes. But if you expect the transaction to take a long time to be mined, then ethers' `wait` may not work. Future versions will also include an ethers provider aware of this.\n\n### Web3.js\n\nYou can also use the `defender-relay-client` with [web3.js](https://web3js.readthedocs.io/) via a `DefenderRelayProvider` which routes all JSON RPC calls through Defender, and uses a Relayer for signing and broadcasting transactions.\n\n```js\nconst { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');\nconst Web3 = require('web3');\n\nconst credentials = { apiKey: API_KEY, apiSecret: API_SECRET };\nconst provider = new DefenderRelayProvider(credentials, { speed: 'fast' });\nconst web3 = new Web3(provider);\n```\n\nYou can then use the `web3` instance to query and send transactions as you would normally do:\n\n```js\nconst [from] = await web3.eth.getAccounts();\nconst erc20 = new web3.eth.Contract(ERC20_ABI, ERC20_ADDRESS, { from });\nconst tx = await erc20.methods.transfer(beneficiary, (1e18).toString()).send();\n```\n\nYou can also sign messages using the Relayer key via the `sign` method:\n\n```js\nconst signature = await web3.eth.sign('0xdead', from);\n```\n\nThe package also includes two composable lower-level providers, the `DefenderRelaySenderProvider` and `DefenderRelayQueryProvider`. The former intercepts all `sendTransaction` methods and serves them via the Relayer, while the latter uses Defender's JSON RPC interface for all method calls. The `DefenderRelayProvider` shown above combines the two.\n\nNote that these web3.js providers currently have the same limitations as the ethers.js one described above.\n\n### Using in Autotasks\n\n[Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) natively support integration with Defender Relay, allowing to send transactions without providing API keys. In your autotask's code, just `require('defender-relay-client')` and construct a new relayer instance using the `credentials` object injected by the autotask. This will give you a relayer object already configured.\n\n```js\nconst { Relayer } = require('@openzeppelin/defender-relay-client');\n\nexports.handler = async function (event) {\n  const relayer = new Relayer(event);\n\n  const txRes = await relayer.sendTransaction({\n    to: '0xc7dd3ff5b387db0130854fe5f141a78586f417c6',\n    value: 100,\n    speed: 'fast',\n    gasLimit: '1000000',\n  });\n\n  console.log(txRes);\n  return txRes.hash;\n};\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","readmeFilename":"README.md"}