question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Algorand Extension Cannot Sign an ASA Opt-in Transaction

See original GitHub issue

✅ Prerequisites

  • ✅ Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • ✅ Are you running the latest SDK version?
  • [] Are you reporting to the correct repository (magic-sdk)? No, the algorand extension code is closed source.

🐛 Description

If I am not mistaken the Magic Extension cannot sign an Algorand ASA opt-in transaction. This would be a major bug in the Algorand Extension as it would imply that users cannot receive ASA tokens (Algorand’s ERC20 equivalent).

🧩 Steps to Reproduce

  1. Clone this repo
  2. Add a test email in index.ts
  3. npm install && npm run dev
  4. Click on “Login With Magic!” => Wait until the address displays, I did not add a loader.
  5. Try signing an opt in Tx with a mock account
  6. Try signing an opt in Tx with Magic => Crashes

🤔 Expected behavior

My users should be able to opt-in to ASA tokens, a prerequisite to any airdrop.

😮 Actual behavior

I get the following error: Uncaught (in promise) Error: Magic RPC Error: [-32603] Internal error: address seems to be malformed

💻 Code Sample

Repro repo here

🌎 Environment

Software Version(s)
@magic-ext/algorand 0.2.0
algosdk 1.12.0
magic-sdk 6.2.1
npm 7.24.0
Browser Firefox (95.0b11) & Brave(1.32.106)
Operating System Mac OS Big Sur & Monterey

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
hcotecommented, Mar 30, 2022

@fmonper1 @Standaa this should be fixed now. Once you create the Transaction object with algosdk.make...TxnWithSuggestedParams() just encode the object and pass it to magic.algorand.signTransaction(encodedTxn).

Here’s a codesandbox - codesandbox.io/s/recursing-frost-lx5qgx

const sendTransaction = async () => {
    let params = await algodClient.getTransactionParams().do();
    const enc = new TextEncoder();
    let note = enc.encode("Hello World");
    let txn = algosdk.makePaymentTxnWithSuggestedParams(
      publicAddress,
      destinationAddress,
      parseInt(sendAmount),
      undefined,
      note,
      params
    );

    let encodedTxn = algosdk.encodeObj(txn.get_obj_for_encoding());
    let signedTx = await magic.algorand.signTransaction(encodedTxn);
    let receipt = await algodClient.sendRawTransaction(signedTx).do();
    console.log(receipt);
}
1reaction
Standaacommented, May 18, 2022

@fmonper1 Ended up dropping Magic altogether. Production feedback from friends + Lack of team responsiveness + the extensions being closed-source + the lacklustre node APIs were way too many redflags.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error occur while OPT-IN an ASA to my Account
Hi All, I tried the OPT-IN of an asset from my account , and I had sufficient funds in my wallet (0.1 algos)....
Read more >
Add (opt-in) BOARD to Algorand Wallet — User Guide - Medium
Enter the ID 342889824 and sign the transaction. 4. The BOARD asset verified now is on Algorand Wallet.
Read more >
Various issues after adding 2nd Algorand account on Ledger ...
I am now unable to make any transactions with Algo on the 2nd account either with Ledger Live or the Algosigner extension. Ledger...
Read more >
Algorand Dapp Development 2: Standard Asset Management
In the second Algorand Dapp Dev course, we'll learn about and code asset management tools · How to create an Algorand Standard Asset...
Read more >
Pera Algo Wallet – Simply the best Algorand wallet. | Algorand ...
Secure. Open Source. Community Driven. Simply the best Algorand wallet.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found