@sodax/sdk 0.0.1-rc.41 → 0.0.1-rc.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -9008,12 +9008,8 @@ var StellarSpokeProvider = class {
9008
9008
  }
9009
9009
  handleSendTransactionError(response) {
9010
9010
  if (response.status === "ERROR") {
9011
- throw new Error(
9012
- `Transaction failed: status: ${response.status}, hash: ${response.hash}, errorResult: ${JSON.stringify({
9013
- name: response?.errorResult?.result()?.switch()?.name ?? "unknown",
9014
- value: response?.errorResult?.result()?.switch()?.value ?? "unknown"
9015
- })}, diagnosticEvents: ${JSON.stringify(response?.diagnosticEvents ?? "{}")}`
9016
- );
9011
+ console.error(JSON.stringify(response, null, 2));
9012
+ throw new Error(JSON.stringify(response, null, 2));
9017
9013
  }
9018
9014
  return response;
9019
9015
  }
@@ -9129,13 +9125,14 @@ var StellarSpokeProvider = class {
9129
9125
  const accountResponse = await this.server.loadAccount(walletAddress);
9130
9126
  const stellarAccount = new CustomStellarAccount(accountResponse);
9131
9127
  const sendMessageCall = this.buildSendMessageCall(walletAddress, dst_chain_id, dst_address, payload);
9132
- const [priorityTx, simulation] = await this.buildPriorityStellarTransaction(
9128
+ const [rawPriorityTx, simulation] = await this.buildPriorityStellarTransaction(
9133
9129
  stellarAccount,
9134
9130
  network,
9135
9131
  sendMessageCall
9136
9132
  );
9133
+ const assembledPriorityTx = stellarSdk.SorobanRpc.assembleTransaction(rawPriorityTx, simulation).build();
9137
9134
  if (raw) {
9138
- const transactionXdr = priorityTx.toXDR();
9135
+ const transactionXdr = rawPriorityTx.toXDR();
9139
9136
  return {
9140
9137
  from: walletAddress,
9141
9138
  to: this.chainConfig.addresses.assetManager,
@@ -9143,7 +9140,13 @@ var StellarSpokeProvider = class {
9143
9140
  data: transactionXdr
9144
9141
  };
9145
9142
  }
9146
- const hash = await this.submitOrRestoreAndRetry(stellarAccount, network, priorityTx, sendMessageCall, simulation);
9143
+ const hash = await this.submitOrRestoreAndRetry(
9144
+ stellarAccount,
9145
+ network,
9146
+ assembledPriorityTx,
9147
+ sendMessageCall,
9148
+ simulation
9149
+ );
9147
9150
  return `${hash}`;
9148
9151
  } catch (error) {
9149
9152
  console.error("Error during sendMessage:", error);