{"_id":"@daffiwallet/connect","_rev":"5-24db25afa3e09ce61f80ddebf1e22eae","time":{"created":"2023-04-06T11:10:34.311Z","1.0.0":"2023-04-06T10:50:35.247Z","modified":"2023-04-06T12:24:10.850Z","1.0.1":"2023-04-06T11:10:34.517Z","1.0.2":"2023-04-06T12:09:05.904Z","1.0.3":"2023-04-06T12:24:10.656Z"},"name":"@daffiwallet/connect","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"version":"1.0.1","name":"@daffiwallet/connect","description":"JavaScript SDK for integrating Daffi Wallet to web applications.","main":"dist/index.js","scripts":{"dev":"rollup -c -w","build":"npm run eslint && .\\node_modules\\.bin\\rollup -c","eslint":"eslint --ext .jsx,.js,.tsx,.ts src\\"},"author":{"name":"Daffi Wallet"},"license":"ISC","devDependencies":{"@hipo/eslint-config-base":"^4.1.1","@hipo/eslint-config-typescript":"^1.1.0","@rollup/plugin-image":"^2.1.1","@rollup/plugin-json":"^4.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","@typescript-eslint/parser":"^5.17.0","eslint":"^8.12.0","eslint-config-prettier":"^8.5.0","node-sass":"^7.0.1","prettier":"^2.6.1","rollup":"^2.70.1","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^4.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.31.2","sass":"^1.49.11","typescript":"^4.6.3"},"dependencies":{"@evanhahn/lottie-web-light":"5.8.1","@walletconnect/client":"^1.8.0","@walletconnect/types":"^1.8.0","bowser":"2.11.0","buffer":"^6.0.3","qr-code-styling":"^1.5.0"},"peerDependencies":{"algosdk":"^2.1.0"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/daffiWallet/connect.git"},"bugs":{"url":"https://github.com/daffiWallet/connect/issues"},"homepage":"https://github.com/daffiWallet/connect#readme","_id":"@daffiwallet/connect@1.0.1","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-mmM34Yi2+SDBjJudD5TB+cF/nVrxYaaOXmfmOpZyThPLCQvjoo6BOsZKLO/nF+khnW2iwPzKl1X7OzfgedpI0A==","shasum":"fcdb169fefdd86ac73ae64b589e68979eab08bba","tarball":"https://registry.npmjs.org/@daffiwallet/connect/-/connect-1.0.1.tgz","fileCount":70,"unpackedSize":214947,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr+wNbWMWWNJDVY/jN/WU9LNAbr2vO4ca/5Cfa6FaW8AIgQw+ThzgJagn0xmU04960b1NMZSZ43M2XdtnjwdBAH5c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLqiqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8rA/8DXuPAzED1NUCodIvHf/jQqbPcCYipU2lMPe5A0FouS3egz9m\r\np8SyMZVPTugLU0cyu5PDjwevnYr7dRHZQ6rFs0W4kew952tLlZNWWnMhrND4\r\n9Cl6dU42ggXNnn9fGaKlxoec0Xmti+B0G9q3QFXN2nbUyA7wWasAeBjxYREI\r\nVhQg3AIK8e/7cGele6QtYiDLoCEUzNMim0NGqJGRxe7nk+5Fn7n2BHahRODV\r\nwzbxoxl1Ie8whcFBJ6pGux/u07Lb7tRRUicynYaMNIJ1a4rQV6QcGSgqH7B8\r\nl+x7gWDyvLFNQEoZC3yj/ztkt5nDrq5FT9x+zgdhHGsnS+3boauAqrPf7PoZ\r\nogBsiznrKio7uYnQzJPklrOt6ctf2MKChTs1rOo3S7GYdfFFF38Khfh977m/\r\nezQjOLKtyZASeTsJhZEyH63imfo4LZpRwwbmvK313hus6IymEnZKwq/IIZBq\r\ndi/wRo4M2ecnPOtY51Rg0GGQMk+SLEkXoI6VwccZwodwU/GnavLTYW/EKKZR\r\nc0mtrVEgYvMYV7bbDGgRpO8sCq1PE4eghCA1q+f3baYXwDqkSPyJQHxUXYTX\r\nfj/W9EmQNKXmfXkighF3cqjX98BdzFvcdiSY9oBhvzJ7j/3cT5uHxPSUp02W\r\newqZK/9+Baj30vFBzwU35uT80KlyCCzAETM=\r\n=Y67s\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"},"directories":{},"maintainers":[{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/connect_1.0.1_1680779434360_0.7365362059310692"},"_hasShrinkwrap":false},"1.0.2":{"version":"1.0.2","name":"@daffiwallet/connect","description":"JavaScript SDK for integrating Daffi Wallet to web applications.","main":"dist/index.js","scripts":{"dev":"rollup -c -w","build":"npm run eslint && .\\node_modules\\.bin\\rollup -c","eslint":"eslint --ext .jsx,.js,.tsx,.ts src\\"},"author":{"name":"Daffi Wallet"},"license":"ISC","devDependencies":{"@hipo/eslint-config-base":"^4.1.1","@hipo/eslint-config-typescript":"^1.1.0","@rollup/plugin-image":"^2.1.1","@rollup/plugin-json":"^4.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","@typescript-eslint/parser":"^5.17.0","eslint":"^8.37.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.27.5","node-sass":"^7.0.1","prettier":"^2.6.1","rollup":"^2.70.1","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^4.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.31.2","sass":"^1.49.11","typescript":"^4.6.3"},"dependencies":{"@evanhahn/lottie-web-light":"5.8.1","@walletconnect/client":"^1.8.0","@walletconnect/types":"^1.8.0","bowser":"2.11.0","buffer":"^6.0.3","qr-code-styling":"^1.5.0"},"peerDependencies":{"algosdk":"^2.2.0"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/RDinitiativ/daffiwallet_connect.git"},"bugs":{"url":"https://github.com/RDinitiativ/daffiwallet_connect/issues"},"homepage":"https://github.com/RDinitiativ/daffiwallet_connect#readme","_id":"@daffiwallet/connect@1.0.2","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-L55EKcAqUI/EbwyDM53JmS1CuauxcnnqjkDjXqaebn3aYDowXtFdo5KdvfV6iatQf5sGl1J15Ygd+8Nzzsngug==","shasum":"f298332b554a8adac6754f53546ff720f021b982","tarball":"https://registry.npmjs.org/@daffiwallet/connect/-/connect-1.0.2.tgz","fileCount":70,"unpackedSize":215023,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMzhox1Vzc4qbrzHLl8ZQfOTzNq0g/WrhD6OovsT4j1AIhAKNKL2ZSmV0Ki7Ax1Cl29jdFVW84MuNaHiUXyQSij1G5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLrZhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTxA/9FmlRLGNc46D2BExNKglGgUJ8fEeSU2+Z8fpEXFhv1KGgOFaP\r\nMeCA2CExiSA7t7WF7a281knIuVOycUIiAXfitixg/PtCQM+cKoGKC8WXC5xX\r\npkUO9r6aMfp3D+VNezBnN/sigipWJ3U1KArxtc/jFoMkAUirW1n/nBQFjIZ1\r\nkoLCsqsoB0534f6LXE9BMGGydzKgsoo40qlXONUnVUzr2xhltbiz1v22n35a\r\nB58d+YeDwInmpuCAtWU+ezixNsBJmaSPddrsTeZug67KC2vEqQpyNL0Ha6i/\r\n1wPkDUFgsecLOZgFmCg5hCGf0m3PSrKh871UEMzxdIFnLLUmHQ7wBlUieZWk\r\niO0zmhY0HzFcSvVpzgFr7flPuO3EMDutxsyPs44t9Gen7QUe7Con3LUPKULD\r\nAZlZ1+bQrPpjYkVEKvOXUKBAI99GpeC9jrd5BbUcTKK0jNNuTULrNXQdrKjm\r\nbAzfOXCc8z/M/5+myhzPgO78iQ02qZH1a4ij2M7YQujIOdfRngnfkLAYHQcx\r\nc6+oPcZHj97wIzYImLUiYvj30mzA7Gtr2N/c8cpAN4CEWDfIjWCX2P6ud1mE\r\nzfEd/kFJrcl2+3ZD2Bm24JkGnrh6r4H4mKJaSjbHqBMCpUpbwzrwJvwdWQU5\r\nTFlgXlcMzDmd+PxgK+tzNiCEh1pitVKtEXQ=\r\n=P1Kl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"},"directories":{},"maintainers":[{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/connect_1.0.2_1680782945736_0.9215061081204801"},"_hasShrinkwrap":false},"1.0.3":{"version":"1.0.3","name":"@daffiwallet/connect","description":"JavaScript SDK for integrating Daffi Wallet to web applications.","main":"dist/index.js","scripts":{"dev":"rollup -c -w","build":"npm run eslint && .\\node_modules\\.bin\\rollup -c","eslint":"eslint --ext .jsx,.js,.tsx,.ts src\\"},"author":{"name":"DaffiWallet"},"license":"ISC","devDependencies":{"@hipo/eslint-config-base":"^4.1.1","@hipo/eslint-config-typescript":"^1.1.0","@rollup/plugin-image":"^2.1.1","@rollup/plugin-json":"^4.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","@typescript-eslint/parser":"^5.17.0","eslint":"^8.12.0","eslint-config-prettier":"^8.5.0","node-sass":"^7.0.1","prettier":"^2.6.1","rollup":"^2.70.1","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^4.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.31.2","sass":"^1.49.11","typescript":"^4.6.3"},"dependencies":{"@evanhahn/lottie-web-light":"5.8.1","@walletconnect/client":"^1.8.0","@walletconnect/types":"^1.8.0","bowser":"2.11.0","buffer":"^6.0.3","qr-code-styling":"^1.5.0"},"peerDependencies":{"algosdk":"^2.1.0"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/RDinitiativ/daffiwallet_connect.git"},"bugs":{"url":"https://github.com/RDinitiativ/daffiwallet_connect/issues"},"homepage":"https://github.com/RDinitiativ/daffiwallet_connect#readme","gitHead":"18ba11a69676ff3ac1e152136480dd294869b964","_id":"@daffiwallet/connect@1.0.3","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-H2YaVfvsAW57s23JpJD9cP97hJsO527YtoT/Iga/fBlUUe6akXGi5Uvz3q6KAI8jD7GJ4N3qQTpK4nFbTHmDyQ==","shasum":"fe77b73ad1e867e6171cb8fbdee01cb7f379d0ff","tarball":"https://registry.npmjs.org/@daffiwallet/connect/-/connect-1.0.3.tgz","fileCount":303,"unpackedSize":13127991,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQcwCZ9lN2K1XM9XV3+zZzgpZJoFrdswZXyZaxKRhIOAIgNJB3IyY30PkSWAkvbYMjYBlNYKS5c7c3WqzjUKVfoqQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLrnqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnOhAAlL568131Brf7Y1QA0fXSIMUZWsokoa3PayPlc4L5LNycT81s\r\nkN9+v/FGh3itEIHcpBiOsfx49xzSV+LFPlaBIllTMDOD795y3ePwrdn4qm0Y\r\n+ePAjeP92JjQ7XndxBG70YfL+gkcVEEoUJsVpUk+jALUdyqZh5dCPZEeXOzU\r\ni0opnPUQ9tqE+zmtokWPVexchOpEjnyk3TjFwKE/g0H2OkFL8b7Lbi3ub3du\r\nkUtIw+8tNIzC4kF/YvfnTDKNOpurssLVYz0dNLED4W1OU+do5NMxVyk1pMjP\r\nfbRAltqygoLiw6cOnQA8ubrB+RJjeHS4v52KEN4Wy5JHzMX2HVBc+zzUsl9Z\r\nttVQMRHCjicNcc2QpqrmI1Y0P1wH+xCQYy+9/DcZc1V+YMf7UUhD8jqRYyjN\r\nZGmheA9HzkvmJqe2apP/5a1erJQuaKIKkaWTO8kZT/yCv+PUYk7pTU0KoBqh\r\nJ4teUQlfOYiEAJx2piTMOQpLsE2IGCI5ZzcRZ94Q6MVlGkDQYzAxJuhiGXaG\r\nQTve0BZcnF9TjnawVby+fWxxfs8HCFbuKU4amn3MHpmfdL0dcZF9YincLZMg\r\nuxRzU5StxrZ38MjcCASp18UaxMtfuuTKgSJhy5eoMIQ5kQbk+sn9oPOa2eUX\r\nqWl/9eF4QiKrar9fi0UdbhicVjf1d4UoP0M=\r\n=zeCW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"},"directories":{},"maintainers":[{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/connect_1.0.3_1680783850377_0.6006591490916073"},"_hasShrinkwrap":false}},"maintainers":[{"name":"daffi_wallet","email":"haroon.niaz@tech-tycoon.com"}],"description":"JavaScript SDK for integrating Daffi Wallet to web applications.","homepage":"https://github.com/RDinitiativ/daffiwallet_connect#readme","repository":{"type":"git","url":"git+https://github.com/RDinitiativ/daffiwallet_connect.git"},"author":{"name":"DaffiWallet"},"bugs":{"url":"https://github.com/RDinitiativ/daffiwallet_connect/issues"},"license":"ISC","readme":"## @daffiwallet/connect\r\n\r\nJavaScript SDK for integrating [Daffi Wallet](https://web.daffiwallet.app/) to web applications.\r\n\r\n[![](https://img.shields.io/npm/v/@daffiwallet/connect?style=flat-square)](https://www.npmjs.com/package/@daffiwallet/connect) [![](https://img.shields.io/bundlephobia/min/@daffiwallet/connect?style=flat-square)](https://www.npmjs.com/package/@daffiwallet/connect)\r\n\r\n## Getting Started\r\n\r\n[Learn how to integrate with your JavaScript application](#guide)\r\n\r\n[Learn how to Sign Transactions](#sign-transaction)\r\n\r\n[Try it out using CodeSandbox](#example-applications)\r\n\r\n## Quick Start\r\n\r\nLet's start with installing `@daffiwallet/connect`\r\n\r\n```\r\nnpm install --save @daffiwallet/connect\r\n```\r\n\r\n```jsx\r\n// Connect handler\r\ndaffiWallet\r\n  .connect()\r\n  .then((newAccounts) => {\r\n    // Setup the disconnect event listener\r\n    daffiWallet.connector?.on(\"disconnect\", handleDisconnectWalletClick);\r\n\r\n    setAccountAddress(newAccounts[0]);\r\n  })\r\n  .reject((error) => {\r\n    // You MUST handle the reject because once the user closes the modal, daffiWallet.connect() promise will be rejected.\r\n    // For the async/await syntax you MUST use try/catch\r\n    if (error?.data?.type !== \"CONNECT_MODAL_CLOSED\") {\r\n      // log the necessary errors\r\n    }\r\n  });\r\n```\r\n\r\nIf you don't want the user's account information to be lost by the dApp when the user closes the browser with user’s wallet connected to the dApp, you need to handle the reconnect session status. You can do this in the following way.\r\n\r\n```jsx\r\n// On the every page refresh\r\ndaffiWallet.reconnectSession().then((accounts) => {\r\n  // Setup the disconnect event listener\r\n  daffiWallet.connector?.on(\"disconnect\", handleDisconnectWalletClick);\r\n\r\n  if (accounts.length) {\r\n    setAccountAddress(accounts[0]);\r\n  }\r\n});\r\n```\r\n\r\nAfter that you can sign transaction with this way\r\n\r\n```jsx\r\n// Single Transaction\r\ntry {\r\n  const signedTxn = await daffiWallet.signTransaction([singleTxnGroups]);\r\n} catch (error) {\r\n  console.log(\"Couldn't sign Opt-in txns\", error);\r\n}\r\n```\r\n\r\n## Options\r\n\r\n| option                   | default | value                                 |          |\r\n| ------------------------ | ------- | ------------------------------------- | -------- |\r\n| `chainId`                | `4160`  | `416001`, `416002`, `416003` , `4160` | optional |\r\n| `shouldShowSignTxnToast` | `true`  | `boolean`                             | optional |\r\n\r\n#### **`chainId`**\r\n\r\nDetermines which Algorand network your dApp uses.\r\n\r\n**MainNet**: 416001\r\n\r\n**TestNet**: 416002\r\n\r\n**BetaNet**: 416003\r\n\r\n**All Networks**: 4160\r\n\r\n#### **`shouldShowSignTxnToast`**\r\n\r\nIt's enabled by default but in some cases, you may not need the toast message (e.g. you already have signing guidance for users). To disable it, use the shouldShowSignTxnToast option:\r\n\r\n## Methods\r\n\r\n#### `DaffiWalletConnect.connect(): Promise<string[]>`\r\n\r\nStarts the initial connection flow and returns the array of account addresses.\r\n\r\n#### `DaffiWalletConnect.reconnectSession(): Promise<string[]>`\r\n\r\nReconnects to the wallet if there is any active connection and returns the array of account addresses.\r\n\r\n#### `DaffiWalletConnect.disconnect(): Promise<void | undefined>`\r\n\r\nDisconnects from the wallet and resets the related storage items.\r\n\r\n#### `DaffiWalletConnect.platform: DaffiWalletPlatformType`\r\n\r\nReturns the platform of the active session. Possible responses: _`mobile | web | null`_\r\n\r\n#### `DaffiWalletConnect.isConnected: boolean`\r\n\r\nChecks if there's any active session regardless of platform. Possible responses: _`true | false`_\r\n\r\n#### `DaffiWalletConnect.signTransaction(txGroups: SignerTransaction[][], signerAddress?: string): Promise<Uint8Array[]>`\r\n\r\nStarts the sign process and returns the signed transaction in `Uint8Array`\r\n\r\n## Customizing Style\r\n\r\nYou can override the z-index using the `.daffi-wallet-modal` class so that the modal does not conflict with another component on your application.\r\n\r\n```scss\r\n.daffi-wallet-modal {\r\n  // The default value of z-index is 10. You can lower and raise it as much as you want.\r\n  z-index: 11;\r\n}\r\n```\r\n\r\n## Your app name on Daffi Wallet\r\n\r\nBy default, the connect wallet drawer on Daffi Wallet gets the app name from `document.title`.\r\n\r\nIn some cases, you may want to customize it. You can achieve this by adding a meta tag to your HTML between the `head` tag.\r\n\r\n```html\r\n<meta name=\"name\" content=\"My dApp\" />\r\n```\r\n\r\n## Contributing\r\n\r\nAll contributions are welcomed! To get more information about the details, please read the [contribution](./CONTRIBUTING.md) guide first.\r\n","readmeFilename":"README.md"}