Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] algosdk dependency #192

Closed
PhearZero opened this issue Jun 21, 2024 · 1 comment
Closed

[v3] algosdk dependency #192

PhearZero opened this issue Jun 21, 2024 · 1 comment

Comments

@PhearZero
Copy link
Contributor

Overview

Algosdk depedency is pinned to a specific version, when the dependency cannot be deduplicated it will cause errors with any Transactions. This is something that has come up before as well: algorand/js-algorand-sdk/issues/740

Problem:

A transaction is trying to be created twice in the instantiateTxnIfNeeded call even though it is a valid instance of a Transaction. This is due to the algosdk being included twice in a project that depends on a different version than the currently pinned version.

Error: address seems to be malformed
    at decodeAddress (address.ts:49:11)
    at new Transaction (transaction.ts:264:24)
    at instantiateTxnIfNeeded (transaction.ts:1378:7)
    at Kmd.signTransaction (kmd.ts:264:20)
    at kmd.ts:236:38
    at Array.map (<anonymous>)
    at _a5.signTransactions (kmd.ts:236:18)
    at async _a5.transactionSigner (base.ts:67:28)
    at async Promise.all (:5173/index 0)
    at async _AtomicTransactionComposer.gatherSignatures (composer.ts:541:25)

Solution

Easiest solution would be adding algosdk to the peerDependencies and allowing ^2.7.0.

Details:

  • "@txnlab/use-wallet-react": "^3.0.0-rc.2",
  • Vite React-TS
  • KMD Provider
@drichar drichar added the v3 label Jun 22, 2024
@drichar
Copy link
Collaborator

drichar commented Jun 22, 2024

Ah, thank you. I wasn't aware of this issue. Making algosdk a required peer dependency does seem like the best solution. Probably better to have the library and consuming app always be in sync anyway.

Appreciate the PR! I'll merge it and update the documentation and example apps in the next release.

@drichar drichar added this to the v3.0.0 stable release milestone Jun 22, 2024
@drichar drichar closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants