@msafe/sui-app-store 0.0.21 → 0.0.23

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.js CHANGED
@@ -2683,14 +2683,14 @@ var MPayAppHelper = class {
2683
2683
  const result = decoder.decode();
2684
2684
  if (result.type === "CreateStream" /* CREATE_STREAM */) {
2685
2685
  return {
2686
- txType: import_sui3_utils.TransactionType.Other,
2686
+ txType: import_sui3_utils.TransactionType.Stream,
2687
2687
  txSubType: result.type,
2688
2688
  intentionData: result.info
2689
2689
  };
2690
2690
  }
2691
2691
  if (result.type === "Claim" /* CLAIM */) {
2692
2692
  return {
2693
- txType: import_sui3_utils.TransactionType.Other,
2693
+ txType: import_sui3_utils.TransactionType.Stream,
2694
2694
  txSubType: result.type,
2695
2695
  intentionData: {
2696
2696
  streamId: result.streamId
@@ -2699,7 +2699,7 @@ var MPayAppHelper = class {
2699
2699
  }
2700
2700
  if (result.type === "ClaimByProxy" /* CLAIM_BY_PROXY */) {
2701
2701
  return {
2702
- txType: import_sui3_utils.TransactionType.Other,
2702
+ txType: import_sui3_utils.TransactionType.Stream,
2703
2703
  txSubType: result.type,
2704
2704
  intentionData: {
2705
2705
  streamId: result.streamId
@@ -2708,7 +2708,7 @@ var MPayAppHelper = class {
2708
2708
  }
2709
2709
  if (result.type === "SetAutoClaim" /* SET_AUTO_CLAIM */) {
2710
2710
  return {
2711
- txType: import_sui3_utils.TransactionType.Other,
2711
+ txType: import_sui3_utils.TransactionType.Stream,
2712
2712
  txSubType: result.type,
2713
2713
  intentionData: {
2714
2714
  streamId: result.streamId,
@@ -2718,7 +2718,7 @@ var MPayAppHelper = class {
2718
2718
  }
2719
2719
  if (result.type === "Cancel" /* CANCEL */) {
2720
2720
  return {
2721
- txType: import_sui3_utils.TransactionType.Other,
2721
+ txType: import_sui3_utils.TransactionType.Stream,
2722
2722
  txSubType: result.type,
2723
2723
  intentionData: {
2724
2724
  streamId: result.streamId
@@ -2881,7 +2881,17 @@ var PlainTransactionHelper = class {
2881
2881
  };
2882
2882
  }
2883
2883
  async build(input) {
2884
- return import_transactions6.TransactionBlock.from((0, import_utils15.fromHEX)(input.intentionData.content));
2884
+ const { suiClient, account } = input;
2885
+ const txb = import_transactions6.TransactionBlock.from((0, import_utils15.fromHEX)(input.intentionData.content));
2886
+ const inspectResult = await suiClient.devInspectTransactionBlock({
2887
+ transactionBlock: txb,
2888
+ sender: account.address
2889
+ });
2890
+ const success = inspectResult.effects.status.status === "success";
2891
+ if (!success) {
2892
+ throw new Error(inspectResult.effects.status.error);
2893
+ }
2894
+ return txb;
2885
2895
  }
2886
2896
  };
2887
2897