I’m not sure what the source of the problem is. When I call the method signAndSubmitTransaction
, everything works fine. However, when I try calling the methods getUnsignedTx
and subsequently signTxx
(like so):
let tx = new TransactionService()
const unsignedTx = await tx.getUnsignedTx('tx-endpoint', txPayload)
console.log('unsignedTx:', unsignedTx);
const signedTx = await tx.signTxx(unsignedTx)
console.log('signedTx:', signedTx);
I get the error message: signTx: memory access out of bounds
Excerpt of the definition of TransactionService
:
class TransactionService {
...
async getUnsignedTx(endpoint: string, payload: any): Promise<any> {
return this.postRequest(endpoint, payload)
}
async signAndSubmitTransaction(endpoint: string, payload: any): Promise<any> {
const data: UnsignedTxResponse = await this.getUnsignedTx(endpoint, payload)
const signedTx: string = await this.signTxx(data.urspTxBodyHex)
console.log("Data: ", JSON.stringify(data))
return this.submitTransaction(data.urspTxBodyHex, signedTx);
}
async signTxx(unsignedTx: string): Promise<any> {
const ap = await window.cardano[this.walletName].enable()
const signedTx = await ap.signTx(unsignedTx, true);
console.log("SignedTx: ", JSON.stringify(signedTx))
return signedTx
}
async submitTransaction(unsignedTx: string, signedTx: string): Promise<any> {
return this.postRequest("tx/add-wit-and-submit", {
awasTxUnsigned: unsignedTx,
awasTxWit: signedTx
});
}
...
}
Web browser in use: Brave