Coder Social home page Coder Social logo

txnlab / use-wallet-js Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 4.0 1.14 MB

TypeScript library for integrating Algorand wallets into decentralized applications

TypeScript 100.00%
algorand algosdk defly exodus kmd myalgo perawallet wallet walletconnect

use-wallet-js's People

Contributors

drichar avatar gabrielkuettel avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

use-wallet-js's Issues

Prevent server side (SSR) initialization

In the core library and/or framework adapters, prevent initialization if window and localStorage are not available.

It also might make sense to include SSR framework examples, e.g. Next, Nuxt, etc

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency @testing-library/react to v15
  • chore(deps): update dependency eslint to v9
  • chore(deps): lock file maintenance

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v2
  • actions/cache v4
npm
package.json
  • @testing-library/jest-dom ^6.1.6
  • @testing-library/react ^14.1.2
  • @typescript-eslint/eslint-plugin ^6.7.2
  • @typescript-eslint/parser ^6.7.2
  • @vitejs/plugin-react ^4.2.1
  • @vitejs/plugin-vue ^5.0.2
  • @vitejs/plugin-vue-jsx ^3.1.0
  • @vue/test-utils ^2.4.3
  • eslint ^8.50.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-prettier ^5.0.1
  • prettier 3.2.5
  • vite ^5.0.8
  • vitest ^1.1.1
  • vue-demi ^0.14.6
packages/use-wallet-js/package.json
  • @tanstack/store ^0.3.1
  • @walletconnect/utils ^2.10.2
  • algosdk ^2.7.0
  • buffer ^6.0.3
  • @blockshake/defly-connect ^1.1.6
  • @perawallet/connect ^1.3.3
  • @types/node ^20.6.5
  • @walletconnect/modal ^2.6.2
  • @walletconnect/modal-core ^2.6.2
  • @walletconnect/sign-client ^2.10.2
  • @walletconnect/types ^2.10.2
  • algo-msgpack-with-bigint ^2.1.1
  • lute-connect ^1.1.3
  • tsup ^8.0.0
  • typescript ^5.2.2
  • @blockshake/defly-connect ^1.1.6
  • @perawallet/connect ^1.3.3
  • @walletconnect/modal ^2.6.2
  • @walletconnect/sign-client ^2.10.2
  • lute-connect ^1.1.3
packages/use-wallet-react/package.json
  • @tanstack/react-store ^0.3.1
  • @types/react ^18.2.45
  • algosdk ^2.7.0
  • jsdom ^24.0.0
  • react ^18.2.0
  • react-dom ^18.2.0
  • tsup ^8.0.0
  • typescript ^5.2.2
  • @blockshake/defly-connect ^1.1.6
  • @perawallet/connect ^1.3.3
  • @walletconnect/modal ^2.6.2
  • @walletconnect/sign-client ^2.10.2
  • algosdk ^2.6.0
  • react ^18.2.0
packages/use-wallet-vue/package.json
  • @tanstack/vue-store ^0.3.1
  • algosdk ^2.7.0
  • tsup ^8.0.0
  • typescript ^5.2.2
  • vue ^3.3.13
  • @blockshake/defly-connect ^1.1.6
  • @perawallet/connect ^1.3.3
  • @walletconnect/modal ^2.6.2
  • @walletconnect/sign-client ^2.10.2
  • algosdk ^2.6.0
  • vue ^3.3.13

  • Check this box to trigger a request for Renovate to run again on this repository

Wrong "this" for vue use-wallet

this value for signTransactions and transactionSigner is manager instead of the corresponding wallet.

return manager.signTransactions(txnGroup, indexesToSign, returnGroup)

Leads to this error:
image

My workaround:

        const fn = manager.signTransactions.bind(manager.activeWallet)
        return fn(txnGroup, indexesToSign, returnGroup)

Affects the react package as well. If this is a commonly used pattern (returning a function from a getter), you may want to go over them and confirm the this value is as expected.

vue `wallet.activeNetwork` stuck on `testnet`

Following the vue example, I set the network to NetworkId.MAINNET

app.use(WalletManagerPlugin, {
  wallets: [
    WalletId.PERA,
  ],
  network: NetworkId.MAINNET
})

but if i log the network it's always testnet

const wallet = useWallet()
cl(wallet.activeNetwork) // 'testnet'

The networks in wallet.wallets[].activeNetwork are correctly 'mainnet'

EDIT:

Hook data (walletState, walletManager) aren't reactive.

  1. For walletState, the issue is you can't reassign a reactive object

https://vuejs.org/guide/essentials/reactivity-fundamentals.html#limitations-of-reactive

  1. For walletManager, it's a bit more tricky, but you have to wrap it with a ref and somehow trigger a reactive update.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.