{"_id":"@elrond-giants/erd-react-hooks","_rev":"16-3d1c0dbc7dd80c42c8cd482d7dfbe932","name":"@elrond-giants/erd-react-hooks","dist-tags":{"latest":"0.9.0","beta":"0.5.0-beta.3","alpha":"0.6.0-alpha.1"},"versions":{"0.1.1":{"name":"@elrond-giants/erd-react-hooks","version":"0.1.1","description":"React hooks that make it easy to use the Elrond Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["elrond","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.4.1"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"62b6bbb6b722e05689e6f42b2351c578762d4e3c","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.1.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-OZJqi1spvtwtugbuqAj+u2CKx3gE6DkX9qfAtsjvX75kjPV4XtmiwVnLCAvXO0+kndTesh/swqTJWdUuftbcpw==","shasum":"a26692526a70e56063c0a0354b117f18e000474d","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.1.1.tgz","fileCount":24,"unpackedSize":57767,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENJHsSSlCVeLGX08QgCTdVpZA/Q8E/MYulnWV6ASwTAAiEAt+f6lwm7iazOuk2dshAiE/EakT95xtYCtlj3Ihmo1Ek="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirAvSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocHw//XCxd8BN/9CPm1OfhutQwwN29Rhe9wdwdXO6nbmt9lMebaUec\r\nL7jvXLdjg5U/Xgo2J1VUpNs3lLQAqkJYhOO7QFzzji33H+gRvYXq/zL9Pdej\r\neS3DXfNCDnC4dUrwaGt3r3bb7HRW0HSxujnRPT+vsf0NsDT7I1/MrFPPx+dt\r\ntNGlWRAugzVCX2np9EN8qXEyipxhUKYaWSoCdezeQO3FKzKKZIoTzq357vd5\r\nE54a8FKxJ3LStE5FCNR7CJdpKMxaaKeH9VjpILq3ZFR8wm4mcaSdEUB6T3pI\r\nnVcZwfveugl+9gMuDHKG+2ib1mbMb3WLLRPsMKJkqm1jHokQyqmDGvmAeqJf\r\nQ4Y+Xp1kSQ7QXc60sYNAxB4B96JS8jFt7s3+uIFEKBy2uqrPimSE8A4hikcB\r\nXpsEwRBxtmYkKqYBAPnth3U6bc0zgk6qDRIucYk/e2aFOsZbiiKnS9tmsrVv\r\nNvkqC5BLi7F03XBnr3KFMGkMIIa6WZquex77Eii6+RepU6NKHdBTBffVwNR+\r\nme8/IuQsoveVoWWfe6cBwoYb/MPb4G3+HRFf0HbffbY4YlVbUBe0fPjdMHLx\r\nsGx4j4jTXaYF9gYlWlNTjB92fABpIBJe5LWhv3shUCvUC4rZFZ4Y58nUEQjc\r\neclKqFZwVhfnBzS7+ko8GmPqw0WsSF/u/S8=\r\n=RYoS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.1.1_1655442386141_0.4768785894015495"},"_hasShrinkwrap":false},"0.2.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.2.0","description":"React hooks that make it easy to use the Elrond Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["elrond","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.4.1","@elrondnetwork/erdjs":"^10.2.7","@elrondnetwork/erdjs-network-providers":"^0.1.6","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"04f08cdbc14ac0c30923eeb1b46eb6578cb7da56","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.2.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-BwYss+liZM6n/VmJlZ8rxntaavolQ4hppE6LP5OD4nNp49KJdAxgHGpCFZk9fcqsl0WRKc3WlxFAd+mvfxmXxQ==","shasum":"7113e24449e2dffaf94f4c9db2fcf5ca184016e8","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.2.0.tgz","fileCount":36,"unpackedSize":74171,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZJC6NmwQ/YUuuhdviR7WOshHcK0s6mY4FQFX/wtca+AIhAO6Q3Z2WFev19To+K7a+HZT9omsPGupV3Kt1Gh5/M2f5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1mcZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqIjQ//blTp+1CHUH2/4a7nIdG8AQTpurjE95l0spTAzPUqMSVTJyUE\r\nm7iv7sKAMRvw5RiCwqTIehdYvp5DOnE+6UfccmuS5U2YgceEUFDiG7QZpZjr\r\nSleDIItwdR9oIzPEKl62CeUW3+t2fK0CJPIShMO0RdbyG95WZPtqJ/GMSWDj\r\n+z9gNicvIFrBTaIIQxCIW+DSSYP7AvjZHAr4d4cimI2/jIAdINSRYt/Q2CL2\r\ne0VRolc3nGu+Wm1CPhiQWZpYVTLVa2Z6dnEHqrNRyRHHLI/+eEnlVa75uQL6\r\njyWCN2rofDfn8w4w19a/oXr8ev70wC3Ao6TT34fYa+Xj2yzrYgg6wr+k/kcI\r\npss5+jq5GtnoJmnPGQK6WgZ5K6csC54LLz8RTKm5EQa3cGlXRHsvyb9x+2VG\r\nhLgDL5MYZn9R2+OzS8dFGLM4gvBr/xMtMFV80Nl1GmtQEZorl0fL9uIgz+tj\r\nFUBFUPYWPMdQI3tZrEnd+d3N/sOWe9FQc0lR4dwu4D767gAuIHT1j8aUB4ry\r\nllYJTwIzTpkXnitNyM74WY/thONoGz94sMSXIUvPxfWtg12J3jk+alcllMmV\r\nnDvKHiO6SsZjNX1ksPGg/+UZwOd1IZF2XCNHdqBIf5I8GD+jRm0aLgWDnB9C\r\npuqz6rvXJUOixdlupo8KP2hLxs7y+prN2a0=\r\n=OFuC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.2.0_1658218265108_0.6053781612029494"},"_hasShrinkwrap":false},"0.2.1":{"name":"@elrond-giants/erd-react-hooks","version":"0.2.1","description":"React hooks that make it easy to use the Elrond Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["elrond","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.4.1","@elrondnetwork/erdjs":"^10.2.7","@elrondnetwork/erdjs-network-providers":"^0.1.6","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"5e13ff74f1124de134819d533fefc40179ac9326","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.2.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-MhlkmHGooW9y+R7vOEbls6Kc8jOjVeCPF9NQTxRi0WoDNEwlodlZdmQ8jLX/xUdlLt9dpPttZjLTYmjHSxiJJw==","shasum":"25611e6b6fae21cfac528619c8fababeddc05115","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.2.1.tgz","fileCount":36,"unpackedSize":74555,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkI4QZTo6KRY7+2Ex5w/W/k02M5sOhCT/j9EQeUiHfmQIhAPD6jNoecn04fUQovH0BA3qJoSQb4s59K4edflG0IcUj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1+e5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzWhAAgSyUkxH8M9amGc8OMAG6Ygf1hLGXIWrlOlYGeWQVfUNKkAI7\r\n6mhRgUkGaJRPVjwP4W7dQ90ZFgJUZkJVnaoams44NuLmiGWEa2GIXPHSI6lL\r\nHUjG8/liFgKsQcVcExNvYts4c86bSquLwXCn/Zhz+U0wAWx+xzrOMH3ARYzX\r\ny48XzL6vh7dZ/gAWNj6d/2mU6iZwXPEj2wq0Eg8nxZfSa42NUJK6wX7OB3Za\r\nkEoCJ0vdjT5zHaZMfG49WPmbwHGV3CFudNF4TIMbSovVTbCWEYb0gZK3mY3y\r\nVmAF7a7m0v9REhjK5yGlkDVYwBU0gYCYDj2mw2D/SI4eMblSHTzfTAz+m6si\r\nkj+rRRUyt1l+7TQiWBtnHr4Pe2J5FIo32XT6u97pKYU0u8d2/CReCQBOZxzr\r\n/nLNjJCZ+ndQK/2AcT2RYrhpSRjE0rO84ObrWHo7iidA8WmKfgv2N3LoOccF\r\nurtmWh4yfQGWFVRIBHSUoUYWA5gQKyajM1p7TDa9TUr4XsCHg0E0R/qX4t3h\r\nx3bApZaf04Pcm0ZeGQfY8azTBYTfGryHYrCi15wMgtbFAJ901D7h91xkpMn8\r\nCXIRTTcjxHLOuaMdVA+qItB/DLnMpk/yBrNrwTnvYni4SNsYpyvgSYg+fe7Q\r\nX7fYYzRYUtxpEvtKrlgacRnCXHs7Mw6wGW8=\r\n=Wqb1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.2.1_1658316728805_0.5551958698068606"},"_hasShrinkwrap":false},"0.3.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.3.0","description":"React hooks that make it easy to use the Elrond Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["elrond","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.4.1","@elrondnetwork/erdjs":"^10.2.7","@elrondnetwork/erdjs-network-providers":"^0.1.6","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"c640d0abcbf6b421d6f27f42463e4516cafd3470","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.3.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-fmPWZwUxYmyMr3kl73caqgERI/RwSvmYMUerMqd0w/MicBKmnX6P/BwXDihuGf3YORxFPfc0S1RGOTgk239eXA==","shasum":"61c514975665326b590dec567cee306c016fc7de","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.3.0.tgz","fileCount":37,"unpackedSize":76877,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6uollCvNBAFVJ1fwAosLeVbm4CwHIHKWlwumpRMu7WwIgOMEguU0xQXf+d0d69xYHEl0hKBB+HljXS2blwi7oACs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7RZXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2Ow//WoISGeibFBDJyE3enxmXXfUPQD9lFic5Wu2IMky4P7paVbu1\r\nfIhwDUEMKLvjDYR+5vZkJMkLeuO7OnyhAkMyMrkhE3+Qpl1CX9aNzxnMXWIt\r\nZle1d3Z+EW+3bE0r5JYwVv8irj37CsXl+JwL775eQ37f2y7TJJsMYHoY6tV0\r\nIJCU9wtsL72xAp49k6WNqerNywy2pnLiEJyl684WFegj2jr3eyybKyaJC8VQ\r\nD6ag/30wdVEd+pKm6tKAWp+BJLaa2/y5GmhUTS/jdTgbRZ5tegrwg4Z6yT2B\r\nRl+R00LFYUbVcOr+wUItxrpYqgwX76a0PfXlJC/RwehSKKLb6jLwOwfWU6PX\r\n2CMKgPBAKutpsBT6h4deg7gon2Ctbj4qjHHVhGQZZkt6HrKAC8UTQUVWNVmN\r\n86w0EADxjk0VaMly5vGL39btQovJ/DBHHfvbXkthYCmItZ/lnbMzk7qdawLb\r\n+sv9Llfv9iOH0TCgP4BvqMoPNwn1vd6KKTobeGtA2ItH527PdfYFigRIeKHi\r\nsp75IU3rYrqEu4G5W4ii7Qm6Q/RQBE4oZjwtRT5fHrlCchTLhkG0EvLZohBR\r\njQVfXDC4dSZLFG4RBf0appopXcE8wtVYo/J/Ex6wJKM4Btc7vsmGGRmvxONn\r\nfyyGzBQqsn5bALge+YpQ9rSNFLDDL2HSEnw=\r\n=ookj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.3.0_1659704919743_0.6642733790571405"},"_hasShrinkwrap":false},"0.4.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.4.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.5.0","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"c685122234b5548f6d06cec9d0cdedc8990860ff","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.4.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-l8TBhMn0ExgAbIl+kbQepwkF1QMoViF9e0MGmcZH0AwdKt4dRVXChS2UZSucavtz9xOKkFxULfh5fywm3GV4gw==","shasum":"b03e1ae7561c03feec13f542f747bb55e7df32be","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.4.0.tgz","fileCount":37,"unpackedSize":77738,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCK1ODa1Bk75HNkpHxMbbqUyImVYWglwnpNv9WvDonPoAIhAMidFQ8D+jpZuIQQJuSVRfPwzytf9ygwYHW6FIuwqQA+"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/5DiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppoQ//VmT0EL9pDGjvODWuGKsmp7RKNU+ZOJZ4flkFWb8BcXBWbx09\r\nB66CDPXzOdoqKDqlZhjdURpwsuP7dns+GsG1nNcfME/RbgI/dj4jW7OPWnYI\r\nEtDZtZjARDxZ9R4SMfxnO5akadwoBw2ICMI1Dz1uSrsFPV4icylRJJYD+mGV\r\n7I/8+3pFxnBSkU3DUPAsjYa/6tj9Qfs1beGgjdQ2zmgvcFrfjfBj5InSK9y6\r\nC2AW2NRJhfVfaJ8L54vrRX+dnlrmJfHqR78KebIBpT2+0vSL3h8lSSoaxd7K\r\nQ6UpJ5ylNQ6qoOpeAcGXncotUQbu0NdW0azKRZycpVtNbs0eQaozLpkT7N66\r\nFV1H21pDBwFKB6NMoUe82bDTGfVv8F7D8o6UYby3jd/dBBwM5X6qt4wCxf7K\r\nTapK41hQ7F3CifsRLcRq9y49BRYn+fCVo6m0L8zSpiaWp+jhxtwdPrMC4j/k\r\nW3XeKSVedB048P2oxsFpu6fMmRMFT0hJejlAoYGju0MzIwRfomFB8rm0jnyX\r\nJLrooFj2WwquetTGNk+ceU1+CD9gDnhG4ryLiA2Z+JISnjYvu8pB8P0cxgl7\r\n2Lmr5ekmDElpriKyS3F79jpu4mk/R1VWS3hnX68tbmIlYP0LKff45hF/L8OU\r\nXAQ5iHIvoi7upqnR6O1DV8GE3ahaXVdpBmc=\r\n=bMfp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.4.0_1677693154219_0.8421967277533524"},"_hasShrinkwrap":false},"0.4.1":{"name":"@elrond-giants/erd-react-hooks","version":"0.4.1","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.5.0","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"50bd7431e0be8718078d5fdc95206158370c208e","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.4.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-wGgr8Y2m+ZLOnAsgjV7Jm+r3HgbsnMSYzMrKMGuhE/asNaWHx2sof348gs9xM71AskFvxQQ/5U1VnwyolOoo+A==","shasum":"15804edb02506d9d33c0dfd242b6d046df1fcd87","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.4.1.tgz","fileCount":37,"unpackedSize":78223,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVabdcBjNAhr8gTW6BSFBvRENX3PFr5oSsoovYCQE/iAiBWVct/71wvPGUi1T1p6UdSeEs+ZdVUtYe6QC8nJ9SZjg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/6GWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFQA/9GeFQSfy/tNdGP+VO/E4VyA051D/Aoh2mxugVNj2ykvUezImg\r\n0eUI/xg5TwwUSUstMNhwYzRqFu1DtcMSS8t8fKxAgZAvs1D61JDHu3WeohkW\r\nEfW2R0+2GOyLCdJ3ovuyByqxXhdJv4AXhu1bNcSOZv64Ay6e6ge6Nx1Yy8Xt\r\n8hHSBDkUdNkVSXUBiXiwU+EYWoQR4J0IBlK1edA5DZbhL8BewuuPZMam562T\r\nrNJ2Y9gQV/bARTkReD+G/klADRtkAMu4NSHvjXc3lFMqEGIMMpGr2jO/5y8R\r\nlVnbORBwz0RUwtDDOXH8pR+JS5LRemYrW8fVsXjLYZF2ALBtaYjeFyJi/qNH\r\nKF4OvDfdxtOrBnPNu2C0PhDphl9jKNzpIl6Gdj0JyyIZaMn411YVvSXgWY+k\r\nYKeLd+Eth/rI5FJw/vv+hqxJW93IqUlU969xVTR0MYSYAgbJWSgXMdW8DNiM\r\nDqnLQbsYxMEM2kU0/Jv7+CKIBEdWTpVjz5Kb+cNU5xHsFyzgAptqs/ivkgDb\r\nzr9fMK67NT1V8Fy7PV/hHYctchwiivtAuwpJXPqEoqBxOkEpxgs02URf385g\r\nImqKEPQllyzl7X4KMAV4Oiy/DqVluv1oZ5Cbg054bufn+GHoC0kXBBBOc722\r\nDwH39w68dXm7cMF6ObzCYO4WDdhSJyt4H1U=\r\n=WetE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.4.1_1677697430451_0.6871641906058097"},"_hasShrinkwrap":false},"0.4.2":{"name":"@elrond-giants/erd-react-hooks","version":"0.4.2","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.5.0","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"ce30d86792fcce20f4026ee6b853bf9554b69530","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.4.2","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-/Z+2UEIEZLxSTduLnHlhzakW2HDmTrlGXVNTd1W41nRiqcf2+RbWQLSreRqZW4QNja46zsSwPq1mW4DV/cG2BQ==","shasum":"3136f15c8cff105c6898d1774ef1c54bff59706c","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.4.2.tgz","fileCount":37,"unpackedSize":78221,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIqqXdDYwxvSFdA1H30YD7AjL4SeylFFuipAjubUThNQIgOdgfpuDNxl1BPqZkPs5UhaE8x3qnc03YtagsuMRaaXQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/6KIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroYg//ebRW65MpGIeA0U+CN6eGHFIIFp8PeckSyQI9p4M/AyY64Zjv\r\nlMjV5qbOvRb4TI9kOxJRwCoRzdSL0tyasQsDUp0zwazzmbSm6YZi+vwSdE1X\r\nahJJws0TADlSVjMoSut15XEPeL7UWH3D4sRxLQsE9oQBWG2eRtofc9TQuhTR\r\nkXx7J1BBFokQr/TLN8/N/9SzfsKWMfmEHibCuPNnlks/Ek69DVviBiP453kZ\r\n+h890TrzOXOKAsWmGj4HVhGBBCirgp2WgXrIFpEalxyjIfLQgaFeeIbXvdR8\r\nh9KAkFULopHRvuF3FRHMkHHOfO/0uyeczhNyu4PEsizIbfAU+q4QVkimMUVD\r\n23ZoCo/78nDcW2JS4KOEpW25h2u/2K/T+UKMEmYLmSUSjOOIQZURQbgf4ibZ\r\nf3vqnHzXvf5chpcINfyFDLNgE6R4vRRMUhYthBueC5Ktbfya3UsaRAxyaE+F\r\nO6t1Gfk+SzMb9DGR740wygF3ley74anSskwICcN1ezKNyMYJXzCsCjYx61/C\r\ndTV2LOFLzLltSmk7M4/V/+vFN8wyg56Q0DjyAIRXUq/r8QA7zUT9EYAZ5MhT\r\nEYTUMIuSzBWG1tEX7hMWmgUjlWI3tyIGX4EOzPRsCNa+c5nhzYzJOZoawjQc\r\nLb+D/LnePxEbooZzu0cZYBgitGOODK/WkfQ=\r\n=0lZA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.4.2_1677697672395_0.5739183834688519"},"_hasShrinkwrap":false},"0.5.0-beta.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.5.0-beta.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.6.0-beta.1","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the Elrond ecosystem. It aims to make it easy to authenticate, sign and send\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n&ast; useQuery will be available soon.\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, login, logout} = useAuth();\n\n    return (\n        <div>\n            <span>address: {address}</span>\n            <span>authenticated: {authenticated ? \"yes\" : \"no\"}</span>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that resolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\nWhen using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of the `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used to get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 0.001,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed using `GasEstimator().forEGLDTransfer()`.\n\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to MultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to be `window.location.href`.\n\n#### `useQuery` - coming soon\n","readmeFilename":"README.md","gitHead":"8b7d68312b549d75b5566d1436e006e89f5bf1cc","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.5.0-beta.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-a5AugDTPkG08Dr0OQ68ti25tOO3yxgu+PntVo9Sr9nzAxK8bsGFKsSWfXfrMXbp82+bEziBdKWVhn5kBgr/x4g==","shasum":"1e89a2bc4d0eaa38326ee75744ac642cbd85e386","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.5.0-beta.0.tgz","fileCount":37,"unpackedSize":78915,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDScXnuWUPMq16+ohIFlAV6z5CshVCKZgi5ek9hIDTBEwIgR/xAS0AbTC6UMYRfRNFGX6aBbzJWuJEnfZyBic84h0w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAPmtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPaA/+KHZa7ocRkGW+dN7sGMboxUXKqZF3r/CNUPmH24+czvdyFq1g\r\nunvJEsk2nGz8y/xyYhNY7FZNQ8H2YycNN2hthYQ/9J0rgvXU4G/FqDkKQj0B\r\nI5U072oOQE5Bag01+/OcYS0+ei2bEDewPI4iEVVxCh2Q64XTBCCd/Ox22njN\r\nU+PQPVhs5kUTwRK0aTPhB0r5Oy915VisYThik/lqnZpRymu1ip1h4MG9bmZq\r\ny5X2PvMkWz7jBvbtODPUBQ+mFbh7NrvmHG9UiHKN2hW54oepWkfqnvMs+V6C\r\n7jiHdeOY0I+mOzx44VyhoydB85+0MIGJeb3WD8aKEVlwgalRX5wX6y1ogp/O\r\nZNzHKipQD6tGZAVrvldaANkuzMVpRF1Obs51A7rFywXCekUy27lBdrokHprp\r\ngXXVXkEnt6tvQh+4WW8oltPYERUKn8La1Rsf5LKAoaeMdG4eofXrtsERAoKe\r\nceTQ1DaKFtI1+QhXixvYKgxpY5MfgeoMw4OZU8C7inxYzNMpP9khbJIVDZ7E\r\nSXHTJZWMEclZiPOdkbHUIBC7tc0rXKBtzUwVpOZS2BPQ81bnKKvyjaUppsVy\r\nUGeOzPNdfGZyxSFLjRCDfBlh+RghpRxVnrbcR1B7AlaEYpxnRTmI2IAYbCOf\r\nmjZ752JIs0YeKZG8kT7NF2bU+Br+RTzOv8c=\r\n=h/fr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.5.0-beta.0_1677785516965_0.5321536897283725"},"_hasShrinkwrap":false},"0.5.0-beta.1":{"name":"@elrond-giants/erd-react-hooks","version":"0.5.0-beta.1","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.6.0-beta.1","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the Elrond ecosystem. It aims to make it easy to authenticate, sign and send\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n&ast; useQuery will be available soon.\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, login, logout} = useAuth();\n\n    return (\n        <div>\n            <span>address: {address}</span>\n            <span>authenticated: {authenticated ? \"yes\" : \"no\"}</span>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that resolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\nWhen using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of the `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used to get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 0.001,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed using `GasEstimator().forEGLDTransfer()`.\n\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to MultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to be `window.location.href`.\n\n#### `useQuery` - coming soon\n","readmeFilename":"README.md","gitHead":"934e43b709c789c03f6aa6f5c04128c78a339a0c","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.5.0-beta.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-QA+pzFDJwSW3ZHGGT6tA/7sPHu3xDG8Qmb2iZyYHUl6hfBhIrPlloakryM8oCrumF3zF+TKGSO0Cq9RR20RC/w==","shasum":"df166c0ad0f3ec9b29926343283817211a4a77bf","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.5.0-beta.1.tgz","fileCount":37,"unpackedSize":78921,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAV8zGCh0JvcjAQNWIJ72KHC54UUlACmZFf1yXNsj2BIAiEA0vI2Q6k7XPxRMLEWHSVyo5SpjMfxHLMEUN/Wq2XdPN0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAPxFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmql+w//dOXkkUc2l9oDOWA/9SZhYSd52lHlPn4bT29c38O5JmQ1y0Lt\r\nU69bQaqMK0wifKHLkQ8k2gcrbSc1/IPxwypTrDG5GGjoLGCUWJt3Srb/rFg8\r\n4hm9p4JLQY961O501uHxk1tuP40XgzTdqRo1FRsSgffqi5j9cNm2vgW7AcL3\r\nYZItyakR9Ij7K/8XsC1T6SA5HQxTm/FgYoZJ/9pRwHwSpi6cExF7OezFIS/6\r\nsiUWzN0+3AfZN5ZaZMF2TLoiQ01g8x0l9gn9ZGbzHrySJOuqCA2rMLcGBhiG\r\noqSZb8B+LQqIgzTlDe5evF/M35g/wWpt5ykVro+llNbWUGOaimDrUpjI0J96\r\n0DHsre9lNziJhK8zNoBbEft17hD2LG+PRCZE3bEwAFRvH/OnV8e5TKC1VthV\r\n3cCRo1QEs4QVERMWBxxnZ7TeGpz7rpZrl7are0HTqDnqEyXmOu9swrPDHurp\r\nKPvXw4NyyG67PpfMfHj+P6zFKWBWCeeEDQAwGX7CPJa5ukdKlYvk8ivh43Eu\r\nGSc0R02BFH5yHU0qliUTs9Rny5gfQNu8XpqQ/hswg5kaClRKr4eFnzzxlmph\r\nY5PKdgNIvZqvSmczUfGbniyrxszoeBNJUCgX2i3jfYOaTeNNDzOvluBMk+in\r\n/jZR7tkPvlMnBqzNpyD/Wm+iGjDH7Ff3TLk=\r\n=6NSz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.5.0-beta.1_1677786180933_0.14277790626936304"},"_hasShrinkwrap":false},"0.5.0-beta.2":{"name":"@elrond-giants/erd-react-hooks","version":"0.5.0-beta.2","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.6.0-beta.1","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the Elrond ecosystem. It aims to make it easy to authenticate, sign and send\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n&ast; useQuery will be available soon.\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, login, logout} = useAuth();\n\n    return (\n        <div>\n            <span>address: {address}</span>\n            <span>authenticated: {authenticated ? \"yes\" : \"no\"}</span>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that resolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\nWhen using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of the `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used to get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 0.001,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed using `GasEstimator().forEGLDTransfer()`.\n\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to MultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to be `window.location.href`.\n\n#### `useQuery` - coming soon\n","readmeFilename":"README.md","gitHead":"652faba2272e36fc2bf9333f4faa7ec1f39d59b3","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.5.0-beta.2","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-fhWr8tgBJkZp/s8NpsEkYKQOJgGXABRjyOZLFaBfC4cTKU5xqvlhE3vv5iEOG3V5rM3+ahrVDWBVaSU+0io3JA==","shasum":"6d8efa46c6758284b6b030d01159f1168a2d467e","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.5.0-beta.2.tgz","fileCount":37,"unpackedSize":78967,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHTuQienTSCGRj1+15Z9HSUS6oAA8M18keSDie3PwroqAiBqttLH043JJkqVGAx5NrqEIUUQ16z56beyeXGaEszfHw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHCD/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+ag/+O4/NGkzqsdYHym+rbzpm8AoRwbcoXlzc+5jFu/etYVRMMNt/\r\nV7FVxQAtgjMgfglu+LDpLuZ1bNEo0L+g7Yh/TiTk702+/IIwjc2kPPUtAbGG\r\nvzZjxIqw61lXeNe7XqiVUkV5I/E/OTLdxH1l8fa4UpqiwbA7DGxUEKlCXi/C\r\nEP6krgCuY/OCC4Gclvl9MhU6uVCRyf8DpfkLDgX23MzAy1k9dfVmSH8BIsSL\r\nOgnoxbjDVUJdpy89eo6erdX5wrmkr7GaknPtsSFeXunFyEfowqampkx9KRlr\r\nFg5GNnvYEBhZX1ceu2YDxsZVDvekGY47N+LPsUdADlY9s5ockCB3ng0KYlVk\r\nDCTeuc8N0fTQ8LBC3/fQQJZlP6gUoCRcG+GiB7RL9FOuuMJG4bhUpu6kKDFe\r\nHnY+b4djcpVbooghjqeX0rBMhB0H82R7cAFnnjc91XY0cznsNfv4P5BlE3Sy\r\nk6/AkewLPtzUvdpSvL7Va1y/15341laPSzPrgkwczfLlAWYF1PeDQ4XvmBTm\r\n04R/ZEOgQy9NJxsOueVnk+k387Zos4Fm5yxqxw2WfSRyA8rYxDppImpUduXm\r\nMgtHoZDd/f4dyiB/Wg335GpTaGNHbYX2yZVhFNiN0Id8sr9Pc9PIZVcgZv/U\r\n6uAt5nFrB9fBn1bHi1FzjpUxnv3dH16sPIk=\r\n=PRZ3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.5.0-beta.2_1679565055408_0.2985397294375536"},"_hasShrinkwrap":false},"0.5.0-beta.3":{"name":"@elrond-giants/erd-react-hooks","version":"0.5.0-beta.3","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^17.0.41","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"^0.6.0-beta.2","@multiversx/sdk-core":"^11.4.1","@multiversx/sdk-network-providers":"^1.3.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the Elrond ecosystem. It aims to make it easy to authenticate, sign and send\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n&ast; useQuery will be available soon.\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, login, logout} = useAuth();\n\n    return (\n        <div>\n            <span>address: {address}</span>\n            <span>authenticated: {authenticated ? \"yes\" : \"no\"}</span>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that resolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\nWhen using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of the `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used to get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 0.001,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed using `GasEstimator().forEGLDTransfer()`.\n\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to MultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to be `window.location.href`.\n\n#### `useQuery` - coming soon\n","readmeFilename":"README.md","gitHead":"cd928e6558f6472b1638fd9e3b4e3231dac8a9c5","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.5.0-beta.3","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-BaIL8K7D8y2rM84OF/9Fh4gwEUtT7LU6Vo/LajJb4tHG7H0sk6hVthYkpOPBybJYGY5g9feZxclHRxvMaywILA==","shasum":"550b096ce2278712b31513e65fc4f98a2ff830f7","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.5.0-beta.3.tgz","fileCount":37,"unpackedSize":78967,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBO+EFk+kAyOIX5qQ9oGt2x4oaAHX+FSulJKMlKa9+vOAiBlzeXPJLjp6fxGDJO2UbomRN5KWkoea6Cpx2XAJv0f9Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHCaMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3AA//ew3zCaGGJq3BxeIP96mm9IMPi6uTjmbVYGzYX3ipfi6xW532\r\nMH54trRaNOZJED389PZNgoqv3Y0tIZ0BFs9VuVEwOGveqjADQfWeuBwkx1zy\r\nfy4/i0oB0lEyfp6rlw5RK52deduNVJyfQa0y3iz2V+qjHsmUB2KYqnnY/Thl\r\nfomCEHXM7QTjhRUaKDGwG21w3ajDgQm8Zw5U51BU9xegnutXsomRycRyyGLu\r\nfhuXnheYI1DAGYLNVwL3v1MUn5pt62Ivloa0Sgl6+2e8D+k3i0qjw5Ai+dEy\r\neZiMFxxXQ+E5GuXMiuqcTs3rqdtFVWjam+dP2rwDT+6gm50gOiGDUba2V/fw\r\nnbhPhEJu7YY0iEbBF93SnYbDdxsT7w7DkxtpwHz4GrQsKEEtbq9QnuGfYuqp\r\nH49A3ZB8mesYkWEZKmN5Nfu5HlZyoBaiLxJm8f3QK8XlJ4g8L4goKTAzgGm3\r\nixqXHvmQFOeSFVhwvTy6hsyJwqxmNR2t0kZneoWi0tCljCgdnpKixz0K3FIK\r\nXh7AQ1P/7+2dYolfzq6qFXlLlJZqKLNqFGtr4qqIRTGMmCBAky1+x7dc0U7f\r\nqvD9UDDABPTeI+7XfXwenVHM098c6Hn/4UVKRFR7WT4G9h62dCLp/C2xoEVu\r\n7i8DHoxtWopDr/nabSEt9qxZdviQXvyq5WY=\r\n=oWxu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.5.0-beta.3_1679566476491_0.6136655569248419"},"_hasShrinkwrap":false},"0.6.0-alpha.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.6.0-alpha.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^18.15.3","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"0.7.0-alpha.0","@multiversx/sdk-core":"^12.3.0","@multiversx/sdk-network-providers":"^1.4.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the Elrond ecosystem. It aims to make it easy to authenticate, sign and send\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, guardian, login, logout} = useAuth();\n\n    return (\n        <div>\n            <p>address: {address}</p>\n            <p>authenticated: {authenticated ? \"yes\" : \"no\"}</p>\n            <p>Guarded: {guardian.guarded ? \"Yes\" : \"No\"}</p>\n            <p>Pending Guardian: {guardian.pendingGuardian?.address.bech32()}</p>\n            <p>Active Guardian: {guardian.activeGuardian?.address.bech32()}</p>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that resolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\nWhen using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of the `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used to get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\nTo use the Webview Provider (Beta), you must enable it by setting `enableWebview` to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" enableWebview={true}>\n```\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 0.001,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed using `GasEstimator().forEGLDTransfer()`.\n\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to MultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to be `window.location.href`.\n\n","readmeFilename":"README.md","gitHead":"f440442115a80427d607164eb244a2a8ea1e4aaa","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.6.0-alpha.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-6uoSElFoJ9sitBRta4D4BCo8FKT0fnqWgJRZh7N6VHAI8XW0f1tKfW/Nw3067QQ8JU74KI9td6GsW3H+VIwNjw==","shasum":"01f8f6efd673bacc76964bbe8b08df8994e36999","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.6.0-alpha.0.tgz","fileCount":40,"unpackedSize":84040,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVLDX006Qya98WGRCgtTbIaLEueCH2gAtdVt3zCo51WAiEAgZ2hzdQSfN7yqrF+UXzzM5AZtm9OHjGbBw1ZUOGQeyE="}]},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.6.0-alpha.0_1686670308334_0.4455915079032362"},"_hasShrinkwrap":false},"0.6.0-alpha.1":{"name":"@elrond-giants/erd-react-hooks","version":"0.6.0-alpha.1","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^18.15.3","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"0.7.0-alpha.0","@multiversx/sdk-core":"^12.3.0","@multiversx/sdk-network-providers":"^1.4.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the Elrond ecosystem. It aims to make it easy to authenticate, sign and send\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, guardian, login, logout} = useAuth();\n\n    return (\n        <div>\n            <p>address: {address}</p>\n            <p>authenticated: {authenticated ? \"yes\" : \"no\"}</p>\n            <p>Guarded: {guardian.guarded ? \"Yes\" : \"No\"}</p>\n            <p>Pending Guardian: {guardian.pendingGuardian?.address.bech32()}</p>\n            <p>Active Guardian: {guardian.activeGuardian?.address.bech32()}</p>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that resolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\nWhen using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of the `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used to get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\nTo use the Webview Provider (Beta), you must enable it by setting `enableWebview` to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env=\"devnet\" enableWebview={true}>\n```\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={\"devnet\"}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 0.001,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed using `GasEstimator().forEGLDTransfer()`.\n\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to MultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to be `window.location.href`.\n\n","readmeFilename":"README.md","gitHead":"889c01ff34ba152999284e94900c09ff83fc22ae","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.6.0-alpha.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-tiCS0vUGHqS/WzqZb+G4YTXXY+x3vgU8t6TyYqRQCgOAYpZy7/hVqjmSYw9IqLDgU8EDVSx81VGZeCi7Dsd2IA==","shasum":"8c7fe2815fbd3c60a0213bcc0a0e278d3a74a163","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.6.0-alpha.1.tgz","fileCount":40,"unpackedSize":84211,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlrTv/qkFRplCBEK4Xp9zvsA7nyuLxMEn6yRStnEcdgAiEAk5ZlAXROY0TzkjNB26EJM5RiEjoUE7abLOWkPSxvtbo="}]},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.6.0-alpha.1_1686752962257_0.5435486367748346"},"_hasShrinkwrap":false},"0.7.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.7.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^18.15.3","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"0.8.0","@multiversx/sdk-core":"^12.6.0","@multiversx/sdk-network-providers":"^1.5.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"74ca05d0dfa9068d8fb057e01eb12a2a1e646fa5","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.7.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-s9+wEeVJQKaXPYaGfq3NYRFf8/beSu3NhQFZNNDv5xwiot7SNR4Uoij4jM0zDeVaMvaSz57UFTxNfpf+tiYj5w==","shasum":"461db9b2e0ec9a7abec64c90a5a42cba714436d0","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.7.0.tgz","fileCount":40,"unpackedSize":94841,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAGn7fqGXNQzDnfDPHfe1tyMYOPNdxg8Nx3cGLfap5NiAiEAwklWlnEZlPB82KzZBfsc1MfDNutBFmq3mdrpe2+IxKo="}]},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.7.0_1690459768479_0.40998657260472604"},"_hasShrinkwrap":false},"0.7.1-beta.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.7.1-beta.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^18.15.3","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"0.8.0","@multiversx/sdk-core":"^12.6.0","@multiversx/sdk-network-providers":"^1.5.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"37119f951f553bc34aba375e0cbba8947b7b6ecd","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.7.1-beta.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-N2C2NRuqVBfn3qMtsnzjp4YkoEA9qHs3isCWqiw8UYJFchFoJyPgaVPf23fhx3OgeW7pGOLi7QyM7LAccqmowQ==","shasum":"99dcdbeb6afb6b9210e280695297ba80d10cacd4","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.7.1-beta.0.tgz","fileCount":40,"unpackedSize":95559,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWxTIF3JFRC4W7To/hInqBAiXHNEWMI4als3Dcpo5SNgIhAL937Y6f/r85igaF4Jlslmk9coN6JjajY+4fVwZi9GpT"}]},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.7.1-beta.0_1691672318805_0.7393305103005254"},"_hasShrinkwrap":false},"0.8.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.8.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^18.15.3","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"0.9.0","@multiversx/sdk-core":"^12.8.0","@multiversx/sdk-network-providers":"^2.0.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"54d13c245f4c20fa1e09dba14f2c78a541149487","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.8.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-lWlXj1lqBkruRCDugsUsBhkN5Pwry5mXcV9hiGVw35siRBsZ4Vi8KYy8O6HYbK10L2HP5lwqBncNPf3N/JTDFw==","shasum":"547d1156cae90a7dfa37ddb7d1edd2e1008199a2","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.8.0.tgz","fileCount":40,"unpackedSize":64983,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmxy8GAaszy/c6VE4fDIG/kLXhCxnoyw0+miDppOd9MAIgdTdfIYCDcD/3L0XSBfivi5ZSF56lvLYa+HKaBF2m7P4="}]},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.8.0_1695038136573_0.7372971042402987"},"_hasShrinkwrap":false},"0.9.0":{"name":"@elrond-giants/erd-react-hooks","version":"0.9.0","description":"React hooks that make it easy to use the MultiversX Network.","main":"dist/index.js","types":"dist/index.d.js","scripts":{"build":"rimraf dist && tsc","prepare":"npm run build"},"peerDependencies":{"react":"^16.8 || ^17 || ^18","react-dom":"^16.8 || ^17 || ^18"},"keywords":["multiversx","react auth provider","react hooks","erdjs"],"author":{"name":"ElrondGiants"},"license":"GPL-3.0-or-later","devDependencies":{"@types/node":"^18.15.3","@types/react":"^18.0.12","react":"^18.1.0","rimraf":"^3.0.2"},"dependencies":{"@elrond-giants/erdjs-auth":"0.10.0","@multiversx/sdk-core":"^12.8.0","@multiversx/sdk-network-providers":"^2.0.0","bignumber.js":"^9.0.2"},"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"gitHead":"8a06e3606779a129f192ad1a4b0a9a21708c58a5","bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","_id":"@elrond-giants/erd-react-hooks@0.9.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-JB9X4tw/X/6hoGb8XyVaDlT4Sn7bbeGWzTP8wfhaiEJIbxO3n7z9MmBnEnmpmv1tW/jGL0lT4l55IrVh7KKyZw==","shasum":"b81cd9d51eb5304f1e2b0b922b6becb1309ce21d","tarball":"https://registry.npmjs.org/@elrond-giants/erd-react-hooks/-/erd-react-hooks-0.9.0.tgz","fileCount":40,"unpackedSize":65108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCknbo46T00s6J4ilwM9evewSbLJehYxEhTXcsZN9iWgAIgb2raoreKtBSdpitUBob8XWXiL1cOl7ewdtnweiZZHWI="}]},"_npmUser":{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},"directories":{},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erd-react-hooks_0.9.0_1698760129544_0.6204764275189076"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-17T05:06:25.913Z","0.1.1":"2022-06-17T05:06:26.315Z","modified":"2023-10-31T13:48:49.965Z","0.2.0":"2022-07-19T08:11:05.299Z","0.2.1":"2022-07-20T11:32:08.988Z","0.3.0":"2022-08-05T13:08:39.926Z","0.4.0":"2023-03-01T17:52:34.400Z","0.4.1":"2023-03-01T19:03:50.649Z","0.4.2":"2023-03-01T19:07:52.543Z","0.5.0-beta.0":"2023-03-02T19:31:57.118Z","0.5.0-beta.1":"2023-03-02T19:43:01.083Z","0.5.0-beta.2":"2023-03-23T09:50:55.591Z","0.5.0-beta.3":"2023-03-23T10:14:36.731Z","0.6.0-alpha.0":"2023-06-13T15:31:48.552Z","0.6.0-alpha.1":"2023-06-14T14:29:22.410Z","0.7.0":"2023-07-27T12:09:28.647Z","0.7.1-beta.0":"2023-08-10T12:58:38.961Z","0.8.0":"2023-09-18T11:55:36.813Z","0.9.0":"2023-10-31T13:48:49.762Z"},"maintainers":[{"name":"vlad-d","email":"drinceanu.vlad@gmail.com"},{"name":"razvanstatescu","email":"razvan@statescu.net"}],"description":"React hooks that make it easy to use the MultiversX Network.","homepage":"https://github.com/Elrond-Giants/erd-react-hooks#readme","keywords":["multiversx","react auth provider","react hooks","erdjs"],"repository":{"type":"git","url":"git://github.com/Elrond-Giants/erd-react-hooks.git"},"author":{"name":"ElrondGiants"},"bugs":{"url":"https://github.com/Elrond-Giants/erd-react-hooks/issues"},"license":"GPL-3.0-or-later","readme":"# Elrond React Hooks\n\n### Overview\n\nThis is a library of React hooks built for the MultiversX ecosystem. It aims to make it easy to authenticate, sign and\nsend\ntransactions, and query* smart contracts.\n\nIt makes authentication as easy as:\n\n```typescript jsx\nconst {login} = useAuth();\n\nawait login(AuthProviderType.WEBWALLET);\n```\n\n### Install\n\n```bash\nnpm install @elrond-giants/erd-react-hooks\n```\n\n`@elrond-giants/erd-react-hooks` requires react 16.8+\n\n### Hooks\n\n#### `useAuth`\n\nThis hook makes it easy to authenticate with xPortal App, Web Wallet, Extension, and Ledger. It offers a context provider\nto keep track of the authentication status.\n\n##### How to use\n\n1. Wrap your components in the provided AuthContextProvider.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={{chainId: \"D\"}}>\n    .....\n</AuthContextProvider>\n```\n\n2. Use the value provided by AuthContextProvider.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\nimport {AuthProviderType} from \"@elrond-giants/erd-react-hooks/dist/types\";\n\n\nfunction AuthComponent() {\n    const {address, authenticated, guardian, login, logout} = useAuth();\n\n    return (\n        <div>\n            <p>address: {address}</p>\n            <p>authenticated: {authenticated ? \"yes\" : \"no\"}</p>\n            <p>Guarded: {guardian.guarded ? \"Yes\" : \"No\"}</p>\n            <p>Pending Guardian: {guardian.pendingGuardian?.address.bech32()}</p>\n            <p>Active Guardian: {guardian.activeGuardian?.address.bech32()}</p>\n            <button onClick={async () => {\n                await login(AuthProviderType.EXTENSION);\n            }}>\n                Login\n            </button>\n        </div>\n    );\n}\n```\n\nYou can pass an object with a `token` to the `login` method, and it will be included in the auth signature.\n\n```typescript\nconst {provider, login} = useAuth();\nconst token = \"some_token\";\n\nawait login(AuthProviderType.WALLET_CONNECT, {token});\nconst authSignature = provider.getSignature();\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), you MUST set the Wallet Connect Project ID. \nYou can generate the Project ID at https://cloud.walletconnect.com/sign-in.\n\nTo set it, you simply add it to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env={{chainId: \"D\"}} projectId=\"some-id\">\n```\n\n:grey_exclamation: When using the *Wallet Connect provider* (xPortal), the login method will return a promise that\nresolves with a URL.\nIt's a usual practice to put this URL in a QR code and let users scan it with xPortal App.\n\n:grey_exclamation: When using the *Ledger provider* you MUST set the `ledgerAccountIndex` in the options object of\nthe `login` method.\n\nThe `getLedgerAccounts(page?: number | undefined, pageSize?: number | undefined): Promise<string[]>` method can be used\nto get a list of accounts.\n\n```typescript\nconst {login, getLedgerAccounts} = useAuth();\nconst accounts = getLedgerAccounts();\n\n// --------\n\nconst selectedAccountIndex = 1;\nawait login(AuthProviderType.LEDGER, {ledgerAccountIndex: selectedAccountIndex});\n```\n\nTo use the Webview Provider, you must enable it by setting `enableWebview` to the AuthContextProvider.\n```typescript jsx\n<AuthContextProvider env={{chainId: \"D\"}} enableWebview={true}>\n```\n\nIf you want to set custom api and gateway urls, you can do it by setting `apiUrl` and `gatewayUrl` to the\nAuthContextProvider.\n\n```typescript jsx \n<AuthContextProvider\n    env={{\n        chainId: \"D\",\n        apiUrl: \"https://elrond-api-devnet.public.blastapi.io\"\n    }}\n>\n```\n\n:grey_exclamation: Keep in mind that if you don't set the `apiUrl` and `gatewayUrl`, the default ones (provided by\nMultiversX) will be used. The Devnet default urls are the ones pointing to the Devnet 2.\n\n\n#### `useTransaction`\n\nThis hook makes it easy to sign and broadcast a transaction.\n\n##### How to use\n\nMake sure that `useTransaction` is used inside `AuthContextProvider` and the user is authenticated before trying to make\na\ntransaction.\n\n```typescript jsx\nimport {AuthContextProvider} from \"@elrond-giants/erd-react-hooks\";\n\n\n<AuthContextProvider env={{chainId: \"D\"}}>\n    .....\n\n    <TransactionComponent/>\n\n</AuthContextProvider>\n````\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\n\n\nfunction TransactionComponent() {\n    const {requires2FACode, makeTransaction, whenCompleted} = useTransaction();\n\n    const sendTx = async () => {\n        const txHash = await makeTransaction({\n            transaction:{\n                receiver: \"erd.....\",\n                data: \"test\",\n                value: 1000,\n            },\n            onBeforeSign: () => {\n                console.log(\"Hey, sign the transaction!\");\n            },\n            onSigned: () => {\n                console.log(\"Transaction signed!!\");\n            }\n        });\n\n        const txResult = await whenCompleted(txHash, {interval: 2000});\n        if (txResult.status.isExecuted()) {\n            console.log(\"Hooray, the transaction was successful!\");\n        }\n    };\n\n    return <button onClick={sendTx}>make transaction</button>;\n    \n}\n```\nThe transaction data can be either a `string` or a `TransactionPayload` object.\n\n```typescript jsx\nimport {useTransaction} from \"@elrond-giants/erd-react-hooks\";\nimport {TransactionPayload} from \"@elrondnetwork/erdjs/out\";\n\nconst {makeTransaction, whenCompleted} = useTransaction();\nconst data: string | TransactionPayload = TransactionPayload.contractCall()\n    .setFunction(new ContractFunction(\"SomeFunction\"))\n    .addArg(new BigUIntValue(10))\n    .build();\n\n```\n\n#### Account Guardians\n\nThe `useAuth` hook provides a `guardian` object that contains information about the account guardians.\n\n```typescript jsx\nimport {useAuth} from \"@elrond-giants/erd-react-hooks\";\n\n\nconst {guardian} = useAuth();\n\nreturn (\n    <div>\n        <p>Guarded: {guardian.guarded ? \"Yes\" : \"No\"}</p>\n        <p>Pending Guardian: {guardian.pendingGuardian?.address.bech32()}</p>\n        <p>Active Guardian: {guardian.activeGuardian?.address.bech32()}</p>\n    </div>\n);\n\n```\n\nThe transactions made from a guarded account need to be signed by the guardian. The current option is to use a service\nprovided by MultiversX, which uses 2-Factor Authentication (2FA) to sign the transaction.\n\nThe `requires2FACode` property of the `useTransaction` hook can be used to check if the transactions require 2FA.\n\nWhen using the Browser Extension provider, the guarding is done by the extension and the 2FA is not required. For the\nother providers, the transactions need to be signed by the guardian.\n\nThis package handles all the steps in an easy-to-implement way.\n\nThe `requires2FACode` will be `true` when the account is guarded and it is authenticated with a provider that does not\nhandle 2FA code input, otherwise it will be `false`.\n\nYou should use the `requires2FACode` to decide if you need to ask the user for the 2FA code. If you don't want to use a\ncustom 2FA input, the package can handle it for you using a simple browser prompt - it needs to be enabled by\nsetting `use2FABrowserInput` to the `AuthContextProvider`.\n\nWhen you have the 2FA code, you can call the `makeTransaction` method, and pass the code to it. Then the guarding will\nbe handled by the package using the MultiversX service that guards transactions.\n\n:exclamation: If you don't provide the 2FA code and the `use2FABrowserInput` is not enabled, the transaction(s) will not be guarded\nand fail.\n\n```typescript jsx\nimport {Address, Transaction, TransactionPayload} from \"@multiversx/sdk-core/out\";\n\n\nconst {requires2FACode, makeTransaction} = useTransaction();\nconst [code, setCode] = useState<string>();\nconst sendTransaction = async () => {\n    const transaction = new Transaction({\n        data: new TransactionPayload(\"test\"),\n        gasLimit: 1_000_000,\n        value: 1_000,\n        sender: Address.fromBech32(\"erd.....\"),\n        receiver: Address.fromBech32(\"erd.....\"),\n    });\n    transaction.setNonce(1);\n    \n    const txHash = await makeTransaction({\n        transaction,\n        guard2FACode: code\n    });\n};\n\nreturn (\n    <div>\n        {requires2FACode && (\n            <input\n                type=\"text\"\n                value={code}\n                onChange={(e) => setCode(e.target.value)}\n            />\n        )}\n        <button onClick={sendTransaction}>Make Tx</button>\n    </div>\n);\n\n\n\n```\n\n#### Caveats\n\n:grey_exclamation: You SHOULD always provide a value for `gasLimit`. In case it is not provided, it will be computed\nusing `GasEstimator().forEGLDTransfer()`.\n\n:grey_exclamation: You SHOULD always manage and set the `nonce` when sending multiple transactions.\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the user will be redirected to\nMultiversX website to complete the transaction and then back to your application.\n\nYou can set the `webReturnUrl` when calling `makeTransaction({webReturnUrl: \"\"})`. By default, it is set to\nbe `window.location.href`.\n\n:grey_exclamation: :grey_exclamation: When the account is authenticated with web wallet, the `makeTransactions()` method\nwill not work and will throw an error. \n\n\n","readmeFilename":"README.md"}