{"_id":"@blockshake/defly-connect-dev","_rev":"1-67e961dacdcf91c211fd5a12dcee4055","name":"@blockshake/defly-connect-dev","dist-tags":{"latest":"1.1.6"},"versions":{"1.1.5":{"version":"1.1.5","name":"@blockshake/defly-connect-dev","description":"JavaScript SDK for integrating Defly Wallet to web applications.","main":"dist/index.js","scripts":{"dev":"rollup -c -w","build":"rollup -c","eslint":"eslint --ext .jsx,.js,.tsx,.ts src/"},"author":{"name":"Defly 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":{"@walletconnect/client":"^1.8.0","@walletconnect/types":"^1.8.0","bowser":"2.11.0","buffer":"^6.0.3","lottie-web":"^5.9.6","qr-code-styling":"1.6.0-rc.1"},"peerDependencies":{"algosdk":"^2.1.0"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/blockshake-io/wallet-connect.git"},"bugs":{"url":"https://github.com/blockshake-io/wallet-connect/issues"},"homepage":"https://github.com/blockshake-io/wallet-connect#readme","gitHead":"a4d48ff5332d58100a34a12a5859c936f35a3970","_id":"@blockshake/defly-connect-dev@1.1.5","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-vZhyo14FQ97KQtXwlx2pLQRVUTOYSHQWf1Azsdc8rOQ7zgODc/2a7N1aPxnYBDkBqhIAx+f1jIfzzoij79atWw==","shasum":"c8dfa4a7394f1cc3ed6e98b3b4549da5079d95af","tarball":"https://registry.npmjs.org/@blockshake/defly-connect-dev/-/defly-connect-dev-1.1.5.tgz","fileCount":112,"unpackedSize":276793,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGk6/k/uZsPdBtfEpCC0d6v+oK+v8VS/ghfQ9F/Ap+XQIhANXEmTGELiIDSuGkG1PfRygR4OFcqfZxl/UZxn8iQHDz"}]},"_npmUser":{"name":"blockshake.io","email":"npm@blockshake.io"},"directories":{},"maintainers":[{"name":"blockshake.io","email":"npm@blockshake.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defly-connect-dev_1.1.5_1687594118521_0.469443004142716"},"_hasShrinkwrap":false},"1.1.6":{"version":"1.1.6","name":"@blockshake/defly-connect-dev","description":"JavaScript SDK for integrating Defly Wallet to web applications.","main":"dist/index.js","scripts":{"dev":"rollup -c -w","build":"rollup -c","eslint":"eslint --ext .jsx,.js,.tsx,.ts src/"},"author":{"name":"Defly 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":{"@walletconnect/client":"^1.8.0","@walletconnect/types":"^1.8.0","bowser":"2.11.0","buffer":"^6.0.3","lottie-web":"^5.9.6","qr-code-styling":"1.6.0-rc.1"},"peerDependencies":{"algosdk":"^2.1.0"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/blockshake-io/wallet-connect.git"},"bugs":{"url":"https://github.com/blockshake-io/wallet-connect/issues"},"homepage":"https://github.com/blockshake-io/wallet-connect#readme","gitHead":"61a4e34d54c39dd8a6ac7a53fb65fbfe0b6170c6","_id":"@blockshake/defly-connect-dev@1.1.6","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-G0aUhflv/KT4q1oHr4n7xex+YKi1fYctPWJg3zr4Q7gRpopDYfqUU4AwHSlDD9aU+FaGukRRUDnS7UFCf4MyWQ==","shasum":"6f5498b6cf8efabdcd5bbc14e1b6c374d241dbf1","tarball":"https://registry.npmjs.org/@blockshake/defly-connect-dev/-/defly-connect-dev-1.1.6.tgz","fileCount":112,"unpackedSize":276793,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICgwgD2aj2wtCtKMZXhNGSH/aZIlHniHwQXj0FWbSVmBAiEA2ylG1W0X7s2ccVATvdcN95ecuYriI4pUdwyymtBCs60="}]},"_npmUser":{"name":"blockshake.io","email":"npm@blockshake.io"},"directories":{},"maintainers":[{"name":"blockshake.io","email":"npm@blockshake.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defly-connect-dev_1.1.6_1687594706123_0.7608495084800606"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-24T08:08:38.385Z","1.1.5":"2023-06-24T08:08:38.898Z","modified":"2023-06-24T08:18:28.747Z","1.1.6":"2023-06-24T08:18:27.749Z"},"maintainers":[{"name":"blockshake.io","email":"npm@blockshake.io"}],"description":"JavaScript SDK for integrating Defly Wallet to web applications.","homepage":"https://github.com/blockshake-io/wallet-connect#readme","repository":{"type":"git","url":"git+https://github.com/blockshake-io/wallet-connect.git"},"author":{"name":"Defly Wallet"},"bugs":{"url":"https://github.com/blockshake-io/wallet-connect/issues"},"license":"ISC","readme":"\n### @blockshake/defly-connect\n\nJavaScript SDK for integrating [Defly Wallet](https://defly.app) to web applications. For more detailed information, please check our [Defly Manual](https://docs.defly.app/app/overview/).\n\nThis is a fork of the Pera connect JavaScript SDK, for more details visit [Pera connect](https://github.com/perawallet/connect) on GitHub.\n\n### Quick Start\n\nLet's start with installing `@blockshake/defly-connect`\n\n```\nnpm install --save @blockshake/defly-connect\n```\n\n```jsx\n// Connect handler\ndeflyWallet\n  .connect()\n  .then((newAccounts) => {\n    // Setup the disconnect event listener\n    deflyWallet.connector?.on(\"disconnect\", handleDisconnectWalletClick);\n\n    setAccountAddress(newAccounts[0]);\n  })\n  .reject((error) => {\n    // You MUST handle the reject because once the user closes the modal, deflyWallet.connect() promise will be rejected.\n    // For the async/await syntax you MUST use try/catch\n    if (error?.data?.type !== \"CONNECT_MODAL_CLOSED\") {\n      // log the necessary errors\n    }\n  });\n```\n\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.\n\n```jsx\n// On the every page refresh\ndeflyWallet.reconnectSession().then((accounts) => {\n  // Setup the disconnect event listener\n  deflyWallet.connector?.on(\"disconnect\", handleDisconnectWalletClick);\n\n  if (accounts.length) {\n    setAccountAddress(accounts[0]);\n  }\n});\n```\n\nAfter that you can sign transaction with this way\n\n```jsx\n// Single Transaction\ntry {\n  const signedTxn = await deflyWallet.signTransaction([singleTxnGroups]);\n} catch (error) {\n  console.log(\"Couldn't sign Opt-in txns\", error);\n}\n```\n\n## Options\n\n| option                   | default | value                                 |          |\n| ------------------------ | ------- | ------------------------------------- | -------- |\n| `chainId`                | `4160`  | `416001`, `416002`, `416003` , `4160` | optional |\n| `shouldShowSignTxnToast` | `true`  | `boolean`                             | optional |\n\n#### **`chainId`**\n\nDetermines which Algorand network your dApp uses.\n\n**MainNet**: 416001\n\n**TestNet**: 416002\n\n**BetaNet**: 416003\n\n**All Networks**: 4160\n\n#### **`shouldShowSignTxnToast`**\n\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:\n\n## Methods\n\n#### `DeflyWalletConnect.connect(): Promise<string[]>`\n\nStarts the initial connection flow and returns the array of account addresses.\n\n#### `DeflyWalletConnect.reconnectSession(): Promise<string[]>`\n\nReconnects to the wallet if there is any active connection and returns the array of account addresses.\n\n#### `DeflyWalletConnect.disconnect(): Promise<void | undefined>`\n\nDisconnects from the wallet and resets the related storage items.\n\n#### `DeflyWalletConnect.platform: DeflyWalletPlatformType`\n\nReturns the platform of the active session. Possible responses: _`mobile | null`_\n\n#### `DeflyWalletConnect.isConnected: boolean`\n\nChecks if there's any active session regardless of platform. Possible responses: _`true | false`_\n\n#### `DeflyWalletConnect.signTransaction(txGroups: SignerTransaction[][], signerAddress?: string): Promise<Uint8Array[]>`\n\nStarts the sign process and returns the signed transaction in `Uint8Array`\n\n### Customizing Style\n\nYou can override the z-index using the `.defly-wallet-connect-modal` class so that the modal does not conflict with another component on your application.\n\n```scss\n.defly-wallet-connect-modal {\n  // The default value of z-index is 10. You can lower and raise it as much as you want.\n  z-index: 11;\n}\n```\n\n### Your app name on Defly Wallet\n\nBy default, the connect wallet drawer on Defly Wallet gets the app name from `document.title`.\n\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.\n\n```html\n<meta name=\"name\" content=\"My dApp\" />\n```\n\n### Contributing\n\nAll contributions are welcomed! To get more information about the details, please read the [contribution](./CONTRIBUTING.md) guide first.\n","readmeFilename":"README.md"}