@pushchain/core 6.0.5 → 6.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushchain/core",
3
- "version": "6.0.5",
3
+ "version": "6.0.6",
4
4
  "homepage": "https://push.org",
5
5
  "keywords": [
6
6
  "pushchain",
@@ -35,6 +35,7 @@ function preflightSuffix(sufficient, pathTag, enforceGasCheck) {
35
35
  ? `INSUFFICIENT (${pathTag}); warning only, proceeding`
36
36
  : `INSUFFICIENT (${pathTag})`;
37
37
  }
38
+ const displayPathTag = (pathTag) => pathTag === 'CASCADE' ? 'MULTICHAIN' : pathTag;
38
39
  /**
39
40
  * Classify a sign-time error as either a true wallet user-decline
40
41
  * (viem `UserRejectedRequestError`, ethers `ACTION_REJECTED`, EIP-1193 4001,
@@ -275,14 +276,14 @@ const RAW_HOOKS_R1 = {
275
276
  },
276
277
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_03]: (targetChain, elapsedMs) => ({
277
278
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_03,
278
- title: `Syncing State with ${friendlyChain(targetChain)} Timeout`,
279
- message: `Timed out waiting for UGPC relay to ${targetChain}`,
279
+ title: 'Syncing State with Push Chain Timeout',
280
+ message: 'Timed out waiting for relay to Push Chain',
280
281
  response: { error: 'relay timeout', chain: targetChain, elapsedMs },
281
282
  level: 'ERROR',
282
283
  }),
283
284
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_99]: (txHash) => ({
284
285
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_99,
285
- title: 'Push Chain Tx Completed',
286
+ title: 'Intermediate Push Chain Tx Completed',
286
287
  message: `Intermediate Push Chain tx confirmed: ${txHash}, progressing to next phase`,
287
288
  response: { txHash },
288
289
  level: 'INFO',
@@ -340,7 +341,7 @@ const RAW_HOOKS_R2 = {
340
341
  const enforceGasCheck = extra === null || extra === void 0 ? void 0 : extra.enforceGasCheck;
341
342
  return {
342
343
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_203_03,
343
- title: 'Pre-flight Balance Check',
344
+ title: 'Checking Balance Requirements',
344
345
  message: `UEA balance: ${availableStr}; required: ${requiredStr}; ` +
345
346
  preflightSuffix(sufficient, pathTag, enforceGasCheck),
346
347
  response: {
@@ -471,7 +472,7 @@ const RAW_HOOKS_R2 = {
471
472
  }),
472
473
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_299_99]: (targetChain, txHash) => ({
473
474
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_299_99,
474
- title: `${friendlyChain(targetChain)} Tx Completed`,
475
+ title: `Intermediate ${friendlyChain(targetChain)} Tx Completed`,
475
476
  message: `Intermediate ${friendlyChain(targetChain)} tx confirmed: ${txHash}, progressing to next phase`,
476
477
  response: { chain: targetChain, txHash },
477
478
  level: 'INFO',
@@ -551,7 +552,7 @@ const RAW_HOOKS_R3 = {
551
552
  const enforceGasCheck = extra === null || extra === void 0 ? void 0 : extra.enforceGasCheck;
552
553
  return {
553
554
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_04,
554
- title: 'Pre-flight Balance Check',
555
+ title: 'Checking Balance Requirements',
555
556
  message: `UEA balance: ${availableStr}; required: ${requiredStr}; ` +
556
557
  preflightSuffix(sufficient, pathTag, enforceGasCheck),
557
558
  response: {
@@ -712,11 +713,7 @@ const RAW_HOOKS_R3 = {
712
713
  },
713
714
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_399_03]: (sourceChain, elapsedMs, phase = 'inbound') => ({
714
715
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_399_03,
715
- title: phase === 'outbound'
716
- ? `Syncing State with ${friendlyChain(sourceChain)} Timeout`
717
- : phase === 'push'
718
- ? 'Push Chain Tx Timeout'
719
- : 'Push Chain Inbound Timeout',
716
+ title: 'Push Chain Inbound Tx Timeout',
720
717
  message: phase === 'outbound'
721
718
  ? `Timed out waiting for ${friendlyChain(sourceChain)} relay`
722
719
  : phase === 'push'
@@ -736,8 +733,8 @@ const RAW_HOOKS_R3 = {
736
733
  }),
737
734
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_399_99]: (sourceChain, txHash) => ({
738
735
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_399_99,
739
- title: `${friendlyChain(sourceChain)} Tx Completed`,
740
- message: `Intermediate ${friendlyChain(sourceChain)} tx confirmed: ${txHash}, progressing to next phase`,
736
+ title: `Intermediate ${friendlyChain(sourceChain)} to Push Tx Completed`,
737
+ message: `Intermediate ${friendlyChain(sourceChain)} to Push tx confirmed: ${txHash}, progressing to next phase`,
741
738
  response: { chain: sourceChain, txHash },
742
739
  level: 'INFO',
743
740
  }),
@@ -824,11 +821,12 @@ const RAW_HOOKS_MULTICHAIN = {
824
821
  const availableStr = kind === 'PRC20' ? `${available} units` : (0, formatters_1.formatPc)(available, 4);
825
822
  const requiredStr = kind === 'PRC20' ? `${required} units` : (0, formatters_1.formatPc)(required, 4);
826
823
  const enforceGasCheck = extra === null || extra === void 0 ? void 0 : extra.enforceGasCheck;
824
+ const visiblePathTag = displayPathTag(pathTag);
827
825
  return {
828
826
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_003_03,
829
- title: 'Cascade Pre-flight Balance Check',
827
+ title: 'Checking Balance Requirements',
830
828
  message: `UEA balance: ${availableStr}; required: ${requiredStr}; ` +
831
- preflightSuffix(sufficient, pathTag, enforceGasCheck),
829
+ preflightSuffix(sufficient, visiblePathTag, enforceGasCheck),
832
830
  response: {
833
831
  required,
834
832
  available,
@@ -849,13 +847,14 @@ const RAW_HOOKS_MULTICHAIN = {
849
847
  var _a, _b, _c, _d;
850
848
  const kind = (_a = extra === null || extra === void 0 ? void 0 : extra.kind) !== null && _a !== void 0 ? _a : 'NATIVE';
851
849
  const shortfallStr = kind === 'PRC20' ? `${shortfall} units` : (0, formatters_1.formatPc)(shortfall, 4);
850
+ const visiblePathTag = displayPathTag(pathTag);
852
851
  const remediation = kind === 'PRC20'
853
852
  ? `Bridge the burn token (${(_b = extra === null || extra === void 0 ? void 0 : extra.burnToken) !== null && _b !== void 0 ? _b : 'PRC-20'}) to UEA ${ueaAddress} before retrying.`
854
853
  : `Bridge >=${shortfallStr} to UEA ${ueaAddress} before retrying.`;
855
854
  return {
856
855
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_003_04,
857
- title: 'Cascade Insufficient UEA Balance',
858
- message: `Shortfall ${shortfallStr} on ${pathTag}. ${remediation}`,
856
+ title: 'Multichain Insufficient UEA Balance',
857
+ message: `Shortfall ${shortfallStr} on ${visiblePathTag}. ${remediation}`,
859
858
  response: {
860
859
  required,
861
860
  available,
@@ -871,9 +870,9 @@ const RAW_HOOKS_MULTICHAIN = {
871
870
  },
872
871
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_003_05]: (quoted, threshold, gasToken, pathTag) => ({
873
872
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_003_05,
874
- title: 'Cascade SVM Native-Value Warn Threshold',
873
+ title: 'Multichain SVM Native-Value Warn Threshold',
875
874
  message: `Buffered pool quote ${(0, formatters_1.formatPc)(quoted, 4)} exceeds warn threshold ${(0, formatters_1.formatPc)(threshold, 4)} ` +
876
- `for ${gasToken} (${pathTag}). Pool may be skewed or quote is unusually large. ` +
875
+ `for ${gasToken} (${displayPathTag(pathTag)}). Pool may be skewed or quote is unusually large. ` +
877
876
  `No action taken — pre-flight will determine if balance covers it.`,
878
877
  response: { quoted, threshold, gasToken, pathTag },
879
878
  level: 'INFO',
@@ -888,15 +887,15 @@ const RAW_HOOKS_MULTICHAIN = {
888
887
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_999_02]: (failedAt, total, errorMessage) => ({
889
888
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_999_02,
890
889
  title: 'Multichain Transactions Failed',
891
- message: `Cascade failed at hop ${failedAt} of ${total}: ${errorMessage}`,
890
+ message: `Multichain failed at hop ${failedAt} of ${total}: ${errorMessage}`,
892
891
  response: { failedAt, total, error: errorMessage },
893
892
  level: 'ERROR',
894
893
  }),
895
894
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_999_03]: (failedAt, total) => ({
896
895
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_999_03,
897
896
  title: 'Multichain Transactions Timeout',
898
- message: `Cascade timed out at hop ${failedAt} of ${total}`,
899
- response: { failedAt, total, error: 'cascade timeout' },
897
+ message: `Multichain timed out at hop ${failedAt} of ${total}`,
898
+ response: { failedAt, total, error: 'multichain timeout' },
900
899
  level: 'ERROR',
901
900
  }),
902
901
  };