@debridge-finance/solana-utils 6.1.1 → 6.1.2

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.
@@ -13490,20 +13490,22 @@ function getTransactionDiff(connection, tx, txAccounts) {
13490
13490
  const preBalances = parseMultipleAccounts(accountsInfo);
13491
13491
  const postBalances = parseMultipleAccounts(simulatesInfo);
13492
13492
  const balancesDiff = accountsPubKeys.reduce((map, pubKey, i) => {
13493
- var _a;
13493
+ var _a, _b, _c;
13494
13494
  if ((_a = accountsInfo[i]) === null || _a === void 0 ? void 0 : _a.executable) {
13495
13495
  return map;
13496
13496
  }
13497
13497
  const preBalance = preBalances[i];
13498
13498
  const postBalance = postBalances[i];
13499
+ const nativeBefore = (_b = preBalance === null || preBalance === void 0 ? void 0 : preBalance.balance) !== null && _b !== void 0 ? _b : 0;
13500
+ const nativeAfter = (_c = postBalance === null || postBalance === void 0 ? void 0 : postBalance.balance) !== null && _c !== void 0 ? _c : 0;
13499
13501
  const diff = {
13500
13502
  pubKey: pubKey,
13501
- preBalance: preBalance.balance,
13502
- postBalance: postBalance.balance,
13503
- diff: postBalance.balance - preBalance.balance,
13503
+ preBalance: nativeBefore,
13504
+ postBalance: nativeAfter,
13505
+ diff: nativeAfter - nativeBefore,
13504
13506
  };
13505
- if (preBalance.spl || postBalance.spl) {
13506
- const splDiff = getSplDiff(preBalance.spl, postBalance.spl);
13507
+ if ((preBalance === null || preBalance === void 0 ? void 0 : preBalance.spl) || (postBalance === null || postBalance === void 0 ? void 0 : postBalance.spl)) {
13508
+ const splDiff = getSplDiff(preBalance === null || preBalance === void 0 ? void 0 : preBalance.spl, postBalance === null || postBalance === void 0 ? void 0 : postBalance.spl);
13507
13509
  if (splDiff.diff) {
13508
13510
  diff.spl = splDiff;
13509
13511
  }