You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the code where the transactions are sent to Pera wallet here, the unsigned transactions are sent in base64 but @perawallet/connect is expecting an unsigned Transaction that is from the algosdk.
Therefore, signTxns should probably follow:
import{decodeUnsignedTransaction}from'algosdk';exportdefaultfunctionALGO_MakePeraConnect(PeraWalletConnect:any){returnclassPeraConnect{// ...asyncsignTxns(txns:string[]): Promise<string[]>{letrawSignedTxns: Uint8Array[];awaitthis.ensureSession();rawSignedTxns=awaitthis.pc.signTransaction([txns.map((value)=>{constdecodedUnsignedTxn: Transaction=decodeUnsignedTransaction(Buffer.from(value,'base64'));// decode the transactionreturn{txn: decodedUnsignedTxn,};}),]);returnrawSignedTxns.map((value)=>Buffer.from(value).toString('base64')// encode the signed transactions back to base64 to be returned);}}};
The text was updated successfully, but these errors were encountered:
Describe the error
In the latest update, it seems Pera wallet connect no longer seems to work. Whenever a transaction is sent to be signed to Pera an error is thrown:
"TypeError: e.map is not a function"
To Reproduce
Expected behavior
Extra information
Looking at the code where the transactions are sent to Pera wallet here, the unsigned transactions are sent in base64 but
@perawallet/connect
is expecting an unsignedTransaction
that is from thealgosdk
.Therefore,
signTxns
should probably follow:The text was updated successfully, but these errors were encountered: