{"bugs":{"url":"https://github.com/walletconnect/walletconnect-monorepo/issues"},"dist":{"shasum":"5ea9318b8c2cb5e642e955867d2d6319b0c28de6","tarball":"https://registry.npmjs.org/@walletconnect/web3-provider/-/web3-provider-1.3.5-rc.1.tgz","fileCount":8,"integrity":"sha512-/3YP+XVJxaYhYaPH32uf7WuGzDEwyNFv41AhT0BFYrvdpKpJ4SOZBPpU/A5V2Py5SAi/H4ER2y4nSM15o7tBeg==","signatures":[{"sig":"MEUCIEb4T7b6YPRGwuTcreMA4tZiBDx4eCpqqvDXIrVgj3IpAiEA6twA9BpfPgaRvUleJhMtC1JZJFV3KHC0k2G5nRUtI9s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1629680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGY1qCRA9TVsSAnZWagAAl3AP/jF6P3PRQj1RdaJkB2kJ\nJAhkk/Ih5BZ9aB3J+3aoT7LxhNEolXAYZKumdGt6E8FJLogh6NvnUdol0Iz2\nHfbZPvU8945G/PMjwU0VNXccxpBR/jPQ6Dn6Q6LS/BN9VBkiKZvBx1+GrjII\ntca9l5sHbSnTaS4YPwKlESKvR821ZNcAslT7xyX/eDsJYkDpkn+UO5CbqqBe\n9YMt7lKk37hOzfBH5z2irsxwVCtwiGKWjw2ef2uETDgSp9VgQJZUqrDYrniG\nmfQOePP2hT9e4EcFtLzdRBlK9bBAAyn7k6q4hfb2B/sEQSTZUHyoIdv5A3Pc\npRlebp19PKO/iW6UrWegOem42OS8T9mjsK908P3U4ec3k5AKj6O+pAAmW2e/\nqZwdwBvD4L4uV4NwA4qkiUQycNbEI3X0OfTKZfOvc/mzzak4TSU/DSrUSx/y\njkzFi6jAFZBEuR1t1D0BdhiDxW8Fc0FrnFCVbWMQlN4qYVAFlxeKa9eIH580\n57rAiqUY8yVQyhVWofI9eR7CRTpCpvQheDt7Md7cvNZpFI6B7POu1GG5A2Ba\npaobnCGjXmoGtGVZGdlfoSDFQe7NTmaZdY2Dl/vcBCjNSiQ/SVtfEsyHwTUz\naCY4VHKL6uY6etTio8Xvs9q1kXyiu4tHhd2vJkAVHHxfStRQWv3yHt6FHHT2\neOet\r\n=su8y\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```typescript\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```typescript\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 session connection\nprovider.on(\"connect\", () => {\n  console.log(\"connect\");\n});\n\n// Subscribe to session disconnection\nprovider.on(\"disconnect\", (code: number, reason: string) => {\n  console.log(code, reason);\n});\n```\n\n## Provider Methods\n\n```typescript\ninterface RequestArguments {\n  method: string;\n  params?: unknown[] | object;\n}\n\n// Send JSON RPC requests\nconst result = await provider.request(payload: RequestArguments);\n\n// Close provider session\nawait provider.disconnect()\n```\n\n## Web3 Methods\n\n```typescript\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\n### Required\n\nIn order to resolve non-signing requests you need to provide one of the following:\n\n#### Infura ID\n\nThe infuraId will support the following chainId's: Mainnet (1), Ropsten (3), Rinkeby(4), Goerli (5) and Kovan (42)\n\n```typescript\nconst provider = new WalletConnectProvider({\n  infuraId: \"27e484dcd9e3efcfd25a83a78777cdf1\",\n});\n```\n\n#### RPC URL Mapping\n\nThe RPC URL mapping should indexed by chainId and it requires at least one value.\n\n```typescript\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\n### Optional\n\nYou can also customize the connector through the provider using the following options\n\n#### Bridge URL\n\nUse your own hosted bridge by providing the url\n\n```typescript\nconst provider = new WalletConnectProvider({\n  infuraId: \"27e484dcd9e3efcfd25a83a78777cdf1\",\n  bridge: \"https://bridge.myhostedserver.com\",\n});\n```\n\n#### Disable QR Code Modal\n\nUse your own custom qrcode modal and disable the built-in one\n\n```typescript\nconst provider = new WalletConnectProvider({\n  infuraId: \"27e484dcd9e3efcfd25a83a78777cdf1\",\n  qrcode: false,\n});\n\nprovider.connector.on(\"display_uri\", (err, payload) => {\n  const uri = payload.params[0];\n  CustomQRCodeModal.display(uri);\n});\n```\n\n#### Filter Mobile Linking Options\n\nIf you would like to reduce the number of mobile linking options or customize its order, you can provide an array of wallet names\n\n```typescript\nconst provider = new WalletConnectProvider({\n  infuraId: \"27e484dcd9e3efcfd25a83a78777cdf1\",\n  qrcodeModalOptions: {\n    mobileLinks: [\n      \"rainbow\",\n      \"metamask\",\n      \"argent\",\n      \"trust\",\n      \"imtoken\",\n      \"pillar\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.10","description":"Web3 Provider for WalletConnect","directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_nodeVersion":"14.15.4","dependencies":{"@walletconnect/types":"^1.3.5-rc.1","@walletconnect/utils":"^1.3.5-rc.1","web3-provider-engine":"16.0.1","@walletconnect/client":"^1.3.5-rc.1","@walletconnect/qrcode-modal":"^1.3.5-rc.1","@walletconnect/http-connection":"^1.3.5-rc.1"},"_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.3.5-rc.1_1612287337786_0.5994358604690089","host":"s3://npm-registry-packages"},"_id":"@walletconnect/web3-provider@1.3.5-rc.1","version":"1.3.5-rc.1"}