#prepareTransaction error

1 messages · Page 1 of 1 (latest)

silk venture
#

Hello !

I've this error message when I try to prepareTransaction:

utils.ts:107 Error: HostError: Error(Storage, MissingValue)
DebugInfo not available

    at e.eval (stellar-sdk.min.js:3:566992)
    at f (stellar-sdk.min.js:3:550834)
    at Generator.eval (stellar-sdk.min.js:3:552176)
    at Generator.eval [as next] (stellar-sdk.min.js:3:551263)
    at S (stellar-sdk.min.js:3:556737)
    at a (stellar-sdk.min.js:3:556940)

Someone see any issue in my function ?

export async function getContractXDR(
  address: string,
  contractMethod: string,
  caller: string,
  values: xdr.ScVal[]
) {

  const provider = new SorobanRpc.Server('https://mainnet.sorobanrpc.com', {
    allowHttp: true,
  });

  const sourceAccount = await provider.getAccount(caller);
  const contract = new Contract(address);

  const transaction = new TransactionBuilder(sourceAccount, {
    fee: BASE_FEE,
    networkPassphrase: Networks.PUBLIC,
  })
    .addOperation(contract.call(contractMethod, ...values))
    .setTimeout(30)
    .build();

  try {
    const prepareTx = await provider.prepareTransaction(transaction);

    return prepareTx.toXDR();
  } catch (e) {
    console.error(e);
    throw new Error('Unable to send transaction');
  }
}

#

@agile compass

agile compass
#

@rose tree

karmic dagger
silk venture
#

Hey @karmic dagger ! Thank you for your answer 🙂

Is there any reason for a DApp to work well on Testnet and when you change to Mainnet have this kind of error that you did not had before ?