{"bugs":{"url":"https://github.com/walletconnect/walletconnect-monorepo/issues"},"dist":{"shasum":"e6e7774e43e1c5c0833c17fb3f389cc16490758f","tarball":"https://registry.npmjs.org/@walletconnect/client/-/client-1.0.0-beta.98.tgz","fileCount":8,"integrity":"sha512-ashTUdCdgv2KzhMAsTdkPWY5KQjl1/pRQz4lNAe6Oq5mUvPmsVamuRoRd8KdIklX1f6nSDRwBQ8DwIqBquITTw==","signatures":[{"sig":"MEYCIQC9bFtW5BOeLFPXVZZ1cK8X/hThEqWiKA113Uh8KV15cQIhAN+O0vCZUMa3MzPOBcBhuiPru/Lhgakmapn8OV4GyYyc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":802826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1OsnCRA9TVsSAnZWagAAR5oP/R9z/IxCfk5r9Y3orIMj\n+aP2DyWJHf0ra7QicyHUZUGCyw32P49duW85bx3LcZRPBNZdor1MG4A5hbFk\nBQcIGiUoGEoKlAO1jvDdCtr8stkTUmKkGsYv7wmUyYrJfztRUbzH33ofI/0M\n+VL1F+sa23n2HFB9KKjW9BIIqmqKSGCsld0uzSGRt1zpFg7H2uNwicgQ87p3\nvW1FBaBQkQ1WBT6MJJak3ZSvlh4ZyqmpWnEmegiiqoj+qedCNzKVODVwqnhr\niwf1Lk5tEPNL8K6qZAdtsXTYh7bQjiKnMgqY4kJmj9CrropmaOSFGbKWCNxv\nbJibvLw5AcVpxtioCcDfEWlR8110c6DQI7A8Ig1brpH9ejci+eRniEn9Tfvp\nk1MmtPm+coahGpUMPhap/62sRDJbfT9eM5xlGaanhp1nTPyPhIp1Hch4pm7m\nZMTpfzVeetjjdWmzH1KWWTfto1HI1ot6kSu/RH80qm2s/KVazhsu6DxPsCz4\n3J2PO3Ifbwy+TJR9pN97OwgFT3mTp1tFosxI3msm7bSxRTFOLc/FTtiecQl9\nvuFREXTqP/0siuBLxknE2ChK6DkIyZHtDJPqMa//DApo7Te6ZwwdmkK1OVGQ\nkou24mWyn2qqotDwhsB2iDLD+H2m49bvtJijzprpq50CcufSmcNJLK7YrcZi\nJchd\r\n=4XCx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"@walletconnect/client","types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","author":{"name":"WalletConnect","email":"walletconnect.org"},"readme":"# WalletConnect Client\n\nClient for WalletConnect\n\nFor more details, read the [documentation](https://docs.walletconnect.org)\n\n## Install\n\n```bash\nyarn add @walletconnect/client\n# OR\n\nnpm install --save @walletconnect/client\n```\n\n## Initiate Connection\n\n```javascript\nimport WalletConnect from \"@walletconnect/client\";\n\n// Create a connector\nconst connector = new WalletConnect({\n  bridge: \"https://bridge.walletconnect.org\", // Required\n});\n\nconnector.on(\"session_update\", (error, payload) => {\n  if (error) {\n    throw error;\n  }\n\n  // Get updated accounts and chainId\n  const { accounts, chainId } = payload.params[0];\n});\n\nconnector.on(\"disconnect\", (error, payload) => {\n  if (error) {\n    throw error;\n  }\n\n  // Delete connector\n});\n\nconst { accounts, chainId } = await connector.connect();\n```\n\n## Send Transaction \\(eth_sendTransaction\\)\n\n```javascript\n// Draft transaction\nconst tx = {\n  from: \"0xbc28Ea04101F03aA7a94C1379bc3AB32E65e62d3\", // Required\n  to: \"0x89D24A7b4cCB1b6fAA2625Fe562bDd9A23260359\", // Required (for non contract deployments)\n  data: \"0x\", // Required\n  gasPrice: \"0x02540be400\", // Optional\n  gasLimit: \"0x9c40\", // Optional\n  value: \"0x00\", // Optional\n  nonce: \"0x0114\", // Optional\n};\n\n// Send transaction\nconnector\n  .sendTransaction(tx)\n  .then(result => {\n    // Returns transaction id (hash)\n    console.log(result);\n  })\n  .catch(error => {\n    // Error returned when rejected\n    console.error(error);\n  });\n```\n\n## Sign Transaction \\(eth_signTransaction\\)\n\n```javascript\n// Draft transaction\nconst tx = {\n  from: \"0xbc28Ea04101F03aA7a94C1379bc3AB32E65e62d3\", // Required\n  to: \"0x89D24A7b4cCB1b6fAA2625Fe562bDd9A23260359\", // Required (for non contract deployments)\n  data: \"0x\", // Required\n  gasPrice: \"0x02540be400\", // Optional\n  gasLimit: \"0x9c40\", // Optional\n  value: \"0x00\", // Optional\n  nonce: \"0x0114\", // Optional\n};\n\n// Sign transaction\nconnector\n  .signTransaction(tx)\n  .then(result => {\n    // Returns signed transaction\n    console.log(result);\n  })\n  .catch(error => {\n    // Error returned when rejected\n    console.error(error);\n  });\n```\n\n## Sign Personal Message \\(personal_sign\\)\n\n```javascript\n\n// Draft Message Parameters\nconst message = \"My email is john@doe.com - 1537836206101\"\n\nconst msgParams = [\n  convertUtf8ToHex(message)                                                 // Required\n  \"0xbc28ea04101f03ea7a94c1379bc3ab32e65e62d3\",                             // Required\n];\n\n\n// Sign personal message\nconnector\n  .signPersonalMessage(msgParams)\n  .then((result) => {\n    // Returns signature.\n    console.log(result)\n  })\n  .catch(error => {\n    // Error returned when rejected\n    console.error(error);\n  })\n```\n\n## Sign Message \\(eth_sign\\)\n\n```javascript\n\n// Draft Message Parameters\nconst message = \"My email is john@doe.com - 1537836206101\";\n\nconst msgParams = [\n  \"0xbc28ea04101f03ea7a94c1379bc3ab32e65e62d3\",                            // Required\n  keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))    // Required\n];\n\n\n// Sign message\nconnector\n  .signMessage(msgParams)\n  .then((result) => {\n    // Returns signature.\n    console.log(result)\n  })\n  .catch(error => {\n    // Error returned when rejected\n    console.error(error);\n  })\n```\n\n## Sign Typed Data \\(eth_signTypedData\\)\n\n```javascript\n// Draft Message Parameters\nconst typedData = {\n  types: {\n    EIP712Domain: [\n      { name: \"name\", type: \"string\" },\n      { name: \"version\", type: \"string\" },\n      { name: \"chainId\", type: \"uint256\" },\n      { name: \"verifyingContract\", type: \"address\" },\n    ],\n    Person: [\n      { name: \"name\", type: \"string\" },\n      { name: \"account\", type: \"address\" },\n    ],\n    Mail: [\n      { name: \"from\", type: \"Person\" },\n      { name: \"to\", type: \"Person\" },\n      { name: \"contents\", type: \"string\" },\n    ],\n  },\n  primaryType: \"Mail\",\n  domain: {\n    name: \"Example Dapp\",\n    version: \"1.0.0-beta\",\n    chainId: 1,\n    verifyingContract: \"0x0000000000000000000000000000000000000000\",\n  },\n  message: {\n    from: {\n      name: \"Alice\",\n      account: \"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    },\n    to: {\n      name: \"Bob\",\n      account: \"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\n    },\n    contents: \"Hey, Bob!\",\n  },\n};\n\nconst msgParams = [\n  \"0xbc28ea04101f03ea7a94c1379bc3ab32e65e62d3\", // Required\n  typedData, // Required\n];\n\n// Sign Typed Data\nconnector\n  .signTypedData(msgParams)\n  .then(result => {\n    // Returns signature.\n    console.log(result);\n  })\n  .catch(error => {\n    // Error returned when rejected\n    console.error(error);\n  });\n```\n\n## Send Custom Request\n\n```javascript\n// Draft Custom Request\nconst customRequest = {\n  id: 1337,\n  jsonrpc: \"2.0\",\n  method: \"eth_signTransaction\",\n  params: [\n    {\n      from: \"0xbc28Ea04101F03aA7a94C1379bc3AB32E65e62d3\",\n      to: \"0x89D24A7b4cCB1b6fAA2625Fe562bDd9A23260359\",\n      data: \"0x\",\n      gasPrice: \"0x02540be400\",\n      gasLimit: \"0x9c40\",\n      value: \"0x00\",\n      nonce: \"0x0114\",\n    },\n  ],\n};\n\n// Send Custom Request\nconnector\n  .sendCustomRequest(customRequest)\n  .then(result => {\n    // Returns request result\n    console.log(result);\n  })\n  .catch(error => {\n    // Error returned when rejected\n    console.error(error);\n  });\n```\n\n## Create Instant Request\n\n```js\nimport WalletConnect from \"@walletconnect/browser\";\nimport WalletConnectQRCodeModal from \"@walletconnect/qrcode-modal\";\n\n// Create a connector\nconst connector = new WalletConnect();\n\n// Draft Instant Request\nconst instantRequest = {\n  id: 1,\n  jsonrpc: \"2.0\",\n  method: \"eth_signTransaction\",\n  params: [\n    {\n      from: \"0xbc28ea04101f03ea7a94c1379bc3ab32e65e62d3\",\n      to: \"0x0000000000000000000000000000000000000000\",\n      nonce: 1,\n      gas: 100000,\n      value: 0,\n      data: \"0x0\",\n    },\n  ],\n};\n\n// Create Instant Request\nconnector\n  .createInstantRequest(instantRequest)\n  .then(result => {\n    // Get Instant Request Result\n    console.log(result);\n  })\n  .catch(error => {\n    // Handle Error or Rejection\n    console.error(error);\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/tree/v1.0.0-beta","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":"Client for WalletConnect","directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_nodeVersion":"10.20.1","dependencies":{"@walletconnect/core":"^1.0.0-beta.98","@walletconnect/types":"^1.0.0-beta.98","@walletconnect/utils":"^1.0.0-beta.98","@walletconnect/iso-crypto":"^1.0.0-beta.98"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsdx":"0.12.3","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/client_1.0.0-beta.98_1591012134885_0.19980710277824332","host":"s3://npm-registry-packages"},"_id":"@walletconnect/client@1.0.0-beta.98","version":"1.0.0-beta.98"}