{"bugs":{"url":"https://github.com/walletconnect/walletconnect-monorepo/issues"},"dist":{"shasum":"0ab3bfa756e51b3dd480f8794b4c515870f79382","tarball":"https://registry.npmjs.org/@walletconnect/client/-/client-1.0.8.tgz","fileCount":8,"integrity":"sha512-lZkTNTeEvxQ1DNCUmXxWABi0lRAw2ztCFjivP33Am9wJy7VbJliP2H7ipSua3EWPTZ+YLlm95MM6PNvpX2sezA==","signatures":[{"sig":"MEUCIQDcXgWSs6+zbR2dCY5pzRxJ4vQABypn06PI0362DR1rdAIgBpJ0qYZmwCiB2cepiF9bmLxIONU9PAxuJxBknmMMXj8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":791611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8PtQCRA9TVsSAnZWagAAMKgP/2o14AyPKGc4E+x5+sV/\nK5RXO9YsdCTcvSBMv3VsxqYLxBMvNFXKVei0JCIXqiFc2DUobUoROGmsD7Re\n8DRM47e3p1/NETlcuCPgYg5S5nBc3rMFwcpoKgzT5vnbOMeAWFmojfeyijdf\nFGinpzuohOhhfB47rHPe4cplzInO5S+dV4Tov0Fm6hIp7BHbdB6Q2nkBDcjM\nbHsNWY3Zu2ZBDMkc9BpKfJ1DRdj+8f+98GnTFUmBzSBL3glzzc2P7cpamzU6\nSP0iubEmlF9lJAg5hkicQrpcrDVyRexF0isH/A0V3jDIjW1J9alEtSfCyyLH\n2NZnA6Y8ah5Wv3hbsSxToNayoOuCBNQT/JKfYojznGcdCBrqKn9FfRS0BT0D\nba1chP6t6NEAlHm2SZZ+I6qZ4aPvtAAJ3vB4d5defS3gCtJ+zpJxEuenf3E2\n5M0ls2MABi4hc5PDDTItV0Eyx+5G3rjMGvakvuEJjpYR+ecfjmbbae8iQ637\nZ1InUa1+GZPc3olPGnvNIAnQKFMapLS0AcCqiF734bkaG0RIDFRc2WrYBIzM\nrLZrWdJpQ0hpt8fn4oBxdHeB5glDldYGyr9xlhj80jhPCaA3d7FWLv1nSEfp\npKZHVM7i5CnDCO5t4csgz7D5AwQiS5YzHcxT+Y2BQ8kjioMfIEw9D1vFcScL\nCXCE\r\n=GAAr\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/","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.8","@walletconnect/types":"^1.0.8","@walletconnect/utils":"^1.0.8","@walletconnect/iso-crypto":"^1.0.8"},"_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.8_1592851280269_0.27524574191711304","host":"s3://npm-registry-packages"},"_id":"@walletconnect/client@1.0.8","version":"1.0.8"}