freighter icon indicating copy to clipboard operation
freighter copied to clipboard

Freigther extension shows error when sign transaction and account is not funded: TypeError: Cannot read properties of undefined (reading 'available')

Open mcaruso85 opened this issue 1 year ago • 0 comments

What version are you using?

The version of Freighter extension is 5.23.1 The version of Freighter api is 3.0.0

What did you do?

I have to sign a transaction for Stellar Web Auth protocol in SEP 10. The source of the account is the signing key of the server "GBULXH3437Y3YOEDJI52ELEV4NVBGWCDHU5SJWZ2HB6CKVLOWQRI6C5V" and it is account that is funded. The transaction only has a manageData operation and the source of that operation is not funded, this account is the one I have in Freigther and I need to sign this tx with that account. The tx is like this:

{ "tx": { "tx": { "source_account": "GBULXH3437Y3YOEDJI52ELEV4NVBGWCDHU5SJWZ2HB6CKVLOWQRI6C5V", "fee": 0, "seq_num": 0, "cond": { "time": { "min_time": 1726893563, "max_time": 1726894163 } }, "memo": "none", "operations": [ { "source_account": "GBRIEBZAG25IQGZRBEEDLDTC6464C5POO63OZKCQNNDS35IDJNTF5KDT", "body": { "manage_data": { "data_name": "stg.volag.io auth", "data_value": "3861663637363266306436626434373061633034646435336261373630333..........................." } } } ], "ext": "v0" }, "signatures": [ { "hint": "6eb4228f", "signature": "4fc290109ff3da3df73e4.......3ebca732ebe57ea065a23feed,,,,8fac9c892ab49564911468a104..........." } ] } }

When I call :

import { signTransaction } from '@stellar/freighter-api'

let xdr = 'AAAAAgAAAABou5983/G8OINKO6IsleNqE1hDPTsk2zo4fCVVbrQijwAAAAAAAAAAAAAAAAAAAAEAAAAAZu7vZQAAAABm7vG9AAAAAAAAAAEAAAABAAAAAGKCByA2uogbMQkINY5i9z3Bde53tuyoUGtHLfUDS2ZeAAAACgAAABFzdGcudm9sYWcuaW8gYXV0aAAAAAAAAAEAAABAMTUzNjM0Yjc5NDk1MzJiMzY3MjY5OTk0Yzc5MjQwNGI2ZjViMTQzNGVlZDNlNjNhNTYzZDg2YjRhMzc3ZTI2OAAAAAAAAAABbrQijwAAAEDO2lAZ9aXC8ZR76DAJBve1RKmAfVoP3ulL0T3ezzC7M7mpxwZVSFmN9PEL2s596Q1DDbyGAi2WryvYMcA0AvsM'

const signedTransactionRes = await signTransaction(xdr, { networkPassphrase: StellarSdk.Networks[network], address: publicKey })

Then Freigther is opened but shows the error:

TypeError: Cannot read properties of undefined (reading 'available')

What did you expect to see?

I expect to have no errors on Freigther extension, it should show the transaction to sign and confirm.

What did you see instead?

I see the error: TypeError: Cannot read properties of undefined (reading 'available') This does not happen when the source account of the manage data operation is funded. The error only shows up when account is not funded. The source account of the manage data is the account I have in Freigther and I will use to sign this tx.

Screenshot 2024-08-23 at 10 56 50 PM Screenshot 2024-08-23 at 10 57 20 PM

mcaruso85 avatar Sep 21 '24 16:09 mcaruso85