@pushchain/core 3.0.8 → 4.0.0

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.
@@ -1,3 +1,4 @@
1
1
  import { PushChain } from './push-chain/push-chain';
2
2
  export type { ConversionQuote } from './constants/tokens';
3
+ export type { UniversalSigner, UniversalAccount, UniversalSignerSkeleton, } from './universal/universal.types';
3
4
  export { PushChain };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAG3C,0FAHA,sBAAS,OAGA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAQ3C,0FARA,sBAAS,OAQA"}
@@ -1,9 +1,8 @@
1
1
  import { CHAIN, PUSH_NETWORK } from '../constants/enums';
2
- import { UniversalAccount, UniversalSigner } from '../universal/universal.types';
3
- import { ExecuteParams } from './orchestrator.types';
4
- import { ProgressEvent } from '../progress-hook/progress-hook.types';
5
- import { UniversalTxResponse } from './orchestrator.types';
6
2
  import { ConversionQuote, MoveableToken, PayableToken } from '../constants/tokens';
3
+ import { ProgressEvent } from '../progress-hook/progress-hook.types';
4
+ import { UniversalAccount, UniversalSigner } from '../universal/universal.types';
5
+ import { ExecuteParams, UniversalTxResponse } from './orchestrator.types';
7
6
  export declare class Orchestrator {
8
7
  private readonly universalSigner;
9
8
  private pushNetwork;
@@ -32,6 +31,18 @@ export declare class Orchestrator {
32
31
  * @returns Transaction hash bytes
33
32
  */
34
33
  private lockFee;
34
+ private _buildUniversalTxRequest;
35
+ /**
36
+ * Builds the SVM UniversalTxRequest object from an existing EVM-style UniversalTxRequest.
37
+ * This allows reusing the same request shape for both EVM and SVM while only translating
38
+ * field encodings (addresses, bytes) to the Solana program format.
39
+ */
40
+ private _buildSvmUniversalTxRequestFromReq;
41
+ /**
42
+ * Builds the SVM UniversalTxRequest object expected by the Solana gateway program.
43
+ * Shape mirrors the request used in `svm-gateway` tests.
44
+ */
45
+ private _buildSvmUniversalTxRequest;
35
46
  private signUniversalPayload;
36
47
  /**
37
48
  * Sends a custom Cosmos tx to Push Chain (gasless) to execute user intent.
@@ -58,6 +69,25 @@ export declare class Orchestrator {
58
69
  * @returns keccak256 digest to be signed by the user
59
70
  */
60
71
  private computeExecutionHash;
72
+ /**
73
+ * ABI-encodes a UniversalPayload struct to bytes, matching the Solidity layout.
74
+ * This mirrors abi.encode(UniversalPayload) in the EVM contracts.
75
+ */
76
+ private encodeUniversalPayload;
77
+ /**
78
+ * Encodes a UniversalPayload into Borsh bytes for the SVM universal gateway.
79
+ * Layout mirrors Rust `UniversalPayload`:
80
+ * to: [u8; 20],
81
+ * value: u64,
82
+ * data: Vec<u8> (u32 LE len + bytes),
83
+ * gas_limit: u64,
84
+ * max_fee_per_gas: u64,
85
+ * max_priority_fee_per_gas: u64,
86
+ * nonce: u64,
87
+ * deadline: i64,
88
+ * v_type: u8 (0 = SignedVerification, 1 = UniversalTxVerification)
89
+ */
90
+ private encodeUniversalPayloadSvm;
61
91
  /**
62
92
  * Computes UEA for given UniversalAccount
63
93
  * @dev - This fn calls a view fn of Factory Contract
@@ -79,6 +109,11 @@ export declare class Orchestrator {
79
109
  private getUEANonce;
80
110
  getUOA(): UniversalAccount;
81
111
  private waitForLockerFeeConfirmation;
112
+ /**
113
+ * Internal helper: fetches the full origin-chain transaction for a given hash,
114
+ * used only for progress-hook context (EVM or Solana).
115
+ */
116
+ private fetchOriginChainTransactionForProgress;
82
117
  /**
83
118
  * Quotes exact-output on Uniswap V3 for EVM origin chains using QuoterV2.
84
119
  * Returns the minimum required input (amountIn) to receive the target amountOut.