{"bugs":{"url":"https://github.com/walletconnect/walletconnect-monorepo/issues"},"dist":{"shasum":"d1a9aa2073b2cdeef11746443d53c2519bd8f53b","tarball":"https://registry.npmjs.org/@walletconnect/client/-/client-1.1.0-rc.0.tgz","fileCount":8,"integrity":"sha512-LQYuXe2/brzIQM/bCFRb4PWehUVi68nbA6NXjAHR35DzgYP0HAYL9r9qR+C82b7EMMD78gZfCdNIyh4hnIioYQ==","signatures":[{"sig":"MEQCICGKCI6B0Qr8kDF3QfiSWCJA0gca5X+bgxKkA4PrslSOAiAhpyT01whHIaBi/WuSXw2383iTChvIiVpKebee4dzFAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":779025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFgD9CRA9TVsSAnZWagAAij0QAJnAOJOYEr9S72pnM7RM\nHvV1s4WBQ5GQ7GqmLJODgKvDHp9824NOMXIt3nMPLVoNkcHWU2GW1MmOGtgi\n4egpk7m05azTRWAmmM0eXYt7ptkRydOCz6Pd8hyPz6e3mVSfTwhaXNau6Yn/\nXLRdj4QYLTh8qSCA6KJmgoduP5WjbTa8mInF6o4TtezCYt8wl65ZLADaxa4b\nABmUeZ6S+t3z7zZKavHdWwZUifPK6HVRfPMMKMm+E49TAH7QG2Uuzqvy+4l3\n1QYUw2onM4bhKV02D16Yl8f69ZDDTqpZJwEkYY/ne7UYFnJ8ba+9d66+LmKD\nTW27hsutb11wyLjVhIdLKYBZumHLGAGUZXZqlm5Y8AUafkM51Wbsc+E7NSDt\nBXgtfW5b5HUgz5GJ2gxAFdUDeGuF1UtLiAotmsBoY8fAV7Wx2gLGxJ2I0F5O\nXy7iMYC3+ShLL/Bek9CP5HuIZgz1iaWyZpkTO4T1WghIxo4X7ZQO8Vnh/HA5\n6sNM1BdvSlnL3mFLFX74SFxtfHMDp9curhGgDRgvi+O5xmBVwfzQaxQTmcf/\nO6GRixJFs2TTTOOjn0NlUo/2gctevBzQT6AO7W0diOTqtH5tzZYO+hV2ngnn\nMu3AQfIIVs5uKIoeqDTxw5osLPDpLsjchorA5ZRCVGHC1UysNNoT+xCti29W\nyrmw\r\n=Tm5F\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.13.7","description":"Client for WalletConnect","directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_nodeVersion":"13.13.0","dependencies":{"@walletconnect/core":"^1.1.0-rc.0","@walletconnect/types":"^1.1.0-rc.0","@walletconnect/utils":"^1.1.0-rc.0","@walletconnect/iso-crypto":"^1.1.0-rc.0"},"_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.1.0-rc.0_1595277565252_0.15461425673105622","host":"s3://npm-registry-packages"},"_id":"@walletconnect/client@1.1.0-rc.0","version":"1.1.0-rc.0"}