{"_id":"@dartroom/signer","_rev":"7-b0cc3ad4e1609f04b5f93576e4205153","name":"@dartroom/signer","dist-tags":{"latest":"0.3.5-alpha"},"versions":{"0.3.3-alpha":{"name":"@dartroom/signer","version":"0.3.3-alpha","keywords":["algorand"],"author":{"name":"Stef de Groot"},"license":"MIT","_id":"@dartroom/signer@0.3.3-alpha","maintainers":[{"name":"stefdegroot","email":"stefdegrootsdg@gmail.com"}],"homepage":"https://github.com/Dartroom/dart-signer#readme","bugs":{"url":"https://github.com/Dartroom/dart-signer/issues"},"dist":{"shasum":"8aa69b8f0e3ea83406af2d9cb324902e952126b9","tarball":"https://registry.npmjs.org/@dartroom/signer/-/signer-0.3.3-alpha.tgz","fileCount":6,"integrity":"sha512-XtSJg5R2EFC990ea8XRJHmLTuEseIJUk+bVmblgQlMPqmLoBlzB8eZaZmfATcoz4VfrF3iyfPrX2Qw5ZNwwZYw==","signatures":[{"sig":"MEUCIQDnsewczqstkkA7gVjJ3LMtBDlBbl/vuM9MaHQip24OUwIgHUxC5TgOnlnvMKPlOTgcbZ+OfWMEnrO2hY4EOsnl65s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43138},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"29ce5178cdd36c29428b8db373bc2ae6af3c0233","scripts":{"lint":"tsc","build":"tsup index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stefdegroot","email":"stefdegrootsdg@gmail.com"},"repository":{"url":"git://github.com/Dartroom/dart-signer.git","type":"git"},"_npmVersion":"8.19.4","description":"A package that aggregates multiple Algorand signing options into one interface. Handles signing and address/login management.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"buffer":"^6.0.3","algosdk":"^2.1.0","@perawallet/connect":"^1.2.1","@randlabs/myalgo-connect":"^1.4.0"},"publishConfig":{"registry":"https://npm.pkg.github.com/dartroom"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^6.5.0","typescript":"^4.8.2","@types/node":"^18.11.18"},"_npmOperationalInternal":{"tmp":"tmp/signer_0.3.3-alpha_1686595362064_0.9235032986285403","host":"s3://npm-registry-packages"}},"0.3.4-alpha":{"name":"@dartroom/signer","version":"0.3.4-alpha","keywords":["algorand"],"author":{"name":"Stef de Groot"},"license":"MIT","_id":"@dartroom/signer@0.3.4-alpha","maintainers":[{"name":"spencer98","email":"spencernajib2@gmail.com"},{"name":"stefdegroot","email":"stefdegrootsdg@gmail.com"}],"homepage":"https://github.com/Dartroom/dart-signer#readme","bugs":{"url":"https://github.com/Dartroom/dart-signer/issues"},"dist":{"shasum":"8f50aa6094dffc5c7a2a7736c59419bddb6bd9e8","tarball":"https://registry.npmjs.org/@dartroom/signer/-/signer-0.3.4-alpha.tgz","fileCount":6,"integrity":"sha512-KOGKKAfxuAtIRY9mcfgkEmZlJnJ9MdYDyX+HtC15b1Qf26Vi4Qc0W8pkjwwjR4Tzmy0l+A+9s3zLRqbquusU2w==","signatures":[{"sig":"MEYCIQCSndxDdMctoX+dTJdcl7BZuUurWzX0FIqF/0V0AWXlbQIhANjB0iybZwPvXcOSGIVE/iYQxNCw+AFwsqjZdoyfbqJf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42818},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"6a4382493613a04dbb717489443609aabd1f628e","scripts":{"lint":"tsc","build":"tsup index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stefdegroot","email":"stefdegrootsdg@gmail.com"},"repository":{"url":"git://github.com/Dartroom/dart-signer.git","type":"git"},"_npmVersion":"8.19.4","description":"A package that aggregates multiple Algorand signing options into one interface. Handles signing and address/login management.","directories":{},"_nodeVersion":"16.20.1","dependencies":{"buffer":"^6.0.3","algosdk":"^2.1.0","@perawallet/connect":"^1.2.1","@randlabs/myalgo-connect":"^1.4.0"},"publishConfig":{"registry":"https://npm.pkg.github.com/dartroom"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^6.5.0","typescript":"^4.8.2","@types/node":"^18.11.18"},"_npmOperationalInternal":{"tmp":"tmp/signer_0.3.4-alpha_1692095953131_0.6767147881945299","host":"s3://npm-registry-packages"}},"0.3.5-alpha":{"name":"@dartroom/signer","version":"0.3.5-alpha","keywords":["algorand"],"author":{"name":"Stef de Groot"},"license":"MIT","_id":"@dartroom/signer@0.3.5-alpha","maintainers":[{"name":"allandiamante","email":"allandiamantedesouza@gmail.com"},{"name":"spencer98","email":"spencernajib2@gmail.com"},{"name":"stefdegroot","email":"stefdegrootsdg@gmail.com"}],"homepage":"https://github.com/Dartroom/dart-signer#readme","bugs":{"url":"https://github.com/Dartroom/dart-signer/issues"},"dist":{"shasum":"e0f8595ecb9bdbaa64e87ca45cb2dd599b36d4be","tarball":"https://registry.npmjs.org/@dartroom/signer/-/signer-0.3.5-alpha.tgz","fileCount":6,"integrity":"sha512-Cyom5ouClavpsWvKfXNk4RcX7+Ed7IRRitp1rldwcbxtrg95+nt6wbtwAL8SGhFK2VU9tjczoEaqzCD8DruVGg==","signatures":[{"sig":"MEUCIQDugerL7w3Y9FfX1TPgIQ1xUgj58MDVu9wnHzZ6SC5ElwIgQV7h1hUytkgnv2GZ5b86yxllfAdR3pUPIZVkhMMnIos=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51681},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"592d37ce774b0247347c6d8a63c95c6cf3954b3d","scripts":{"lint":"tsc","build":"tsup index.ts --format cjs,esm --dts"},"_npmUser":{"name":"allandiamante","email":"allandiamantedesouza@gmail.com"},"repository":{"url":"git://github.com/Dartroom/dart-signer.git","type":"git"},"_npmVersion":"9.8.1","description":"A package that aggregates multiple Algorand signing options into one interface. Handles signing and address/login management.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"buffer":"^6.0.3","algosdk":"^2.1.0","@perawallet/connect":"^1.2.1","@randlabs/myalgo-connect":"^1.4.0","@blockshake/defly-connect":"^1.1.6"},"publishConfig":{"registry":"https://npm.pkg.github.com/dartroom"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^6.5.0","typescript":"^4.8.2","@types/node":"^18.11.18"},"_npmOperationalInternal":{"tmp":"tmp/signer_0.3.5-alpha_1706989304108_0.9506969758751709","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-06-12T18:42:41.977Z","modified":"2025-03-28T19:43:40.399Z","0.3.3-alpha":"2023-06-12T18:42:42.208Z","0.3.4-alpha":"2023-08-15T10:39:13.387Z","0.3.5-alpha":"2024-02-03T19:41:44.278Z"},"bugs":{"url":"https://github.com/Dartroom/dart-signer/issues"},"author":{"name":"Stef de Groot"},"license":"MIT","homepage":"https://github.com/Dartroom/dart-signer#readme","keywords":["algorand"],"repository":{"url":"git://github.com/Dartroom/dart-signer.git","type":"git"},"description":"A package that aggregates multiple Algorand signing options into one interface. Handles signing and address/login management.","maintainers":[{"email":"allandiamantedesouza@gmail.com","name":"allandiamante"}],"readme":"# signer\r\n[![CI](https://github.com/Dartroom/signer/actions/workflows/main.yml/badge.svg)](https://github.com/Dartroom/signer/actions/workflows/main.yml)\r\n[![Publish](https://github.com/Dartroom/signer/actions/workflows/publish.yml/badge.svg)](https://github.com/Dartroom/signer/actions/workflows/publish.yml)\r\n[![npm version](https://badge.fury.io/js/@dartroom%2Fsigner.svg)](https://badge.fury.io/js/@dartroom%2Fsigner)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nA package that aggregates multiple Algorand signing options into one interface. Handles signing and address/login management.\r\n\r\nIntegrates the following wallet apps:\r\n- [AlgoSigner](https://github.com/PureStake/algosigner)\r\n- [DeflyWallet](https://github.com/blockshake-io/defly-connect)\r\n- [MyAlgo](https://github.com/randlabs/myalgo-connect)\r\n- [PeraWallet](https://github.com/perawallet/connect)\r\n\r\n## Documenation\r\n- [Installation](#installation)\r\n- [Setup](#setup)\r\n  - [Options](#options)\r\n- [Connect](#connect)\r\n- [Sign transactions](#sign-transactions)\r\n\r\n# Installation\r\n\r\n```bash\r\nnpm install @dartroom/signer\r\n```\r\n\r\n# Setup\r\n\r\n```ts\r\nimport { Wallet, Address } from '@dartroom/signer'\r\n\r\nconst wallet = new Wallet({\r\n  ledger: \"MAINNET\"\r\n})\r\n```\r\n\r\n## Options\r\n\r\n#### **`ledger?: \"MAINNET\" | \"TESTNET\"`**\r\n\r\nSome wallet apps require the specification of the network to use. (instead of reading the genesis hash from the transactions them selfs)\r\n\r\n# Connect\r\n\r\nThe Dartroom Signer does not have any UI built-in. All methods are designed to be integrated with your own UI.\r\n\r\nWhen you want to connect to the users' wallet app, you first let them choose between the available options. `AlgoSigner`, `MyAlgo` and `PeraWallet` are currently supported. The chosen options can be passed into the `connectNewAddress`, triggering the wallet connection process.\r\n\r\n```ts\r\nconst addresses = await wallet.connectNewAddress({ wallet: \"PeraWallet\" })\r\n```\r\n\r\nThe return value is an array of one or more addresses, depending on how many the users selected.\r\n\r\n```ts\r\ntype AddressList = Array<{\r\n  address: string\r\n  wallet: Wallets\r\n}>\r\n```\r\n\r\nThe package supports multiple connections to different wallet apps. The users can stay connected to all three supported wallets a the same time.\r\n\r\nIn cases where the users need to choose a single address, you can store this configuration with the `setActive` function. This function will store the configuration in the LocalStorage of the browser.\r\nThe active wallet setting does not affect the signing of transactions. You can always sign transactions for any connect address, regardless of if it is the chosen one.\r\n\r\n```ts\r\nwallet.setActive({\r\n  address: \"FSQW3UTLB5IZ32ZE35MUDPNNAXHCBGMGAKXHR3ENQ5JMT43IB3BET7WPDE\",\r\n  wallet: \"PeraWallet\"\r\n})\r\n\r\nconsole.log(wallet.active) // { address: \"FSQW3UTLB5IZ32ZE35MUDPNNAXHCBGMGAKXHR3ENQ5JMT43IB3BET7WPDE\", wallet: \"PeraWallet\" }\r\n```\r\n\r\nAlgon side storing the active wallet, the connect accounts and sessions are also stored. When you create a new instance of the `Wallet` class, it will always try to restore the last session.\r\n\r\n# Sign transactions\r\n\r\n```ts\r\nconst signedTxns = await wallet.signTransactions([\r\n  [\r\n    {\r\n      blob: [],\r\n      signers: [\"FSQW3UTLB5IZ32ZE35MUDPNNAXHCBGMGAKXHR3ENQ5JMT43IB3BET7WPDE\"]\r\n    },\r\n  ]\r\n])\r\n```\r\n","readmeFilename":"README.md"}