{"_id":"@thencc/any-wallet","_rev":"118-52c8b7fcdb199a10f2e12619b77e1ba5","name":"@thencc/any-wallet","dist-tags":{"beta":"0.2.10","latest":"0.2.10"},"versions":{"0.1.0":{"name":"@thencc/any-wallet","version":"0.1.0","description":"name subject to change.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.12","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.12","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"gitHead":"03d4b61511962537027ed860f686221f863ef72b","_id":"@thencc/any-wallet@0.1.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-J3dwFbDzcW3gS5t6Tm0gRoGzm0j6+5kyNNlicby0HdsgJtwbyY9RfSTwesHaRXLMXXNUwisjm2pp4ETJZEC3WQ==","shasum":"1df7d9cb8e3bd49145b5ea9ce1e217c1d38832f6","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.0.tgz","fileCount":5,"unpackedSize":110689,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDA59be5g8Dr9UUvZdeRbJJEmxKNKPaX1yAniI8bFa1ywIgDsGZO5j9j8k2zXUCzQH8NMuLR6CPy93LOA/3t35Ybgg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCgGEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp70g//VaBzhHKXFQwNUNJw4pC8kWDsGTmHmTu9+GpKmYLFAxZWzMQg\r\n1qXouI9pQBtiaFpauk0AVcZ5Kdjy3OwTKBGzl/WFtQj30oiNbqS+SWYz+avE\r\n+f68jouuH8MOiYDC1ZvHQAI8H36LWjFoFfLPI90/ckTOJZFbp8kTsT18VLXE\r\nrE1MPMDrJ3Fpm3qKgz+DOyqqhOVwR/ofMTt413Q6va8hqQfHReh3qN8FFDkB\r\nU9nff9v57NSnOySDNY5AUNrdHoAo6JRv/pux0LKW6cfH4Y4/umRd5kR4/l9t\r\nGesKJdmuyYG7g/dqfr0aUqgL9MEEYx+xHO9+BPyoO9WkK+jaKwO5HuJkFDRQ\r\nCJ1Op9oXfVezg9B10tg7YUBPmwLAqjS27L0N4rCPXL/FoPi6kYoIabVl6Ida\r\nt1wpsqPjVIw7+KDU9xwXZiMFmZcH+kPK1xe3JBRXZKV1VQ/wFTYfZHE+p/Le\r\nHBlr/gsyw7G8feucEnkGIcsDIz4WYR+QtQWUumHYgXkPKc0v8xt7PUXrPON/\r\nuZRuU+Zt+iXAQy8so4qzpY872dMENz9xVAY2PHo1NmUo4ZUO6HCmISMXEveX\r\nCxqL23dqrQaPMdlxLjsyJG2qgMLmr7SbzCKd0kXdSKBe1LexNjUNANn4xbpJ\r\nlgLRj7b7slhpZ2Hh3aXDXHjZ34CRGiPt/6U=\r\n=mIH1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.0_1678377347602_0.6514408640295264"},"_hasShrinkwrap":false},"0.1.1":{"name":"@thencc/any-wallet","version":"0.1.1","description":"name subject to change.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.12","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.12","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"# any-wallet\n\nname subject to change.\n\n---\n\n## TODO\n- add docs\n- can remove `buffer` + `algosdk` after most everything is working. reference + package.json deps\n- whoever uses this pkg be sure to use `--no-optional` flag w pkg manager install like `pnpm i --no-optional` to no install all of the wallet's client apis. stands true w pkgs that depend on this pkg like algjs. then selectively install each. or should we default to all and let the next dev handle build/bundle/rollup optimizations like this. all just work?\n- add correct err handling for browser extension not installed / OR is on mobile where extensions dont exist\n- combine clients and wallets consts + types so PRing a new wallet is simpler (less files to change)\n- note how @randlabs/myalgo requires buffer to be installed too\n- note how pera (mobile + web) + delfy require that the mobile app is set to the same net (testnet/mainnet) as the dapp requesting a txn to be signed\n- Q: try mnemonic connect, reload, then try to sign txn. cant because its lost the mnemonic from the input. should we store the mnemonic in ls or what?\n- known err: if defly was connected, page reloads, then try test txn on Demo.vue page. lib has err constructing. but signing IS ok if connected + signed in same flow w/out reload\n-\n\n\n## Attributions\n\nspecial thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"7d33d879ba39604bdd622832b59c59248c225c31","_id":"@thencc/any-wallet@0.1.1","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-iXrqD49BtYr3B500Pq0uygFQ1Ijn45i/hYSnC1NpggQhVMlIYPOfalc954rURTPw8Yu45gHw66HvP3Cn8HDnlg==","shasum":"e14d439861a9d4d380710e3476ed4e5a44d3d3b0","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.1.tgz","fileCount":5,"unpackedSize":110919,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCf2KJpk19J9XhFmoLBjBrBvjGEtizgUjrd8gj0TLR/GAIgUU6z4DaL11g+NGR1S6p6YZda+RkDlk7rsX1DdAXE+Lc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCgvUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVKBAAj8qMyeWGYEditVagefprB5iPDX20GoaldP0Q/FQyaNWxn8jH\r\nBmZtcXQ4cUOxSjP8mRtl9w/gY2kb+/Ws8nSzB5sDIuYK4qgaPdtJ9bW2HBP9\r\nSkpNufurVbFknqq71IhG1wmCxfj0ggGevEObpnTs7EhWD6RAl41e02ke6ZyF\r\noyfqPdBmoCwdz98IiPGm31mIQDbrif/HcfuS11iA/04eI2vBRo/fCR44Y9A6\r\nsFZfRAq7VGHF18DIxT0PB3LWjzXGf/9c3tPQOxpmKCowi30+9a6XH90glJlc\r\nnBEy59SYWmONhrnWVa+qxhcAhG7cp8Z1h+i7l2MQiQypMFuJk8BFAdGmY3Px\r\nq63Jvh2lTprwoaUZ7+wPCu/tQtxI5y7LK1hWxYoDmSAOeQ76cUB8A1/owbzj\r\n9VUZyDUUzed+k1ZGXxeUVRnoLGh8UdWozQvFQ6fsL8Fpg1xp3QqMY3tHllwP\r\nZc7FkeX4Co6jRJ7co1IoKVIGI0ZxH8t2uPMDSXCHUZPXCiLHeFlfu5vYTMI8\r\nznu4DoX/mLUSgCULF1TG3mFtOkKigAtAmRVz70xB3oHpKwSc6HbfP45Rh+Za\r\nT0+0e/yiWCteh80mshUFvJkDVdSmAYnpDvTQl1bTn+zTEUw9ieFw+xux9D4f\r\n3vGhjfWWKzKcIseZMAGfEwuWkUytVSbCWPA=\r\n=FKHG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.1_1678379988109_0.4345063256225312"},"_hasShrinkwrap":false},"0.1.2":{"name":"@thencc/any-wallet","version":"0.1.2","description":"> :warning:⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.13","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.13","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> :warning:⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# any-wallet\n\nname subject to change.\n\n---\n\n## TODO\n- add docs\n- can remove `buffer` + `algosdk` after most everything is working. reference + package.json deps\n- whoever uses this pkg be sure to use `--no-optional` flag w pkg manager install like `pnpm i --no-optional` to no install all of the wallet's client apis. stands true w pkgs that depend on this pkg like algjs. then selectively install each. or should we default to all and let the next dev handle build/bundle/rollup optimizations like this. all just work?\n- add correct err handling for browser extension not installed / OR is on mobile where extensions dont exist\n- combine clients and wallets consts + types so PRing a new wallet is simpler (less files to change)\n- note how @randlabs/myalgo requires buffer to be installed too\n- note how pera (mobile + web) + delfy require that the mobile app is set to the same net (testnet/mainnet) as the dapp requesting a txn to be signed\n- Q: try mnemonic connect, reload, then try to sign txn. cant because its lost the mnemonic from the input. should we store the mnemonic in ls or what?\n- known err: if defly was connected, page reloads, then try test txn on Demo.vue page. lib has err constructing. but signing IS ok if connected + signed in same flow w/out reload\n-\n\n\n## Attributions\n\nspecial thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"779bb527e1e408310085fb357750825ebc620c2c","_id":"@thencc/any-wallet@0.1.2","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-UvHY5B/FTJoy0CGQYCACmag+Pv2WrU9G1Y32lmOxGtOgOKWY282WZSipAVASSrtw7LJOHeogAHIBykIMvyJ1dQ==","shasum":"eac89cf7618f697583dde55ce64adf3275e82af4","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.2.tgz","fileCount":5,"unpackedSize":111052,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAZesEvStLE71toM1xZm9OeuIi2YFGBJWADusM9fwNLgIhAJTlOi6jhNH+WzR5x0pGiw+FdLgmxUGcAEa6SUMXsMLl"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkChUrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXThAAlW6v24u+wtOJDs4tPv6ditnm3M18sIRUh7cfE0BazkSxoNAz\r\noalthlt+kG77UQ6sf8Dp8GeY+hZqmlrT2pm3bVATpWhxahpdlvwXuy4A1xK2\r\n/3wD1hco1U3HaynOFbfuAT/4HNRbEYkik5G3bwc4LfRIj15esc7w2y3J4PbL\r\nrqP7olonTuCjleZrn5Oa0+rEGuOE4x0BwRGIeHYA/MQwn3PDv/RSo1is3iEm\r\nsMed0zLJVDbSVqLhf/ocz0pTm0wo/L1AMykP7OQ0tYWVeza6CNgFz6tACZPs\r\n+eYAHMKDufr8cDMa2Vtf5EX5X5A7awVdIBu6EY0DCV75regnzETBydxMEzVo\r\ng1SdNh1h86vkGOdmvumStHTnvydhDZmTAF/LDx8a0Yw13sG+7oL+2PUfo+/D\r\nUNLfp6tZ9azXDfA7VE+wctwgB3ZrIfe40Pc6WX9O7Jhacj02g2nuFqt9ia4l\r\nYV735b0GErVNDCtKmDEVrs93me8k9MK9j4/5yXwdKHRbChhTFIQkIl0sQmrc\r\n6ITggWciRLxDHwg/DHP3ANxuVYaMPTz9OWgq0OVViCYqp4tSWuL7xJroCqas\r\ntQKMCtI+XSQ5+US4WhuV1X2Zndo19bRvLiNcwhAskmAgPLkLRdeTrAR2mcJ1\r\nhr6G7doGZrF8RiKzOkzOZAhm6nA6bqIbZEo=\r\n=rpAX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.2_1678382378838_0.55752085358443"},"_hasShrinkwrap":false},"0.1.3":{"name":"@thencc/any-wallet","version":"0.1.3","description":"> :warning:⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> :warning:⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# any-wallet\n\nname subject to change.\n\n---\n\n## TODO\n- add docs\n- can remove `buffer` + `algosdk` after most everything is working. reference + package.json deps\n- whoever uses this pkg be sure to use `--no-optional` flag w pkg manager install like `pnpm i --no-optional` to no install all of the wallet's client apis. stands true w pkgs that depend on this pkg like algjs. then selectively install each. or should we default to all and let the next dev handle build/bundle/rollup optimizations like this. all just work?\n- add correct err handling for browser extension not installed / OR is on mobile where extensions dont exist\n- combine clients and wallets consts + types so PRing a new wallet is simpler (less files to change)\n- note how @randlabs/myalgo requires buffer to be installed too\n- note how pera (mobile + web) + delfy require that the mobile app is set to the same net (testnet/mainnet) as the dapp requesting a txn to be signed\n- Q: try mnemonic connect, reload, then try to sign txn. cant because its lost the mnemonic from the input. should we store the mnemonic in ls or what?\n- known err: if defly was connected, page reloads, then try test txn on Demo.vue page. lib has err constructing. but signing IS ok if connected + signed in same flow w/out reload\n-\n\n\n## Attributions\n\nspecial thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"779bb527e1e408310085fb357750825ebc620c2c","_id":"@thencc/any-wallet@0.1.3","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-0hGcaI6/w8j71PXws3O0341eZkg77EtAavvd/rAEguAIf+5MqIe66xDrycEvXi0nTcHjSVJATl9jFQj3mmYeYQ==","shasum":"5951bb0631da5176a5f2b4a6051b2c53b9ecd66a","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.3.tgz","fileCount":5,"unpackedSize":111052,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNQ8NvXYtmBRq1Ky16LFBgxadYy6GXfuDxgea+SV1XigIhAIlyPjVNc8YoYxG9j3e5cRtRuTTLXyfHDHIindlkBpjj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkChW8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGZA/+NWz5bt4FioAKjwHF456cFMOGdXlFmXwFDkDV9ZZ8PD1geGT0\r\nuosScFlAeuHSKFKHHbRo12LD7La72gcuYm6xaWzHSaqht4Mz2ew/sZCORseV\r\nl9L1Nz3i2KrwR/bsqpsWZwG3lJw5FAVltvWTuoxDNWOY44KvnsRtvPPXRSUi\r\nIyAj/F+/y+lGjsKTWde6qaCdPt0evpXl9i88h/VS0rCuPHwch1XcZ9p3vlvV\r\nIWkzBaHr2lhoq7eUnHvMVZ7gHeLskenWdY9513Sz6JvK+ElgQsoPHMYxBpri\r\nogI4OfLF/9aiJlq/pl2d7fHKEOw1uOfFL2hpQdM0IC9WEYzYcD83xaTpciKB\r\nJGvPBhDL6yRRtjs/PAA0IVMNd8u93uP26tPcR0wPZ2VZkoqlSMd76K98Wllx\r\nzvFYI/qdVKQUkUSjKczXShEru8RF3Seg0TOYmSH+SP8K5LzD8XC53qFaTvCk\r\nMUYl1mkNrxFZB1MEgQDV+pFX5kuNZc20GTcImy93iTY9e39bjGgLhSJpBuMR\r\nBM7OwNC329rAFRhF44ZfZ5zW1lah2lb5kN8Hw8I6t+a2rPDW4Y9SHnSyyeev\r\nrOr0NlqcsNIDK6AJ25Vsee2jW8m5Vqt8obrq/iWsVcLpD7otHwXpZIUxlBSw\r\n+7nVE8bt/x5zosdKmvTAieDcEO3vTgJlypY=\r\n=RRTE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.3_1678382523773_0.5890925684133996"},"_hasShrinkwrap":false},"0.1.4":{"name":"@thencc/any-wallet","version":"0.1.4","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to or the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\nwe currently support these chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## using the mnemonic wallet\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input\n...\n\n2. mnemonic via code config\n...\n\n\n## Notes\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- using mnemonic wallet\n\t-\n\n## TODO\n- Q: try mnemonic connect, reload, then try to sign txn. cant because its lost the mnemonic from the input. should we store the mnemonic in ls or what?\n- known err: if defly was connected, page reloads, then try test txn on Demo.vue page. lib has err constructing. but signing IS ok if connected + signed in same flow w/out reload\n-\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"cf93617c50e95eb55220ea63c8c719030f34fb44","_id":"@thencc/any-wallet@0.1.4","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-XDREhYOqyQE/h5+kEX3Gsw+Z1hYik/8JpHX1awT4AfrVwObs+MjXItygAYasyAvNyPjZjCUNo3yUboUY6RnMvA==","shasum":"63448124ae2ca68e45e8e19b6c3c5ea443be9bf2","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.4.tgz","fileCount":5,"unpackedSize":111315,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFa65lb55OzyaGc2DDI0Arwe+RjpqpTAw08OFX3bw7zAiEA2+4ioQhZUDJq5eNxhF0X/CJWTBmblh9j4gArjpGFmwk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCiDRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFXg//dKTKptwgOutbo4u+9L6QRJI69ucd13b0aCVECmyJrOqGHYb8\r\nLGPXwag1oMQDA6uCEj7LAUT8Vu0IEuIh7ZB+oCfPANrxApK/AudyMfZrReCt\r\n/HLiOms5YsGwrZhoRi8cdcvBjcAR+FiLjM+Wnvx7Xs5bc9gkjVun4oqROTXZ\r\nrVHG9PqXyhmcGLem82grG4+FjcGJE1yQIiwpikPMF4z20QyclVxuX/4hxwVb\r\nteyFINnMMXw3CptpnJF8nuhoJC6e/heiJMrHF5dRryHmY7Noo5m8fBv5C/te\r\n0rN5qz9Zg13/Z7cyy9E60DzI7Scv+QA1cWdgV4ClXkSCHtVSky9rChHo6t0a\r\nkd1u3F3yFTA/EqZNxxdMQM3C/Z12KB+lWpBB+ZhsmZ3jsHnhqrLyFBGk8T39\r\nxMOuFv6xgK59wfWBFLtWBzQHr49dra8Cv9PP8c4W64oqwdvq0VYFdQJUygAz\r\nHx6MKfFR3Oz17kzZJXSI+HSiH5Ur3jfRmvk2TnGJRae6aDS2Sn2z0+H7CGO/\r\nn85MWgOXuXSR8eCYsaJpEWhFbe65zuo+MnFSlQxwBe64NsWqv/Spt7dVIpeG\r\n4Vc89PlXoocYObQYJQdpE7LImcQiFAxCiZmBqeN5oKNo9g/WiQ2ZdDO+CbQr\r\npoAG2d2gim5oTxM9BdNL2yJTHPQVaWXUeH0=\r\n=c++E\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.4_1678385361419_0.16209141866570098"},"_hasShrinkwrap":false},"0.1.5":{"name":"@thencc/any-wallet","version":"0.1.5","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to or the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\nwe currently support these chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## using the mnemonic wallet\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input\n...\n\n2. mnemonic via code config\n...\n\n\n## Notes\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- using mnemonic wallet\n\t-\n\n## TODO\n- Q: try mnemonic connect, reload, then try to sign txn. cant because its lost the mnemonic from the input. should we store the mnemonic in ls or what?\n- known err: if defly was connected, page reloads, then try test txn on Demo.vue page. lib has err constructing. but signing IS ok if connected + signed in same flow w/out reload\n-\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"cf93617c50e95eb55220ea63c8c719030f34fb44","_id":"@thencc/any-wallet@0.1.5","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-rqGglLvu2UgTpaA3p4wi7nU1XwpfoJgGJBTsg63rIiCWv2tOks+sFQBImNMhF+v4IiEkVXWu706KGPSQ6Gncgg==","shasum":"f2b88e3bd0c91effeb891cc7776ff6f83cf49803","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.5.tgz","fileCount":5,"unpackedSize":111399,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBa281Reyi/4hPETlO9mlZsKZoU5sq+KlpQye09MPh20AiEA7hNC1zi3biCu7lv/yvo0dQy49UUPJRA4QAlT/dvOIVo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCiJ2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+yw//U0buSV7FUHDhjPzanXIr0h3TwE7IL1nOKE1ZCg7n39oNg6c0\r\nBbZhqYMLCbHTuUphfF6B+tMNZTvPu7rL/769d83kDDXtV0K/LS0ERNfarwwL\r\nHoSbst6JD92sPlMq1a24S9Rxlz+jBBNeLCgL0AsQ4P7liQgOR3pqEBF5f6CP\r\n691ufaerX/oRTa5j5ZoEoiPLtGIHh0hqN4wWaZIba0uDixIZPYBAyXjQ9jNb\r\nY6NhD1bEy9mzzOPa3jux1vWEOq8PD3xVajkvCl/9C+neiRJheW/sWPw+ua5G\r\nzS3AkJ5i2n0DMYlq+9Wdhpj1YsMbeovP1/vChtg+LwGWEhg0M8JyGKsz6QRi\r\nX8vb0WMHYArSIdsvZCWueHkHaM1Bxn/uxUtj6mOPqcpOTyGSXsfPYGdiD5pf\r\nuTeMPZVshYvYGSwij+fom4E+ZCA8UKOQwT9IwImxntK+LGHdyux3+4Euj9m8\r\ntlQfpdnyspQLJgXv0NNmYdGJnRSYnzvUBkH0E7BY6/nYLHAjSMTyskFEBtJH\r\nWafcGbWGPX2W9f6gjAQT+mVaFpMlvAK3J76yd6K9/r0aMxgQdynr1cFuzGOk\r\n33/MiX+Q0mD5HWTbvAtdUyhrQxpp4bYLi4avAvRbjWAReJH5T5HBW8JrSa1g\r\nIHVdsf2G7YYX4mUfiy9HWubvcOaPOZLpyrY=\r\n=9sHx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.5_1678385782384_0.542735982116666"},"_hasShrinkwrap":false},"0.1.6":{"name":"@thencc/any-wallet","version":"0.1.6","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.14","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to or the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\nwe currently support these chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## using the mnemonic wallet\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input\n...\n\n2. mnemonic via code config\n...\n\n\n## Notes\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- using mnemonic wallet\n\t-\n\n## TODO\n- Q: try mnemonic connect, reload, then try to sign txn. cant because its lost the mnemonic from the input. should we store the mnemonic in ls or what?\n- known err: if defly was connected, page reloads, then try test txn on Demo.vue page. lib has err constructing. but signing IS ok if connected + signed in same flow w/out reload\n-\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"cf93617c50e95eb55220ea63c8c719030f34fb44","_id":"@thencc/any-wallet@0.1.6","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-OTSvaZGkbENY/2opifGl1W2CyR4pnoyMIvwpKLfZAF9ZAQ0Q9y0HGT463O23s5Izu39AloUNWJV8tthox9sC1g==","shasum":"12042385b359de92e9d2ada929068d1cb08b6a59","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.6.tgz","fileCount":5,"unpackedSize":111294,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH60I0tAg0sIW7OPVUUHDOPNYCfA0C7toQtpiKR3FH0IAiA8ZBJm7BmRMaIQ5GOLk9i304MEQFdDOtdmDVRkW5KEKA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCkA6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpF6BAAof/YeBewqtEmjYG8AglWcnZsf8MVXgp2S/dkYw71xbyAgSqm\r\nEZM1X/Etip81vhJ3PQYv02wV+egFN+odNDCB8wNNUW1ZgrlTCVi0tnMYSD1q\r\nQvRTG62XTvG6kz7x/0BuVj/43FdiA8BmfRcX6kkjugnGdCPmYqAK6t+wdjPW\r\ninwmfH2EHIGKD3mp9ApZpk/LWnvKiGfXzvqLwFjo0ydqLJMwuelfoa7An96z\r\n/Sy1cC5KtxbVNTibJrYKIRGLLhM+BulWvJw+IJQwojTM4/T4BRImKqW3qqTy\r\nUwgd773Qt/3BPRdinp1e6jpJ4J5frTyfmlLHyC4tpR8ZzDj63TPcDWTC3Zal\r\nSwn5aLNg8eYEx+BupwwvkFOaZygMIv6owr2lTTv6bIZv39QSPANYgQQjRIrz\r\nyGbMYsoFFLVqIyO6MfPZOk7XLD27e6GYuAKQ4E6pW1qteKZY10aloFeCloJ2\r\nl4X221AG7Zb/OauIoRXWfB6v05NFfsk6tzcrkzt3jSbQ59ZcqNQmRizn3CgP\r\n3OkKRldyJc4RCmTECFWZLD45VFjSgngCgwgMLsYOT1ssoJJhu/E9GZWpT5LW\r\nNf9lbQq77nwdjW3UNcNdnZGYWv6yLPBf8wGOuJ8so8h1I0nhitlZBI1xT1IU\r\nSRarLR9ejqyKktMoIg3bn+8iI967dGbWr6k=\r\n=thGw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.6_1678393402562_0.28802724641001864"},"_hasShrinkwrap":false},"0.1.7":{"name":"@thencc/any-wallet","version":"0.1.7","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.15","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.1","@perawallet/connect":"^1.1.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.15","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^1.23.2 || ^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsetChangedStateHandler,\n\tsetChangedAccountHandler,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\n// uses the current activeWallet as chosen by the user\nawait signTransactions([txn1, txn2]);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's <template> computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `setChangedAccountHandler` and `setChangedStateHandler` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsetChangedStateHandler,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tsetChangedStateHandler(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\t},\n});\n```\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9e2271b664423bc780ce3000d6bd579ab4718c8b","_id":"@thencc/any-wallet@0.1.7","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-Ko37kvwlPUwVU+/IWfEfSsoy8Svit+LGGD8FvOT3YF8LFSDwwJ1LwmFg180H08MR8zpewtVKacS4PvaWxtzR2g==","shasum":"605a4574d00493531bc9883c8fa348a4d70ea7ae","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.7.tgz","fileCount":5,"unpackedSize":114612,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuEPrqlXOVOZknx4usBYw/32pBz6LlxtJXrGTApAiNuQIgLJwbIQga7GkekAoFXn7zNMihkjsd4mXGoyIC0dwBCn0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEm8JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrf7A/+PQfuv+q1ssLyK/NM7cMSm4X4Zg/bRu4dfF37tckonZ0/lXM4\r\nlqtwAML0XOS62Gsac7rnyV4D2RPior/6H9JT3ZdApnToeh7R0XXFsCeb8vFM\r\nQ7odVeJvb62CXLZrIO/wH/Uqicph2oFb9rI1K+vOi0aWLKToBRxoX2gSS2i6\r\nwQmZ+3JTcAhb8op3/OvZAH/gRUWB0npkEU8DyEiqtxi6M9ZANHb5m4GRlCTc\r\nm971N9gm4FYc9Rq5YQgvXXeSw/7K71h34togQuozYs/hkswhjuqhts96Vb/w\r\nl30JBRnKg039/mHEG4W+4OOzfUBt479mv+d/08e8rMHaf6v/3MAtoLT9brsl\r\n1RN/4m+3Jay9XLjffGdGKE1NhAyBjJN0IL6MvVLGVTC3tJjjXMSNc8F3AYGg\r\nFDzTok+8kvSCqvPuibQtbPtWRhX5hG4eat/Pw2j+3K2Gkrf9/GJcclQbESVS\r\nAK8X903udWhlYDGjYmw2uopFu9CPuWnYEtkUY66hPiNDqqNoYxlUv6h8HNIe\r\naTF3XKcK2/+gRu3batrJBYgM0W95EG+i8YfRmPRIuQNJHIIq0QNsHcbIBKNQ\r\nKgOaKfSOYXSdWLzFecxhhxLSvEqNRvdLsaATDSv2W/L6KwcJn+65TVIhNtW5\r\nakZ5UR4Pyj957qq88HZE1HK7WLG3Juxeg24=\r\n=ehWc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.7_1678929673207_0.5529665583262564"},"_hasShrinkwrap":false},"0.1.8":{"name":"@thencc/any-wallet","version":"0.1.8","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.15","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.15","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsetChangedStateHandler,\n\tsetChangedAccountHandler,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\n// uses the current activeWallet as chosen by the user\nawait signTransactions([txn1, txn2]);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's <template> computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `setChangedAccountHandler` and `setChangedStateHandler` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsetChangedStateHandler,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tsetChangedStateHandler(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\t},\n});\n```\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"cbe40dac571c7d6669519af881b3b9a1437f4773","_id":"@thencc/any-wallet@0.1.8","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-pchfXN7PYTAtTe1oNBEnT7KjA1Np+25A99Jfa1INxjAosNi02LJ2fjm+EPR6TDlpmcIRLuL4jsKyFVjQz+oUsw==","shasum":"484622b048b615d6883437cae9af2539709835aa","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.8.tgz","fileCount":5,"unpackedSize":114601,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0E1DbqdCanqnk1ffwi65ES5pxLMHNJWf5B16mwm6g+QIgB6D6fcH2NRxiU0QCZ955wSOmhzdXIV3cAynAdKw2FLw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGaJIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrnBAAixYS6sWlTOu/3nCPHd5Hp4WTD+v3CYeZmXe9hEqM75V4b8Yk\r\naP10SbPDIvPT9/ls4QHXlsANbJuigLhY75ZCCCH5ax43Wgmz9O9Uj80AHH7u\r\nrDPeL4wVsEC3fqmxgriZJuEb6aRoXMc7X5g1BSYPv+1ta/BT11lLfOHvTrbC\r\njlyFL4s6P5T5ZeVBPqstunYIGjhOsM9Dm+Pn1GKh/Cxc8VHE/GMs1LCPfahp\r\nj5wW0TaLY5M0zlKjZ4vlGXZDWBLJ/aIcufUKQUW9l69bDO/1LKzzbf+ZCenB\r\nGVJ+u3m85vtGpXylfjl29nbCQnMGULZWDQQVFXVdeD+K32FdSMroI8EhzLNy\r\n3EgxZXkaGpTdsSFDhzxLl2M4/KW+bpzpXAKgTRK0odEi4brsdiLEeKupOdO5\r\nqwnktD9/rpftdEnLSdmGwiZkyJMUiNqGBEKbtjAoe2eVds3vzPw4XJD3eNJw\r\nyhqWFOl0aRfIe2RgGK2xss+fHh0AqwDAYBRYlTqaDtfP/WusMpkjkPiWQ9Zo\r\nUsAR3J3gMTYS5C8BDvplq7CbXhkYZzG71MhboG+QFwyadymXkm8s6NvB+uT0\r\ntJaOMhcU4UuY6R7mUF7rk5d4WNps+Nl44zT+Qeg8mw+fksL1JqjyLKh/1UwZ\r\n13bih5wZaNC9kNAWTg+Ek6z8iG1/uF3x9IE=\r\n=qRBe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.8_1679401544110_0.3472211778855425"},"_hasShrinkwrap":false},"0.1.9":{"name":"@thencc/any-wallet","version":"0.1.9","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.15","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.15","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\n// uses the current activeWallet as chosen by the user\nawait signTransactions([txn1, txn2]);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's <template> computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tsubscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\t},\n});\n```\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"83465d914fbd8b68db698ee1e44e9f8536772aab","_id":"@thencc/any-wallet@0.1.9","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-Uuit40xcK7RZ9kz8m9vknQiygV0sSzeLDFz2EBWAB/Koa6Yi/MFHzO3E7hCO+2c6HTDKqeEUA9mfSPAdCrp3kA==","shasum":"f89a991e3946d23beaf4ab8ab7659e7128691448","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.9.tgz","fileCount":5,"unpackedSize":115221,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDClcF7/PTd7Zn4LAh5ilLvduRtClTqlxpJm0Pdcjqx1QIhALZGlp7fkqz2mth0s60civXFjwtGHIR3pGDdJkLETNCu"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGiICACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6Bg//ese+EWdxku2iu/LZdVjBKDp/dJvVL+9lRnBNSVRemKR8FOj9\r\nKljJkcAzzLiR1Sm9Tqedo+uKoslg82vWHjf5BrNqAYz29/KJ84bGaYqLSF0I\r\n1C6LeHm7MIFpjlD8Xv6mGFFclccpaasa2EPvBqXxzDwCKy7bkXx/wWMY4qfX\r\nSj0REhZ/m5vAvntFEl7kessQuYQfVNiOhz+gUqKZ5zJwuBX/UwSGA2vxkVHe\r\nZtU+iJaBolORFI2cyOob3FLcIV3l0bZWpnHUIFnBrnNzgpAq7yqt9wXGv4+8\r\nqFvJ8w4OffX2IGiRzyQOemKcSzd9s898yWCS7mkRG5L80FcSQ1SUUPhaLxhO\r\nBdYeuVlU02EphV89WrX8JxcpIvJ8k8NadsJ4y5qfHMo0ctGdizViuqJP6H2z\r\n1qCOyTu/o1lqp9UywRu5aFEwS9piil8e6MVDCFZNgQMCwO5mPc3XALUqWRDs\r\nIOr7sYVpdhTfG9kumm5INCMpd8YJQLRJWAw8FzHqvXYz9ZieGV+KkqrMLjYq\r\nYx+GYS24yw0xIbhvCOx1gZXCT7APDggDGbTGjZ2FzTdQEZwrVlZEUF2PLLuS\r\nZIA/mmESv3RFfe4qRLWIbjuaAw6N+QCkDqkz2LL4fYari9H++7spoyWEW0Rm\r\nRcky6RuNYZ2NLhfvZo/HQ2bQC0LAC9N8GGs=\r\n=Q3jg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.9_1679434242059_0.38672858077508954"},"_hasShrinkwrap":false},"0.1.10":{"name":"@thencc/any-wallet","version":"0.1.10","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.10","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-OO2OxqGptMucN50B/EuzljTFuox1+UKZqLaXqQHU1Jiq7fdcmV2p6BR/mcvZwMqMAZ+V99nEqsCf14Kh4255pg==","shasum":"832f8a82cc4700af972903f14f4b40c6321b9192","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.10.tgz","fileCount":5,"unpackedSize":116878,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGuOkBDEuRP8tguMl0GJ5/UllmhSbNxwLbYVns1Win/PAiEAjotOl0cC21J4CUaCSeW8/+6O3+V8jIW2N2pMH5v3cDM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQzIEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWHQ/8CMEaks9W/vrW5sUdmFxYcwBad1cWrwgGXc5HL5S3Teywf0BG\r\nhkOnycNDdt0sBvwfzKRLhivo0lRlBXiQGgNSB6c8u/EPPPZitj0bihBtTycj\r\nd+SnIMdEfRce6Q2Lvoxx9SdkBC6vYp8n04n2zXKSYFmvvY8a7vKJn62aFNKJ\r\nahBGJl32HfikShbRx/Vdww4SI+tK1nPMKTSs+1m7NieMh7lyciD29qLsgpJN\r\nCnzK2NMYhZZKNB90nyFUHii9/1N+BqzBYoRd3owT6xRddzhOxdqt7yT5pd+7\r\nV+WXIANLxRNa9wbPk2yFIYgqGjX0/flCz131hu37FmO/egmR9qi4zb1vlTpQ\r\ng052HMMxmkBnoNwy7QJ7CS5ARdramLflNsb3YK46wQOTdGSbe3JAWuKn5b8Y\r\nWO3Nk6T6rYdzObJXh1q2DGQDLdlNQLzO8pYF5fkgudYlLJ1Edu804ALK+Bqd\r\n79eUWVYJYMHCELM1DJS8/ozrP1mpkDdai4hUTZdJ3uIE0FOkLsG+f+IjmZz7\r\nQOKRaXn3yTQY6UHHS1yNjYSih47GzZGH2LMArnL2UnXPfX6dhi/GWrA6NEYd\r\nS9gACGMF7xEPrbdIqC0/1VDL9gkzspeW2gQTDMpUq9aZRVaIa1ODwzK8ErXT\r\nXWnFk8FCybUCJHte/J8I1+Fm3OWLwjz8kHU=\r\n=HtCK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.10_1682125315849_0.00498992828801792"},"_hasShrinkwrap":false},"0.1.11":{"name":"@thencc/any-wallet","version":"0.1.11","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.11","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-eEIq17QXtw0k8W5i00Db9THsEkW0x14qPYegKmcVakg0qGSpf6gVgZI9JlhxHBVBEqXcQzO6bHHToM7TsuN7QQ==","shasum":"f28310b91b9532b18326ce45d8caa78bc68738a3","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.11.tgz","fileCount":5,"unpackedSize":117029,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE96vzBNUXDBbdEpIboyL95nzawFsA8jIEdNIBSCv7igAiAmYaCFj4SVAK98tNzeyIVRy3Hio1oF4/qMDud9Xl2k8w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQzKjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvEQ//asL4pT+Bhg+dDhw+MWdandA0soC66EEhL04/OFC4vJ2RbkSf\r\nw0z8VAitjueWm3kqTHPFuiLLE6Gj2CLRkmBpmS24MDj9QPefLGv2CjO0hk5K\r\nKBNSe8ioOEKuWslkQVlsj/ZZvaTDBOGfWkbABXPLcN66eV2xxKZjb7KWKxrq\r\ncC2K5QB2rXp96QrUTQhV512fB+eN5Yx9OJGEUJKH8VBgdHQ4KL/QSRBNIxZ8\r\nSm91fYp4mKiDKFZNK0fAFEBre50dvvt3YrYE6dCcxUsAsItyLOkjJksMkQ1G\r\n8Oo74FQJ++OOKLF6L4mqxY7Pk18k5YwfvFuhZ7eag9LjZkDgG+F0hh3mys1s\r\nXhAY8igJUmdESd5y/RUniV9DkwA/ZQ6WI+dQuatTJQQn0BE/uXdVcPzyZOMd\r\nV3Z6uaNoDbRAtQJ2ICqJVC3KEPD8DevZA4ore5uRklL71mhM+wcFstBgOSZR\r\n+IDtoQpdTYwGM1HA8C7yKd0gadJ/n410WYoiWaZKM6j6jTcbssrE5L3hk7uE\r\n5JMYAI7qgrN7FAPDE4qvHz2UmgcIu0/dX6tIKv9rPkBAE9ebioOJFYf5IK/Q\r\n4xh2uj0qAF30HelO2CktEkYdSQ5c0Ls21Ve291NvoV4EZU6tRVeKXDXHf7gq\r\nfoMYECkEoO6IB+uICH9sXTuXHbDKOH2qT3s=\r\n=R8kP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.11_1682125474812_0.6172077299022245"},"_hasShrinkwrap":false},"0.1.12":{"name":"@thencc/any-wallet","version":"0.1.12","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.12","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-CEuu9VCvMaCaEaactDb/Yrp/X4zvGzg3oAhh8yIL8ZJjgZ5aaFbipFZCWR7ghhbVcFSKY8OpNwPBNrLnfrnOag==","shasum":"428038a6608c25a605a04e218af7188158366610","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.12.tgz","fileCount":5,"unpackedSize":117275,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFCGFp2cAcL1ZMz3A/bWvB9SYpqlYWato6Qeum93KBLAiEAqQu/x9aIvrAt/3DrKotT6uUmcRhDuHnwbNajeGZFS3o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ0GnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXUg/9H2SYGFB1vifIfjfCqYowTM6ng0fkoXeAQYugRxekidclZaRi\r\n1fVHxy0IrtRVkyCv7NDmbaNx9lMT+xl6NSdp+WVHfYdeswFGllYqNI9gdGTc\r\n6NmCOlZBpHbwchwYSv0QPeD1F/ygjpHnrlLvoWgNld7ur4Or7cdMv8HkHbyq\r\nAuTueICGBeDSImzoJ9fgHdHpsWzJ7+UyrCV7Cohfwti5G7odlwQ//3cWnLV8\r\nGWXCFlSyrntJ253BL4ZgSivrFZ8IUx9VaW0Wwv5+WBuwTXGdiCPCJvtFp11Y\r\nsq0KJ6tIum06RndzgI2FGe5+S4Bc8Q5zlGHbuUQQfWlQgqdtQM7n05JAZ01O\r\nkL2FCbbSjou0gFoxf5eFMzZD0WNqpzsRM70mf8UOe2ktkxkql/gVHS6lcngQ\r\nVtUFcBT3W669eFd0Rflyb76mHybNxO1hrVrr+fnVxrErWRfls8NffsYRxS7J\r\n+v7mwExGmMqoBbuPfCUUyUgoavSEnz+Wo5UhQVcuLBmWj++rad/cvOErgyAD\r\n4nIIqSyQLY3/mHlkFwS+7wml7gbMhDqUEnZiIDvFSTU2vf6YPPZ4w9Nxlefx\r\n8Pjb1oGUq5BXZtYbkazBexO3jY4MCv5js+p0+LM01S4Ps7xnxhSwC9zGUq9E\r\niR342fe1NAD2C7TWfwFQNKKuCVQeKlrrmKk=\r\n=NDCI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.12_1682129319121_0.9559958932889114"},"_hasShrinkwrap":false},"0.1.13":{"name":"@thencc/any-wallet","version":"0.1.13","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.13","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-t+zMyt3lDC6HZ5RW2lXbGlFqoQHOxjG+0kydmxbRRheOblCoBeJGWVMwpKmtK6ydUxQjBqolrDS2a7q63tnzOg==","shasum":"0f11b42fb4aa39fc831d7006e99e922ecabbac12","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.13.tgz","fileCount":5,"unpackedSize":117270,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbAPim4d3IFbpucDxg9r3bIO2oHNVoTIkTwaEMn2NW0AiEAiYU7TIO9Ie+APFvJx/tTd8V4PnnhoWrRb313jri8Hdg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ0KKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqdcw/+OOPMV0gsPVtuk3RPpl84VgnreGGoOGYJ7GuY+4MqqmQ3GUek\r\nhRhQlBE1D5UEk5F0VyfVgNU799oTL6vXU+L8Os/U/ISTm1h+heImgXwwwEzZ\r\nplooAKslWrK2bT08DuVBK1GMBCALxzMUyf9Ey1ipjUL60p+J7KfdrRnaMI/R\r\nQll3GEVUVWXdvTst7q5k/Kxps7JEnfeY8SoA1bBG0CMFtlmIJGpld6PnzOCe\r\nMVB0AwgHPrp12vWh39Rve6YG20P9pmyQZqy8vX/Gi6jSvwDFdfu534waijQz\r\n0ED0qgTkiI1T49VrlsoO3+NEtyOzFFNqMzzx8+NmJNAciKv5+ke2+j4w4Mg6\r\nT0kahYOQm7EEyIX2VWUnhpIqhiIt6KnT0iSrNmgCdrwS02970oPI5D2mJqEJ\r\npw21ZsCtvq/UxjCh+akmpSi00fWEdAmqVF0RufZ10vnW9WMviTLypDAqjPgQ\r\nkJDgEfLONkQbrHGlFCSxGHVNOaPbJ4wKYLKo+eIIZPBikzM919rfbALxQg2g\r\nzoEA/prUy4QQ5o4MdiOnH0ZT8Jb3wi0M6ZFgY/t7r4qrVxHIcbvuYNAwgr4I\r\naNKai/0QqDnZEcW0/YjviNciOQ13Brbr3U2PDMcLkCDN4kQp41MwOwM3xJA2\r\nYCWEPBrWYAeG86HwVvSyVSbesYKzCxWyKiA=\r\n=+CzM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.13_1682129546381_0.5182434195227499"},"_hasShrinkwrap":false},"0.1.14":{"name":"@thencc/any-wallet","version":"0.1.14","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.14","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-dEu+lbMM5k6lBwaEwAt5Y3jqkZThn6Ok3zx6tHxLd014byvIcu+Bf8l6PT9duWufY822FLmLcaBgKL5KHgckKA==","shasum":"edc6df15c0562d63fbf2027e73afcda988cb4c59","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.14.tgz","fileCount":5,"unpackedSize":117270,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAJfKTlsSt4Sf0tJ9XS7lwq9vv5v+8tEDfENddy/6X6oAiA9QXjvjYXlkBaYlhMpzu0QF2KUumeX6Gix49tm+DFDlQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ0OGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNkw/8CCCcaqrXOyAxB+P6JFhRTncqV5JgafYypp3dYa3c3gmzBc1K\r\ngmeHEAHFV8HBhs8cisWTO+jzVe6c79vrVaTszLGgxnmtxVi/Sr4qkmKmHeYv\r\n9cBWlEFZ12Hbz0fQMxhn7Od5CI8pvmhsbmnVSJ7tdn8nMvzEKI9yy79rXl9t\r\naDDid5VbIW/c4GkcdUiBN6pq4IkzJFPPVxHeEtIUUJ5AFriufoyvHfJ0TJdq\r\n6E2ppi16bzJbM/KFbyssl54Kvnf6+yNBQsZrjhyTRWasAruw+WiDRIDCrGz2\r\nGZfznlu9hCp0CKh6HoIQbd00cqFqCuR+YjJkG9qS5+DVKfqQddU2/jQM4scv\r\nqANKKENkNBJ1jHe/jODrDd1OpjypCnrdfRaHfJ7eXyICWz7yZCYmZr5JEYfl\r\nn8S3h4V8Oeg7YlC/4M4TU2K0OoQyosLYsEo1YEfvKXh3F2+2oczodrZ9lULt\r\nFXaKQes2i8yHwgkh/Y019eBcLct0dtSMMz8rdS7M0cyk99ZvsqEFxoCyzmA5\r\nmsqdam6jpJ6TxZI+2sHmADgUQB3xpk79HeSMQV9HGeSb6YqUicc5ysvKUaRC\r\n+apg69htFeqOZO1m45fj3nQ971JcKzqwp7TikSZ5cNxXBh06NS/xng1UAFQL\r\n8r2Pwea710XCnv5dfuPCIDjnRTuAIHfsw6M=\r\n=kKOg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.14_1682129797809_0.30300225439273065"},"_hasShrinkwrap":false},"0.1.15":{"name":"@thencc/any-wallet","version":"0.1.15","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.15","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-sLgDr2rYDO9tlFr83QJ6CHjKDcyBc2WjODj+dVuvsptZZgbi/s8UqvK04mAn/PHT8DZ5DUenxHw3scylb5JVYg==","shasum":"53120635b21fd2515c15536c672723cca43818a0","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.15.tgz","fileCount":5,"unpackedSize":117275,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGE5FK/w/Eja/qlWJ0cpv/F6vPfcfRdgu+gsXxvMelOzAiBx0fo1KUXpXxNd1U7R0DLiUzVcxVWr0fydIT524E+ukw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ0PnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnxxAAnRamM/MrklTbZvySdm8EfbK/7FRcsfFxTlQMBeFBgyoVFYh3\r\nXdXU4WiwCmgr9mG1D0hU6ZCSW8afho5Cj08Tnqo/XPcwRPVRSz1BE4C1LBOl\r\ntnd16/yUd6IJtS9D54R9rrBaNgvo4PP1z5SF+UsmarWZcozGU0GeB1kv64i9\r\nwIXo/VYSD/F6pTKAe+dKU05hVyCo5YA3BL5bxii32hB68FA3ROalO9Y00u4s\r\naNtI6Yl+kAWcQADFqeN8dcypIwZsPPuoUkq6LfnzT6uC5coUI12BBVDYrXMM\r\n/V5R1IBacNUYuxODxNt6HITOnSbnSWlrs1NrErSnfbHSgyASdxzEsSvcWKXB\r\nVfeQNVMezE2sixVjVBdAawvP3eFnLdvgOyzSFL01q4I0jZYMOS7QGzM2vCOM\r\nF0k88XYKTaN5yrfBa/PS6q0gMAi3dmyWOdVU4wj+y5e8H802/wZ9eoyY0717\r\nxiaPVzLHZpc5p7mFmB0hBSUa6CztGHhsoZiSS9bqA6OMXnml4fghlYw1wGgB\r\nOBkd82OAc20aPcoRM+ybmX9iNDlmFjvUijzVU2yebRCkH+5pyhyihnkHA7IS\r\nzzn2Q86qD2wYquQXWtiklN+Dye7vwW3+fW8qhwW5LhIqWDYPowM53OSeos0s\r\nNYdA/0fkgDL9TLLJUQy1XupzMkLvkaZsHAs=\r\n=KuDT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.15_1682129895260_0.7127558847493001"},"_hasShrinkwrap":false},"0.1.16":{"name":"@thencc/any-wallet","version":"0.1.16","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.16","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-sG9mGLf8ffgoEIi/05MAMMLoaU0b0rW0/wKhyhjWqmUmgYksOk5RZpvdMuVMF7HTSamkU37BgjWvJaf12/BaPw==","shasum":"e499905abe22c3b252037d90930e793981f0201e","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.16.tgz","fileCount":5,"unpackedSize":117431,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcQ4I/k7mkeeRzusg21Grlg9+n5s8+X+mvBG+jVMSGBAiAWneFJEusyaI8c/+mWzSRoN5/pQNhWx0qTk3/4E22Y0A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ0XFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbAg//UEu4ll1iA4/VXCDaWYDUq1h2w5RJ2LMlBNhUSJmsxD77GMQj\r\nCXVdnZxWX+QM3QeQnVqdVmuE+JcgORIcZemzMnA7h1WXCVhkWf+NdNC1dGOK\r\n96fBW3RnU76HI8Fgs3RPq2Zqf+l1FWqQ3djmzSvtf5h60kZ0Ek1O7Kj7YURm\r\nKvuBnsc23S8WxTXSufzNGWGcAJc12WNtDoXdu46o2A2mc2WQM9SmwImCplJz\r\nHEMo+70dDS3puoHFf+wt7JcGev0tQDXM9K+78ewdti/aHozU056sTI4IMWJm\r\nBUUOlEIuG9/21Py3bX87zmexDpFR6RC6mwdKzxLcNnE9L0TZGxJ9725EADiv\r\nxUqBlY9AWAgM8mGF8Z2WGOtU32ukksZ66sA8kTp/A4K541gCWpjA4s2lzd3P\r\nZbsVs0YVFvSEzoLvJE5JxMlf/pKqeMwxtczil7mHCwuwN5nZiHAwjlod9aON\r\nRar12rMksA/rJI2HyMWsc3JQRWvF02DxGT+/icd+XZY+yGfllSXO9Pa6P/I3\r\nknDRR+s0/qph+DxISXpfBFJ8vtWlA2UBWso82JfhLRpuK3YPC3a0ikfO3woB\r\nJy6LoinrZQs9fG/6kTYlGB7nw58mJ1ZZLIGdu28TMTh/FcKyEihgdklb0Xcy\r\njw7qEqDNVBylBSoBPOgfxLk3Kk/C5GYHXTA=\r\n=JEC0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.16_1682130372969_0.398459496928504"},"_hasShrinkwrap":false},"0.1.17":{"name":"@thencc/any-wallet","version":"0.1.17","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.17","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-JtW1BMr07SS2w7yQFWD+zNuu4eRkW1iUjt4BHxFbHl3LRAvnf89A9CQv8qBGfvrWjV3QUJRFHWo4yjwLTYdQvg==","shasum":"596e891b5f2f8bf59bd4a6111220a2574685680e","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.17.tgz","fileCount":5,"unpackedSize":117306,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZGh7wGvtg8qtm8VCcOZU4OZsAZAWTTs8+0dwv5nOxmwIgXEUBE9Vx/NKVVEq7tcrCO1owy0SDv2zobcsGNmjQRDM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ3oeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2yQ/9ECXuMd2TDGR2l7lOHID6AjLhDLVg+e5ZFxZYD3+VO3MF4Q0u\r\nmCJ6ntJzjF5Lsa10nKEbtqLyV5k25lmhITI/3EKo9Gs5zYdoUKEeKu4yp9lr\r\nM6hiYuD9qQbrMqvjbkf6gNjG1kL07XvaLuhPZnJ7QSuSFGTxA5MYWFvLG5pm\r\n0YBZ2e2F/hqJMiIJWIzjxlxX8HXXQo7IXFpAzvxAQbPCJzVjzQ5/5PAHtNhd\r\nv+TAqYZ2b4k88HQ8ySHAjO8pm8PBAwwxZxx229/yxXBaWkfz2wnDbLS0E5mi\r\nNECH8lE1A3Ldm2FHLgIYvX2F6gIpU/rxNHWC5izwab/AtF+PMi7sZ7Tr7D+u\r\nuvfL/rOXz4HKNMVBlswRMYxT6utAkgXwLm09H5tXoQu31H02KJ2Ar0qyrSL8\r\nQ6JzcuDvB+TpZOYvsLqXfwTxCtGhFBufBARGOkJ9tTFlWVTTT4ihmsFJe18T\r\nGdWiTsxs4VjnHLTBNtQTagSmJXYavLRoCmaz/quoI1DbY9qyEyL3V4DYuDwd\r\n/mg1sy+qmL97POpqdWwhFZ2hdkdBmmLbzl20bY5S4p+XhNlgg76nYa/7YDkw\r\nalTeAtQ3Ri8AfjDTdbgXWWRqazCDxoD1rbAhfJfISOhDA1FOhgr9/TEllodn\r\nS2TIBB08jXp0oks9f5P9POJGaMVlUVJYQIk=\r\n=kC8T\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.17_1682143773972_0.9410537521583178"},"_hasShrinkwrap":false},"0.1.18":{"name":"@thencc/any-wallet","version":"0.1.18","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.18","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-hQuPn6MWNd0CHIUZfgF/qojn3Kh6LORQQlNOLN3aInDknzo3JWG0qljY3cHgYgn+E5rPOGOSDwJ4Pi/9IbhBiQ==","shasum":"32d0f50f49d6c40f8656ea3b75dc93cbf04313c9","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.18.tgz","fileCount":5,"unpackedSize":117357,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiO74xHV8HlmFbT74C414VuZEvKYffc/P9fbsQidfmiwIgM7PhDpp3BgwrTOC4rTjhEow9T5cqFtIj1sFeebEG5sM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ3y/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtUA/+PaHaOfn4jjuDEo9e5cuRcWwwQyzJ0DclCdsfDPJmVZcExtdc\r\nrGt6b55SwJFv6e3SYNRxBKTCjc5nOkKw14PJ58e8uHEEdm0K2t7EGo06/u1f\r\nW8X31tXsF3KGUknUgAIJuoLgo1OucI0d5uk2Ru5feVDiG9+h0yhgkmom+8l5\r\nkubbkMIVddKjtiolku+mm3OesNFxPOJwSu6dEkF8fG9ji45PWCcAvY0U2C3s\r\nClpo2+kyCsc/tduxC9ZlOqXVQJoj+O19lLIhMbACINZUTWwGYoI/akSAnIMe\r\nE2eRYJxd1ezWfmaM/r96nE6pjGowYVKJlkXTUekTLC9v18HFDJjJkEk1osD2\r\ndjJp6oSLvame9sSAL+FEnodnxwJrzEeOiCAeFJXs3g3TuhKvxIfYpF2M0uZq\r\n3SSpKmV38jH8pUwiiq9OdEeu4RRMRzxTHGpQhcvp3psm/WflMGpGnb8dkytr\r\nwuX4DNaEPdZc3R6T1hBkX401/Cw53JXyjF2N0nYrMt8p04VmJuzP0fMl+fqH\r\nDAoquXNMKaYVteOP5AhTBgAPYxdQpj9JiYXnuSXMIe1fjkVk2hT1fziv/Hj8\r\nPq7tBw4KTBVnr/NlKEma+bLmR19wps07MEoLDYbJ8NVWB6b+JLMHeWJYtIkp\r\n/N2z787GUpfEcRX2uU9+78gwWV9fSDIfXDI=\r\n=9YMW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.18_1682144447200_0.7990000228551306"},"_hasShrinkwrap":false},"0.1.19":{"name":"@thencc/any-wallet","version":"0.1.19","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.19","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-kNopI3eSoBFdMzMr+rQK/FX8CkYIKU8pWf6fCyan2Z7cgi/VpvroGmcN2ZXgzoQRQdylLq0xb9LsvD4XDufb8A==","shasum":"09c7872f7551d282a1e769f1953538795e587968","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.19.tgz","fileCount":5,"unpackedSize":117357,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE51uAXdom7+sDx+ROX0Op5TuYHgW2vIFoKh2b6VwsOcAiBwcSQQpfj6H1BGX6aCpBwYXE2fHOhq0FujUnze/AISDA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ30aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqQQ/+JEql/x0oIhtCG1CmJsOeFPa9WtqdMk3WahvChh2FcCiuuNsJ\r\nuKXNfeAIIKIlBtGd6yTCeCdCLx8xvv94ZoZpd29hVbpmcoiBa37NQJ+K1Haz\r\nM7FhOrwL40bWwVZx74Z8ua6+nPMzkb5ruPtuFmxXQBnIAYNRuwqS0ZeIWZbR\r\n0E+mpBl/qaS+G/ygUBbjLVoFot20CxMmktVdttQFf9ubVVRYNBJGJQYMSDjA\r\nIi7ZxUXbLJRbk9jp3J33tCcCSoNUWqDRiNeMHmrS27R9PV6A10OSlOnKKWlz\r\nZdNbd7GZVzE8U+vTOJluN6Kr3ot0VVsE+OE/4KVyuZTj3h+yaBy8UQYhXtBh\r\nGhbYw6dyE6e5lGV3qPG363MvrRN7jRS7stmx+ZJWqRoJhDpCnm79x2CFTdOw\r\n7rjpfelt09WIRLt102Em40JMKfG9rSIhO9yxbv34WyVRUqI0btdCLXE7ZQqP\r\nd8MO2ra/adZYKI8bWJZvMn+qCG9lpfgLCbBrZ+By5osog+Hz+B7Q0nWt4YUs\r\nOM57HdaWQnXk1JVywx/Lw9jHkKlXcxrDsEsSComFs4Da2nVVay/7MFLtAJw4\r\n3ni+mm3oWzjiMLN0SYcrvFVYiw9v4EobvvgQZgkawr5dabNGc+3Vw7JW5YCc\r\nG0Zv3OQVQeN6cRWSVu7x4kAFnSP6QzUDrMk=\r\n=yS42\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.19_1682144537823_0.022964119344866418"},"_hasShrinkwrap":false},"0.1.20":{"name":"@thencc/any-wallet","version":"0.1.20","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.20","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-u7lhaOkw83nVU73bgpLGAuJM7DjQfZgj1NT447YRfDBmpU20qWsqAQartaAIApoBGILTcR5TY9Ay6XK8/vpL0A==","shasum":"790013f78aba5b433026e64c54207243ee427248","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.20.tgz","fileCount":5,"unpackedSize":117357,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnHfTf4NwXsn24OXAf3t2qeE1I8pCuNHEEHbHNXS9MNAiEA72Z31qbeJ0Sw/fpfjPLdMXKeHQWtR/kI1bEOG3SDjZw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ31LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkfw/9HR0TeLAZjkfExJxUT6vgzkRGpiziwLpYN/lzn4lcLA5mLpiz\r\nRrhyUGbrpxAyRK+9Chk3T+2YQfPcJBCcgEU5RFhWBqiAfp3saiEHnc+/Z+gk\r\nWjkPupXAnxYRQnY40M/CULQxYEKNsbefuWsg4av4HoR0BcSt2RbI1QzQSdjT\r\nOm1pb60bMH4o2enLmh9s69USg8H/pkEOD6q4igEEl0EFvNpMHjpMY2lIzu0z\r\n+6S1aBeexLEU3HJZqx9QxoMLpLf1t472/Ctwn4PzWq0s2rbTMSBemx8AcUqP\r\nL8B3idun2JCzL6fSQV6crUZX+WLgqyCVaH8w0jqZQBoJG+DcFatrtM0HZ2+q\r\n80NR5/LdKi8RHan3QF5t55D7J6RvPc0Rje9u13SMHWgvA9OOldLoPv+Bp8eX\r\nWlJ4t9WVvnVY1nxQKLOWjbEkaMllVTgZKguijAjNn4K+mKQrE4bJiY2o0z+i\r\ntXn2ByFarTr8jl4lcbsk0n8QZVN645p4TGnWoElQwZCiYZhdO5qwkp/2s4Ds\r\nXHs2w7pdgdtSCnKRNxIJHvSZgJ+XUIojUDlAknaDdZvlSkVPeoKqY7qAN7pm\r\npllpzi833+UCPjzNxzbpoQFvNO91NhGlG2SHx/5e9hN6JJZxeF2q2lpj+gm9\r\nCQsq6K+Rpz6ajEGc40jIxsAmZ0A2pbhiDck=\r\n=cFqK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.20_1682144587754_0.4222214298094049"},"_hasShrinkwrap":false},"0.1.21":{"name":"@thencc/any-wallet","version":"0.1.21","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.21","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-rPE0ZsQgb04EcRPDOog1sPl782cQZQJcgEMMcTqZUU8uEiKLkCryR6NgvPp73gdVCzZkprgmjieOy5tm6Bn/Ow==","shasum":"75b1aace99c9c2a7167fae6a556412ddb56d6620","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.21.tgz","fileCount":5,"unpackedSize":118762,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYhaZksI/flzqOkhufOIJ+BAXlPGRbToZIw+h2rjwcvwIgJ/PNYypwXhvw64brCALSf2UeapiA1i5jtAR9paJ47Gk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ39rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/PxAAmSPJtd2m5JNJbQpHvVjP3J9hocyoL6dKoSenIrxI033SHqCO\r\nGwUN9Y8RdO4fuGEgsxQqyedP3f+pxH6FNLx7r/gVVtBf7T52SAiFUzK223KT\r\ny38/YVy0dTWnaG6C6gUEHJzoYMNo17Ep//uFqFOjuMRn/reUYJMvnpgIwaPt\r\n2lQEMNh8OZN9KZfJ4Xg2UYdZpsZ7eM6wYm4h3aZurjcdfIZYVLc4+Rug6Z0u\r\nwrurRgR0/EhiPRQp30hU6yBgQdJInrghwMDHHvWShsXHCgQF3UUtPL7Er84E\r\nhSQCU5MHGLytHsrmhgGjzqw3w4VCQvKZCfygBMMmKP24Vj3aEAd7HzzZUtQC\r\n3PcuupNJbdrN2he/RIpo8z9l7xTWDrjKOkOO/wFE84ADiKx4gqydY4j1eL20\r\nlYUPeMHph73VOarvbsoD5hLE7hai7lf4IVqIp0mFTYgbW9HuScCcvuSSvL1O\r\n33zjwYuxjzRB/kjKGaYWl8UUtMUY4/gpawpMQPt0ze45YHsxXAWGkZ7tVBzT\r\nxnctppRTU/FMFTgg6qA0uPmX5TA7iFGYYYNEWjYWPh0xow4gqrGAUR9/7qV2\r\ntI6kyXHUTBA8Mkykx1PnQRl6n0/E8pjuDFy7Mxh9PMvyzFJdhtMbCfaE5P71\r\nyEYKFpWtvcz4oR8zdtSIo+P1Wv55Fch6FPM=\r\n=/eIE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.21_1682145131315_0.5869908361950671"},"_hasShrinkwrap":false},"0.1.22":{"name":"@thencc/any-wallet","version":"0.1.22","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"6e957d96d95b7573b14f9e0b062b229859295198","_id":"@thencc/any-wallet@0.1.22","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-L+IvNNNJs+Ftk+e1uSnE1fvXqaMJC30KyXWV4YE8AvIJ7rOZQtClOhfOosSddSf4tIg8nULRcfYTPpRyxLnqmg==","shasum":"cc527b15a1162cb97851d6e0c9973dec6097235d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.22.tgz","fileCount":5,"unpackedSize":118762,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2x50piaiYdnBBlpOv9cr0gtYqeTWipe/Vow+xn4hTIQIgYvhCFQTnoNATDJAyrDDg8PRnsTGaTD4p4KgowJbNEMU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUtR7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpvtw/9FBFwEc6xq++vmtZIIcJ+W9SoiGVfePc+LJG7ZRqyyjub+KH3\r\nVK3zUtJUmA7CxlcNasGmVB5fW3w7PnOqWhh57rftu9Fma4H2nbWfG+xfOFn0\r\nucHEczK0MPQ9pA/yyRCmcOBPxlbd+8I+rGMn+mVna/ACmRbCQK1c7xpCFqvD\r\npcUBGpHAVKmaT4R5N/XotD7zT7swb6x2vDYUYPkaQGlLjDFNjtmtjlwmFzCh\r\nnIPgnNCtGQEpHSX7ItIC6N2/VI08lzf6vuyf12RJIHIB9AJdOUTJCnBYWmf3\r\naj3s4fi3Ix8wMV7ICkjd6FHa+mYHgLJnTX3DXBKafgpElLc/HBv2AX+A2B40\r\n1iECF9P1o5T9s5JfEBBWqYZRIFRHR7sXKPdR8RbRKY/d6bg2Gnt8dVhRTQQd\r\noRCPPDcUKnJEC+d+JIZ8+IUOxyT8czytS6e3XctTKJn3bPw/dSk0q1+KIpU9\r\nJnd4ykhQk1NT3H/tfkEEhC8lINJ70RPsNEDUUuGj6lATgpICOyHROXghFu7p\r\nmTRymtOwupgsLB+CZDb7V0bSOQ9RjrP/6jty8O4NKSbyJ+P+RB+y/+YFi486\r\nOwIqbJka5ClyY6RsjJvr1ipZBseP+LZo853jeWwWvbeKuetcFA4cvfh/deO1\r\nr3lAfC35mfoOZfX19nVNp8pd47S1bC8QZ9I=\r\n=P6OQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.22_1683149946974_0.5158884392962984"},"_hasShrinkwrap":false},"0.1.23":{"name":"@thencc/any-wallet","version":"0.1.23","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"a5692354b25063bd5daf6abf0259d1e3e8cd8262","_id":"@thencc/any-wallet@0.1.23","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-eoHrWH1xUL2oP3DkYA1wJ4SUL1QV8eUm+xeMKnQxKLnWXHVhx+L+oktBjMZp8z5YBYnoDiAkDpeDShO5jHTBjw==","shasum":"8818f2c3db8d2f26782a08f97d76f55740694dd2","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.23.tgz","fileCount":5,"unpackedSize":119094,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDewU+SdlZ8rqaapgU++VKf3/ensW6C2nVfzU4gW3KEbAIhALEIHGOjwwN3Bgr/RxVt0WHFNIQfk8FRT3qQ9jLA9a7Y"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.23_1683422252015_0.4843156472478676"},"_hasShrinkwrap":false},"0.1.24":{"name":"@thencc/any-wallet","version":"0.1.24","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"c9318f167aa611dba90dd2e002c1c2fcfda7b019","_id":"@thencc/any-wallet@0.1.24","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-vMthvZU/Rf+m7M8FCBwoDlsJn7KQIt5A8Wyt6aCtcUDphkglCwBD8EeOH11HBvf5gdSMG5zW1lyxti5zU6tKZA==","shasum":"49927f399feb6e6c0ccde1c9b81ddfcd07ba926f","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.24.tgz","fileCount":5,"unpackedSize":119103,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrlU0b7Inpb/gv0rkS7CkUSKENCIHvItjnTDyqSaGdMAiAiei6zSgqCcpS2nWegLLLMpOkbEOTH66do5mQWF1D/qw=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.24_1683486698850_0.13038315664293187"},"_hasShrinkwrap":false},"0.1.25":{"name":"@thencc/any-wallet","version":"0.1.25","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"c9318f167aa611dba90dd2e002c1c2fcfda7b019","_id":"@thencc/any-wallet@0.1.25","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-ymQourgH4Es6X2w1fB4F99w/lUWkgXgA6OajDrXvNeJUmM4Gqlrb7g6wwxsdzt8GzZtISJbioP4PlOrjNFls0w==","shasum":"234fc3644a25616b57935aff76435eea14fcec53","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.25.tgz","fileCount":5,"unpackedSize":119103,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWBH99D+hVDrRqm5LXpKL46tYXu84h5kiegpQI5ZqovAiBwALvncUHq4lQ+kQf7VzsqiXlLmcm8A7UBh+wge6UdIA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.25_1683486712913_0.9826222180232376"},"_hasShrinkwrap":false},"0.1.26":{"name":"@thencc/any-wallet","version":"0.1.26","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link-pnpm":"pnpm link --global","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.16","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"c9318f167aa611dba90dd2e002c1c2fcfda7b019","_id":"@thencc/any-wallet@0.1.26","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-ds8bm6o4Y6ztFKmiyb3gWzuVh5hAk0dbA2hWqXu2LdeEVAcy5DihhY6RdkD9QaU2UqYyjmOW24rb5oym+xUXCQ==","shasum":"fe6ae8a4f109a60714f613c0da2fd90d47bf9a9d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.26.tgz","fileCount":5,"unpackedSize":119906,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMUFUSE3HHTKxb5wvdQRb8qNRzWnmPGa3smcTEs4RU7wIgeT09XCIJlvafpcAriJGjvxQlsnsgmTBJX9+0mvD6hzk="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.26_1683582698695_0.6853857750095564"},"_hasShrinkwrap":false},"0.1.27":{"name":"@thencc/any-wallet","version":"0.1.27","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.17","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.17","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"1e00e29fe9157311665062125f7204dcdc40dc6e","_id":"@thencc/any-wallet@0.1.27","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-FkzuzCIHeJwpGKnERsRitiHQTqwgEvLQtbqvpsTZ8za1BD15xab4etsarhVW1rQftUF0x6Pl//noOaOg5+mioA==","shasum":"07b3058157586a43e95bb6fc054cfbba8d309d7a","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.27.tgz","fileCount":5,"unpackedSize":119940,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIkGchZ+IDEMEYbRa7uT8pCEIeVQ7n+i0CmxYIXgvkgAiEAu04Cwt4QbjjY+93vicos8Lueim6jRdtQ+QbnvRCEs4o="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.27_1683699089673_0.026725969463718746"},"_hasShrinkwrap":false},"0.1.28":{"name":"@thencc/any-wallet","version":"0.1.28","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.18","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.18","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"aae0d0e7f3c203cb9d73c998558ecf899c900ce7","_id":"@thencc/any-wallet@0.1.28","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-+aUlJLPMDtueBt2QeubvSjNEkHuHg882hAjkBuA+vHyzTLihDEVud10o47wl/xBF7/x9Jsl2tetLu6cVIqYAKg==","shasum":"be07bb0eb259ae782418cce8bd3304b6f776826e","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.28.tgz","fileCount":5,"unpackedSize":119940,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhcmX/Iq25oiawv46PmM0uuUAeX+hBjgVDrObX/9O7gAIhAOBd/m8dJsO+tpMrP0KYrnz18Cb66X6cx47EHQCdndPc"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.28_1683699674826_0.6608144992444436"},"_hasShrinkwrap":false},"0.1.29":{"name":"@thencc/any-wallet","version":"0.1.29","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.18","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.18","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"7c95dfdc57af759e0cc2bb87c00e704044909953","_id":"@thencc/any-wallet@0.1.29","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-UiYhaCjiAZwGsWU8wUYq+o2qJvzohCz5z4F+pynxYhfD1iUFxym88CKFhzvQEFmNA+RA5gfKYqMDXHwzUOviyQ==","shasum":"c155b88e7bae8f0f013de67ae367ad029043413d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.29.tgz","fileCount":5,"unpackedSize":120092,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpr3FrQkxgP/8uiF9QgpJIFeCL6BCJuQuW1PDpAPEuSgIgJrORxXyz8dSA3NMEwwKlo5GVW6SC8I+k//2WDQfo6Yk="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.29_1683701179335_0.9011384046478543"},"_hasShrinkwrap":false},"0.1.30":{"name":"@thencc/any-wallet","version":"0.1.30","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.18","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.18","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.30","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-rOZhD5s8yLUM9eHQCm8zkCXRsRWqIQMbEzZTEEWHJkyl38GhG5Y5qOMpr4qJw5ng28mfZPq1Q0ZVPzRWlIhuIQ==","shasum":"2c5089663d343af59535bac833363960f8c66474","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.30.tgz","fileCount":5,"unpackedSize":120246,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQsyGkwouKHu2LBMrDP8yjJ4VOtvnDqUdY9FWO9tJk7AiEA+qjPjnKmyuN1qa8MImufy9aLDVSWtSE4MZcEN3hp+CU="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.30_1683778007669_0.94833909857301"},"_hasShrinkwrap":false},"0.1.31":{"name":"@thencc/any-wallet","version":"0.1.31","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.31","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-l8W85E+ujDWM0U6B+g4DifYuHYvdw14sxa74J+zpgNyE5BiF5sXER57rjrCuSK6JZXLk/XEh81gS5QHya2FZXg==","shasum":"42125353ee2c14f6ce9e9001ec738a8fd1a3cb39","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.31.tgz","fileCount":5,"unpackedSize":120025,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqrwXF7tvxvzDDcD32ohRyTIBOeq2668c54dMGgFEC1AiBQtING6ZvEWzyk15S566gAzdHiEo+Wu4t/3fFuO/3n4A=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.31_1683780960649_0.929766103281281"},"_hasShrinkwrap":false},"0.1.32":{"name":"@thencc/any-wallet","version":"0.1.32","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.32","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-CJk33IikO44ljJtEkfufHkKOtNxRdFO/9xkQNTpFqDmiBJ9P34WxaG2XBc/lbYftTfldBVWVClCTT25UINJPKg==","shasum":"07858767ea0c2d4f37793f65269940ce106b6ae5","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.32.tgz","fileCount":5,"unpackedSize":120087,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZhWzifwuiqqew0wuTbLDAWG7ilYcYsnyd5uBFzlDS/QIgEyhRfYh4Yca7YWSrmdXCJzfrW87FhUhpPF3/5UFayvw="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.32_1683937132853_0.7493382472180028"},"_hasShrinkwrap":false},"0.1.33":{"name":"@thencc/any-wallet","version":"0.1.33","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.33","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-T1iA+/BIiP5GtiyBQ9dWJJv7Dt9iU4sda+EN469IZNnQAvIxfuO+ys3E+uF8XNadAEVFGR73/AG/gEKuAFl2nA==","shasum":"d07d6c8ecc74bc0dcad3eeec3520f70c1b46e3f1","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.33.tgz","fileCount":5,"unpackedSize":120311,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPSGtuf26yDWuRykzlPSuuE+p+5MOSVGbeAYL+XT6xuQIhAMBGMlZTlSJyR0XKpD1x40sFtFYMd+g56vsI2ArWXIUC"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.33_1683937666204_0.5882322101231001"},"_hasShrinkwrap":false},"0.1.34":{"name":"@thencc/any-wallet","version":"0.1.34","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.34","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-9WwYVRdPs0ZaTTMLdvCcsLn/t4gmfD7F23XZ1KSQoEmWLDeX9OtmXZ+W47LxfMSrreY5iZtaoQr8WI4gPmr3aA==","shasum":"8427bb9035b92a0c84a5da76f9fdf1d29ca0d7dc","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.34.tgz","fileCount":5,"unpackedSize":120563,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEirl/mm7e4QIDIV3e97PP0bSYhFr+xDvIKT5JGUdJBbAiAwLGmX0VrHN7uCFbOrtXm9DXCvg4Qc1Zr9dmy2pHhGWQ=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.34_1683938135132_0.12607440027557182"},"_hasShrinkwrap":false},"0.1.35":{"name":"@thencc/any-wallet","version":"0.1.35","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.35","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-ydQTm406e3V/HtMY0QUwouYl0mUd6Av/SkSAaF+Ti+NcPAHDX1rjeX27X2TEig9ao2dhZNOqBh+35MdQ84o6Mw==","shasum":"6497401398035d391a5c230e06baa894d3abc606","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.35.tgz","fileCount":5,"unpackedSize":120765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtL5QhEHxII74eGsNli1i+YmOvLKWXqZ/7fJW00pQ4tQIhALV8jZpHNZWh0hWsD8G23jPvCMEdCTp8PLwGKhZ1jL0c"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.35_1683938957409_0.21770947169878418"},"_hasShrinkwrap":false},"0.1.36":{"name":"@thencc/any-wallet","version":"0.1.36","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.36","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-e8EpL4f3hD0BJ24+PrZquoPOhhWC3crz/m8XHmSmBHOIZZrIJysOozZ2dOn6t0/rHht6uH3dgMj8+2+VFHthOg==","shasum":"7a817b8779af10461047536b90cdee862854def3","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.36.tgz","fileCount":5,"unpackedSize":120843,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAvfxlspqR42aXyZinMS0RPjX/NVxxep93+3m9pGZZomAiAKVPbpVZNe6MEGAfZtOK5PaqK0ankNxroEvVqpXL8kdw=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.36_1683939520695_0.0010559999988983826"},"_hasShrinkwrap":false},"0.1.37":{"name":"@thencc/any-wallet","version":"0.1.37","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.37","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-t4Pts/L7RRWR7IIHicB88Ukan39aL9jjOhQFxxz86ZqPZNGu9Po0UmV+6NkeAx8ayFkiac4BSStGAHATKdi5wg==","shasum":"f961539f508ef8d16ada2d611098fbd7ed18737d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.37.tgz","fileCount":5,"unpackedSize":120685,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcjpvltUCerAVfIB73kjqzALfcgnLbw63rg4RGS6tU3QIhAOUNiWBuVdEAOEufTSSH7t6l0ujBeLMWg8+tTYZFqNYt"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.37_1683940399696_0.12301430949613157"},"_hasShrinkwrap":false},"0.1.38":{"name":"@thencc/any-wallet","version":"0.1.38","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.38","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-vVuroX8Y+NTxRC9VhrQ5JNEKIr/xWDt9vKKWemPHwt2FoK2Kg0IpptjhHEMrIR2qalpSLDw5izwpeuc7CqFTzA==","shasum":"27c388b94df94ef93af7424912ba7e250efd30c8","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.38.tgz","fileCount":5,"unpackedSize":120631,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7SRexS50xEwt79gzniRlr1WgjgJ+pD0+9bU/CrLIhegIgBiqimCRDaw7Y7WdC2mk0eX9yt6eIialcvNfKHDtDTDE="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.38_1683940739830_0.5540951944573651"},"_hasShrinkwrap":false},"0.1.39":{"name":"@thencc/any-wallet","version":"0.1.39","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.39","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-aX3b7Si0nuPBjEwcS/aW5ru4KRTnQ8UpM7TzFhIk7CbSVEySYHkmKHtf90e4R/6399yCqjgPTjf3fyXpNxO8Sw==","shasum":"ca198619d335e93f058dec8fb8b94316173bba2f","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.39.tgz","fileCount":5,"unpackedSize":120265,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjqk1hLE6E9JSWN+A/9AOLNgMWVlORudzQy5eSlRL9oQIhAPSxlrMmKkyOpsy9YLUaHzhEtcrx+azGa7ShRUjfo648"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.39_1683941169166_0.4977327061554484"},"_hasShrinkwrap":false},"0.1.40":{"name":"@thencc/any-wallet","version":"0.1.40","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.40","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-CDf8aZtF8nujUGu24+O+4WUp14sUfKgv90xd00cb3G/J57UzQ4ludM55Vw/3NPOwq7B1ajO9oA4AN/4ePjhyqw==","shasum":"c25ddd3159a8490e38230eba6e797f9a77a2fb89","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.40.tgz","fileCount":5,"unpackedSize":126279,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsKGxCSzsfRTDvXab6cpdA1qSgLHH7Hgzl+QHyDD64TAIhAPucvGMJCGaggAgll7MeVd8jIFBlkLnZwplAMutMuz83"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.40_1683944847914_0.45593875202885936"},"_hasShrinkwrap":false},"0.1.41":{"name":"@thencc/any-wallet","version":"0.1.41","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.41","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-nwejcTBJG1ggcqrC/AR0azmM8iZfbmkqNXAP30zaamu7LkbNwXM8O2mcMSqYlWC3izTiitgqdNEmZN5T5IUJaQ==","shasum":"523b8948fe38a9ea548d6b079bb56a13e5f4281b","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.41.tgz","fileCount":5,"unpackedSize":125889,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiCDmi6KuTZHVDlxX6iaBj1WoXoy04CnM4coJjtKoeOAIhAIMDcddzzK0B8Z0Lm5whSAVmD80xgSWkAXA83lNOzNQO"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.41_1683945067850_0.49372245328756126"},"_hasShrinkwrap":false},"0.1.42":{"name":"@thencc/any-wallet","version":"0.1.42","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.42","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-DbXOi5y8rPi7oyIl7ngzt1k+VfFtxk85n4JNdLaP6tjY5xEuzxIel1pML8mNoKS+ixcdz1UFAKaMHeeQadr/AA==","shasum":"48ba82f0bd1098a1934ea7778edf701120e4a061","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.42.tgz","fileCount":5,"unpackedSize":120524,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDT5MyqwIBZn+Yip2/N8eGBBeFbv2pVDb6Tmr/OXl4V3QIgKBkB4+8/Tx6biWsA6kdagTFmFlSvB7xKQhaXlGZ64wk="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.42_1683945201487_0.19407968458773128"},"_hasShrinkwrap":false},"0.1.43":{"name":"@thencc/any-wallet","version":"0.1.43","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.43","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-HTmzEieHmd4w8IaZWvSLPXmToVIO8nKkx11YWX9LGtlpXaAvHQKpHbzeHG2e9LcfiT+7LhrLXRpBoCrqNJAi6g==","shasum":"14a376d6a75b06b493309adf0d81933ea8272d71","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.43.tgz","fileCount":5,"unpackedSize":120524,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPXHawvUWCLA0o/L0t4tWkQbIeg3CDrV8kwxT+tZHAZAiBIk1leamuSxnX+k0B27kXH8zn1n/g4vMm0g/mLIzCl0g=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.43_1683945575979_0.6356738432530078"},"_hasShrinkwrap":false},"0.1.44":{"name":"@thencc/any-wallet","version":"0.1.44","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.44","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-f4V/fQSoj/O9Vmx8Erf+bxw3LvUaogMiYC3Oca0fJAHyv2d1X0JT/LIULvkKyoKrimh9366MsliHgIKm+Py1fg==","shasum":"317350c066407ade71f780e615a23aee2064cc11","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.44.tgz","fileCount":5,"unpackedSize":120520,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEVMqUKhNqMMYAkHUZ6kcDwXyuXMH5soKFxNDpfJwmLBAiB5IYsFB1mXWNkbYbwUSfnzN4Q4k1XVarQDAWYJcl2ONw=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.44_1683945813869_0.5295885959256657"},"_hasShrinkwrap":false},"0.1.45":{"name":"@thencc/any-wallet","version":"0.1.45","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.45","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-fPE9dMf4rsKT1EGOyHJR+ypwm/TJj9SjXVXvppED2YccbtcJDgiZXUTzSb4dmxEPF31eW8NIh0Br69BGoH6RlA==","shasum":"cf4ba72ba866986e6d5d8853227e7feb3659bbe4","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.45.tgz","fileCount":5,"unpackedSize":120382,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD37S73pPfWJdm1xmHuw95l9t8aNAtulLAk0kJp80r+FwIhAIaOfArWnoPbOxzCQjh6qv33NCoQEKtPOAld7Lq83ULT"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.45_1683946461633_0.041329940781711594"},"_hasShrinkwrap":false},"0.1.46":{"name":"@thencc/any-wallet","version":"0.1.46","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.46","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-9MmCkMwvGWzFw2FDxEv44qkUbL4Fr3jWKIqvoPISHT/nulaHoa5dYzXe8EmGCq7a7eslqfpEkzH6CzELwUmRtA==","shasum":"f669e2098723c91cff690a1bdf69bf529c6e5e43","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.46.tgz","fileCount":5,"unpackedSize":120528,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEZI7C46pyfqGQwT6HH3v/2epxlQXYji23o+JUmgTS4AiEA/dT7DPW8eA15P5EyE/n5cCw+ypfGsu6p8pBsjyn21L0="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.46_1683946593121_0.2856654428978689"},"_hasShrinkwrap":false},"0.1.47":{"name":"@thencc/any-wallet","version":"0.1.47","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9c10a2f9f17792513dc65643b309cb023e4d5480","_id":"@thencc/any-wallet@0.1.47","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-lUspvabQT7YG01rkdx1ixHaDkB/DlHKeq0IO+I0ZGC98gWqzgViNqkz2C7dxdupUFqZHXgR3fCSMOL8U8JxIJA==","shasum":"29eba11eabbeb8a538bc1056786c077025791780","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.47.tgz","fileCount":5,"unpackedSize":120584,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSvYxcvw0PySjMRNwtzAShV6DYpmWhBHViazwd21hgzQIhAKnMDHuOJQS8g02zXOeRh9loBliOJKu8Hoy0jQtdEWnz"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.47_1683946688117_0.48853985352613205"},"_hasShrinkwrap":false},"0.1.48":{"name":"@thencc/any-wallet","version":"0.1.48","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"c136ec78e458c0051acc3ee5e0b8f6bbd9508e24","_id":"@thencc/any-wallet@0.1.48","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-qUAUZxuXikLv5k1Y69OyDDTqd2wsoijCobF6WGs6hdy0OqRR3QI5qhUEFw6Ct70gNMahU7oKPtR/rHZHIZGWLQ==","shasum":"0da67bb7234dc3dde646f49ba7c54c1a475959f7","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.48.tgz","fileCount":5,"unpackedSize":126285,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFS0wMMUC/mjcAmdVf04AFYP8/3ZasmNXTyfiYBaKNmHAiEAjDzIvFranXYjEY2EB7HyJ7OdOXGXyBAhd/MJ+PFI3wU="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.48_1683948729301_0.054974551527438686"},"_hasShrinkwrap":false},"0.1.49":{"name":"@thencc/any-wallet","version":"0.1.49","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"bdde65e79ed1e4a60452669c20d4599b090796df","_id":"@thencc/any-wallet@0.1.49","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-QKZbBBQSYGL4qH6556kOZjqaVyJ9MXHd0ve2yd/rnGlZwu0mE1xZ2s1cDYdpwWV5rGr30C8m8Kzt0UxS1NwCEQ==","shasum":"82319e35640864361aca82027ee67a15a52cb1cf","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.49.tgz","fileCount":5,"unpackedSize":126703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS8IFyxHuoFBUjI4gZOOMySE/JBH9sGwAWzfA7+5iAhwIhAMwPU4BWihR/yYvnqUHazep1wVzoMOrc6xWmINJss4L+"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.49_1684190685198_0.8661794889993517"},"_hasShrinkwrap":false},"0.1.50":{"name":"@thencc/any-wallet","version":"0.1.50","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"756f2858217d905e2ccdc34bac6176f3361904b9","_id":"@thencc/any-wallet@0.1.50","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-4cbBIn/ySa5ep8jFF7eoXeh+7GoolLTyJiC0J+ckOzLiQ0PDdGrs0hRyuRUF13Jnish9eym0YwLoB3owCAyYCA==","shasum":"f79ac194996302445a5b18c6ddf36efb49249a01","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.50.tgz","fileCount":5,"unpackedSize":129282,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAorGf14Q0kWouA2C4j7UNcUj+l26PpCHle5GzWlEs+WAiAda/b08Dpiyj+CfeN9Dy8Jzc6aeslh9aSY9vVKLoapOA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.50_1684193589990_0.9785360401760517"},"_hasShrinkwrap":false},"0.1.51":{"name":"@thencc/any-wallet","version":"0.1.51","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"9fe56e8b79f0acbdb8063b6f263b22c799bc6f74","_id":"@thencc/any-wallet@0.1.51","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-lT9WaFV4DNgwdScR/6N7eHm6xtFeuExmF4yno+zNVpiws8nOZEBTZEcsMIAHR6BP22vtIOrhbP7qiWydpTkVOw==","shasum":"79f2a0323fd149a9ffa08225c99495c7b99d3fc2","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.51.tgz","fileCount":5,"unpackedSize":129575,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgv8IvcdyoGXTDyLsgKF6VjIhrFmw1BVg88FHn9tshvAiEA2peJEUh72MY5DD1XEpOuVG2P9+kIpFTe3cb2B/wPxKA="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.51_1684194573785_0.9661246533241394"},"_hasShrinkwrap":false},"0.1.52":{"name":"@thencc/any-wallet","version":"0.1.52","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.52","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-xzWvJg1lz4EP9+H8JgeWStvQdRImTpZ3k+6Fm3Xhc8k0nMHal7hNJtW2jVDAwm0DwHqeLSvBlXmCnI0E3QH4xA==","shasum":"4dc6cfe9943900402c8d2c3a6df1854d94bfb33f","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.52.tgz","fileCount":5,"unpackedSize":129563,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHsljOGy93w9sA42TUGF3VmOGIOgrH6UAtdMgniNbDkwIhAIFXrFIfidZNCByVxK52oRJF39nbn4lbwUO0HDjStL6a"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.52_1684195135564_0.5315785338971635"},"_hasShrinkwrap":false},"0.1.53":{"name":"@thencc/any-wallet","version":"0.1.53","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.53","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-NvzXJ8hrdK/6ZylQ8dKwWS/Hnro/406KaVvJB1XAo9+UC1a61eFEQdAiWRkiLFKgJPrieh+IOQQXyS9B5QDB+w==","shasum":"5a05e5256884f3ff2c1b0387c56dfe0d65e9ff16","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.53.tgz","fileCount":5,"unpackedSize":128991,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkK4o37t+z2Mwbfhm1Lci/exjBLwXLaKXrbwu/ymAKigIhAP9SGzg2sMjrTR2AzmZ8upu1mHEzYwO1Rk7mBUbw6dwh"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.53_1684195482550_0.9042576050780708"},"_hasShrinkwrap":false},"0.1.54":{"name":"@thencc/any-wallet","version":"0.1.54","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.54","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-hXbkUEjJNAXby6FM3g+RhVTG/EobJvK3XTNbhV+sr7BJVcunmzFDUyW+gEY1SsJbEUkWjOxG9MFPHvCmglS4gg==","shasum":"ccbec516c7e42d9cd040d32fed0cb2bdddab1784","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.54.tgz","fileCount":5,"unpackedSize":129005,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGzxkeY/GzcxhsOX+BzoKyHOLA8qZFH3kZxPwLgxfq9AiEAwsunxzivk10S1r4FmggufGCfk5B3Fyp33uKeC0xqfHk="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.54_1684195769706_0.4918644150515581"},"_hasShrinkwrap":false},"0.1.55":{"name":"@thencc/any-wallet","version":"0.1.55","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.55","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-/2vGC6het+MGSMeO6Qvp9ofd9cVUYFzbYRHcaBgsKr0DVWenwS6fVSrmu0gkKphrtgVs21vM+OIwAFS7yRKLcw==","shasum":"39fd181601958335abad1cd71c170b1e8f838287","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.55.tgz","fileCount":5,"unpackedSize":129123,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmXZ9idXn6K486d73FBUtdzpHh/silJy7BkjeuJvKoZAiEA1j/Jn5KYp5uIlK16NeEgn64EF/Abz9mvM/lEwG91N04="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.55_1684196000425_0.5046273199632783"},"_hasShrinkwrap":false},"0.1.56":{"name":"@thencc/any-wallet","version":"0.1.56","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.56","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-tLhSN+QCgpnJqQPA3ekk/FO9cyzf7mvzOkIE57NhNMMdYzYfP/GcredejYtDCi1tf2165PJrXMNwrInrdJYprA==","shasum":"42d5bcd4ce44562d7f5f8ea4644f67d305491b0d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.56.tgz","fileCount":5,"unpackedSize":129161,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClCXB4z59RFOZxOZcdwKizE9ldOFfaiu5V9loN1R9cggIgf6ki727SvamxXvB9qdvue+6ATIXKNbZaqZ267GP2xrE="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.56_1684196187627_0.8931177452057151"},"_hasShrinkwrap":false},"0.1.57":{"name":"@thencc/any-wallet","version":"0.1.57","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.57","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-aI/9AXNIzIRu6Rrbd/T2rIQqvKfwMoUryE4bjcBJNVi2kcF1AdIMTuF6YazO7DdR3a5moar75qb172v3RY9Mug==","shasum":"77a6657c63a768412c768429991f43ef4fb35836","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.57.tgz","fileCount":5,"unpackedSize":129198,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUxlVEUPFHuXbhYHtXwC+snZfCyD9Kbu5Kwf7Y7fOiUgIgcpJARBAvSfg4wKNF5xZuPXK4bQefcpjBa0efYJm6jnw="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.57_1684196365894_0.462844145400219"},"_hasShrinkwrap":false},"0.1.58":{"name":"@thencc/any-wallet","version":"0.1.58","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.58","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-Iti3hMqitH2ifEAzT0HX3cFqZ/1ei/+qK6LliwkqNckdSvFeKTcXVUId8KC0kDxnq8eeYotxsMQBkIZ3lD08uA==","shasum":"73cf2ba30cd9f8d5c60a219d51866ce4700adaae","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.58.tgz","fileCount":5,"unpackedSize":129234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyPcieNV/T0nHNE1fph4x3PnViZMRzCuodb+UKQVB5kAIgTr51zLYNgmBr2gHU+pYsh0Selb6V0AZnLYlkIG3/4hA="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.58_1684196572524_0.283582013991158"},"_hasShrinkwrap":false},"0.1.59":{"name":"@thencc/any-wallet","version":"0.1.59","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.59","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-22SoFbhawJQzVY9QtmaV7S5lzUrHOrrIsc6AGpCXCg95OsxjM+HDopsaiLmqb+697h6FiTq/Hp369mVvz8oU0A==","shasum":"81ea2c816ca7de200ada3abb899aa21208ec6157","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.59.tgz","fileCount":5,"unpackedSize":129813,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFf+KacepVW688E17uWkyYrRG+yWQgVA2IPWOcS67X0AIgDvJRL+jSHMNB3yt1z2OSI1twkXE092TiTTBym5QVLqY="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.59_1684196780432_0.223912891690488"},"_hasShrinkwrap":false},"0.1.60":{"name":"@thencc/any-wallet","version":"0.1.60","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.60","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-fqUkJ1KVOl9zmpwMmqLbyDIH+4pz1gORMBEHUTaQ5g4bM4QDjLQFUjLHL8jzuw+01V4fkY+DCzfbgeT9GKAEZA==","shasum":"510c220a4f65aaf0dcb099ebb3b69f38da84580f","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.60.tgz","fileCount":5,"unpackedSize":130068,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRJ1GEoaE9hCwroLQR0+EbLMENMqv0w6Oofg60GBGEpQIgcxD7Pb2DHxDpTbgiMMjTyTReMyGXVrJZQEBaGBJMjnQ="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.60_1684196979410_0.9284356013271666"},"_hasShrinkwrap":false},"0.1.61":{"name":"@thencc/any-wallet","version":"0.1.61","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.61","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-bQcXTu2quowDyvRswHXnh+V1Ylzw0Pv/nP3B+PN/XEG2bonH3Vm5hiAV728iqVnk+wXYmB077vEtey/9hNjBsQ==","shasum":"08dd5c4bb99e88c1c08cf7655ef3142d666b7714","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.61.tgz","fileCount":5,"unpackedSize":130066,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjpkg8PQX3IJDh6AkXdf1kTvdxkLirlObE0RX9zlKoaAiEA5kAdpCm0OwPMKfKdwUSQpr0z3SB7YBYyFhrqmMH8MhE="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.61_1684197479561_0.5259037242359339"},"_hasShrinkwrap":false},"0.1.62":{"name":"@thencc/any-wallet","version":"0.1.62","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.62","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-tHU3hsNWvnX2+tlyTdczx9LPZON91kX539O6730om0XQQrACi/OqENVwLGADhMln2YmJ1/PEWAhkdSaZ6qHSvw==","shasum":"3f7085762875ac3462c04be88c0e0bb4ab578f78","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.62.tgz","fileCount":5,"unpackedSize":130222,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUAzZ6lmjTG6nZ2TCXVNA5kWZFWYaXM62d7kaRDaQdlwIgHzcp7eTao0c8yCDuv0MeDk6ADjfvm2RL9gMnVPvHu1E="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.62_1684202433191_0.42466192052774"},"_hasShrinkwrap":false},"0.1.63":{"name":"@thencc/any-wallet","version":"0.1.63","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.63","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-D/cfbTlAC/EhVmX/7Fay5O/ggrGYP7DhF7hnq/JkyEPyvhprsRXpZZCBmzI5WnP9iPV7M/zudr+6MqygWq9pag==","shasum":"15cf9cbb32ded0732035468e5d1959a134ea14c4","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.63.tgz","fileCount":5,"unpackedSize":130300,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRTQ0V3imrP/dmTMNLPtP5uI4IaliY2StE4FgdDlzXrQIgZz46h8/qRSFzLynONyI5uvM4AIwKgwimk5Q2cD6i2OA="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.63_1684871948560_0.06644861990011708"},"_hasShrinkwrap":false},"0.1.64":{"name":"@thencc/any-wallet","version":"0.1.64","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.64","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-YevFWWxx1b8Ns1xclNNULlZM7Fqe/8lTurYZICbk9DQYhbO1KBLMYWtw9sfS5BgylJ0fi+lnaYg+Wdbo4CjVXA==","shasum":"60308c5a439ff8cb4a55128895902da37f1a932d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.64.tgz","fileCount":5,"unpackedSize":130460,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs1zCg94qwNht8zmxMQYoXBRqM69XTPYyqWPwGVX1LkgIgIThyvCVXLmDbu4EWxDqQDz81TmPWcmCKkDrpR1xMz64="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.64_1684872394060_0.18464929872400115"},"_hasShrinkwrap":false},"0.1.65":{"name":"@thencc/any-wallet","version":"0.1.65","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.65","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-IAB15lrQDW2BnwOfHtrefYm+UZXhgFkj+IC22+uJrdq876fvvs6UkJfSrubaUwrRbA46hlCFhufhxHNPTEMlIg==","shasum":"83f040ea86de67d3156b5c004cbe3df727009f5d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.65.tgz","fileCount":5,"unpackedSize":130460,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIjQPaJXjB267ThAIou6YsagJmCqiTNQeY+xMBjW1N2wIgUpYoj5x9DkRZOnZsFmWR6Ezc0AI0srECYM8+kulbEmk="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.65_1684953070693_0.37828289859537967"},"_hasShrinkwrap":false},"0.1.66":{"name":"@thencc/any-wallet","version":"0.1.66","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.66","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-EJDXnLQ/X4XzIl3vRFH0Cafo0WpvtXpPr2WHmp8AUYoZCf3XpJlUyiwEHU9TAY0jvX8FV3CBD7dXaclOoAgBRQ==","shasum":"02ea004ff798eb352803026e846178d9040b1bc9","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.66.tgz","fileCount":5,"unpackedSize":130444,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNjEElpGgvuVci1ooj/Fb9j6y2n2hzUEuMo9HcGZg2GAiAq0ZfEdy+XxHlHTF/Rd3/M1IDnMmBen7RCleh2mLc9qA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.66_1684953328952_0.5375005183642243"},"_hasShrinkwrap":false},"0.1.67":{"name":"@thencc/any-wallet","version":"0.1.67","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.67","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-uCO2dD1UXFImiC0/YcF7A3pCMRzW2EwCPcqq25I5BjrFBbxqBVJ/TvZeiSJAwv1cnby4Co4vBkPEklpt2s+2oA==","shasum":"a2208da638b48660da669dfa86318647400ffc4e","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.67.tgz","fileCount":5,"unpackedSize":130356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFGijoDwYQrFqwK2lYMRFPwm3uT2V0rBqSPsNrmpFN/IAiBIzGnuJD7abLbRpEiAqSjefRokcOtgmlcZuY3N/8yjRg=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.67_1684953621618_0.18537586992449828"},"_hasShrinkwrap":false},"0.1.68":{"name":"@thencc/any-wallet","version":"0.1.68","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"f38da43207118abd0b2921713c7e074601591fbf","_id":"@thencc/any-wallet@0.1.68","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-ngnXkhCg2rC/G0LKEcinxWDINu7CQP3NjnnjWd5Yev1Xcj12Und8nEAnxFLDQBoFFnrIyrQtut8qNEbswR4rEw==","shasum":"25c3471c30fbf1bfdfe20cb1f71e54e33bc6a955","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.68.tgz","fileCount":5,"unpackedSize":130794,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDS7zmQgltw0WWtqo5OhzcWAZ7IlB2I3YGWOxRMPF2P8AiEAxO7UBbPc/sEirWEKPe5RjMjW1OW6O+PqC73sNc0sfIU="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.68_1684955859316_0.5576844296715768"},"_hasShrinkwrap":false},"0.1.69":{"name":"@thencc/any-wallet","version":"0.1.69","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"a9cf96d5e3276495bc7901a45f155f6e5a515e1e","_id":"@thencc/any-wallet@0.1.69","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-wzoTe8BvDz2VfkM13wkRccNWhipPTfz6Qu7pzmaA1bSdUeGvtHcd9lgEwno0UIBoWDxXzy22WGZgRk6tjVY0AA==","shasum":"81ce00197a48fce36ace3a1e49887f9beff75e49","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.69.tgz","fileCount":5,"unpackedSize":130740,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7Tn76PsfS1dgWpQtWQSR/GehtffR/P1xR7Ak8N2mPXQIhAP7Y3IvBQbpMln2jN8ALM5cKQstabs8y9pOSE39hkVhP"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.69_1684956379980_0.7565925527498303"},"_hasShrinkwrap":false},"0.1.70":{"name":"@thencc/any-wallet","version":"0.1.70","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"a9cf96d5e3276495bc7901a45f155f6e5a515e1e","_id":"@thencc/any-wallet@0.1.70","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-DV9voEXUpFvPoQS2AKFQwQpuA6F0Zhbqht/1z48i8nfeEv+x4Ac+rHTyHfbeOI5FG02vARZY6eMO5ZjJmnw3ww==","shasum":"0045a7418e6a85c3774f8e944ea0b00d6f2972f7","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.70.tgz","fileCount":5,"unpackedSize":130752,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrMp81ydKNSsK/TNA61+jBKs3aQnZY0ES/3dTCdVbJgQIhAOj3DMcMlNL4/X/I8AD00j56QR9sCEp0KZtYk7+PpuOP"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.70_1684956560268_0.238729834597335"},"_hasShrinkwrap":false},"0.1.71":{"name":"@thencc/any-wallet","version":"0.1.71","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"a9cf96d5e3276495bc7901a45f155f6e5a515e1e","_id":"@thencc/any-wallet@0.1.71","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-YVexOKSwezwk4S9I0ax8Q8CGEybunyldf1X0wI3+hZQD+q0a75aYFyNJoJw9xyKT2ZLSbSkAexJHNZgSHEpKpA==","shasum":"ee5661042c7d159945277a897c8494d60adf74b8","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.71.tgz","fileCount":5,"unpackedSize":130752,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxK18gFCljzA4W7CIa7g4C3W6/Yzosm3pjJGFEM0OP3AiAm0Ckdiyp5XkA0E+cdk6SKGR5nS435U0hn+NKlFVLsSA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.71_1684957250352_0.16948598807575244"},"_hasShrinkwrap":false},"0.1.72":{"name":"@thencc/any-wallet","version":"0.1.72","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"a9cf96d5e3276495bc7901a45f155f6e5a515e1e","_id":"@thencc/any-wallet@0.1.72","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-k89iDoVI2sVkOWHwBOcs0dh/AivsszXtTc6x04yaF3mT/yJUco89wrPtCHPAnZnll6lNuVweKHbLJMBLPoG44w==","shasum":"a0cdc33b13ada8d3f187ec945c71b2b699d9589e","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.72.tgz","fileCount":5,"unpackedSize":130890,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0uUFATdUllAGFMmgIlR+wS4smTBpijkc8Y9a/hGuVcQIhAJ5rwu6UzuutPq37hNi6SZWxwFceNodcVQCCZq4UidLw"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.72_1684958349514_0.20017418171554646"},"_hasShrinkwrap":false},"0.1.73":{"name":"@thencc/any-wallet","version":"0.1.73","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.19","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"a9cf96d5e3276495bc7901a45f155f6e5a515e1e","_id":"@thencc/any-wallet@0.1.73","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-lJPzz3Ug0DGQEYBAVe7DhLAoCdbB2kqjM7vrLxBYRAOs3eKOoPruABn27CoRb614B1ALfMJUYWu5D4pyMW+uDg==","shasum":"da88d45a7ac74897f02c2575b6d4c3976b49c232","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.73.tgz","fileCount":5,"unpackedSize":130752,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDalL9tmSFe+qs/K7HPSsIphU0ZZBlj/kAbqXi/00bZkwIhAMQM94BarIT9HAXMwZ5pF3vR+U2xC8VLz+SEz2PiheFx"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.73_1684958606777_0.4344826487668396"},"_hasShrinkwrap":false},"0.1.74":{"name":"@thencc/any-wallet","version":"0.1.74","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.20","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.20","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"dab272613bc83ef192ba6fc2e8f1f7527f40969a","_id":"@thencc/any-wallet@0.1.74","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-AFEAVVVhi+pjmR8lMJPxZhF8TlPZ+EXi9lkDBLWMIWiZYp/HcutVn7sAe4rhzx51qymd+nbYSHGnzaUwVYZCyA==","shasum":"2e3676cdf97cade0ff2a5458895c7fa630fb1b2a","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.74.tgz","fileCount":5,"unpackedSize":130814,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHgF/mZuIfp4O1wC+MCF9fAPL8GFFzIJ+21TeDpvDCxQIhAJqCnw2cwRdsKWKfN+gcrNOyCQePAzWaTzXcXVJXbNSv"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.74_1685487723086_0.3704150401887778"},"_hasShrinkwrap":false},"0.1.75":{"name":"@thencc/any-wallet","version":"0.1.75","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"dab272613bc83ef192ba6fc2e8f1f7527f40969a","_id":"@thencc/any-wallet@0.1.75","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-5Kgmt4VridbZX8JfkSzNLK09kU+LgsKOqdHdYMoucZvbKnliJw6dzcAsIls/1CE2uPZIZpPo01/F73xjDKW8Eg==","shasum":"4121d33d818e84c906c5d89303c0d7ca9afd460d","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.75.tgz","fileCount":5,"unpackedSize":131178,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGEIbxy7I/Y9fRoMnYA6GZrjMNEGpSuCZWe4vcWWe8PxAiEA0+cPiAT2y//aIWQhy0wymXDqfLE3rvEH95fQKb+pLPY="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.75_1685491585225_0.6599604017860379"},"_hasShrinkwrap":false},"0.1.76":{"name":"@thencc/any-wallet","version":"0.1.76","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"fcc7b251bd0c1f6137d61805956baa2d795a7919","_id":"@thencc/any-wallet@0.1.76","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-yL2yiA03vLxJpeVf9GoDiYd+xB9GNjR/cUm05llkKLtqqGPRYKwUlD82mlpEuN6UtC6GyGZdB6+GxVA/zAA6Fg==","shasum":"51224c7020c85eaa0898de27327fe536bc3b41a6","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.76.tgz","fileCount":5,"unpackedSize":131185,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCch922Sjd9aTzQ+DnLB67WJ4tS3mZOo3V1TcMlyGa8fAIhAJpI/jGtuDkTT3qX1uCYgZAKDRRL9Q4ziGeV2aClPd+f"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.76_1685492148742_0.18891739417524223"},"_hasShrinkwrap":false},"0.1.77":{"name":"@thencc/any-wallet","version":"0.1.77","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.8","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"b77079277d02b8f665ee1093bb8d0bed37fa6d56","_id":"@thencc/any-wallet@0.1.77","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-UUqb03+l8mxaWVjuCpX5V7Mbo4O/CBC54F3WjVmrohoco2O/g3I0w4w4vJgcZ/3Um3L5Jk3/jqyhoygsXUJ1rg==","shasum":"db15f3aa3a836d13ea8401ef1777d1fb471bf234","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.77.tgz","fileCount":5,"unpackedSize":131766,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICEllSQoqV3HFZvSmWZPSGQiGklEBYqnuTfhT0LgWeiJAiBfsZhMhUeDhKH0PLfk6ooHPYe3AfcAWeu5j/51JRjggA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.77_1685729388469_0.2862582984091788"},"_hasShrinkwrap":false},"0.1.78":{"name":"@thencc/any-wallet","version":"0.1.78","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.10","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"gitHead":"0b727ea8d90f948a4a76259c4d6a83b3c98c0ea0","_id":"@thencc/any-wallet@0.1.78","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-doAjoeF0FI3bYoErEfBQssgr9Rjhm8OIfsm1wrSvqBlbDsw4OW+HVjRyDuV3z5jT5iKMolOLSVYB/FXev3FjFg==","shasum":"71ce18bf8595056ccc5203f0e6cf1dc9b79e096b","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.78.tgz","fileCount":5,"unpackedSize":132183,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEJVwBVhmcGAsEvJ0WNOF1lNdF93uJWXlQRYotA3VWfAiEAkYRP/TzLvJVE7b9k/S8Vjky0vyoaNSaRnr4t00vTUu0="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.78_1686074440303_0.6147446423855238"},"_hasShrinkwrap":false},"0.1.79":{"name":"@thencc/any-wallet","version":"0.1.79","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@beta latest "},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.10","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"gitHead":"b50500f0abffe612a80ca0ae9f56d706cb80c240","_id":"@thencc/any-wallet@0.1.79","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-77eRKf709vzXgylHtmkv7WhXAnDaR+UjTiDdXiTK+9M6r0/qIXpPn95Saz2dGOhdD3KWcyc8OOSRAi0B2nNtQQ==","shasum":"f9f7e69e3dd434a6fe4a3a5484ffee7dabfcb5e5","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.79.tgz","fileCount":5,"unpackedSize":133274,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwNBHuV8HdihWwVwf+Hobykf7jLIC4Z/ggY4W1oceBhAiEA76Qc/6MFCOamP+zQgOMo5Oc2NniseaRe2Z8tZBc/vZk="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.79_1686677490728_0.16460983352040826"},"_hasShrinkwrap":false},"0.1.80":{"name":"@thencc/any-wallet","version":"0.1.80","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.79 latest "},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.2.45","@vue/shared":"^3.2.47","@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.2","@perawallet/connect":"^1.2.0","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.10","algosdk":"^2.1.0","buffer":"^6.0.3","tsup":"^6.5.0","typescript":"^4.9.3"},"gitHead":"8823322556105f3a89ef2dc54cd5f17e44436e8c","_id":"@thencc/any-wallet@0.1.80","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-mxejqOJeUIl0WTPrr2BiStIn7vTReKsfqI38J4cvm7i/JQuLMELCPfY9ShN42dC0h7M0Wj2oQmk/iHvvuFyMDw==","shasum":"02c5c15caf4a0163cb67e741ed9f379c14032618","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.80.tgz","fileCount":5,"unpackedSize":124921,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBljoAjGgaWWMWgQVoted769F7mPM7sNElrBKc3Pbe3VAiEA5DWzJGroJcSYAy7hXxhBNtqvlxooDu7eIfqWmyNxMWA="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.80_1687367529780_0.46042243090719914"},"_hasShrinkwrap":false},"0.1.81":{"name":"@thencc/any-wallet","version":"0.1.81","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.80 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.3","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.3","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.10","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.0.0","typescript":"^5.1.3","vitest":"^0.32.2"},"gitHead":"f1c7a56172174c002f7d217f568ed71f40f63c31","_id":"@thencc/any-wallet@0.1.81","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-z4RSKyC/4kLGuCgHK5aShfYghvURDl3sq5TSilIlpYWXNmnOYqOGQR4mtbamRsm+b3qayYFQTTF9Ht8WwGjpMg==","shasum":"806f7e3f614800c4d1a5722f9b8cc67b55b78bec","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.81.tgz","fileCount":5,"unpackedSize":124923,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC2Lduv6dt6ia7YZD0hs6Vuvk9LkLDV/LLlrpioZ7xzgIhAN96b6jHDXaGla4sRnoocjWXebhmZnbc93MDPksqC+jq"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.81_1687369748741_0.2718462662754759"},"_hasShrinkwrap":false},"0.1.82":{"name":"@thencc/any-wallet","version":"0.1.82","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.81 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.3","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.3","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.23","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.10","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.0.0","typescript":"^5.1.3","vitest":"^0.32.2"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic input (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\nfirstly, install it!\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\nthen you're able to import the lib + use its features:\n```ts\nimport {\n\tAnyWalletState,\n\tenableWallets,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n### enable\nto interact with any wallet(s), you need to call `enableWallets` (at least once)\n```ts\n// enables defaults\nenableWallets();\n\n// or, pick which wallet(s) you want to enable in the dapp\nenableWallets({\n\t[WALLET_ID.INKEY]: true,\n\t[WALLET_ID.PERA]: true,\n\t[WALLET_ID.MYALGO]: true,\n\t[WALLET_ID.ALGOSIGNER]: true,\n\t[WALLET_ID.EXODUS]: true,\n\t[WALLET_ID.DEFLY]: true,\n\t[WALLET_ID.MNEMONIC]: true,\n});\n\n// or, initialize w specific wallet config\nenableWallets({\n\t[WALLET_ID.INKEY]: {\n\t\tconfig: {\n\t\t\talign: 'right',\n\t\t}\n\t},\n\t['pera']: {\n\t\tconfig: {\n\t\t\tshouldShowSignTxnToast: true\n\t\t}\n\t},\n\t[WALLET_ID.ALGOSIGNER]: true, // simply accept the defaults\n\t[WALLET_ID.EXODUS]: true,\n\t['mnemonic']: {\n\t\tconfig: {\n\t\t\tmnemonic: '25 secret words'\n\t\t}\n\t},\n});\n```\n\nafter that, `AnyWalletState.enabledWallets` will be populated and connections + signing can now happen\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.enabledWallets.pera.connect();\n\n// or, connect inkey\nawait AnyWalletState.enabledWallets![WALLET_ID.INKEY]?.connect();\n\n// and if you want to be typescript safe...\nif (AnyWalletState.enabledWallets) {\n\tif (AnyWalletState.enabledWallets[WALLET_ID.INKEY]) {\n\t\tlet accts = await AnyWalletState.enabledWallets[WALLET_ID.INKEY].connect();\n\t}\n}\n```\n\n### signing transactions\n```ts\nimport {\n\tenableWallets,\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { AnyWalletState } from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the enabled wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n```\n\n\n## using the mnemonic wallet (for dev!)\nthis wallet can be connected via a mnemonic passed into the init params OR via html prompt input.\n1. mnemonic via prompt input (the default behavior, no config change needed)\n\n2. mnemonic via code config\n```ts\nenableWallets({\n\t[WALLET_ID.MNEMONIC]: {\n\t\tconfig: {\n\t\t\tmnemonic: 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend'\n\t\t}\n\t},\n});\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"08a69c408dd8c6e295543220333a09c044a8d613","_id":"@thencc/any-wallet@0.1.82","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-H0SJsx6uq1zeBDbbPzzrRIZNx8jFZXo02t4Xo5owY64LXm3rGAi9ICgLB5BwOe3t/uABroFIj5Y7nUpR87TxWA==","shasum":"32f6713efc036d0ff51bdbed613569a11cffff55","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.82.tgz","fileCount":5,"unpackedSize":123539,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDczuPDpdAR959apexH/9zxiveiC1M+IBRkpWZq/bKvqAIhAJTdWu18V4un+nE3hX6B0P/vGilBIKXckVn2myhUjXnP"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.82_1687873539168_0.14690775360808006"},"_hasShrinkwrap":false},"0.1.83":{"name":"@thencc/any-wallet","version":"0.1.83","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.81 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"740cc1b7a721023193f9fd59317f3db0868b5140","_id":"@thencc/any-wallet@0.1.83","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-0hWueiPHXUabsfq97aqHr+v29A1kczS2eQWR9NoUx0a5oVdDGjXXSm0dVWxNqGG5A9wKCHRRdgZc/lfl9X+UZQ==","shasum":"fdb4aee291f660c9b1528af6bcdc49af216d5ae0","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.83.tgz","fileCount":4,"unpackedSize":70810,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDF9Swfloa2FtJuDe7JWY8iQ+uNkpSxt8oC7w1COnxkdgIgERBe/Z6PFbIRZnAb7G4cOdkkgLKlG27VP5g/wHMk8QQ="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.83_1687881226028_0.5364456483635685"},"_hasShrinkwrap":false},"0.1.84":{"name":"@thencc/any-wallet","version":"0.1.84","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.81 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"740cc1b7a721023193f9fd59317f3db0868b5140","_id":"@thencc/any-wallet@0.1.84","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-kE0JEiSv51wxms3JSge97FZSq9uGD6ojPv9Pjcx6h6P3swtpfB+w8VpwmpE9IMgHtCXMUv6X6jxWid3WyMUFew==","shasum":"37e21b026393c120336addd29c85795f9a74922f","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.84.tgz","fileCount":6,"unpackedSize":174182,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElHF6NOal0DD8zCeFFzOdsfWTaFUYjNJ71UILop6FbsAiA0cyJG6IRMnBAsz1eUbUz3qHsR2ypa8ZvXRLG18dxkHQ=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.84_1687883965345_0.968736562381409"},"_hasShrinkwrap":false},"0.1.85":{"name":"@thencc/any-wallet","version":"0.1.85","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.81 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"0fccc723db816b68c874216a691940e154fe4d11","_id":"@thencc/any-wallet@0.1.85","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-gt11o4i8TcsvDvvyf7VgQQpTaMis47uoHZo9715V0fN0zE9pJWfskvFjzkMWi9LWAeyDtTzd00cUa/G5Z0GsPQ==","shasum":"9f274cffedd1bbd7e3aad8de64466fd9f3987f68","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.85.tgz","fileCount":6,"unpackedSize":174679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICVVXIEhED7Y517jX4DnC0utYsEUkJIzrCp4cHHRU88DAiB7PdsuX/hbz+kH0rgSQ747pRl5eAbKTkXsoVBNnJ70pA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.85_1687884715260_0.11626996891571251"},"_hasShrinkwrap":false},"0.1.86":{"name":"@thencc/any-wallet","version":"0.1.86","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.81 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.24","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","gitHead":"e69f2749ac850f8555f63048aa4d91b2030ad350","_id":"@thencc/any-wallet@0.1.86","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-7l0/CF5SSv4EQcUkjRu7j+cX41lrUbIynAbPDIUASpi58EmOuU4nN8aFvdTv2vKPqGcSmRzoMljMs6ulNQ+A1w==","shasum":"297c4c7f694db2f2b3fc9d7745bf4579d8f3c099","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.86.tgz","fileCount":6,"unpackedSize":174972,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCM5DnBTageWoRliM9fqnwakci2lvobM0evNABU3KKV2AIhANa6SO10TVLAMXvUmzoOrdTbvxqBVQQj2/qtVhHghl7o"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.86_1687965958827_0.5644386859536812"},"_hasShrinkwrap":false},"0.1.87":{"name":"@thencc/any-wallet","version":"0.1.87","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.81 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.25","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.25","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","gitHead":"e69f2749ac850f8555f63048aa4d91b2030ad350","_id":"@thencc/any-wallet@0.1.87","_nodeVersion":"16.20.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-xAqL3RDV7VfK3f6vkJoLCDbqa+q6sVp+szAlb1b0wfgrQurR2lg3W9IkJ/Ud7iiuRn3V/eZua7T0/SQHXMi7CA==","shasum":"0838687602cd48e77e9087fdb295d404ac833eed","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.87.tgz","fileCount":6,"unpackedSize":175685,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFYSf5QkvzXeQVR9GLgtcp9B6SmPcjfFROJA7CdkW32AiEAz0AVj+dLQcdBvUq3PI5YEVDj5AXVLnIbQTvkcbE9o8k="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.87_1687976247184_0.16170868511461012"},"_hasShrinkwrap":false},"0.1.89":{"name":"@thencc/any-wallet","version":"0.1.89","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.25","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.25","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"0cd8e0cf8c3fed670ab79fcf5aca43218f93936b","_id":"@thencc/any-wallet@0.1.89","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-Z48qEWxVppq7L8GE0zkwrWt1W2DNtWmdEJbrKH57r0J49Z2VZmsEgXoP/oTcWIL9bQZVoNlvLyjQ6XmEmsYoGw==","shasum":"98a45dfdc03f464bc2a6fc5f45d81de4d3b3b3f7","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.89.tgz","fileCount":6,"unpackedSize":137631,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF9znzN6XoUbDRfm0ZpQjLoCb+RzDB4SDQ+OPMOojE7DAiArA8reg6wWP7PYB4C3lHB7hwqQy68b0bwbfSViCr2uJQ=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.89_1692116183139_0.6733486225955772"},"_hasShrinkwrap":false},"0.1.91":{"name":"@thencc/any-wallet","version":"0.1.91","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"e23e1d0f33f092c9ba3476f46933c0dec569148f","_id":"@thencc/any-wallet@0.1.91","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-iIsMFTqDxz4v3hn5s95NUQC1Y+ezkoDhmydA0mwdJHySMIrnMogtyufh/UY1IFagTpaQ+sAcBvE2u+1blmt1oQ==","shasum":"d202dde933cce5bff51a944b8189fe170fe57f44","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.91.tgz","fileCount":6,"unpackedSize":139447,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBD8gqknz5qPYKqgOnnkSTAQOn9QWmI4M5bBJfFFRE5oAiEA4oCDJkRvCWnUSwpx/90JmCf4bA7i516MCFVXDuJOBns="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.91_1692131903433_0.09134808807686778"},"_hasShrinkwrap":false},"0.1.92":{"name":"@thencc/any-wallet","version":"0.1.92","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"1504ae9e551384b10244720dac123ead845cc6b9","_id":"@thencc/any-wallet@0.1.92","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-ua6UEBKEtZY/VJef3GzFwLZpYVNhr2nBnf+dxVSGyQfQeQFiYTHbqpXn7yUVBYsRTIJ2LoYkmpwPm5Yz9PdRxQ==","shasum":"26d1744a94457005010f3cb5497af3b165245393","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.92.tgz","fileCount":6,"unpackedSize":139161,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCm2EQ5Lgvc/vw09R2JyoFWNgEvU/xYJBq78dfYDYpR1gIgDTzcFHRXHU5AKsi7WyKVfl+ccVLRO67BIKxS9H0mV6k="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.92_1692137750940_0.6447205359936612"},"_hasShrinkwrap":false},"0.1.93":{"name":"@thencc/any-wallet","version":"0.1.93","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"1504ae9e551384b10244720dac123ead845cc6b9","_id":"@thencc/any-wallet@0.1.93","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-E/QtF1KLeo4OGtVxdWK6qkVcoHnUmQJ0MZcIIn/vNvSqMjNzHIMOUQcmBe540gnV/NaaHvR+8aA3z9fg2YqVIQ==","shasum":"03c8082b9ee4174f7efe0d5ee502942335108856","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.93.tgz","fileCount":6,"unpackedSize":139051,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz8qynneFdTv2VZlEE4E1oeNb3EGtN8b99usxDB1F91wIhAPrkM2AA7dFOsOf5QGP7Z8/u+iNJ1WUmhPBxNGPAdr5z"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.93_1692141354350_0.13476427736744934"},"_hasShrinkwrap":false},"0.1.94":{"name":"@thencc/any-wallet","version":"0.1.94","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"1504ae9e551384b10244720dac123ead845cc6b9","_id":"@thencc/any-wallet@0.1.94","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-qAcrQ9KvQNMFNbKNXK/Fidm9RlRrkrDaAfQhJkUu6ZufLNccRGaMANVdRjWgE3gPbTGZjxtOUTO+X+TJ5bwIDA==","shasum":"e7a5b95e4db3ed0fd9371c59195525502d446b34","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.94.tgz","fileCount":6,"unpackedSize":139201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHq/HL/Pwdpi7CVYNh9v2K6VTq45UZGNwRjK51wa7we3AiEA9Giapzu0Htj0eOVZmORtsH/htrRmSvC//wVAbYmWu34="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.94_1692143399648_0.156786604430182"},"_hasShrinkwrap":false},"0.1.95":{"name":"@thencc/any-wallet","version":"0.1.95","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"652671ed6af29fb82b187e339e319c1093682d6e","_id":"@thencc/any-wallet@0.1.95","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-3S+kOKu7Gp2fDYkEYl/5nUItsy9ZkxIXjDAJBj0T0tV+ReatcwgNZj7jH2pp7tNBwf0bWVCcsRcvDsgb6ByvJA==","shasum":"aba6fb2976a62788746fc47c494fc9460588d9d5","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.95.tgz","fileCount":6,"unpackedSize":140506,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvl+3ai4UsoU/uPvuqoUM37oiUpahERrYXfPi/qHNOIAIgayoIvw4q7X7tOs85FcClsbo/0DZjhcMLKzFXtkSwgzQ="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.95_1692287510554_0.6480413984350228"},"_hasShrinkwrap":false},"0.1.96":{"name":"@thencc/any-wallet","version":"0.1.96","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"@vue-reactivity/watch":"^0.2.0","@vue/reactivity":"^3.3.4","@vue/shared":"^3.3.4","mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"482e376c0412cbf18629a06a82d3fa5eb2d50f34","_id":"@thencc/any-wallet@0.1.96","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-loRoQ9luO/6lVNluj4Plb20g6+ddNSQeRfhAHRisr84j54vAgwFL9dGMT1IFVnPRzYxAUroqwYV4w18j0cflVg==","shasum":"98e0fee7be4f112a7c8cc34a9740a25380bff92c","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.96.tgz","fileCount":6,"unpackedSize":140514,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFr/D6iLJI/qmmWewKgecvXDjU4MuXpmUiWrLSsZ0J32AiBAhz/r5pKZjh3fwMxBMn/AwWpoW5jDzUla3JO8urqsJg=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.96_1692698352865_0.28060426221405677"},"_hasShrinkwrap":false},"0.1.97":{"name":"@thencc/any-wallet","version":"0.1.97","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"03dcf2eabbab1501f516d1f35cc2e440499f0437","_id":"@thencc/any-wallet@0.1.97","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-mbP0LEqmij0Grw3NJJB5xl1fIhZxZSFbkiy3bVvJOO2pWfRQxSGwSqZrrkO6qXFsGhMSaXGcQmotA6V6s/2yOQ==","shasum":"804ac648053b520283faf52c2ee55dd212604678","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.1.97.tgz","fileCount":6,"unpackedSize":140419,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2LVPTal5sPIpncmCLsOR46UVB/Clbafv3jCLg3dIPWAIhANKH0nXvHIV1YtHWgzHqdxgiGpH3CEmTwmdwhy/c7KT+"}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.1.97_1692698520093_0.05000170281824423"},"_hasShrinkwrap":false},"0.2.0":{"name":"@thencc/any-wallet","version":"0.2.0","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import\n```ts\nimport {\n\tAnyWalletState,\n\tconnectWallet,\n\trecallState,\n\tsubscribeToStateChanges,\n\tsubscribeToAccountChanges,\n\tsignTransactions,\n\tWALLET_ID,\n} from '@thencc/any-wallet';\n```\n\n\n### connecting\n```ts\n// connect pera\nawait AnyWalletState.allWallets.pera.connect();\n\n// or, simpler api\nawait connectWallet('pera');\n\n// or, connect inkey\nconst accts = await AnyWalletState.allWallets[WALLET_ID.INKEY].connect();\n\n// now...\n// accts[0] == AnyWalletState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tsignTransactions\n} from '@thencc/any-wallet';\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\n`AnyWalletState` is your friend – it is a reactive proxy object where you can access instances of each wallet (which are connected or active), which account + address the user has picked as active, etc.\n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState,\n\trecallState\n} from '@thencc/any-wallet';\n\n// access the current address\nconsole.log(AnyWalletState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(AnyWalletState.isSigning);\n\n// even after a page reload, the dapp can access the reconnect the last connected account(s) by called recallState so it is recommended to call this on page load\nrecallState();\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tconnectWallet\n} from '@thencc/any-wallet';\n\nlet accts = await connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState,\n\tsubscribeToStateChanges,\n} from '@thencc/any-wallet';\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = subscribeToStateChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to txnlab/use-wallet for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"03dcf2eabbab1501f516d1f35cc2e440499f0437","_id":"@thencc/any-wallet@0.2.0","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-gPz/721M3NFk/tm5ZB2IDJXIfWXbWci7fMcUj/6Om3Rdv70sIgh3SNkRk4G2rodDJFaLHPThXUuu2Ad6c1ATDA==","shasum":"9a3374ae96f90f44e10a941e8480be4c97baf227","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.0.tgz","fileCount":6,"unpackedSize":140418,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCO7mb978i/c9BfbWIMQfB8hWs/pHbExAaTAPA+t8byUwIgeVXcBGIxMp3jT25nQknki3w8p8Zl6HjnV9ptMhKZ1xM="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.0_1692698554000_0.8302488384176676"},"_hasShrinkwrap":false},"0.2.1":{"name":"@thencc/any-wallet","version":"0.2.1","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.26","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tawState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to `txnlab/use-wallet` for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"7ad37789f3703e5604a423501d2be0384d234ed8","_id":"@thencc/any-wallet@0.2.1","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-xvxK5/B/Cql4abUzD8Auymlkem4hj0C3n+XJm1L0KwNdPOjV0UC7rI7bu4K7eYFK2gWyEAX+PiaTZt7L9cmGfA==","shasum":"c81c939d61b5fe81a9664989972544e4382cc0bf","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.1.tgz","fileCount":6,"unpackedSize":140646,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICNstmVlIS5mbRFSgDspVO8zmcGkfc9c7znI2LCSfIgYAiEAs4y0jUhaSKVzz6SjmIfQOm30zHUlZFLwDbUh9fnJjJI="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.1_1692700649241_0.3718848097781766"},"_hasShrinkwrap":false},"0.2.2":{"name":"@thencc/any-wallet","version":"0.2.2","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest ","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.28","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.28","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.11","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tawState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to `txnlab/use-wallet` for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"bd4e1f67238c6252fdec2ed14ad3b1c7ad5d40c4","_id":"@thencc/any-wallet@0.2.2","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-oLLPAy18cdQA2N4lMJqd+vOoyo+lnONxDPSOL1J6L/OGRDtj0l8AUpGvjTQ62ufTfl+l6mHh50p+Yjd06SEJjA==","shasum":"2b1244fcde86608b54671b6c1d69315a3da0182b","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.2.tgz","fileCount":6,"unpackedSize":140646,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIASM3iWV+N/4FSCoxEiHggrPttgoNoxApXnaPByctpMWAiB9FGOCA4M2EVX8ralZx44na8DV8/Amo7lq2FPh23L6og=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.2_1692889611545_0.043414669236827796"},"_hasShrinkwrap":false},"0.2.3":{"name":"@thencc/any-wallet","version":"0.2.3","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.29","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.29","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tawState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to `txnlab/use-wallet` for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"3d2957cda36fd69f9b5e75905a2314b50707e687","_id":"@thencc/any-wallet@0.2.3","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-cknrxdbgROWEBqg/69o7op+E/mG8FS/lZbxj4skjb5svog59CuBk0z1GUPLuP7pbyCsG20Q2hycomEhUK/iR+g==","shasum":"fec409af7688ac14834ed97119a79ef3feb198f7","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.3.tgz","fileCount":6,"unpackedSize":140645,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjk/F2umzkjxwpsblL7MosGMb5p/M/af2cKA4m6uVAiwIgY9jMP9ObO51VtlzpnCExnBYQdhuzSUiHr3T1kCKsUKU="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.3_1692964032565_0.06985246091730679"},"_hasShrinkwrap":false},"0.2.4":{"name":"@thencc/any-wallet","version":"0.2.4","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- pera\n\t- inkey\n\t- myalgo\n\t- algosigner\n\t- exodus\n\t- defly\n\t- mnemonic (not \"safe\" but helpful for development)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport {\n\tawState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue!\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to `txnlab/use-wallet` for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"225cc6379959c3a02bf4f68471c2d0d4348a1976","_id":"@thencc/any-wallet@0.2.4","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-G1M+1DBO6jqyXrJwzIyWN0tvUNPPob1f1AazWMbUlygayknVd+z1i8YYaGd7rknA2qRm+Vw9B6DW7x7jjpgGJw==","shasum":"d76b2f3222e8165a2360128e6f104f54cc6d8897","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.4.tgz","fileCount":6,"unpackedSize":140645,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB88xfJhARf/gf5JXIQGQR8eiMPI8GzWWIw6kGE8YYFzAiAjMoYOwMiLBUFBOOdwJPqeM7Dyoyb76iN75fKrO13WlA=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.4_1693481205115_0.15654068686180223"},"_hasShrinkwrap":false},"0.2.5":{"name":"@thencc/any-wallet","version":"0.2.5","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.1.87 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.0","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.5","@perawallet/connect":"^1.2.3","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.2","@vitest/ui":"^0.32.2","algosdk":"^2.4.0","buffer":"^6.0.3","tsup":"^7.1.0","typescript":"^5.1.3","vitest":"^0.32.2"},"packageManager":"^pnpm@8.3.1","gitHead":"64e49549d37f62aab5213198fafa297b526491c3","_id":"@thencc/any-wallet@0.2.5","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-xNzrvMwyEyvU7zHlf0ZDAArNIdIh4rvl8bOPH8d51uiAEbnqxomFuUKuF93D8+/DDjFy/HHlMLTPwSg5T0OP7Q==","shasum":"ed98fe5f2a7d284105ae74cbf1015fbe25d0b14c","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.5.tgz","fileCount":6,"unpackedSize":140645,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA46XpFRcT9OIPKIWvQYIg6iIdthHkCOGSWrC+KXIg7rAiBZEZRpuuAvpET/004BsRt/9csG8p1uNBoexWjDpce2AQ=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.5_1693481688704_0.0348315368438068"},"_hasShrinkwrap":false},"0.2.6":{"name":"@thencc/any-wallet","version":"0.2.6","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.2.5 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.2","mobx-persist-store":"^1.1.3","mobx-utils":"^6.0.8","@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.4","@vitest/ui":"^0.34.4","algosdk":"^2.5.0","buffer":"^6.0.3","tsup":"^7.2.0","typescript":"^5.2.2","vitest":"^0.34.4"},"packageManager":"^pnpm@8.3.1","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\nis a wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n\n## about\nany-wallet provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- ✅ Pera\n\t- ✅ Inkey\n\t- ✅ MyAlgo\n\t- ✅ AlgoSigner \n\t- ✅ Exodus \n\t- ✅ Defly\n\t- ✅⚠️ Mnemonic (not secure client-side)\n\n\n## usage\n\n### install\n```bash\npnpm i @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `AnyWalletState` because these deep object changes arent tracked by the vue runtime. for this, there are 2 helpful functions: `subscribeToAccountChanges` and `subscribeToStateChanges` which allow you to define a callback when say the active account changes or when anything in the state tree changes.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // if you wanted to call this at some point the handler would stop getting called\n\t},\n});\n```\n\n> Applies to most frontends with components in some way. `this.requestUpdate()` in `lit` or `this.forceUpdate()` in `react`.\n\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n- ...\n\n\n## Attributions\n\nbig thanks to [`txnlab/use-wallet`](https://github.com/TxnLab/use-wallet) for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"99156e44afc68fa3663711f388dfb33405e59d16","_id":"@thencc/any-wallet@0.2.6","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-XysWmp42Dgk/zEMT0dKn92r4ShXG0X2bq9+9flXZLO9O2Uq1vFaliPVJyVXQTPunh2gzyKIWOQJE87/tTOTmxg==","shasum":"d81041c97eca208fddbc550089926c054475c0d2","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.6.tgz","fileCount":6,"unpackedSize":139123,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICl8chbYSeRNXLJlvdhNQbumN7H0LPkC85Xpynty54qbAiAHpKpGY9ecE64VUGm9uGuguPOn6BoXIS/85TutIWHF5g=="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.6_1694796589801_0.8010071202832774"},"_hasShrinkwrap":false},"0.2.7":{"name":"@thencc/any-wallet","version":"0.2.7","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.2.5 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.2","mobx-persist-store":"^1.1.3","@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.4","@vitest/ui":"^0.34.4","algosdk":"^2.5.0","buffer":"^6.0.3","tsup":"^7.2.0","typescript":"^5.2.2","vitest":"^0.34.4"},"packageManager":"^pnpm@8.3.1","gitHead":"0c766268df001a60a4b066273cb05f64af2ca8fa","_id":"@thencc/any-wallet@0.2.7","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-iF6wp7Twq32O1bOklXjTxhH6kZuqaud+9qhNgqDeveORSOR/Hrb7mP6AHjmlm13eDl8QeDAXvqYAdqyDes0XWg==","shasum":"980fafe60b8b9382ddc9c8483ce4c50569dc37d0","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.7.tgz","fileCount":6,"unpackedSize":139097,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu5U00ZDtCrlJS9akYJv4hg1iZkt3p9Fkh+nkFIcyJoAIgTW9bmWjKusQYJwg3R1KOmguNIe44hGL70u+wUkv7FNQ="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.7_1695155611433_0.8487735397034908"},"_hasShrinkwrap":false},"0.2.8":{"name":"@thencc/any-wallet","version":"0.2.8","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.2.8 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.2","mobx-persist-store":"^1.1.3","@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.4","@vitest/ui":"^0.34.4","algosdk":"^2.5.0","buffer":"^6.0.3","tsup":"^7.2.0","typescript":"^5.2.2","vitest":"^0.34.4"},"packageManager":"^pnpm@8.3.1","gitHead":"c1ad2591397b553259e8710762cd375d076f1e68","_id":"@thencc/any-wallet@0.2.8","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-YKOAtxS7sfYngDMUpjKEsTPGow99O+PyyV/9y8cHlPhSIaWf+QWK8MINBZusr6pvO6oghdbuDe69IxncB5pqWg==","shasum":"f4c55a421dc5ddbb9dc90cbc156df19e34b43ead","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.8.tgz","fileCount":6,"unpackedSize":139264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJQBgqeDuyL6WMlGXVZChJqHCXm680+bKSrwKHm0A34AiEA8TH/byvNcHxYybKgUyFTEbiAdPStLydZKKjc8hnZYAM="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.8_1695157525969_0.09686204055836356"},"_hasShrinkwrap":false},"0.2.9":{"name":"@thencc/any-wallet","version":"0.2.9","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.2.8 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.2","mobx-persist-store":"^1.1.3","@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.4","@vitest/ui":"^0.34.4","algosdk":"^2.5.0","buffer":"^6.0.3","tsup":"^7.2.0","typescript":"^5.2.2","vitest":"^0.34.4"},"packageManager":"^pnpm@8.3.1","gitHead":"c1ad2591397b553259e8710762cd375d076f1e68","_id":"@thencc/any-wallet@0.2.9","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-6KVRGSs+sUDNPptaNHekpoQpkzJKIipVSeTK780088BeYjxX4v42ikh0/qUT9IM9lRGXQf5hTUEWEPE+pKJLbw==","shasum":"2f3deaf1749fb32362f31fadbffcc54bd216c65f","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.9.tgz","fileCount":6,"unpackedSize":139114,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqvE7M0M0BmYLScJmzzUqsSvbVTOBgzXTxMFQtycANyAiEA6A8qL8WcFY6ruYBbi77JGC6nv/oUf2veowM5ardNU8w="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.9_1695158537821_0.9900592037446623"},"_hasShrinkwrap":false},"0.2.10":{"name":"@thencc/any-wallet","version":"0.2.10","description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","type":"module","module":"dist/index.js","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"packageManager":"^pnpm@8.3.1","repository":{"type":"git","url":"git://github.com/thencc/any-wallet.git"},"scripts":{"link":"pnpm link --global","unlink":"pnpm -g rm @thencc/any-wallet","link-ic":"pnpm link @thencc/inkey-client-js --global","unlink-ic":"pnpm unlink @thencc/inkey-client-js","build":"tsup --config=tsup.config.ts","publish:beta":"npm publish --access public --tag beta --greater-version-only","publish:latest":"npm dist-tag add @thencc/any-wallet@0.2.10 latest","test:watch":"vitest","test:run":"vitest run","test:ui":"vitest --ui","test:coverage":"vitest run --coverage"},"dependencies":{"mobx":"^6.10.2","mobx-persist-store":"^1.1.3","@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"optionalDependencies":{"@blockshake/defly-connect":"^1.1.6","@perawallet/connect":"^1.3.1","@randlabs/myalgo-connect":"^1.4.2","@thencc/inkey-client-js":"^0.0.30","buffer":"^6.0.3"},"peerDependencies":{"algosdk":"^2.1.0"},"devDependencies":{"@thencc/inkey-types":"^0.0.12","@vitest/coverage-v8":"^0.32.4","@vitest/ui":"^0.34.4","algosdk":"^2.5.0","buffer":"^6.0.3","tsup":"^7.2.0","typescript":"^5.2.2","vitest":"^0.34.4"},"readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\na wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n🔗 [npm](https://www.npmjs.com/package/@thencc/any-wallet) 🔗 [jsdelivr](https://www.jsdelivr.com/package/npm/@thencc/any-wallet)\n\n## about\n`any-wallet` provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- ✅ Pera\n\t- ✅ Inkey\n\t- ✅ MyAlgo\n\t- ✅ AlgoSigner \n\t- ✅ Exodus \n\t- ✅ Defly\n\t- ✅⚠️ Mnemonic (not secure client-side)\n\n\n## usage\n\n### install\n```bash\nnpm i @thencc/any-wallet\n# or\npnpm add @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `awState` because these deep object changes arent tracked by the vue runtime. for this, there is the helpful method `subscribeToAccountChanges` which allows you to define a callback when the active account changes.\n\n> Errors in builds have been observed if the entire `awState` is included in a component's `data`\n\n> This note on reactivity applies to most frontend frameworks with components in some way: \n<br />• `this.requestUpdate()` in `lit`\n<br />• `this.forceUpdate()` in `react`.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // call to stop callbacks\n\t},\n});\n```\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n\n\n## Attributions\n\nbig thanks to [`txnlab/use-wallet`](https://github.com/TxnLab/use-wallet) for developing the react groundwork for this pkg\n","readmeFilename":"README.md","gitHead":"99fb76d2015783959d6b353c6a422a235fbb05dc","bugs":{"url":"https://github.com/thencc/any-wallet/issues"},"homepage":"https://github.com/thencc/any-wallet#readme","_id":"@thencc/any-wallet@0.2.10","_nodeVersion":"18.16.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-EuhWkstDqthGxdbNMPRKKua9qXLvGQ4XQ4gYjaaP+dLEO9PjrCWZpQq9yXk2TDaB6LaZ9on+mNLTVqP0q1VKrQ==","shasum":"c2cff660e9a247a942f62ee253a004e436f0ae34","tarball":"https://registry.npmjs.org/@thencc/any-wallet/-/any-wallet-0.2.10.tgz","fileCount":6,"unpackedSize":139200,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQN84isO7NTM57wPFVUdP/h2PTotDOnztQWKXypKqDHAIgPwwj76/WCc6B+a62LJTcLwMf5p5zWDV+UBaz3DjrdJ0="}]},"_npmUser":{"name":"spencercapp","email":"sc@ncc.la"},"directories":{},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-wallet_0.2.10_1695158831034_0.7475282096423355"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-09T15:55:47.505Z","0.1.0":"2023-03-09T15:55:47.789Z","modified":"2023-09-19T21:27:33.777Z","0.1.1":"2023-03-09T16:39:48.259Z","0.1.2":"2023-03-09T17:19:39.072Z","0.1.3":"2023-03-09T17:22:04.004Z","0.1.4":"2023-03-09T18:09:21.604Z","0.1.5":"2023-03-09T18:16:22.623Z","0.1.6":"2023-03-09T20:23:22.720Z","0.1.7":"2023-03-16T01:21:13.389Z","0.1.8":"2023-03-21T12:25:44.307Z","0.1.9":"2023-03-21T21:30:42.229Z","0.1.10":"2023-04-22T01:01:56.027Z","0.1.11":"2023-04-22T01:04:34.978Z","0.1.12":"2023-04-22T02:08:39.298Z","0.1.13":"2023-04-22T02:12:26.657Z","0.1.14":"2023-04-22T02:16:38.026Z","0.1.15":"2023-04-22T02:18:15.494Z","0.1.16":"2023-04-22T02:26:13.180Z","0.1.17":"2023-04-22T06:09:34.160Z","0.1.18":"2023-04-22T06:20:47.355Z","0.1.19":"2023-04-22T06:22:18.026Z","0.1.20":"2023-04-22T06:23:07.961Z","0.1.21":"2023-04-22T06:32:11.467Z","0.1.22":"2023-05-03T21:39:07.187Z","0.1.23":"2023-05-07T01:17:32.147Z","0.1.24":"2023-05-07T19:11:39.118Z","0.1.25":"2023-05-07T19:11:53.146Z","0.1.26":"2023-05-08T21:51:38.843Z","0.1.27":"2023-05-10T06:11:29.893Z","0.1.28":"2023-05-10T06:21:14.989Z","0.1.29":"2023-05-10T06:46:19.551Z","0.1.30":"2023-05-11T04:06:47.886Z","0.1.31":"2023-05-11T04:56:00.862Z","0.1.32":"2023-05-13T00:18:53.047Z","0.1.33":"2023-05-13T00:27:46.382Z","0.1.34":"2023-05-13T00:35:35.328Z","0.1.35":"2023-05-13T00:49:17.576Z","0.1.36":"2023-05-13T00:58:40.859Z","0.1.37":"2023-05-13T01:13:19.866Z","0.1.38":"2023-05-13T01:19:00.010Z","0.1.39":"2023-05-13T01:26:09.324Z","0.1.40":"2023-05-13T02:27:28.165Z","0.1.41":"2023-05-13T02:31:08.033Z","0.1.42":"2023-05-13T02:33:21.656Z","0.1.43":"2023-05-13T02:39:36.221Z","0.1.44":"2023-05-13T02:43:34.056Z","0.1.45":"2023-05-13T02:54:21.810Z","0.1.46":"2023-05-13T02:56:33.338Z","0.1.47":"2023-05-13T02:58:08.277Z","0.1.48":"2023-05-13T03:32:09.471Z","0.1.49":"2023-05-15T22:44:45.391Z","0.1.50":"2023-05-15T23:33:10.229Z","0.1.51":"2023-05-15T23:49:33.944Z","0.1.52":"2023-05-15T23:58:55.778Z","0.1.53":"2023-05-16T00:04:42.751Z","0.1.54":"2023-05-16T00:09:29.903Z","0.1.55":"2023-05-16T00:13:20.673Z","0.1.56":"2023-05-16T00:16:27.808Z","0.1.57":"2023-05-16T00:19:26.046Z","0.1.58":"2023-05-16T00:22:52.744Z","0.1.59":"2023-05-16T00:26:20.584Z","0.1.60":"2023-05-16T00:29:39.583Z","0.1.61":"2023-05-16T00:37:59.746Z","0.1.62":"2023-05-16T02:00:33.594Z","0.1.63":"2023-05-23T19:59:08.744Z","0.1.64":"2023-05-23T20:06:34.214Z","0.1.65":"2023-05-24T18:31:10.831Z","0.1.66":"2023-05-24T18:35:29.143Z","0.1.67":"2023-05-24T18:40:21.772Z","0.1.68":"2023-05-24T19:17:39.553Z","0.1.69":"2023-05-24T19:26:20.253Z","0.1.70":"2023-05-24T19:29:20.470Z","0.1.71":"2023-05-24T19:40:50.574Z","0.1.72":"2023-05-24T19:59:09.658Z","0.1.73":"2023-05-24T20:03:27.035Z","0.1.74":"2023-05-30T23:02:03.298Z","0.1.75":"2023-05-31T00:06:25.381Z","0.1.76":"2023-05-31T00:15:48.964Z","0.1.77":"2023-06-02T18:09:48.746Z","0.1.78":"2023-06-06T18:00:40.483Z","0.1.79":"2023-06-13T17:31:30.892Z","0.1.80":"2023-06-21T17:12:09.963Z","0.1.81":"2023-06-21T17:49:08.986Z","0.1.82":"2023-06-27T13:45:39.450Z","0.1.83":"2023-06-27T15:53:46.274Z","0.1.84":"2023-06-27T16:39:25.610Z","0.1.85":"2023-06-27T16:51:55.471Z","0.1.86":"2023-06-28T15:25:59.021Z","0.1.87":"2023-06-28T18:17:27.371Z","0.1.89":"2023-08-15T16:16:23.314Z","0.1.91":"2023-08-15T20:38:23.657Z","0.1.92":"2023-08-15T22:15:51.133Z","0.1.93":"2023-08-15T23:15:54.589Z","0.1.94":"2023-08-15T23:49:59.847Z","0.1.95":"2023-08-17T15:51:50.755Z","0.1.96":"2023-08-22T09:59:13.038Z","0.1.97":"2023-08-22T10:02:00.324Z","0.2.0":"2023-08-22T10:02:34.185Z","0.2.1":"2023-08-22T10:37:29.533Z","0.2.2":"2023-08-24T15:06:51.795Z","0.2.3":"2023-08-25T11:47:12.804Z","0.2.4":"2023-08-31T11:26:45.309Z","0.2.5":"2023-08-31T11:34:48.920Z","0.2.6":"2023-09-15T16:49:50.010Z","0.2.7":"2023-09-19T20:33:31.709Z","0.2.8":"2023-09-19T21:05:26.162Z","0.2.9":"2023-09-19T21:22:18.173Z","0.2.10":"2023-09-19T21:27:11.222Z"},"maintainers":[{"name":"lr.ncc","email":"lr@ncc.la"},{"name":"spencercapp","email":"sc@ncc.la"},{"name":"aubreyncc","email":"aa@ncc.la"},{"name":"youraerials","email":"misteranderson@gmail.com"}],"description":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.","license":"MIT","readme":"> ⚠️ **this is beta software**: no significant security audits have yet been performed so use at your own discretion.\n\n\n# @thencc/any-wallet\na wallet connection handler for web3 dapps\n![](./any-wallet-screenshot.png)\n\n# [🌐 live-demo](https://thencc.github.io/any-wallet/) | [example dapp source code](https://github.com/thencc/any-wallet/blob/main/example-dapp/src/components/Demo.vue)\n\n🔗 [npm](https://www.npmjs.com/package/@thencc/any-wallet) 🔗 [jsdelivr](https://www.jsdelivr.com/package/npm/@thencc/any-wallet)\n\n## about\n`any-wallet` provides a common interface layer between the dapp and the wallet so that dapp developers can treat any connected wallet the same way. any-wallet does not load a wallet's client library until it needs to / when the user starts interacting with that wallet. for optimal user experience across page loads, any-wallet saves the last connected account(s) to localstorage (dont worry, no secrets are saved, just the user's public address and a reference to which wallet they connected with).\n\ncurrently supported chains + wallets:\n- algorand\n\t- ✅ Pera\n\t- ✅ Inkey\n\t- ✅ MyAlgo\n\t- ✅ AlgoSigner \n\t- ✅ Exodus \n\t- ✅ Defly\n\t- ✅⚠️ Mnemonic (not secure client-side)\n\n\n## usage\n\n### install\n```bash\nnpm i @thencc/any-wallet\n# or\npnpm add @thencc/any-wallet\n```\n\n### import + construct\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n```\n\n\n### connecting\n```ts\n// connect pera\nawait awState.connectWallet('pera');\n\n// or, connect inkey\nconst accts = await awState.connectWallet('inkey');\n\n// now...\n// accts[0] == awState.activeAccount;\n```\n\n### signing transactions\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nconst txn1 = await algonaut.atomicSendAlgo({\n\tamount: 1000,\n\tto: receiverAddr,\n\tfrom: senderAddr // .from needed IF not authenticated\n});\n\nconst assetId = 10458941;\nconst txn2 = await algonaut.atomicOptInAsset(assetId);\n\n// prompts user for approval using current activeWallet as chosen by the user\nconst signedTxns = await awState.signTransactions([txn1, txn2]); // throws if user rejects txn\n// \"signedTxns\" is an array of Uint8Array's (raw algorand txn bytes)\n\n// now do what you want w the signed txns, like submit them to the network\nconst txnGroup = await algonaut.algodClient.sendRawTransaction(signedTxns).do();\nconsole.log('txn id: ', txnGroup.txId);\n```\n\n\n### state\nthe `AnyWalletState` instance is enhanced with reactive proxy fields that update as you connect client wallets, sign transactions and change connected accounts. \n\na few helpful things inside `AnyWalletState`\n```ts\nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// access the current address\nconsole.log(awState.activeAddress);\n\n// boolean for if any of the wallets are doing some txn signing\nconsole.log(awState.isSigning);\n```\n\nrecall previous state (`localstorage`):\n```ts\n// even after a page reload, the dapp can access the last connected account(s) by initializing with the same storageKey, which uses localstorage (by default) to remember relavent state fields. \nimport { \n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awStateA = new AnyWalletState({\n\tstorageKey: 'state1'\n});\nconst awStateB = new AnyWalletState({\n\tstorageKey: 'state1'\n});\n\n// now... \n/// awStateA.activeAddress == awStateB.activeAddress\n```\n\n\n## using the mnemonic wallet (for dev!)\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\nlet accts = await awState.connectWallet('mnemonic', 'uniform eager witness salt evolve pole envelope name supreme column begin venue decline blast finger grunt avoid people crawl during street priority diary ability lend');\n```\n\n\n\n## vue\nwhen used with vue, you might need to re-render a component's `<template>` computations if you are displaying information stored in `awState` because these deep object changes arent tracked by the vue runtime. for this, there is the helpful method `subscribeToAccountChanges` which allows you to define a callback when the active account changes.\n\n> Errors in builds have been observed if the entire `awState` is included in a component's `data`\n\n> This note on reactivity applies to most frontend frameworks with components in some way: \n<br />• `this.requestUpdate()` in `lit`\n<br />• `this.forceUpdate()` in `react`.\n\n```ts\nimport {\n\tAnyWalletState\n} from '@thencc/any-wallet';\n\nconst awState = new AnyWalletState();\n\n// then in the vue component's mounted or setup hook you would add:\nexport default defineComponent({\n\tmounted() {\n\t\tlet unsubscribe = awState.subscribeToAccountChanges(\n\t\t\t() => this.$forceUpdate()\n\t\t);\n\n\t\t// unsubscribe(); // call to stop callbacks\n\t},\n});\n```\n\n\n## Notes\n- this lib handles txn signing and is supposed to be used in conjuction with a lib that does txn construction + submitting (we recommend `@thencc/algonautjs` though `algosdk` works as well)\n- some wallets (like defly/pera) require that the mobile app is set to the same net (testnet/mainnet) as requested for signing by the dapp\n\n\n## Attributions\n\nbig thanks to [`txnlab/use-wallet`](https://github.com/TxnLab/use-wallet) for developing the react groundwork for this pkg\n","readmeFilename":"README.md"}