{"bugs":{"url":"https://github.com/walletconnect/walletconnect-monorepo/issues"},"dist":{"shasum":"ab41a522daa1da1b22a42498f90506e7d541b4dc","tarball":"https://registry.npmjs.org/@walletconnect/web3-provider/-/web3-provider-1.0.8.tgz","fileCount":8,"integrity":"sha512-u7i/1wp3PKS6eB/yiV5Z7okzPF8q322V9dsHBaRDYEGphyQlBb4EH0aDeecVmu1p95CvIauWhxCP5m+7SL/Dfw==","signatures":[{"sig":"MEUCIHo4CKBM0MJ6lTxB0WTawRpSPCo1M6M8L4oV6Jj0SGEwAiEAommSa04mAaT/2v94yA18CqcwaPPFhl+LUhCmRjPOdS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1155550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8PtWCRA9TVsSAnZWagAApkcQAJxtrjfoX+T+ipB9UjVY\nUsNMN21h8kbWOV3IqMaSywoqSu5gvMjcYWhyurt+ubAiiTGAOnOkERznaOGu\n8wJaRJ4njF67WBwnsPdqHKg8ZHvo12RrODa7wgrjKnGZw7nvrd6B5SWmu1ok\nK1x4qVDAs+IkiBwrZnJKMB6c9oWKPsC9ywdn2JRyUKf4bU0YbhYORqAxMV0g\nqNe5ofyql8PzxPoc98YwM61kfYmaGQNQvBYVgGSVPu30j1Tl0QPAmWEffJP+\nhlHdnVjALszLKg/QDq/3lU+hie/3AJ5xiDEKSbHIgFnZqT9+bA5Y1CWA8NOH\n5X7u/AIbJ5R+VssOiFPUwz3yVA/Jm4xmNFloyaHTSlIzuodiBvsGqDiC+Gx4\nypDRhVbXxY/fqSqV05aZDZKwfgH3sfnA9+r9X6FAugMyR4b5xje+9Ik8izat\nPiYJ/DFprW9WHDbu8Uc4QJWfmTaUNXc8Ik5y+LXXatcncfVkH6AVqsLSCxaZ\n9Y4YX1U9Pxau2MsNKmgxqkLV+T/VyqqNDyMje4elN3lYuwmba01OR2yYJCZ0\nFSHsrYCpiU1VvbMomFeqhal3ZMh8v1j1pbK87LA0x+LONaEhMUWsFO06VD/I\nLfQpGW5zzl3A7Zljv83izh/EiidCY3elf+md/XRghBdC1v2+CmO/Y1jqKUk4\nBj58\r\n=eYIA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"@walletconnect/web3-provider","types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","author":{"name":"WalletConnect","email":"walletconnect.org"},"readme":"# WalletConnect Web3 Provider\n\nWeb3 Provider for WalletConnect\n\nFor more details, read the [documentation](https://docs.walletconnect.org)\n\n## Setup\n\n```javascript\nimport Web3 from \"web3\";\nimport WalletConnectProvider from \"@walletconnect/web3-provider\";\n\n//  Create WalletConnect Provider\nconst provider = new WalletConnectProvider({\n  infuraId: \"27e484dcd9e3efcfd25a83a78777cdf1\", // Required\n});\n\n//  Enable session (triggers QR Code modal)\nawait provider.enable();\n\n//  Create Web3\nconst web3 = new Web3(provider);\n```\n\n## Events (EIP-1193)\n\n```javascript\n// Subscribe to accounts change\nprovider.on(\"accountsChanged\", (accounts: string[]) => {\n  console.log(accounts);\n});\n\n// Subscribe to chainId change\nprovider.on(\"chainChanged\", (chainId: number) => {\n  console.log(chainId);\n});\n\n// Subscribe to networkId change\nprovider.on(\"networkChanged\", (networkId: number) => {\n  console.log(networkId);\n});\n\n// Subscribe to session connection/open\nprovider.on(\"open\", () => {\n  console.log(\"open\");\n});\n\n// Subscribe to session disconnection/close\nprovider.on(\"close\", (code: number, reason: string) => {\n  console.log(code, reason);\n});\n```\n\n## Provider Methods\n\n```javascript\n// Send JSON RPC requests\nconst result = await provider.send(method: string, params?: any[]);\n\n// Close provider session\nawait provider.close()\n```\n\n## Web3 Methods\n\n```javascript\n//  Get Accounts\nconst accounts = await web3.eth.getAccounts();\n\n//  Get Chain Id\nconst chainId = await web3.eth.chainId();\n\n//  Get Network Id\nconst networkId = await web3.eth.net.getId();\n\n// Send Transaction\nconst txHash = await web3.eth.sendTransaction(tx);\n\n// Sign Transaction\nconst signedTx = await web3.eth.signTransaction(tx);\n\n// Sign Message\nconst signedMessage = await web3.eth.sign(msg);\n\n// Sign Typed Data\nconst signedTypedData = await web3.eth.signTypedData(msg);\n```\n\n## Provider Options\n\n1. Required (at least one of the following)\n   a. infuraId - the Infura Id is used for read requests that don't require user approval like signing requests\n   b. rpc - custom rpc url mapping with chainId keys for each url (check custom rpc url section)\n2. Optional\n   a. bridge - the Bridge Url points to the bridge server used to relay WalletConnect payloads - default=\"https://bridge.walletconnect.org\"\n   b. chainId - preferred chain id to be provided by the wallet on session request - default=1\n\n## Custom RPC Url\n\nWalletConnect Web3 Provider uses a HTTP connection to a remote node to make read calls instead of making unnecessary JSON-RPC requests through the WalletConnect session.\n\nIt's required to pass either the infuraId or rpc option values to make this connection remotely. If you would like to use your own custom RPC url you don't need to pass an InfuraId for the provider to work.\n\nExample RPC mapping by chainId\n\n```javascript\nconst provider = new WalletConnectProvider({\n  rpc: {\n    1: \"https://mainnet.mycustomnode.com\",\n    3: \"https://ropsten.mycustomnode.com\",\n    100: \"https://dai.poa.network\",\n    // ...\n  },\n});\n```\n","gitHead":"165f7993c2acc907c653c02847fb02721052c6e7","license":"LGPL-3.0","scripts":{"test":"tsdx test ./test","build":"run-s build:pre build:cjs build:umd","clean":"rm -rf dist","build:cjs":"npx tsc -p tsconfig.cjs.json","build:pre":"run-s clean","build:umd":"webpack"},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"homepage":"https://github.com/WalletConnect/walletconnect-monorepo/","keywords":["wallet","walletconnect","ethereum","jsonrpc","mobile","qrcode","web3","crypto","cryptocurrency","dapp"],"deprecated":"WalletConnect's v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/","repository":{"url":"git+https://github.com/walletconnect/walletconnect-monorepo.git","type":"git"},"_npmVersion":"6.14.4","description":"Web3 Provider for WalletConnect","directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_nodeVersion":"10.20.1","dependencies":{"@walletconnect/types":"^1.0.8","@walletconnect/utils":"^1.0.8","web3-provider-engine":"15.0.7","@walletconnect/client":"^1.0.8","@walletconnect/qrcode-modal":"^1.0.8","@walletconnect/http-connection":"^1.0.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsdx":"0.12.3","web3":"1.2.8","webpack":"4.41.5","@babel/cli":"7.8.3","typescript":"3.7.5","@babel/core":"7.8.3","@babel/node":"7.8.3","@types/jest":"22.2.3","@types/node":"12.12.14","npm-run-all":"4.1.5","webpack-cli":"3.3.10","@babel/polyfill":"7.8.3","@babel/register":"7.8.3","@babel/preset-env":"7.8.3","@babel/preset-typescript":"7.8.3"},"_npmOperationalInternal":{"tmp":"tmp/web3-provider_1.0.8_1592851285734_0.7013946104326811","host":"s3://npm-registry-packages"},"_id":"@walletconnect/web3-provider@1.0.8","version":"1.0.8"}