@pushchain/core 5.1.5-alpha.0 → 5.1.5

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/package.json +1 -1
  3. package/src/lib/constants/abi/index.d.ts +2 -0
  4. package/src/lib/constants/abi/index.js +6 -1
  5. package/src/lib/constants/abi/uniswap-v3-router.evm.d.ts +58 -0
  6. package/src/lib/constants/abi/uniswap-v3-router.evm.js +41 -0
  7. package/src/lib/constants/abi/wpc.evm.d.ts +24 -0
  8. package/src/lib/constants/abi/wpc.evm.js +27 -0
  9. package/src/lib/constants/chain.d.ts +1 -0
  10. package/src/lib/constants/chain.js +8 -6
  11. package/src/lib/constants/tokens.js +3 -3
  12. package/src/lib/generated/uexecutor/v2/types.d.ts +14 -0
  13. package/src/lib/generated/uexecutor/v2/types.js +96 -3
  14. package/src/lib/orchestrator/internals/cascade.d.ts +1 -1
  15. package/src/lib/orchestrator/internals/cascade.js +556 -225
  16. package/src/lib/orchestrator/internals/confirmation.js +60 -15
  17. package/src/lib/orchestrator/internals/context.d.ts +23 -0
  18. package/src/lib/orchestrator/internals/context.js +54 -0
  19. package/src/lib/orchestrator/internals/execute-funds-only.js +47 -21
  20. package/src/lib/orchestrator/internals/execute-funds-payload.js +53 -31
  21. package/src/lib/orchestrator/internals/execute-standard.js +137 -26
  22. package/src/lib/orchestrator/internals/gas-calculator.d.ts +5 -2
  23. package/src/lib/orchestrator/internals/gas-calculator.js +59 -11
  24. package/src/lib/orchestrator/internals/gas-usd-sizer.d.ts +53 -0
  25. package/src/lib/orchestrator/internals/gas-usd-sizer.js +165 -0
  26. package/src/lib/orchestrator/internals/helpers.js +2 -0
  27. package/src/lib/orchestrator/internals/inbound-tracker.d.ts +83 -0
  28. package/src/lib/orchestrator/internals/inbound-tracker.js +322 -0
  29. package/src/lib/orchestrator/internals/index.d.ts +3 -1
  30. package/src/lib/orchestrator/internals/index.js +8 -2
  31. package/src/lib/orchestrator/internals/outbound-sync.d.ts +32 -1
  32. package/src/lib/orchestrator/internals/outbound-sync.js +154 -17
  33. package/src/lib/orchestrator/internals/pc-usd-oracle.d.ts +28 -0
  34. package/src/lib/orchestrator/internals/pc-usd-oracle.js +285 -0
  35. package/src/lib/orchestrator/internals/progress-route-hooks.d.ts +23 -0
  36. package/src/lib/orchestrator/internals/progress-route-hooks.js +72 -0
  37. package/src/lib/orchestrator/internals/push-chain-tx.d.ts +27 -1
  38. package/src/lib/orchestrator/internals/push-chain-tx.js +111 -15
  39. package/src/lib/orchestrator/internals/rescue.js +1 -1
  40. package/src/lib/orchestrator/internals/response-builder.d.ts +5 -0
  41. package/src/lib/orchestrator/internals/response-builder.js +252 -53
  42. package/src/lib/orchestrator/internals/route-handlers.js +480 -206
  43. package/src/lib/orchestrator/internals/tx-transformer.js +293 -35
  44. package/src/lib/orchestrator/orchestrator.d.ts +7 -1
  45. package/src/lib/orchestrator/orchestrator.js +108 -56
  46. package/src/lib/orchestrator/orchestrator.types.d.ts +120 -5
  47. package/src/lib/orchestrator/payload-builders.d.ts +16 -0
  48. package/src/lib/orchestrator/payload-builders.js +6 -5
  49. package/src/lib/orchestrator/route-detector.js +20 -8
  50. package/src/lib/orchestrator/svm-idl/normalize-address.d.ts +19 -0
  51. package/src/lib/orchestrator/svm-idl/normalize-address.js +56 -0
  52. package/src/lib/orchestrator/svm-idl/registry.d.ts +13 -4
  53. package/src/lib/orchestrator/svm-idl/registry.js +15 -14
  54. package/src/lib/orchestrator/svm-idl/resolve.js +5 -2
  55. package/src/lib/progress-hook/progress-hook.d.ts +28 -0
  56. package/src/lib/progress-hook/progress-hook.js +555 -101
  57. package/src/lib/progress-hook/progress-hook.types.d.ts +76 -24
  58. package/src/lib/progress-hook/progress-hook.types.js +74 -29
  59. package/src/lib/push-client/push-client.d.ts +7 -0
  60. package/src/lib/push-client/push-client.js +18 -1
  61. package/src/lib/universal-tx-detector/__tests__/fixtures/builders.d.ts +32 -0
  62. package/src/lib/universal-tx-detector/__tests__/fixtures/builders.js +65 -0
  63. package/src/lib/universal-tx-detector/__tests__/fixtures/scenarios.d.ts +72 -0
  64. package/src/lib/universal-tx-detector/__tests__/fixtures/scenarios.js +669 -0
  65. package/src/lib/universal-tx-detector/auto-detect.d.ts +37 -0
  66. package/src/lib/universal-tx-detector/auto-detect.js +112 -0
  67. package/src/lib/universal-tx-detector/cascade.d.ts +64 -0
  68. package/src/lib/universal-tx-detector/cascade.js +254 -0
  69. package/src/lib/universal-tx-detector/child-inbounds.d.ts +58 -0
  70. package/src/lib/universal-tx-detector/child-inbounds.js +145 -0
  71. package/src/lib/universal-tx-detector/classify.d.ts +33 -0
  72. package/src/lib/universal-tx-detector/classify.js +228 -0
  73. package/src/lib/universal-tx-detector/detector-svm.d.ts +46 -0
  74. package/src/lib/universal-tx-detector/detector-svm.js +324 -0
  75. package/src/lib/universal-tx-detector/detector.d.ts +13 -0
  76. package/src/lib/universal-tx-detector/detector.js +233 -0
  77. package/src/lib/universal-tx-detector/events.d.ts +765 -0
  78. package/src/lib/universal-tx-detector/events.js +241 -0
  79. package/src/lib/universal-tx-detector/index.d.ts +18 -0
  80. package/src/lib/universal-tx-detector/index.js +36 -0
  81. package/src/lib/universal-tx-detector/svm-events.d.ts +41 -0
  82. package/src/lib/universal-tx-detector/svm-events.js +68 -0
  83. package/src/lib/universal-tx-detector/types.d.ts +100 -0
  84. package/src/lib/universal-tx-detector/types.js +3 -0
  85. package/src/lib/utils.d.ts +30 -13
  86. package/src/lib/utils.js +47 -21
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ @pushchain/core@5.2.0 (unreleased)
2
+
3
+ - Route 1 (UOA → Push) now applies Case A/B/C USD-bucket sizing to the
4
+ Push-chain gas cost. Case A pads deposits to the $1 floor; Case B passes
5
+ through; Case C is informational (deposits proceed up to the origin
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.
9
+
10
+ - Gas abstraction scope narrowed to R1 (fee-lock USD caps) and R3 (outbound
11
+ msg.value sizing). R2 (UOA → CEA) and cascade outbound segments no longer
12
+ apply Case A/B/C; R2 `msg.value` now uses a live Uniswap V3 quote + 10%
13
+ safety buffer, and the contract refunds any excess as PC back to the UEA.
14
+ The `SEND_TX_202_03_A/B/C` progress hooks, the Case-C bridge-swap composer,
15
+ and the `GasExceedsCategoryCWithErc20FundsError` error class have all been
16
+ removed.
17
+
18
+ ---
19
+
1
20
  @pushchain/core@5.1.0 (2026-03-28)
2
21
 
3
22
  - release: bump to 5.0.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushchain/core",
3
- "version": "5.1.5-alpha.0",
3
+ "version": "5.1.5",
4
4
  "homepage": "https://push.org",
5
5
  "keywords": [
6
6
  "pushchain",
@@ -12,3 +12,5 @@ export { CEA_FACTORY_EVM } from './ceaFactory.evm';
12
12
  export { UNIVERSAL_GATEWAY_PC } from './universalGatewayPC.evm';
13
13
  export { UNIVERSAL_CORE_EVM } from './prc20.evm';
14
14
  export { UEA_FACTORY_ABI } from './uea-factory';
15
+ export { WPC_EVM } from './wpc.evm';
16
+ export { UNIV3_SWAP_ROUTER_EVM } from './uniswap-v3-router.evm';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UEA_FACTORY_ABI = exports.UNIVERSAL_CORE_EVM = exports.UNIVERSAL_GATEWAY_PC = exports.CEA_FACTORY_EVM = exports.CEA_EVM = exports.SVM_GATEWAY_IDL = exports.ERC20_EVM = exports.UNIVERSAL_GATEWAY_V1_SEND = exports.UNIVERSAL_GATEWAY_V0 = exports.UEA_SVM = exports.UEA_EVM = exports.FACTORY_V1 = exports.FEE_LOCKER_SVM = exports.FEE_LOCKER_EVM = void 0;
3
+ exports.UNIV3_SWAP_ROUTER_EVM = exports.WPC_EVM = exports.UEA_FACTORY_ABI = exports.UNIVERSAL_CORE_EVM = exports.UNIVERSAL_GATEWAY_PC = exports.CEA_FACTORY_EVM = exports.CEA_EVM = exports.SVM_GATEWAY_IDL = exports.ERC20_EVM = exports.UNIVERSAL_GATEWAY_V1_SEND = exports.UNIVERSAL_GATEWAY_V0 = exports.UEA_SVM = exports.UEA_EVM = exports.FACTORY_V1 = exports.FEE_LOCKER_SVM = exports.FEE_LOCKER_EVM = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  var feeLocker_evm_1 = require("./feeLocker.evm");
6
6
  Object.defineProperty(exports, "FEE_LOCKER_EVM", { enumerable: true, get: function () { return feeLocker_evm_1.FEE_LOCKER_EVM; } });
@@ -31,4 +31,9 @@ var prc20_evm_1 = require("./prc20.evm");
31
31
  Object.defineProperty(exports, "UNIVERSAL_CORE_EVM", { enumerable: true, get: function () { return prc20_evm_1.UNIVERSAL_CORE_EVM; } });
32
32
  var uea_factory_1 = require("./uea-factory");
33
33
  Object.defineProperty(exports, "UEA_FACTORY_ABI", { enumerable: true, get: function () { return uea_factory_1.UEA_FACTORY_ABI; } });
34
+ // SDK 5.2 gas abstraction (Case C overflow bridging)
35
+ var wpc_evm_1 = require("./wpc.evm");
36
+ Object.defineProperty(exports, "WPC_EVM", { enumerable: true, get: function () { return wpc_evm_1.WPC_EVM; } });
37
+ var uniswap_v3_router_evm_1 = require("./uniswap-v3-router.evm");
38
+ Object.defineProperty(exports, "UNIV3_SWAP_ROUTER_EVM", { enumerable: true, get: function () { return uniswap_v3_router_evm_1.UNIV3_SWAP_ROUTER_EVM; } });
34
39
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Minimal ABI fragment for the Uniswap V3 SwapRouter deployed on Push Chain.
3
+ *
4
+ * Only `exactInputSingle` is used by the SDK — the gas-abstraction Case C
5
+ * overflow-bridging flow swaps WPC → destination PRC-20 with a known WPC
6
+ * input and a minimum acceptable PRC-20 output.
7
+ *
8
+ * Router address on PUSH_TESTNET_DONUT: 0x5D548bB9E305AAe0d6dc6e6fdc3ab419f6aC0037
9
+ * (from https://push.org/agents/contract-addresses.json)
10
+ */
11
+ export declare const UNIV3_SWAP_ROUTER_EVM: readonly [{
12
+ readonly type: "function";
13
+ readonly name: "exactInputSingle";
14
+ readonly inputs: readonly [{
15
+ readonly name: "params";
16
+ readonly type: "tuple";
17
+ readonly internalType: "struct ISwapRouter.ExactInputSingleParams";
18
+ readonly components: readonly [{
19
+ readonly name: "tokenIn";
20
+ readonly type: "address";
21
+ readonly internalType: "address";
22
+ }, {
23
+ readonly name: "tokenOut";
24
+ readonly type: "address";
25
+ readonly internalType: "address";
26
+ }, {
27
+ readonly name: "fee";
28
+ readonly type: "uint24";
29
+ readonly internalType: "uint24";
30
+ }, {
31
+ readonly name: "recipient";
32
+ readonly type: "address";
33
+ readonly internalType: "address";
34
+ }, {
35
+ readonly name: "deadline";
36
+ readonly type: "uint256";
37
+ readonly internalType: "uint256";
38
+ }, {
39
+ readonly name: "amountIn";
40
+ readonly type: "uint256";
41
+ readonly internalType: "uint256";
42
+ }, {
43
+ readonly name: "amountOutMinimum";
44
+ readonly type: "uint256";
45
+ readonly internalType: "uint256";
46
+ }, {
47
+ readonly name: "sqrtPriceLimitX96";
48
+ readonly type: "uint160";
49
+ readonly internalType: "uint160";
50
+ }];
51
+ }];
52
+ readonly outputs: readonly [{
53
+ readonly name: "amountOut";
54
+ readonly type: "uint256";
55
+ readonly internalType: "uint256";
56
+ }];
57
+ readonly stateMutability: "payable";
58
+ }];
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNIV3_SWAP_ROUTER_EVM = void 0;
4
+ /**
5
+ * Minimal ABI fragment for the Uniswap V3 SwapRouter deployed on Push Chain.
6
+ *
7
+ * Only `exactInputSingle` is used by the SDK — the gas-abstraction Case C
8
+ * overflow-bridging flow swaps WPC → destination PRC-20 with a known WPC
9
+ * input and a minimum acceptable PRC-20 output.
10
+ *
11
+ * Router address on PUSH_TESTNET_DONUT: 0x5D548bB9E305AAe0d6dc6e6fdc3ab419f6aC0037
12
+ * (from https://push.org/agents/contract-addresses.json)
13
+ */
14
+ exports.UNIV3_SWAP_ROUTER_EVM = [
15
+ {
16
+ type: 'function',
17
+ name: 'exactInputSingle',
18
+ inputs: [
19
+ {
20
+ name: 'params',
21
+ type: 'tuple',
22
+ internalType: 'struct ISwapRouter.ExactInputSingleParams',
23
+ components: [
24
+ { name: 'tokenIn', type: 'address', internalType: 'address' },
25
+ { name: 'tokenOut', type: 'address', internalType: 'address' },
26
+ { name: 'fee', type: 'uint24', internalType: 'uint24' },
27
+ { name: 'recipient', type: 'address', internalType: 'address' },
28
+ { name: 'deadline', type: 'uint256', internalType: 'uint256' },
29
+ { name: 'amountIn', type: 'uint256', internalType: 'uint256' },
30
+ { name: 'amountOutMinimum', type: 'uint256', internalType: 'uint256' },
31
+ { name: 'sqrtPriceLimitX96', type: 'uint160', internalType: 'uint160' },
32
+ ],
33
+ },
34
+ ],
35
+ outputs: [
36
+ { name: 'amountOut', type: 'uint256', internalType: 'uint256' },
37
+ ],
38
+ stateMutability: 'payable',
39
+ },
40
+ ];
41
+ //# sourceMappingURL=uniswap-v3-router.evm.js.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Minimal ABI for the Wrapped Push Chain token (WPC) on Push Chain.
3
+ *
4
+ * WPC follows the canonical WETH9 interface — only `deposit()` and
5
+ * `withdraw()` are needed on top of ERC-20 for the gas-abstraction
6
+ * Case C overflow-bridging flow.
7
+ */
8
+ export declare const WPC_EVM: readonly [{
9
+ readonly type: "function";
10
+ readonly name: "deposit";
11
+ readonly inputs: readonly [];
12
+ readonly outputs: readonly [];
13
+ readonly stateMutability: "payable";
14
+ }, {
15
+ readonly type: "function";
16
+ readonly name: "withdraw";
17
+ readonly inputs: readonly [{
18
+ readonly name: "wad";
19
+ readonly type: "uint256";
20
+ readonly internalType: "uint256";
21
+ }];
22
+ readonly outputs: readonly [];
23
+ readonly stateMutability: "nonpayable";
24
+ }];
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WPC_EVM = void 0;
4
+ /**
5
+ * Minimal ABI for the Wrapped Push Chain token (WPC) on Push Chain.
6
+ *
7
+ * WPC follows the canonical WETH9 interface — only `deposit()` and
8
+ * `withdraw()` are needed on top of ERC-20 for the gas-abstraction
9
+ * Case C overflow-bridging flow.
10
+ */
11
+ exports.WPC_EVM = [
12
+ {
13
+ type: 'function',
14
+ name: 'deposit',
15
+ inputs: [],
16
+ outputs: [],
17
+ stateMutability: 'payable',
18
+ },
19
+ {
20
+ type: 'function',
21
+ name: 'withdraw',
22
+ inputs: [{ name: 'wad', type: 'uint256', internalType: 'uint256' }],
23
+ outputs: [],
24
+ stateMutability: 'nonpayable',
25
+ },
26
+ ];
27
+ //# sourceMappingURL=wpc.evm.js.map
@@ -59,6 +59,7 @@ export declare const CHAIN_INFO: Record<CHAIN, {
59
59
  dex?: {
60
60
  uniV3Factory?: `0x${string}`;
61
61
  uniV3QuoterV2?: `0x${string}`;
62
+ uniV3SwapRouter?: `0x${string}`;
62
63
  weth?: `0x${string}`;
63
64
  };
64
65
  }>;
@@ -55,15 +55,15 @@ exports.SYNTHETIC_PUSH_ERC20 = {
55
55
  pETH_BNB: '0x7a9082dA308f3fa005beA7dB0d203b3b86664E36',
56
56
  pSOL: '0x5D525Df2bD99a6e7ec58b76aF2fd95F39874EBed',
57
57
  USDT_ETH: '0xCA0C5E6F002A389E1580F0DB7cd06e4549B5F9d3',
58
- USDC_ETH: '0x387b9C8Db60E74999aAAC5A2b7825b400F12d68E',
58
+ USDC_ETH: '0x7A58048036206bB898008b5bBDA85697DB1e5d66',
59
59
  USDT_ARB: '0x76Ad08339dF606BeEDe06f90e3FaF82c5b2fb2E9',
60
- USDC_ARB: '0xa261A10e94aE4bA88EE8c5845CbE7266bD679DD6',
60
+ USDC_ARB: '0x1091cCBA2FF8d2A131AE4B35e34cf3308C48572C',
61
61
  USDT_SOL: '0x4f1A3D22d170a2F4Bddb37845a962322e24f4e34',
62
62
  USDC_SOL: '0x04B8F634ABC7C879763F623e0f0550a4b5c4426F',
63
63
  USDT_BNB: '0x2f98B4235FD2BA0173a2B056D722879360B12E7b',
64
64
  USDC_BNB: '0xTBD',
65
65
  USDT_BASE: '0x2C455189D2af6643B924A981a9080CcC63d5a567',
66
- USDC_BASE: '0x84B62e44F667F692F7739Ca6040cD17DA02068A8',
66
+ USDC_BASE: '0xD7C6cA1e2c0CE260BE0c0AD39C1540de460e3Be1',
67
67
  },
68
68
  [enums_1.PUSH_NETWORK.TESTNET]: {
69
69
  pETH: '0x2971824Db68229D087931155C2b8bB820B275809',
@@ -72,15 +72,15 @@ exports.SYNTHETIC_PUSH_ERC20 = {
72
72
  pETH_BNB: '0x7a9082dA308f3fa005beA7dB0d203b3b86664E36',
73
73
  pSOL: '0x5D525Df2bD99a6e7ec58b76aF2fd95F39874EBed',
74
74
  USDT_ETH: '0xCA0C5E6F002A389E1580F0DB7cd06e4549B5F9d3',
75
- USDC_ETH: '0x387b9C8Db60E74999aAAC5A2b7825b400F12d68E',
75
+ USDC_ETH: '0x7A58048036206bB898008b5bBDA85697DB1e5d66',
76
76
  USDT_ARB: '0x76Ad08339dF606BeEDe06f90e3FaF82c5b2fb2E9',
77
- USDC_ARB: '0xa261A10e94aE4bA88EE8c5845CbE7266bD679DD6',
77
+ USDC_ARB: '0x1091cCBA2FF8d2A131AE4B35e34cf3308C48572C',
78
78
  USDT_SOL: '0x4f1A3D22d170a2F4Bddb37845a962322e24f4e34',
79
79
  USDC_SOL: '0x04B8F634ABC7C879763F623e0f0550a4b5c4426F',
80
80
  USDT_BNB: '0x2f98B4235FD2BA0173a2B056D722879360B12E7b',
81
81
  USDC_BNB: '0xTBD',
82
82
  USDT_BASE: '0x2C455189D2af6643B924A981a9080CcC63d5a567',
83
- USDC_BASE: '0x84B62e44F667F692F7739Ca6040cD17DA02068A8',
83
+ USDC_BASE: '0xD7C6cA1e2c0CE260BE0c0AD39C1540de460e3Be1',
84
84
  },
85
85
  [enums_1.PUSH_NETWORK.LOCALNET]: {
86
86
  pETH: '0xTBD',
@@ -143,9 +143,11 @@ exports.CHAIN_INFO = {
143
143
  timeout: 30000,
144
144
  explorerUrl: 'https://explorer.donut.push.org',
145
145
  // Push Chain AMM - Uniswap V3
146
+ // Source: https://push.org/agents/contract-addresses.json
146
147
  dex: {
147
148
  uniV3Factory: '0x81b8Bca02580C7d6b636051FDb7baAC436bFb454',
148
149
  uniV3QuoterV2: '0x83316275f7C2F79BC4E26f089333e88E89093037',
150
+ uniV3SwapRouter: '0x5D548bB9E305AAe0d6dc6e6fdc3ab419f6aC0037',
149
151
  weth: '0xE17DD2E0509f99E9ee9469Cf6634048Ec5a3ADe9',
150
152
  },
151
153
  },
@@ -88,7 +88,7 @@ const TOKEN_META = {
88
88
  USDC: {
89
89
  symbol: 'USDC',
90
90
  decimals: 6,
91
- address: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',
91
+ address: '0x97F477B7f970D47a87B42869ceeace218106152a',
92
92
  mechanism: 'approve',
93
93
  },
94
94
  stETH: {
@@ -136,7 +136,7 @@ const TOKEN_META = {
136
136
  USDC: {
137
137
  symbol: 'USDC',
138
138
  decimals: 6,
139
- address: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
139
+ address: '0x5dd39b0b3610F666F631a6506b7713EF83e1Ac5C',
140
140
  mechanism: 'approve',
141
141
  },
142
142
  WETH: {
@@ -163,7 +163,7 @@ const TOKEN_META = {
163
163
  USDC: {
164
164
  symbol: 'USDC',
165
165
  decimals: 6,
166
- address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
166
+ address: '0x5c3504F0E3bA28FDc1F74234fE936518276AaBB8',
167
167
  mechanism: 'approve',
168
168
  },
169
169
  WETH: {
@@ -49,6 +49,8 @@ export interface OutboundObservation {
49
49
  blockHeight: number;
50
50
  txHash: string;
51
51
  errorMsg: string;
52
+ /** Field 5 — actual gas fee consumed on destination chain (proto types.proto:143). */
53
+ gasFeeUsed: string;
52
54
  }
53
55
  /**
54
56
  * RevertInstructions - Instructions for reverting the transaction
@@ -76,6 +78,18 @@ export interface OutboundTxV2 {
76
78
  outboundStatus: OutboundStatus;
77
79
  revertInstructions?: RevertInstructions | undefined;
78
80
  pcRevertExecution?: PCTx | undefined;
81
+ /** Field 16 — gas price on destination chain at time of outbound. */
82
+ gasPrice: string;
83
+ /** Field 17 — gas fee paid to relayer on destination chain. */
84
+ gasFee: string;
85
+ /** Field 18 — PC tx that executed the gas refund, non-nil if refund ran. */
86
+ pcRefundExecution?: PCTx | undefined;
87
+ /** Field 19 — non-empty if swap-refund failed and we fell back to no-swap. */
88
+ refundSwapError: string;
89
+ /** Field 20 — gas token PRC20 address used to pay relayer fee. */
90
+ gasToken: string;
91
+ /** Field 21 — Human-readable reason why the outbound was aborted. */
92
+ abortReason: string;
79
93
  }
80
94
  /**
81
95
  * UniversalTxV2 - Universal transaction with id field and repeated outbound_tx
@@ -198,7 +198,13 @@ exports.OriginatingPcTx = {
198
198
  },
199
199
  };
200
200
  function createBaseOutboundObservation() {
201
- return { success: false, blockHeight: 0, txHash: '', errorMsg: '' };
201
+ return {
202
+ success: false,
203
+ blockHeight: 0,
204
+ txHash: '',
205
+ errorMsg: '',
206
+ gasFeeUsed: '',
207
+ };
202
208
  }
203
209
  exports.OutboundObservation = {
204
210
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -210,6 +216,8 @@ exports.OutboundObservation = {
210
216
  writer.uint32(26).string(message.txHash);
211
217
  if (message.errorMsg !== '')
212
218
  writer.uint32(34).string(message.errorMsg);
219
+ if (message.gasFeeUsed !== '')
220
+ writer.uint32(42).string(message.gasFeeUsed);
213
221
  return writer;
214
222
  },
215
223
  decode(input, length) {
@@ -231,6 +239,9 @@ exports.OutboundObservation = {
231
239
  case 4:
232
240
  message.errorMsg = reader.string();
233
241
  break;
242
+ case 5:
243
+ message.gasFeeUsed = reader.string();
244
+ break;
234
245
  default:
235
246
  if ((tag & 7) === 4 || tag === 0)
236
247
  return message;
@@ -252,6 +263,9 @@ exports.OutboundObservation = {
252
263
  errorMsg: isSet(object.errorMsg)
253
264
  ? globalThis.String(object.errorMsg)
254
265
  : '',
266
+ gasFeeUsed: isSet(object.gasFeeUsed)
267
+ ? globalThis.String(object.gasFeeUsed)
268
+ : '',
255
269
  };
256
270
  },
257
271
  toJSON(message) {
@@ -264,15 +278,18 @@ exports.OutboundObservation = {
264
278
  obj.txHash = message.txHash;
265
279
  if (message.errorMsg !== '')
266
280
  obj.errorMsg = message.errorMsg;
281
+ if (message.gasFeeUsed !== '')
282
+ obj.gasFeeUsed = message.gasFeeUsed;
267
283
  return obj;
268
284
  },
269
285
  fromPartial(object) {
270
- var _a, _b, _c, _d;
286
+ var _a, _b, _c, _d, _e;
271
287
  const message = createBaseOutboundObservation();
272
288
  message.success = (_a = object.success) !== null && _a !== void 0 ? _a : false;
273
289
  message.blockHeight = (_b = object.blockHeight) !== null && _b !== void 0 ? _b : 0;
274
290
  message.txHash = (_c = object.txHash) !== null && _c !== void 0 ? _c : '';
275
291
  message.errorMsg = (_d = object.errorMsg) !== null && _d !== void 0 ? _d : '';
292
+ message.gasFeeUsed = (_e = object.gasFeeUsed) !== null && _e !== void 0 ? _e : '';
276
293
  return message;
277
294
  },
278
295
  };
@@ -341,6 +358,12 @@ function createBaseOutboundTxV2() {
341
358
  outboundStatus: 0,
342
359
  revertInstructions: undefined,
343
360
  pcRevertExecution: undefined,
361
+ gasPrice: '',
362
+ gasFee: '',
363
+ pcRefundExecution: undefined,
364
+ refundSwapError: '',
365
+ gasToken: '',
366
+ abortReason: '',
344
367
  };
345
368
  }
346
369
  // Import PCTx encoder from v1
@@ -377,6 +400,20 @@ exports.OutboundTxV2Codec = {
377
400
  exports.RevertInstructions.encode(message.revertInstructions, writer.uint32(114).fork()).join();
378
401
  if (message.pcRevertExecution !== undefined)
379
402
  types_3.PCTx.encode(message.pcRevertExecution, writer.uint32(122).fork()).join();
403
+ // Tag = (field<<3) | wire_type. wire_type=2 (length-delim) for string/msg.
404
+ if (message.gasPrice !== '')
405
+ writer.uint32(130).string(message.gasPrice); // field 16
406
+ if (message.gasFee !== '')
407
+ writer.uint32(138).string(message.gasFee); // field 17
408
+ if (message.pcRefundExecution !== undefined)
409
+ types_3.PCTx.encode(message.pcRefundExecution, writer.uint32(146).fork() // field 18
410
+ ).join();
411
+ if (message.refundSwapError !== '')
412
+ writer.uint32(154).string(message.refundSwapError); // field 19
413
+ if (message.gasToken !== '')
414
+ writer.uint32(162).string(message.gasToken); // field 20
415
+ if (message.abortReason !== '')
416
+ writer.uint32(170).string(message.abortReason); // field 21
380
417
  return writer;
381
418
  },
382
419
  decode(input, length) {
@@ -431,6 +468,24 @@ exports.OutboundTxV2Codec = {
431
468
  case 15:
432
469
  message.pcRevertExecution = types_3.PCTx.decode(reader, reader.uint32());
433
470
  break;
471
+ case 16:
472
+ message.gasPrice = reader.string();
473
+ break;
474
+ case 17:
475
+ message.gasFee = reader.string();
476
+ break;
477
+ case 18:
478
+ message.pcRefundExecution = types_3.PCTx.decode(reader, reader.uint32());
479
+ break;
480
+ case 19:
481
+ message.refundSwapError = reader.string();
482
+ break;
483
+ case 20:
484
+ message.gasToken = reader.string();
485
+ break;
486
+ case 21:
487
+ message.abortReason = reader.string();
488
+ break;
434
489
  default:
435
490
  if ((tag & 7) === 4 || tag === 0)
436
491
  return message;
@@ -477,6 +532,22 @@ exports.OutboundTxV2Codec = {
477
532
  pcRevertExecution: isSet(object.pcRevertExecution)
478
533
  ? types_3.PCTx.fromJSON(object.pcRevertExecution)
479
534
  : undefined,
535
+ gasPrice: isSet(object.gasPrice)
536
+ ? globalThis.String(object.gasPrice)
537
+ : '',
538
+ gasFee: isSet(object.gasFee) ? globalThis.String(object.gasFee) : '',
539
+ pcRefundExecution: isSet(object.pcRefundExecution)
540
+ ? types_3.PCTx.fromJSON(object.pcRefundExecution)
541
+ : undefined,
542
+ refundSwapError: isSet(object.refundSwapError)
543
+ ? globalThis.String(object.refundSwapError)
544
+ : '',
545
+ gasToken: isSet(object.gasToken)
546
+ ? globalThis.String(object.gasToken)
547
+ : '',
548
+ abortReason: isSet(object.abortReason)
549
+ ? globalThis.String(object.abortReason)
550
+ : '',
480
551
  };
481
552
  },
482
553
  toJSON(message) {
@@ -511,10 +582,22 @@ exports.OutboundTxV2Codec = {
511
582
  obj.revertInstructions = exports.RevertInstructions.toJSON(message.revertInstructions);
512
583
  if (message.pcRevertExecution !== undefined)
513
584
  obj.pcRevertExecution = types_3.PCTx.toJSON(message.pcRevertExecution);
585
+ if (message.gasPrice !== '')
586
+ obj.gasPrice = message.gasPrice;
587
+ if (message.gasFee !== '')
588
+ obj.gasFee = message.gasFee;
589
+ if (message.pcRefundExecution !== undefined)
590
+ obj.pcRefundExecution = types_3.PCTx.toJSON(message.pcRefundExecution);
591
+ if (message.refundSwapError !== '')
592
+ obj.refundSwapError = message.refundSwapError;
593
+ if (message.gasToken !== '')
594
+ obj.gasToken = message.gasToken;
595
+ if (message.abortReason !== '')
596
+ obj.abortReason = message.abortReason;
514
597
  return obj;
515
598
  },
516
599
  fromPartial(object) {
517
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
600
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
518
601
  const message = createBaseOutboundTxV2();
519
602
  message.destinationChain = (_a = object.destinationChain) !== null && _a !== void 0 ? _a : '';
520
603
  message.recipient = (_b = object.recipient) !== null && _b !== void 0 ? _b : '';
@@ -545,6 +628,16 @@ exports.OutboundTxV2Codec = {
545
628
  object.pcRevertExecution !== null
546
629
  ? types_3.PCTx.fromPartial(object.pcRevertExecution)
547
630
  : undefined;
631
+ message.gasPrice = (_m = object.gasPrice) !== null && _m !== void 0 ? _m : '';
632
+ message.gasFee = (_o = object.gasFee) !== null && _o !== void 0 ? _o : '';
633
+ message.pcRefundExecution =
634
+ object.pcRefundExecution !== undefined &&
635
+ object.pcRefundExecution !== null
636
+ ? types_3.PCTx.fromPartial(object.pcRefundExecution)
637
+ : undefined;
638
+ message.refundSwapError = (_p = object.refundSwapError) !== null && _p !== void 0 ? _p : '';
639
+ message.gasToken = (_q = object.gasToken) !== null && _q !== void 0 ? _q : '';
640
+ message.abortReason = (_r = object.abortReason) !== null && _r !== void 0 ? _r : '';
548
641
  return message;
549
642
  },
550
643
  };
@@ -19,7 +19,7 @@ export declare function prepareTransaction(ctx: OrchestratorContext, params: Uni
19
19
  export declare function buildHopDescriptor(ctx: OrchestratorContext, params: UniversalExecuteParams, route: TransactionRoute, ueaAddress: `0x${string}`): Promise<HopDescriptor>;
20
20
  export declare function classifyIntoSegments(hops: HopDescriptor[]): CascadeSegment[];
21
21
  export declare function getSegmentType(route: string): CascadeSegmentType;
22
- export declare function composeCascade(ctx: OrchestratorContext, segments: CascadeSegment[], ueaAddress: `0x${string}`, ueaBalance?: bigint, ueaNonce?: bigint): MultiCall[];
22
+ export declare function composeCascade(ctx: OrchestratorContext, segments: CascadeSegment[], ueaAddress: `0x${string}`, ueaBalance?: bigint, ueaNonce?: bigint): Promise<MultiCall[]>;
23
23
  export declare function createCascadedBuilder(ctx: OrchestratorContext, preparedTxs: PreparedUniversalTx[], callbacks: CascadeCallbacks): {
24
24
  send: () => Promise<CascadedTxResponse>;
25
25
  };