@pushchain/core 0.1.17 → 0.1.18
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/README.md +11 -226
- package/package.json +1 -1
- package/src/lib/constants/abi/factoryV1.d.ts +15 -16
- package/src/lib/constants/abi/factoryV1.js +276 -193
- package/src/lib/constants/abi/factoryV1.js.map +1 -1
- package/src/lib/constants/abi/feeLocker.evm.d.ts +22 -22
- package/src/lib/constants/abi/feeLocker.evm.js +273 -229
- package/src/lib/constants/abi/feeLocker.evm.js.map +1 -1
- package/src/lib/constants/abi/index.d.ts +2 -2
- package/src/lib/constants/abi/index.js +5 -5
- package/src/lib/constants/abi/index.js.map +1 -1
- package/src/lib/constants/abi/{smartAccount.evm.d.ts → uea.evm.d.ts} +15 -22
- package/src/lib/constants/abi/{smartAccount.evm.js → uea.evm.js} +49 -59
- package/src/lib/constants/abi/uea.evm.js.map +1 -0
- package/src/lib/constants/abi/{smartAccount.svm.d.ts → uea.svm.d.ts} +15 -22
- package/src/lib/constants/abi/{smartAccount.svm.js → uea.svm.js} +49 -59
- package/src/lib/constants/abi/uea.svm.js.map +1 -0
- package/src/lib/constants/chain.js +7 -7
- package/src/lib/constants/chain.js.map +1 -1
- package/src/lib/constants/index.d.ts +0 -1
- package/src/lib/constants/viem-push-testnet.d.ts +0 -1
- package/src/lib/generated/v1/tx.d.ts +44 -31
- package/src/lib/generated/v1/tx.js +120 -157
- package/src/lib/generated/v1/tx.js.map +1 -1
- package/src/lib/orchestrator/orchestrator.d.ts +28 -21
- package/src/lib/orchestrator/orchestrator.js +170 -218
- package/src/lib/orchestrator/orchestrator.js.map +1 -1
- package/src/lib/orchestrator/orchestrator.types.d.ts +1 -1
- package/src/lib/price-fetch/price-fetch.js +23 -13
- package/src/lib/price-fetch/price-fetch.js.map +1 -1
- package/src/lib/push-client/push-client.d.ts +10 -3
- package/src/lib/push-client/push-client.js +25 -6
- package/src/lib/push-client/push-client.js.map +1 -1
- package/src/lib/pushChain.d.ts +28 -13
- package/src/lib/pushChain.js +33 -9
- package/src/lib/pushChain.js.map +1 -1
- package/src/lib/universal/account/account.js +3 -11
- package/src/lib/universal/account/account.js.map +1 -1
- package/src/lib/vm-client/svm-client.js +1 -1
- package/src/lib/vm-client/svm-client.js.map +1 -1
- package/src/lib/constants/abi/smartAccount.evm.js.map +0 -1
- package/src/lib/constants/abi/smartAccount.svm.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CHAIN, PUSH_NETWORK } from '../constants/enums';
|
|
2
2
|
import { UniversalAccount, UniversalSigner } from '../universal/universal.types';
|
|
3
3
|
import { ExecuteParams } from './orchestrator.types';
|
|
4
|
-
import {
|
|
4
|
+
import { UniversalPayload } from '../generated/v1/tx';
|
|
5
|
+
import { DeliverTxResponse } from '@cosmjs/stargate';
|
|
5
6
|
export declare class Orchestrator {
|
|
6
7
|
private readonly universalSigner;
|
|
7
8
|
private readonly rpcUrls;
|
|
@@ -11,7 +12,7 @@ export declare class Orchestrator {
|
|
|
11
12
|
/**
|
|
12
13
|
* Executes an interaction on Push Chain
|
|
13
14
|
*/
|
|
14
|
-
execute(execute: ExecuteParams): Promise<
|
|
15
|
+
execute(execute: ExecuteParams): Promise<DeliverTxResponse>;
|
|
15
16
|
/**
|
|
16
17
|
* Locks a fee on the origin chain by interacting with the chain's fee-locker contract.
|
|
17
18
|
*
|
|
@@ -20,47 +21,53 @@ export declare class Orchestrator {
|
|
|
20
21
|
* @returns Transaction hash of the locking transaction
|
|
21
22
|
*/
|
|
22
23
|
private lockFee;
|
|
23
|
-
private
|
|
24
|
+
private signUniversalPayload;
|
|
24
25
|
/**
|
|
25
26
|
* Sends a custom Cosmos tx to Push Chain (gasless) to execute user intent.
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
+
sendUniversalTx(isUEADeployed: boolean, feeLockTxHash?: string, universalPayload?: UniversalPayload, signature?: Uint8Array): Promise<DeliverTxResponse>;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
* Used to differentiate logic for Push-native interactions vs external chains.
|
|
31
|
-
*
|
|
32
|
-
* @param chain - The chain identifier (e.g., PUSH_MAINNET, PUSH_TESTNET_DONUT)
|
|
33
|
-
* @returns True if the chain is a Push chain, false otherwise.
|
|
34
|
-
*/
|
|
35
|
-
private isPushChain;
|
|
36
|
-
/**
|
|
37
|
-
* Computes the EIP-712 digest hash for the CrossChainPayload structure.
|
|
30
|
+
* Computes the EIP-712 digest hash for the UniversalPayload structure.
|
|
38
31
|
* This is the message that should be signed by the user's wallet (e.g., Solana signer).
|
|
39
32
|
*
|
|
40
33
|
* The resulting hash is equivalent to:
|
|
41
34
|
* keccak256("\x19\x01" || domainSeparator || structHash)
|
|
42
35
|
*
|
|
43
36
|
* @param chainId - EVM chain ID of the destination chain (Push Chain)
|
|
44
|
-
* @param verifyingContract - Address of the verifying contract (i.e., the user's
|
|
37
|
+
* @param verifyingContract - Address of the verifying contract (i.e., the user's UEA smart wallet)
|
|
45
38
|
* @param version - Optional EIP-712 domain version (default: '0.1.0')
|
|
46
|
-
* @param payload - Execution details encoded into the
|
|
39
|
+
* @param payload - Execution details encoded into the UniversalPayload struct
|
|
47
40
|
* @returns keccak256 digest to be signed by the user
|
|
48
41
|
*/
|
|
49
42
|
private computeExecutionHash;
|
|
50
43
|
/**
|
|
51
|
-
* Computes
|
|
44
|
+
* Computes UEA for given UniversalAccount
|
|
45
|
+
* @dev - This fn calls a view fn of Factory Contract
|
|
46
|
+
* @returns UEA Address with Deployment Status
|
|
52
47
|
*/
|
|
53
|
-
|
|
48
|
+
computeUEA(): Promise<{
|
|
54
49
|
address: `0x${string}`;
|
|
55
50
|
deployed: boolean;
|
|
56
51
|
}>;
|
|
57
|
-
|
|
52
|
+
computeUEAOffchain(): `0x${string}`;
|
|
58
53
|
/**
|
|
59
54
|
* @dev - Although as of now nonce var is same in evm & svm so switch conditions does not matter
|
|
60
|
-
* @param address
|
|
61
|
-
* @returns
|
|
55
|
+
* @param address UEA address
|
|
56
|
+
* @returns UEA current nonce
|
|
62
57
|
*/
|
|
63
|
-
private
|
|
58
|
+
private getUEANonce;
|
|
64
59
|
getUOA(): UniversalAccount;
|
|
65
60
|
private waitForLockerFeeConfirmation;
|
|
61
|
+
/********************************** HELPER FUNCTIONS **************************************************/
|
|
62
|
+
private bigintReplacer;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if the given chain belongs to the Push Chain ecosystem.
|
|
65
|
+
* Used to differentiate logic for Push-native interactions vs external chains.
|
|
66
|
+
*
|
|
67
|
+
* @param chain - The chain identifier (e.g., PUSH_MAINNET, PUSH_TESTNET_DONUT)
|
|
68
|
+
* @returns True if the chain is a Push chain, false otherwise.
|
|
69
|
+
*/
|
|
70
|
+
private isPushChain;
|
|
71
|
+
private validateMainnetConnection;
|
|
72
|
+
private printLog;
|
|
66
73
|
}
|