@pushchain/core 5.1.5 → 5.1.7

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/CHANGELOG.md CHANGED
@@ -4,8 +4,10 @@
4
4
  Push-chain gas cost. Case A pads deposits to the $1 floor; Case B passes
5
5
  through; Case C is informational (deposits proceed up to the origin
6
6
  gateway's contract-enforced `MAX_CAP_UNIVERSAL_TX_USD`). The SDK's previous
7
- $1000 ceiling has been removed. New progress hooks `SEND_TX_106_07_01/02/03`
8
- fire with the sizer's decision.
7
+ $1000 ceiling has been removed. New progress hooks `SEND_TX_103_03_01/02/03`
8
+ fire with the sizer's decision, under the new `SEND_TX_103_03` "Calculating
9
+ Prepaid Deposit" parent and `SEND_TX_103_03_04` "Prepaid Deposit Estimated"
10
+ terminal (which replaces the prior `SEND_TX_102_02` "Gas Estimated").
9
11
 
10
12
  - Gas abstraction scope narrowed to R1 (fee-lock USD caps) and R3 (outbound
11
13
  msg.value sizing). R2 (UOA → CEA) and cascade outbound segments no longer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushchain/core",
3
- "version": "5.1.5",
3
+ "version": "5.1.7",
4
4
  "homepage": "https://push.org",
5
5
  "keywords": [
6
6
  "pushchain",
@@ -55,9 +55,13 @@ function printLog(ctx, msg) {
55
55
  const R1_SUPPRESSED_IN_NON_R1 = new Set([
56
56
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_101,
57
57
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_01,
58
- progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02,
59
58
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_01,
60
59
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_02,
60
+ progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03,
61
+ progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_01,
62
+ progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_02,
63
+ progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_03,
64
+ progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04,
61
65
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_01,
62
66
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_02,
63
67
  progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_03,
@@ -74,6 +74,7 @@ function executeFundsWithPayload(ctx, execute, eventBuffer, getResponseCallbacks
74
74
  const requiredFunds = requiredGasFee + payloadValue;
75
75
  const ueaAddress = (0, uea_manager_1.computeUEAOffchain)(ctx);
76
76
  const ueaBalance = yield ctx.pushClient.getBalance(ueaAddress);
77
+ (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_01);
77
78
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_02, ueaAddress, deployed);
78
79
  // SDK 5.2 Case A/B/C sizing on the Push-chain gas portion.
79
80
  // Floor pad comes from the sizer ($1 for Case A); upper bound now lives in
@@ -82,18 +83,33 @@ function executeFundsWithPayload(ctx, execute, eventBuffer, getResponseCallbacks
82
83
  pushGasFeeWei: requiredGasFee,
83
84
  originChain: chain,
84
85
  });
86
+ // Convert the sizer's USD result into planned PC native deposit so the
87
+ // sizer progress hook can surface the user-facing `extraDepositPC` =
88
+ // totalPCDeposit - gasRequired. The same conversion is reused below for
89
+ // the final nativeAmount calc (after SVM clamp).
90
+ const nativeTokenUsdPrice = yield new price_fetch_1.PriceFetch(ctx.rpcUrls).getPrice(chain);
91
+ const nativeDecimals = chain_1.CHAIN_INFO[chain].vm === enums_1.VM.SVM ? 9 : 18;
92
+ const oneNativeUnit = utils_1.Utils.helpers.parseUnits('1', nativeDecimals);
93
+ const usdToNative = (usd) => {
94
+ if (nativeTokenUsdPrice === BigInt(0))
95
+ return BigInt(0);
96
+ const out = (usd * oneNativeUnit + (nativeTokenUsdPrice - BigInt(1))) / nativeTokenUsdPrice;
97
+ return out + BigInt(1);
98
+ };
99
+ const plannedPCDeposit = usdToNative(r1Sizing.paddedDepositUsd);
100
+ const extraDepositPC = plannedPCDeposit > requiredGasFee ? plannedPCDeposit - requiredGasFee : BigInt(0);
101
+ (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03, chain, r1Sizing.paddedDepositUsd);
85
102
  const r1SizingHookId = {
86
- A: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_01,
87
- B: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_02,
88
- C: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_03,
103
+ A: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_01,
104
+ B: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_02,
105
+ C: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_03,
89
106
  }[r1Sizing.category];
90
- (0, context_1.fireProgressHook)(ctx, r1SizingHookId, chain, r1Sizing.pushGasUsd, r1Sizing.paddedDepositUsd);
107
+ (0, context_1.fireProgressHook)(ctx, r1SizingHookId, chain, requiredGasFee, extraDepositPC, r1Sizing.paddedDepositUsd);
91
108
  const deficit = requiredFunds > ueaBalance ? requiredFunds - ueaBalance : BigInt(0);
92
109
  let depositUsd = deficit > BigInt(0) ? ctx.pushClient.pushToUSDC(deficit) : BigInt(0);
93
110
  // Apply sizer floor: Case A pads to $1, Cases B/C pass-through.
94
111
  if (depositUsd < r1Sizing.paddedDepositUsd)
95
112
  depositUsd = r1Sizing.paddedDepositUsd;
96
- (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02, depositUsd);
97
113
  // If SVM, clamp depositUsd to on-chain Config caps
98
114
  if (chain_1.CHAIN_INFO[chain].vm === enums_1.VM.SVM) {
99
115
  const svmClient = new svm_client_1.SvmClient({
@@ -120,12 +136,9 @@ function executeFundsWithPayload(ctx, execute, eventBuffer, getResponseCallbacks
120
136
  // best-effort
121
137
  }
122
138
  }
123
- // Convert USD(8) -> native units
124
- const nativeTokenUsdPrice = yield new price_fetch_1.PriceFetch(ctx.rpcUrls).getPrice(chain);
125
- const nativeDecimals = chain_1.CHAIN_INFO[chain].vm === enums_1.VM.SVM ? 9 : 18;
126
- const oneNativeUnit = utils_1.Utils.helpers.parseUnits('1', nativeDecimals);
127
- let nativeAmount = (depositUsd * oneNativeUnit + (nativeTokenUsdPrice - BigInt(1))) / nativeTokenUsdPrice;
128
- nativeAmount = nativeAmount + BigInt(1);
139
+ // Final USD(8) -> native conversion reusing the cached price fetched above.
140
+ let nativeAmount = usdToNative(depositUsd);
141
+ (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04, nativeAmount, depositUsd, chain);
129
142
  const bridgeAmount = execute.funds.amount;
130
143
  const symbol = execute.funds.token.symbol;
131
144
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_01, bridgeAmount, execute.funds.token.decimals, symbol);
@@ -144,8 +157,6 @@ function executeFundsWithPayload(ctx, execute, eventBuffer, getResponseCallbacks
144
157
  try {
145
158
  if (chain_1.CHAIN_INFO[ctx.universalSigner.account.chain].vm === enums_1.VM.EVM) {
146
159
  const tokenAddr = execute.funds.token.address;
147
- (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_01);
148
- (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_02, ueaAddress, deployed);
149
160
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_01);
150
161
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_02);
151
162
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_03);
@@ -72,7 +72,7 @@ function executeStandardPayload(ctx, execute, eventBuffer, getResponseCallbacks)
72
72
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_01);
73
73
  // Push to Push Tx
74
74
  if ((0, helpers_1.isPushChain)(chain)) {
75
- (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02, (_a = execute.gasLimit) !== null && _a !== void 0 ? _a : BigInt(21000));
75
+ (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04, (_a = execute.gasLimit) !== null && _a !== void 0 ? _a : BigInt(21000), BigInt(0), chain);
76
76
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_107);
77
77
  let tx;
78
78
  try {
@@ -100,7 +100,6 @@ function executeStandardPayload(ctx, execute, eventBuffer, getResponseCallbacks)
100
100
  const gasPrice = yield ctx.pushClient.getGasPrice();
101
101
  const requiredGasFee = gasEstimate * gasPrice;
102
102
  const requiredFunds = requiredGasFee + execute.value;
103
- (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02, requiredFunds);
104
103
  // Fetch UEA Details (or use pre-fetched status if available)
105
104
  const UEA = (0, uea_manager_1.computeUEAOffchain)(ctx);
106
105
  let isUEADeployed;
@@ -135,6 +134,7 @@ function executeStandardPayload(ctx, execute, eventBuffer, getResponseCallbacks)
135
134
  }
136
135
  }
137
136
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_02, UEA, isUEADeployed);
137
+ (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04, requiredFunds, BigInt(0), chain);
138
138
  // Validate and decode feeLockTxHash
139
139
  let feeLockTxHash = execute.feeLockTxHash;
140
140
  if (feeLockTxHash) {
@@ -428,7 +428,7 @@ function calculateNativeAmountForDeposit(ctx, chain, requiredFunds, ueaBalance)
428
428
  let nativeAmount = (depositUsd * oneNativeUnit + (nativeTokenUsdPrice - BigInt(1))) /
429
429
  nativeTokenUsdPrice;
430
430
  nativeAmount = nativeAmount + BigInt(1);
431
- (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02, nativeAmount);
431
+ (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04, nativeAmount, depositUsd, chain);
432
432
  return nativeAmount;
433
433
  });
434
434
  }
@@ -168,24 +168,24 @@ function buildR2CeaPayloadEvm(params, ceaAddress, targetAddress) {
168
168
  }
169
169
  const SIZER_HOOK_BY_ROUTE = {
170
170
  R3: {
171
- A: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_01,
172
- B: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_02,
173
- C: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_03,
171
+ A: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_01,
172
+ B: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_02,
173
+ C: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_03,
174
174
  },
175
175
  };
176
176
  /**
177
177
  * Fire the route-scoped sizing progress hook based on the sizer's decision.
178
- * Case C carries the overflow amount as an extra arg so UIs can render the
179
- * bridge leg separately.
178
+ * Emits the consumer-facing shape { gasRequired, extraDepositPC, totalDepositUSD, chain }.
179
+ * - gasRequired = sizer's gas leg in native PC wei
180
+ * - extraDepositPC = overflow in native PC wei (> 0 only for Case C)
181
+ * - totalDepositUSD = sized total in USD (8-dec): $1 for Case A (padded),
182
+ * raw gasUsd for Case B/C (which for Case C equals gasLegUsd + overflowUsd).
180
183
  */
181
184
  function fireSizingHook(ctx, route, chain, sizing) {
182
185
  const hook = SIZER_HOOK_BY_ROUTE[route][sizing.category];
183
- if (sizing.category === 'C') {
184
- (0, context_1.fireProgressHook)(ctx, hook, chain, sizing.gasUsd, sizing.gasLegNativePc, sizing.overflowNativePc);
185
- }
186
- else {
187
- (0, context_1.fireProgressHook)(ctx, hook, chain, sizing.gasUsd, sizing.gasLegNativePc);
188
- }
186
+ const ONE_USD_8D = BigInt(100000000);
187
+ const totalDepositUSD = sizing.category === 'A' ? ONE_USD_8D : sizing.gasUsd;
188
+ (0, context_1.fireProgressHook)(ctx, hook, chain, sizing.gasLegNativePc, sizing.overflowNativePc, totalDepositUSD);
189
189
  }
190
190
  // ---------------------------------------------------------------------------
191
191
  // executeMultiChain
@@ -913,19 +913,19 @@ function executeCeaToPush(ctx, params, executeFn) {
913
913
  sizingDecisionR3 = result.sizing;
914
914
  (0, context_1.printLog)(ctx, `executeCeaToPush — queried gas fee: ${gasFee.toString()}, gasToken: ${gasToken}, nativeValueForGas: ${nativeValueForGas.toString()}, sizing=${(_h = (_g = result.sizing) === null || _g === void 0 ? void 0 : _g.category) !== null && _h !== void 0 ? _h : 'legacy'}`);
915
915
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_02, sourceChain, protocolFeeR3, gasFee);
916
- if (result.sizing) {
917
- fireSizingHook(ctx, 'R3', sourceChain, result.sizing);
918
- }
919
916
  }
920
917
  catch (err) {
921
918
  throw new Error(`Failed to query outbound gas fee for Route 3: ${err}`);
922
919
  }
923
920
  }
924
- // Emit account-resolution checkpoint post-gas to match numeric-spec order
925
- // (301 → 302-xx → 303-xx). UEA + CEA were resolved earlier so we can feed
926
- // both into 303-02.
921
+ // Account-resolution checkpoint fires before the gas-sizing sub-hook so
922
+ // consumers see the full account-resolution phase (303-xx) complete before
923
+ // the sizing decision is surfaced.
927
924
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_01, sourceChain);
928
925
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_02, ueaAddress, ceaAddress, sourceChain);
926
+ if (sizingDecisionR3) {
927
+ fireSizingHook(ctx, 'R3', sourceChain, sizingDecisionR3);
928
+ }
929
929
  // R3 Case C: unlike R2, R3 has no destination funds-delivery semantic
930
930
  // (CEA self-executes and bridges funds BACK to Push Chain). When the
931
931
  // sizer returns Case C, we simply top up msg.value with the overflow so
@@ -1135,19 +1135,19 @@ function executeCeaToPushSvm(ctx, params, sourceChain, executeFn) {
1135
1135
  sizingDecisionR3Svm = result.sizing;
1136
1136
  (0, context_1.printLog)(ctx, `executeCeaToPushSvm — gasFee: ${gasFee.toString()}, gasToken: ${gasToken}, nativeValueForGas: ${nativeValueForGas.toString()}, sizing=${(_d = (_c = result.sizing) === null || _c === void 0 ? void 0 : _c.category) !== null && _d !== void 0 ? _d : 'legacy'}`);
1137
1137
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_02, sourceChain, protocolFeeR3Svm, gasFee);
1138
- if (result.sizing) {
1139
- fireSizingHook(ctx, 'R3', sourceChain, result.sizing);
1140
- }
1141
1138
  }
1142
1139
  catch (err) {
1143
1140
  throw new Error(`Failed to query outbound gas fee for SVM Route 3: ${err}`);
1144
1141
  }
1145
1142
  }
1146
- // Emit account-resolution checkpoint post-gas to match numeric-spec order
1147
- // (301 → 302-xx → 303-xx). UEA + gateway were resolved earlier so we can
1148
- // feed both into 303-02.
1143
+ // Account-resolution checkpoint fires before the gas-sizing sub-hook so
1144
+ // consumers see the full account-resolution phase (303-xx) complete before
1145
+ // the sizing decision is surfaced.
1149
1146
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_01, sourceChain);
1150
1147
  (0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_02, ueaAddress, lockerContract, sourceChain);
1148
+ if (sizingDecisionR3Svm) {
1149
+ fireSizingHook(ctx, 'R3', sourceChain, sizingDecisionR3Svm);
1150
+ }
1151
1151
  // R3 SVM Case C: same minimal interpretation as R3 EVM — bump msg.value
1152
1152
  // by the overflow so swapAndBurnGas can afford the full gas cost. No
1153
1153
  // bridge-swap entries (R3 has no destination funds-delivery semantic).
@@ -105,7 +105,6 @@ function reconstructProgressEvents(universalTxResponse, universalTxData) {
105
105
  const originAddress = originParts.length >= 3 ? originParts[2] : universalTxResponse.from;
106
106
  events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_101](chainNamespace, originAddress));
107
107
  events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_01]());
108
- events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02](universalTxResponse.gasLimit));
109
108
  const pushChainIds = [
110
109
  chain_1.CHAIN_INFO[enums_1.CHAIN.PUSH_MAINNET].chainId,
111
110
  chain_1.CHAIN_INFO[enums_1.CHAIN.PUSH_TESTNET_DONUT].chainId,
@@ -116,6 +115,7 @@ function reconstructProgressEvents(universalTxResponse, universalTxData) {
116
115
  events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_01]());
117
116
  events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_02](universalTxResponse.from, true));
118
117
  }
118
+ events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04](universalTxResponse.gasLimit, BigInt(0)));
119
119
  events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_107]());
120
120
  if (isFailed) {
121
121
  events.push(progress_hook_1.default[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_02](errorMsg));
@@ -61,13 +61,6 @@ const RAW_HOOKS_R1 = {
61
61
  response: { stage: 'estimating-gas' },
62
62
  level: 'INFO',
63
63
  }),
64
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02]: (executionCost) => ({
65
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_102_02,
66
- title: 'Gas Estimated',
67
- message: `Total execution cost: ${executionCost} UPC`,
68
- response: { totalCost: executionCost, currency: 'UPC' },
69
- level: 'SUCCESS',
70
- }),
71
64
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_01]: () => ({
72
65
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_01,
73
66
  title: 'Resolving Universal Execution Account',
@@ -82,6 +75,45 @@ const RAW_HOOKS_R1 = {
82
75
  response: { uea: ueaAddress, deployed },
83
76
  level: 'SUCCESS',
84
77
  }),
78
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03]: (originChain, requiredDepositUsd) => ({
79
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03,
80
+ title: 'Calculating Prepaid Deposit',
81
+ message: `Computing required Push-chain deposit based on UEA balance and gas needs`,
82
+ response: {
83
+ stage: 'calculating-prepaid-deposit',
84
+ chain: originChain,
85
+ requiredDepositUsd,
86
+ },
87
+ level: 'INFO',
88
+ }),
89
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_01]: (originChain, gasRequired, extraDepositPC, totalDepositUSD) => ({
90
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_01,
91
+ title: 'Adjusting Prepaid Deposit to be >$1',
92
+ message: `Required deposit below $1 minimum — padding to $1 floor (gasRequired=${gasRequired} UPC, extraDepositPC=${extraDepositPC} UPC, totalDepositUSD=$${totalDepositUSD})`,
93
+ response: { gasRequired, extraDepositPC, totalDepositUSD, chain: originChain },
94
+ level: 'INFO',
95
+ }),
96
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_02]: (originChain, gasRequired, extraDepositPC, totalDepositUSD) => ({
97
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_02,
98
+ title: 'Prepaid Deposit in range (>=$1 and <$10)',
99
+ message: `Required deposit $${totalDepositUSD} within $1–$10 range — depositing as required`,
100
+ response: { gasRequired, extraDepositPC, totalDepositUSD, chain: originChain },
101
+ level: 'INFO',
102
+ }),
103
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_03]: (originChain, gasRequired, extraDepositPC, totalDepositUSD) => ({
104
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_03,
105
+ title: 'Prepaid Deposit Exceeds $10 Cap, splitting Gas and Funds',
106
+ message: `Required deposit exceeds $10 cap — splitting: $10 gas leg + ${extraDepositPC} UPC overflow bridged as funds`,
107
+ response: { gasRequired, extraDepositPC, totalDepositUSD, chain: originChain },
108
+ level: 'INFO',
109
+ }),
110
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04]: (totalPCDeposit, totalDepositUSD, originChain) => ({
111
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_103_03_04,
112
+ title: 'Prepaid Deposit Estimated',
113
+ message: `Estimated prepaid deposit: $${totalDepositUSD} (${totalPCDeposit} UPC)`,
114
+ response: { totalPCDeposit, totalDepositUSD, chain: originChain !== null && originChain !== void 0 ? originChain : null },
115
+ level: 'SUCCESS',
116
+ }),
85
117
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_01]: () => ({
86
118
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_104_01,
87
119
  title: 'Awaiting Transaction',
@@ -192,27 +224,6 @@ const RAW_HOOKS_R1 = {
192
224
  response: { amount, symbol },
193
225
  level: 'SUCCESS',
194
226
  }),
195
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_01]: (originChain, pushGasUsd, paddedDepositUsd) => ({
196
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_01,
197
- title: `${friendlyChain(originChain)} Push Gas Sizing: Case A`,
198
- message: `Push-chain gas < $1; padding deposit to $1 floor (pushGasUsd=${pushGasUsd}, paddedDepositUsd=${paddedDepositUsd})`,
199
- response: { category: 'A', pushGasUsd, paddedDepositUsd, chain: originChain },
200
- level: 'INFO',
201
- }),
202
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_02]: (originChain, pushGasUsd, paddedDepositUsd) => ({
203
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_02,
204
- title: `${friendlyChain(originChain)} Push Gas Sizing: Case B`,
205
- message: `Push-chain gas within $1–$10; happy path (pushGasUsd=${pushGasUsd}, paddedDepositUsd=${paddedDepositUsd})`,
206
- response: { category: 'B', pushGasUsd, paddedDepositUsd, chain: originChain },
207
- level: 'INFO',
208
- }),
209
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_03]: (originChain, pushGasUsd, paddedDepositUsd) => ({
210
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_106_07_03,
211
- title: `${friendlyChain(originChain)} Push Gas Sizing: Case C`,
212
- message: `Push-chain gas > $10; deposit passes through to origin gateway MAX_CAP_UNIVERSAL_TX_USD (pushGasUsd=${pushGasUsd}, paddedDepositUsd=${paddedDepositUsd})`,
213
- response: { category: 'C', pushGasUsd, paddedDepositUsd, chain: originChain },
214
- level: 'INFO',
215
- }),
216
227
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_107]: () => ({
217
228
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_107,
218
229
  title: 'Broadcasting to Push Chain',
@@ -375,7 +386,7 @@ const RAW_HOOKS_R2 = {
375
386
  const RAW_HOOKS_R3 = {
376
387
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_99_99]: (txHash) => ({
377
388
  id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_199_99_99,
378
- title: 'Push Chain TX Completed',
389
+ title: 'Push Chain Tx Completed',
379
390
  message: `Intermediate Push Chain tx confirmed: ${txHash}, progressing to next phase`,
380
391
  response: { txHash },
381
392
  level: 'INFO',
@@ -406,31 +417,25 @@ const RAW_HOOKS_R3 = {
406
417
  },
407
418
  level: 'SUCCESS',
408
419
  }),
409
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_01]: (sourceChain, gasUsd, gasLegNativePc) => ({
410
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_01,
411
- title: `${friendlyChain(sourceChain)} Gas Sizing: Case A`,
412
- message: `Gas cost < $1; padding to $1 minimum (gasUsd=${gasUsd}, gasLeg=${gasLegNativePc} UPC)`,
413
- response: { category: 'A', gasUsd, gasLegNativePc, chain: sourceChain },
420
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_01]: (sourceChain, gasRequired, extraDepositPC, totalDepositUSD) => ({
421
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_01,
422
+ title: 'Adjusting Prepaid Deposit to be >$1',
423
+ message: `Required deposit below $1 minimum — padding to $1 floor (gasRequired=${gasRequired} UPC, extraDepositPC=${extraDepositPC} UPC, totalDepositUSD=$${totalDepositUSD})`,
424
+ response: { gasRequired, extraDepositPC, totalDepositUSD, chain: sourceChain },
414
425
  level: 'INFO',
415
426
  }),
416
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_02]: (sourceChain, gasUsd, gasLegNativePc) => ({
417
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_02,
418
- title: `${friendlyChain(sourceChain)} Gas Sizing: Case B`,
419
- message: `Gas cost within $1–$10 window; happy path (gasUsd=${gasUsd}, gasLeg=${gasLegNativePc} UPC)`,
420
- response: { category: 'B', gasUsd, gasLegNativePc, chain: sourceChain },
427
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_02]: (sourceChain, gasRequired, extraDepositPC, totalDepositUSD) => ({
428
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_02,
429
+ title: 'Prepaid Deposit in range (>=$1 and <$10)',
430
+ message: `Required deposit $${totalDepositUSD} within $1–$10 range — depositing as required`,
431
+ response: { gasRequired, extraDepositPC, totalDepositUSD, chain: sourceChain },
421
432
  level: 'INFO',
422
433
  }),
423
- [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_03]: (sourceChain, gasUsd, gasLegNativePc, overflowNativePc) => ({
424
- id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_302_03_03,
425
- title: `${friendlyChain(sourceChain)} Gas Sizing: Case C`,
426
- message: `Gas cost > $10; splitting into $10 gas leg + ${overflowNativePc} UPC overflow bridged as funds`,
427
- response: {
428
- category: 'C',
429
- gasUsd,
430
- gasLegNativePc,
431
- overflowNativePc,
432
- chain: sourceChain,
433
- },
434
+ [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_03]: (sourceChain, gasRequired, extraDepositPC, totalDepositUSD) => ({
435
+ id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_03_03,
436
+ title: 'Prepaid Deposit Exceeds $10 Cap, splitting Gas and Funds',
437
+ message: `Required deposit exceeds $10 cap — splitting: $10 gas leg + ${extraDepositPC} UPC overflow bridged as funds`,
438
+ response: { gasRequired, extraDepositPC, totalDepositUSD, chain: sourceChain },
434
439
  level: 'INFO',
435
440
  }),
436
441
  [progress_hook_types_1.PROGRESS_HOOK.SEND_TX_303_01]: (sourceChain) => ({
@@ -16,9 +16,13 @@ export type ProgressEventFunctionWithoutTimestamp = (...args: any[]) => Omit<Pro
16
16
  export declare enum PROGRESS_HOOK {
17
17
  SEND_TX_101 = "SEND-TX-101",
18
18
  SEND_TX_102_01 = "SEND-TX-102-01",
19
- SEND_TX_102_02 = "SEND-TX-102-02",
20
19
  SEND_TX_103_01 = "SEND-TX-103-01",
21
20
  SEND_TX_103_02 = "SEND-TX-103-02",
21
+ SEND_TX_103_03 = "SEND-TX-103-03",// Calculating Prepaid Deposit (parent)
22
+ SEND_TX_103_03_01 = "SEND-TX-103-03-01",// Prepaid deposit Case A (< $1, padded to $1 floor)
23
+ SEND_TX_103_03_02 = "SEND-TX-103-03-02",// Prepaid deposit Case B ($1–$10, pass-through)
24
+ SEND_TX_103_03_03 = "SEND-TX-103-03-03",// Prepaid deposit Case C (> $10, split + overflow bridge)
25
+ SEND_TX_103_03_04 = "SEND-TX-103-03-04",// Prepaid Deposit Estimated (terminal for 103-03)
22
26
  SEND_TX_104_01 = "SEND-TX-104-01",// fee-lock path only
23
27
  SEND_TX_104_02 = "SEND-TX-104-02",// signature path only
24
28
  SEND_TX_104_03 = "SEND-TX-104-03",
@@ -33,9 +37,6 @@ export declare enum PROGRESS_HOOK {
33
37
  SEND_TX_106_04 = "SEND-TX-106-04",
34
38
  SEND_TX_106_05 = "SEND-TX-106-05",
35
39
  SEND_TX_106_06 = "SEND-TX-106-06",
36
- SEND_TX_106_07_01 = "SEND-TX-106-07-01",// R1 Sizer: Case A (push-gas < $1, padded to $1 floor)
37
- SEND_TX_106_07_02 = "SEND-TX-106-07-02",// R1 Sizer: Case B (push-gas $1–$10, pass-through)
38
- SEND_TX_106_07_03 = "SEND-TX-106-07-03",// R1 Sizer: Case C (push-gas > $10, pass-through to contract cap)
39
40
  SEND_TX_107 = "SEND-TX-107",
40
41
  SEND_TX_199_01 = "SEND-TX-199-01",// R1 terminal Push success
41
42
  SEND_TX_199_02 = "SEND-TX-199-02",// R1 terminal Push failure
@@ -59,11 +60,11 @@ export declare enum PROGRESS_HOOK {
59
60
  SEND_TX_301 = "SEND-TX-301",
60
61
  SEND_TX_302_01 = "SEND-TX-302-01",
61
62
  SEND_TX_302_02 = "SEND-TX-302-02",
62
- SEND_TX_302_03_01 = "SEND-TX-302-03-01",// Sizer: Case A (< $1, padded)
63
- SEND_TX_302_03_02 = "SEND-TX-302-03-02",// Sizer: Case B ($1–$10, happy path)
64
- SEND_TX_302_03_03 = "SEND-TX-302-03-03",// Sizer: Case C (> $10, split + overflow bridge)
65
63
  SEND_TX_303_01 = "SEND-TX-303-01",
66
64
  SEND_TX_303_02 = "SEND-TX-303-02",
65
+ SEND_TX_303_03_01 = "SEND-TX-303-03-01",// Sizer: Case A (< $1, padded)
66
+ SEND_TX_303_03_02 = "SEND-TX-303-03-02",// Sizer: Case B ($1–$10, happy path)
67
+ SEND_TX_303_03_03 = "SEND-TX-303-03-03",// Sizer: Case C (> $10, split + overflow bridge)
67
68
  SEND_TX_304_01 = "SEND-TX-304-01",
68
69
  SEND_TX_304_02 = "SEND-TX-304-02",
69
70
  SEND_TX_304_03 = "SEND-TX-304-03",
@@ -90,9 +91,9 @@ export declare enum PROGRESS_HOOK {
90
91
  UEA_MIG_9902 = "UEA-MIG-9902",
91
92
  UEA_MIG_9903 = "UEA-MIG-9903"
92
93
  }
93
- export type PROGRESS_HOOK_R1 = PROGRESS_HOOK.SEND_TX_101 | PROGRESS_HOOK.SEND_TX_102_01 | PROGRESS_HOOK.SEND_TX_102_02 | PROGRESS_HOOK.SEND_TX_103_01 | PROGRESS_HOOK.SEND_TX_103_02 | PROGRESS_HOOK.SEND_TX_104_01 | PROGRESS_HOOK.SEND_TX_104_02 | PROGRESS_HOOK.SEND_TX_104_03 | PROGRESS_HOOK.SEND_TX_104_04 | PROGRESS_HOOK.SEND_TX_105_01 | PROGRESS_HOOK.SEND_TX_105_02 | PROGRESS_HOOK.SEND_TX_106_01 | PROGRESS_HOOK.SEND_TX_106_02 | PROGRESS_HOOK.SEND_TX_106_03 | PROGRESS_HOOK.SEND_TX_106_03_01 | PROGRESS_HOOK.SEND_TX_106_03_02 | PROGRESS_HOOK.SEND_TX_106_04 | PROGRESS_HOOK.SEND_TX_106_05 | PROGRESS_HOOK.SEND_TX_106_06 | PROGRESS_HOOK.SEND_TX_106_07_01 | PROGRESS_HOOK.SEND_TX_106_07_02 | PROGRESS_HOOK.SEND_TX_106_07_03 | PROGRESS_HOOK.SEND_TX_107 | PROGRESS_HOOK.SEND_TX_199_01 | PROGRESS_HOOK.SEND_TX_199_02;
94
+ export type PROGRESS_HOOK_R1 = PROGRESS_HOOK.SEND_TX_101 | PROGRESS_HOOK.SEND_TX_102_01 | PROGRESS_HOOK.SEND_TX_103_01 | PROGRESS_HOOK.SEND_TX_103_02 | PROGRESS_HOOK.SEND_TX_103_03 | PROGRESS_HOOK.SEND_TX_103_03_01 | PROGRESS_HOOK.SEND_TX_103_03_02 | PROGRESS_HOOK.SEND_TX_103_03_03 | PROGRESS_HOOK.SEND_TX_103_03_04 | PROGRESS_HOOK.SEND_TX_104_01 | PROGRESS_HOOK.SEND_TX_104_02 | PROGRESS_HOOK.SEND_TX_104_03 | PROGRESS_HOOK.SEND_TX_104_04 | PROGRESS_HOOK.SEND_TX_105_01 | PROGRESS_HOOK.SEND_TX_105_02 | PROGRESS_HOOK.SEND_TX_106_01 | PROGRESS_HOOK.SEND_TX_106_02 | PROGRESS_HOOK.SEND_TX_106_03 | PROGRESS_HOOK.SEND_TX_106_03_01 | PROGRESS_HOOK.SEND_TX_106_03_02 | PROGRESS_HOOK.SEND_TX_106_04 | PROGRESS_HOOK.SEND_TX_106_05 | PROGRESS_HOOK.SEND_TX_106_06 | PROGRESS_HOOK.SEND_TX_107 | PROGRESS_HOOK.SEND_TX_199_01 | PROGRESS_HOOK.SEND_TX_199_02;
94
95
  export type PROGRESS_HOOK_R2 = PROGRESS_HOOK.SEND_TX_201 | PROGRESS_HOOK.SEND_TX_202_01 | PROGRESS_HOOK.SEND_TX_202_02 | PROGRESS_HOOK.SEND_TX_203_01 | PROGRESS_HOOK.SEND_TX_203_02 | PROGRESS_HOOK.SEND_TX_204_01 | PROGRESS_HOOK.SEND_TX_204_02 | PROGRESS_HOOK.SEND_TX_204_03 | PROGRESS_HOOK.SEND_TX_204_04 | PROGRESS_HOOK.SEND_TX_207 | PROGRESS_HOOK.SEND_TX_209_01 | PROGRESS_HOOK.SEND_TX_209_02 | PROGRESS_HOOK.SEND_TX_299_01 | PROGRESS_HOOK.SEND_TX_299_02 | PROGRESS_HOOK.SEND_TX_299_03 | PROGRESS_HOOK.SEND_TX_299_99;
95
- export type PROGRESS_HOOK_R3 = PROGRESS_HOOK.SEND_TX_199_99_99 | PROGRESS_HOOK.SEND_TX_301 | PROGRESS_HOOK.SEND_TX_302_01 | PROGRESS_HOOK.SEND_TX_302_02 | PROGRESS_HOOK.SEND_TX_302_03_01 | PROGRESS_HOOK.SEND_TX_302_03_02 | PROGRESS_HOOK.SEND_TX_302_03_03 | PROGRESS_HOOK.SEND_TX_303_01 | PROGRESS_HOOK.SEND_TX_303_02 | PROGRESS_HOOK.SEND_TX_304_01 | PROGRESS_HOOK.SEND_TX_304_02 | PROGRESS_HOOK.SEND_TX_304_03 | PROGRESS_HOOK.SEND_TX_304_04 | PROGRESS_HOOK.SEND_TX_307 | PROGRESS_HOOK.SEND_TX_309_01 | PROGRESS_HOOK.SEND_TX_309_02 | PROGRESS_HOOK.SEND_TX_309_03 | PROGRESS_HOOK.SEND_TX_310_01 | PROGRESS_HOOK.SEND_TX_310_02 | PROGRESS_HOOK.SEND_TX_399_01 | PROGRESS_HOOK.SEND_TX_399_02 | PROGRESS_HOOK.SEND_TX_399_03;
96
+ export type PROGRESS_HOOK_R3 = PROGRESS_HOOK.SEND_TX_199_99_99 | PROGRESS_HOOK.SEND_TX_301 | PROGRESS_HOOK.SEND_TX_302_01 | PROGRESS_HOOK.SEND_TX_302_02 | PROGRESS_HOOK.SEND_TX_303_01 | PROGRESS_HOOK.SEND_TX_303_02 | PROGRESS_HOOK.SEND_TX_303_03_01 | PROGRESS_HOOK.SEND_TX_303_03_02 | PROGRESS_HOOK.SEND_TX_303_03_03 | PROGRESS_HOOK.SEND_TX_304_01 | PROGRESS_HOOK.SEND_TX_304_02 | PROGRESS_HOOK.SEND_TX_304_03 | PROGRESS_HOOK.SEND_TX_304_04 | PROGRESS_HOOK.SEND_TX_307 | PROGRESS_HOOK.SEND_TX_309_01 | PROGRESS_HOOK.SEND_TX_309_02 | PROGRESS_HOOK.SEND_TX_309_03 | PROGRESS_HOOK.SEND_TX_310_01 | PROGRESS_HOOK.SEND_TX_310_02 | PROGRESS_HOOK.SEND_TX_399_01 | PROGRESS_HOOK.SEND_TX_399_02 | PROGRESS_HOOK.SEND_TX_399_03;
96
97
  export type PROGRESS_HOOK_MULTICHAIN = PROGRESS_HOOK.SEND_TX_001 | PROGRESS_HOOK.SEND_TX_002_01 | PROGRESS_HOOK.SEND_TX_002_99_99 | PROGRESS_HOOK.SEND_TX_999_01 | PROGRESS_HOOK.SEND_TX_999_02 | PROGRESS_HOOK.SEND_TX_999_03;
97
98
  export type PROGRESS_HOOK_MIG = PROGRESS_HOOK.UEA_MIG_01 | PROGRESS_HOOK.UEA_MIG_02 | PROGRESS_HOOK.UEA_MIG_03 | PROGRESS_HOOK.UEA_MIG_9901 | PROGRESS_HOOK.UEA_MIG_9902 | PROGRESS_HOOK.UEA_MIG_9903;
98
99
  export {};
@@ -6,9 +6,13 @@ var PROGRESS_HOOK;
6
6
  // Route 1: UOA → Push Chain (101–199)
7
7
  PROGRESS_HOOK["SEND_TX_101"] = "SEND-TX-101";
8
8
  PROGRESS_HOOK["SEND_TX_102_01"] = "SEND-TX-102-01";
9
- PROGRESS_HOOK["SEND_TX_102_02"] = "SEND-TX-102-02";
10
9
  PROGRESS_HOOK["SEND_TX_103_01"] = "SEND-TX-103-01";
11
10
  PROGRESS_HOOK["SEND_TX_103_02"] = "SEND-TX-103-02";
11
+ PROGRESS_HOOK["SEND_TX_103_03"] = "SEND-TX-103-03";
12
+ PROGRESS_HOOK["SEND_TX_103_03_01"] = "SEND-TX-103-03-01";
13
+ PROGRESS_HOOK["SEND_TX_103_03_02"] = "SEND-TX-103-03-02";
14
+ PROGRESS_HOOK["SEND_TX_103_03_03"] = "SEND-TX-103-03-03";
15
+ PROGRESS_HOOK["SEND_TX_103_03_04"] = "SEND-TX-103-03-04";
12
16
  PROGRESS_HOOK["SEND_TX_104_01"] = "SEND-TX-104-01";
13
17
  PROGRESS_HOOK["SEND_TX_104_02"] = "SEND-TX-104-02";
14
18
  PROGRESS_HOOK["SEND_TX_104_03"] = "SEND-TX-104-03";
@@ -23,9 +27,6 @@ var PROGRESS_HOOK;
23
27
  PROGRESS_HOOK["SEND_TX_106_04"] = "SEND-TX-106-04";
24
28
  PROGRESS_HOOK["SEND_TX_106_05"] = "SEND-TX-106-05";
25
29
  PROGRESS_HOOK["SEND_TX_106_06"] = "SEND-TX-106-06";
26
- PROGRESS_HOOK["SEND_TX_106_07_01"] = "SEND-TX-106-07-01";
27
- PROGRESS_HOOK["SEND_TX_106_07_02"] = "SEND-TX-106-07-02";
28
- PROGRESS_HOOK["SEND_TX_106_07_03"] = "SEND-TX-106-07-03";
29
30
  PROGRESS_HOOK["SEND_TX_107"] = "SEND-TX-107";
30
31
  PROGRESS_HOOK["SEND_TX_199_01"] = "SEND-TX-199-01";
31
32
  PROGRESS_HOOK["SEND_TX_199_02"] = "SEND-TX-199-02";
@@ -51,11 +52,11 @@ var PROGRESS_HOOK;
51
52
  PROGRESS_HOOK["SEND_TX_301"] = "SEND-TX-301";
52
53
  PROGRESS_HOOK["SEND_TX_302_01"] = "SEND-TX-302-01";
53
54
  PROGRESS_HOOK["SEND_TX_302_02"] = "SEND-TX-302-02";
54
- PROGRESS_HOOK["SEND_TX_302_03_01"] = "SEND-TX-302-03-01";
55
- PROGRESS_HOOK["SEND_TX_302_03_02"] = "SEND-TX-302-03-02";
56
- PROGRESS_HOOK["SEND_TX_302_03_03"] = "SEND-TX-302-03-03";
57
55
  PROGRESS_HOOK["SEND_TX_303_01"] = "SEND-TX-303-01";
58
56
  PROGRESS_HOOK["SEND_TX_303_02"] = "SEND-TX-303-02";
57
+ PROGRESS_HOOK["SEND_TX_303_03_01"] = "SEND-TX-303-03-01";
58
+ PROGRESS_HOOK["SEND_TX_303_03_02"] = "SEND-TX-303-03-02";
59
+ PROGRESS_HOOK["SEND_TX_303_03_03"] = "SEND-TX-303-03-03";
59
60
  PROGRESS_HOOK["SEND_TX_304_01"] = "SEND-TX-304-01";
60
61
  PROGRESS_HOOK["SEND_TX_304_02"] = "SEND-TX-304-02";
61
62
  PROGRESS_HOOK["SEND_TX_304_03"] = "SEND-TX-304-03";