@veridex/sdk 1.0.0-beta.22 → 1.0.0-beta.24
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/dist/EVMClient-CoOR_ywD.d.mts +332 -0
- package/dist/auth/prepareAuth.d.mts +1 -1
- package/dist/auth/prepareAuth.js +749 -3
- package/dist/auth/prepareAuth.js.map +1 -1
- package/dist/auth/prepareAuth.mjs +25 -1404
- package/dist/auth/prepareAuth.mjs.map +1 -1
- package/dist/chains/aptos/index.d.mts +1 -1
- package/dist/chains/aptos/index.mjs +5 -574
- package/dist/chains/aptos/index.mjs.map +1 -1
- package/dist/chains/avalanche/index.d.mts +137 -0
- package/dist/chains/avalanche/index.js +1407 -0
- package/dist/chains/avalanche/index.js.map +1 -0
- package/dist/chains/avalanche/index.mjs +10 -0
- package/dist/chains/avalanche/index.mjs.map +1 -0
- package/dist/chains/evm/index.d.mts +4 -2
- package/dist/chains/evm/index.mjs +8 -1200
- package/dist/chains/evm/index.mjs.map +1 -1
- package/dist/chains/solana/index.d.mts +1 -1
- package/dist/chains/solana/index.mjs +4 -486
- package/dist/chains/solana/index.mjs.map +1 -1
- package/dist/chains/stacks/index.d.mts +1 -1
- package/dist/chains/stacks/index.mjs +36 -1114
- package/dist/chains/stacks/index.mjs.map +1 -1
- package/dist/chains/starknet/index.d.mts +1 -1
- package/dist/chains/starknet/index.mjs +5 -503
- package/dist/chains/starknet/index.mjs.map +1 -1
- package/dist/chains/sui/index.d.mts +1 -1
- package/dist/chains/sui/index.mjs +5 -529
- package/dist/chains/sui/index.mjs.map +1 -1
- package/dist/chunk-3Q34PMHU.mjs +840 -0
- package/dist/chunk-3Q34PMHU.mjs.map +1 -0
- package/dist/chunk-72ZA3OYQ.mjs +20 -0
- package/dist/chunk-72ZA3OYQ.mjs.map +1 -0
- package/dist/chunk-7IEUU6LD.mjs +549 -0
- package/dist/chunk-7IEUU6LD.mjs.map +1 -0
- package/dist/chunk-ABLEEC5N.mjs +38 -0
- package/dist/chunk-ABLEEC5N.mjs.map +1 -0
- package/dist/chunk-AORSW75A.mjs +1101 -0
- package/dist/chunk-AORSW75A.mjs.map +1 -0
- package/dist/chunk-BKTCPT7P.mjs +269 -0
- package/dist/chunk-BKTCPT7P.mjs.map +1 -0
- package/dist/chunk-CCHASDAI.mjs +330 -0
- package/dist/chunk-CCHASDAI.mjs.map +1 -0
- package/dist/chunk-FQ2WU7PX.mjs +509 -0
- package/dist/chunk-FQ2WU7PX.mjs.map +1 -0
- package/dist/chunk-JO74ENTF.mjs +417 -0
- package/dist/chunk-JO74ENTF.mjs.map +1 -0
- package/dist/chunk-K73Y36KS.mjs +407 -0
- package/dist/chunk-K73Y36KS.mjs.map +1 -0
- package/dist/chunk-KHV3EP3I.mjs +179 -0
- package/dist/chunk-KHV3EP3I.mjs.map +1 -0
- package/dist/chunk-MMSTOW4F.mjs +722 -0
- package/dist/chunk-MMSTOW4F.mjs.map +1 -0
- package/dist/chunk-MWZ5UHCF.mjs +1082 -0
- package/dist/chunk-MWZ5UHCF.mjs.map +1 -0
- package/dist/chunk-NU6JGI7L.mjs +565 -0
- package/dist/chunk-NU6JGI7L.mjs.map +1 -0
- package/dist/chunk-PIC2Y5DF.mjs +422 -0
- package/dist/chunk-PIC2Y5DF.mjs.map +1 -0
- package/dist/chunk-PPN7BG3A.mjs +464 -0
- package/dist/chunk-PPN7BG3A.mjs.map +1 -0
- package/dist/chunk-RSV7J43V.mjs +438 -0
- package/dist/chunk-RSV7J43V.mjs.map +1 -0
- package/dist/chunk-UTT6KI7N.mjs +216 -0
- package/dist/chunk-UTT6KI7N.mjs.map +1 -0
- package/dist/constants.mjs +16 -389
- package/dist/constants.mjs.map +1 -1
- package/dist/index-Du1PoZqu.d.mts +216 -0
- package/dist/index.d.mts +131 -9
- package/dist/index.js +12064 -11594
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4407 -12273
- package/dist/index.mjs.map +1 -1
- package/dist/passkey.d.mts +142 -0
- package/dist/passkey.js +807 -0
- package/dist/passkey.js.map +1 -0
- package/dist/passkey.mjs +15 -0
- package/dist/passkey.mjs.map +1 -0
- package/dist/payload.mjs +25 -244
- package/dist/payload.mjs.map +1 -1
- package/dist/portfolio-UV3LLWKI.mjs +13 -0
- package/dist/portfolio-UV3LLWKI.mjs.map +1 -0
- package/dist/queries/index.js +39 -1
- package/dist/queries/index.js.map +1 -1
- package/dist/queries/index.mjs +14 -1591
- package/dist/queries/index.mjs.map +1 -1
- package/dist/{types-DakHNZIP.d.ts → types-Bmk689Lw.d.mts} +1 -1
- package/dist/types.d.mts +10 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.mjs +19 -385
- package/dist/utils.mjs.map +1 -1
- package/dist/wormhole.mjs +25 -397
- package/dist/wormhole.mjs.map +1 -1
- package/package.json +11 -1
- package/dist/auth/prepareAuth.d.ts +0 -25
- package/dist/chains/aptos/index.d.ts +0 -146
- package/dist/chains/evm/index.d.ts +0 -5
- package/dist/chains/solana/index.d.ts +0 -116
- package/dist/chains/stacks/index.d.ts +0 -559
- package/dist/chains/starknet/index.d.ts +0 -172
- package/dist/chains/sui/index.d.ts +0 -182
- package/dist/constants.d.ts +0 -150
- package/dist/index-Dy29mvBf.d.mts +0 -683
- package/dist/index-eXXqodd0.d.ts +0 -683
- package/dist/index.d.ts +0 -3442
- package/dist/payload.d.ts +0 -125
- package/dist/queries/index.d.ts +0 -148
- package/dist/types-DakHNZIP.d.mts +0 -571
- package/dist/types-DvFRnIBd.d.ts +0 -172
- package/dist/types.d.ts +0 -413
- package/dist/utils.d.ts +0 -81
- package/dist/wormhole.d.ts +0 -167
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { Aptos } from '@aptos-labs/ts-sdk';
|
|
2
|
-
import { f as ChainClient, a as ChainConfig, T as TransferParams, E as ExecuteParams, B as BridgeParams, w as WebAuthnSignature, D as DispatchResult, j as VaultCreationResult } from '../../types-DakHNZIP.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Veridex Protocol SDK - Aptos Chain Client
|
|
6
|
-
*
|
|
7
|
-
* Implementation of ChainClient interface for Aptos blockchain
|
|
8
|
-
* Updated to use @aptos-labs/ts-sdk v5.x
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
interface AptosClientConfig {
|
|
12
|
-
wormholeChainId: number;
|
|
13
|
-
rpcUrl: string;
|
|
14
|
-
moduleAddress: string;
|
|
15
|
-
wormholeCoreBridge: string;
|
|
16
|
-
tokenBridge: string;
|
|
17
|
-
network?: 'mainnet' | 'testnet' | 'devnet';
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Aptos implementation of the ChainClient interface
|
|
21
|
-
*/
|
|
22
|
-
declare class AptosClient implements ChainClient {
|
|
23
|
-
private config;
|
|
24
|
-
private client;
|
|
25
|
-
private moduleAddress;
|
|
26
|
-
constructor(config: AptosClientConfig);
|
|
27
|
-
getConfig(): ChainConfig;
|
|
28
|
-
getNonce(userKeyHash: string): Promise<bigint>;
|
|
29
|
-
getMessageFee(): Promise<bigint>;
|
|
30
|
-
buildTransferPayload(params: TransferParams): Promise<string>;
|
|
31
|
-
buildExecutePayload(params: ExecuteParams): Promise<string>;
|
|
32
|
-
buildBridgePayload(params: BridgeParams): Promise<string>;
|
|
33
|
-
dispatch(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, signer: any): Promise<DispatchResult>;
|
|
34
|
-
/**
|
|
35
|
-
* Dispatch an action via relayer (gasless)
|
|
36
|
-
* Note: On Aptos, this still goes through the Hub chain
|
|
37
|
-
* Aptos is a spoke-only chain in Veridex architecture
|
|
38
|
-
*/
|
|
39
|
-
dispatchGasless(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, relayerUrl: string): Promise<DispatchResult>;
|
|
40
|
-
/**
|
|
41
|
-
* Get vault address from on-chain VaultRegistry.
|
|
42
|
-
* Queries the get_vault_address view function which looks up the vault in the registry.
|
|
43
|
-
*/
|
|
44
|
-
getVaultAddress(userKeyHash: string): Promise<string | null>;
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated Use getVaultAddress() instead - this method uses incorrect address derivation.
|
|
47
|
-
* On Aptos, vaults are created as named objects by the relayer, not resource accounts.
|
|
48
|
-
* The vault address depends on which relayer created it, so must be queried on-chain.
|
|
49
|
-
*/
|
|
50
|
-
computeVaultAddress(userKeyHash: string): string;
|
|
51
|
-
private computeVaultAddressFromHash;
|
|
52
|
-
/**
|
|
53
|
-
* Convert hex string to Uint8Array (browser-compatible)
|
|
54
|
-
*/
|
|
55
|
-
private hexToBytes;
|
|
56
|
-
vaultExists(userKeyHash: string): Promise<boolean>;
|
|
57
|
-
createVault(userKeyHash: string, signer: any): Promise<VaultCreationResult>;
|
|
58
|
-
createVaultSponsored?(userKeyHash: string, sponsorPrivateKey: string, rpcUrl?: string): Promise<VaultCreationResult>;
|
|
59
|
-
/**
|
|
60
|
-
* Create a vault via the relayer (sponsored/gasless)
|
|
61
|
-
* This is the recommended way to create Aptos vaults
|
|
62
|
-
*
|
|
63
|
-
* The relayer will dispatch a vault creation action from Hub to Aptos spoke
|
|
64
|
-
*/
|
|
65
|
-
createVaultViaRelayer(userKeyHash: string, relayerUrl: string): Promise<VaultCreationResult>;
|
|
66
|
-
/**
|
|
67
|
-
* Get vault info via relayer (includes existence check)
|
|
68
|
-
*/
|
|
69
|
-
getVaultViaRelayer(userKeyHash: string, relayerUrl: string): Promise<{
|
|
70
|
-
vaultAddress: string;
|
|
71
|
-
exists: boolean;
|
|
72
|
-
}>;
|
|
73
|
-
estimateVaultCreationGas(userKeyHash: string): Promise<bigint>;
|
|
74
|
-
getFactoryAddress(): string | undefined;
|
|
75
|
-
getImplementationAddress(): string | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Get native APT balance
|
|
78
|
-
*/
|
|
79
|
-
getNativeBalance(address: string): Promise<bigint>;
|
|
80
|
-
/**
|
|
81
|
-
* Get fungible asset (FA) or coin balance
|
|
82
|
-
*/
|
|
83
|
-
getTokenBalance(tokenAddress: string, ownerAddress: string): Promise<bigint>;
|
|
84
|
-
/**
|
|
85
|
-
* Compute key hash from public key coordinates
|
|
86
|
-
* Matches EVM keccak256(abi.encode(publicKeyX, publicKeyY))
|
|
87
|
-
*/
|
|
88
|
-
private computeKeyHash;
|
|
89
|
-
/**
|
|
90
|
-
* Build message for signing (matches Hub chain format)
|
|
91
|
-
*/
|
|
92
|
-
private buildMessage;
|
|
93
|
-
/**
|
|
94
|
-
* Get Aptos client instance for advanced usage
|
|
95
|
-
*/
|
|
96
|
-
getClient(): Aptos;
|
|
97
|
-
/**
|
|
98
|
-
* Get module address
|
|
99
|
-
*/
|
|
100
|
-
getModuleAddress(): string;
|
|
101
|
-
/**
|
|
102
|
-
* Get current ledger version
|
|
103
|
-
*/
|
|
104
|
-
getLedgerVersion(): Promise<bigint>;
|
|
105
|
-
/**
|
|
106
|
-
* Get transaction by hash
|
|
107
|
-
*/
|
|
108
|
-
getTransaction(txHash: string): Promise<any>;
|
|
109
|
-
/**
|
|
110
|
-
* Wait for transaction confirmation
|
|
111
|
-
*/
|
|
112
|
-
waitForTransaction(txHash: string, timeoutSecs?: number): Promise<any>;
|
|
113
|
-
/**
|
|
114
|
-
* Get vault resource for an owner
|
|
115
|
-
*
|
|
116
|
-
* @param ownerKeyHash - Owner's passkey hash (32 bytes as hex)
|
|
117
|
-
* @returns Vault resource data or null if not found
|
|
118
|
-
*/
|
|
119
|
-
getVaultResource(ownerKeyHash: string): Promise<{
|
|
120
|
-
ownerKeyHash: string;
|
|
121
|
-
authorizedSigners: string[];
|
|
122
|
-
nonce: bigint;
|
|
123
|
-
} | null>;
|
|
124
|
-
/**
|
|
125
|
-
* Get authorized signers for a vault
|
|
126
|
-
*
|
|
127
|
-
* @param ownerKeyHash - Owner's passkey hash (32 bytes as hex)
|
|
128
|
-
* @returns Array of authorized signer key hashes
|
|
129
|
-
*/
|
|
130
|
-
getAuthorizedSigners(ownerKeyHash: string): Promise<string[]>;
|
|
131
|
-
/**
|
|
132
|
-
* Check if a VAA has been processed (for replay protection)
|
|
133
|
-
*
|
|
134
|
-
* @param vaaHash - VAA hash as hex string
|
|
135
|
-
* @returns Whether the VAA has been processed
|
|
136
|
-
*/
|
|
137
|
-
isVaaProcessed(vaaHash: string): Promise<boolean>;
|
|
138
|
-
/**
|
|
139
|
-
* Check if protocol is paused
|
|
140
|
-
*
|
|
141
|
-
* @returns Whether the protocol is paused
|
|
142
|
-
*/
|
|
143
|
-
isProtocolPaused(): Promise<boolean>;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export { AptosClient, type AptosClientConfig };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
|
-
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import { f as ChainClient, a as ChainConfig, T as TransferParams, E as ExecuteParams, B as BridgeParams, w as WebAuthnSignature, D as DispatchResult, j as VaultCreationResult } from '../../types-DakHNZIP.js';
|
|
4
|
-
|
|
5
|
-
interface SolanaClientConfig {
|
|
6
|
-
wormholeChainId: number;
|
|
7
|
-
rpcUrl: string;
|
|
8
|
-
programId: string;
|
|
9
|
-
wormholeCoreBridge: string;
|
|
10
|
-
tokenBridge: string;
|
|
11
|
-
network?: 'mainnet' | 'devnet' | 'testnet';
|
|
12
|
-
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Solana implementation of the ChainClient interface
|
|
16
|
-
*/
|
|
17
|
-
declare class SolanaClient implements ChainClient {
|
|
18
|
-
private config;
|
|
19
|
-
private connection;
|
|
20
|
-
private programId;
|
|
21
|
-
constructor(config: SolanaClientConfig);
|
|
22
|
-
getConfig(): ChainConfig;
|
|
23
|
-
getNonce(userKeyHash: string): Promise<bigint>;
|
|
24
|
-
getMessageFee(): Promise<bigint>;
|
|
25
|
-
buildTransferPayload(params: TransferParams): Promise<string>;
|
|
26
|
-
buildExecutePayload(params: ExecuteParams): Promise<string>;
|
|
27
|
-
buildBridgePayload(params: BridgeParams): Promise<string>;
|
|
28
|
-
dispatch(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, signer: any): Promise<DispatchResult>;
|
|
29
|
-
/**
|
|
30
|
-
* Dispatch an action via relayer (gasless)
|
|
31
|
-
* Note: On Solana, this still goes through the Hub chain
|
|
32
|
-
* Solana is a spoke-only chain in Veridex architecture
|
|
33
|
-
*/
|
|
34
|
-
dispatchGasless(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, relayerUrl: string): Promise<DispatchResult>;
|
|
35
|
-
getVaultAddress(userKeyHash: string): Promise<string | null>;
|
|
36
|
-
/**
|
|
37
|
-
* Compute vault address using PDA (Program Derived Address)
|
|
38
|
-
* Seeds: ["vault", userKeyHash]
|
|
39
|
-
*/
|
|
40
|
-
computeVaultAddress(userKeyHash: string): string;
|
|
41
|
-
private computeVaultAddressFromHash;
|
|
42
|
-
vaultExists(userKeyHash: string): Promise<boolean>;
|
|
43
|
-
createVault(userKeyHash: string, signer: any): Promise<VaultCreationResult>;
|
|
44
|
-
createVaultSponsored?(userKeyHash: string, sponsorPrivateKey: string, rpcUrl?: string): Promise<VaultCreationResult>;
|
|
45
|
-
/**
|
|
46
|
-
* Create a vault via the relayer (sponsored/gasless)
|
|
47
|
-
* This is the recommended way to create Solana vaults
|
|
48
|
-
*/
|
|
49
|
-
createVaultViaRelayer(userKeyHash: string, relayerUrl: string): Promise<VaultCreationResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Get vault info via relayer (includes existence check)
|
|
52
|
-
*/
|
|
53
|
-
getVaultViaRelayer(userKeyHash: string, relayerUrl: string): Promise<{
|
|
54
|
-
vaultAddress: string;
|
|
55
|
-
exists: boolean;
|
|
56
|
-
}>;
|
|
57
|
-
estimateVaultCreationGas(userKeyHash: string): Promise<bigint>;
|
|
58
|
-
getFactoryAddress(): string | undefined;
|
|
59
|
-
getImplementationAddress(): string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Get native SOL balance
|
|
62
|
-
*/
|
|
63
|
-
getNativeBalance(address: string): Promise<bigint>;
|
|
64
|
-
/**
|
|
65
|
-
* Get SPL token balance
|
|
66
|
-
*/
|
|
67
|
-
getTokenBalance(tokenAddress: string, ownerAddress: string): Promise<bigint>;
|
|
68
|
-
/**
|
|
69
|
-
* Compute key hash from public key coordinates
|
|
70
|
-
* Matches EVM keccak256(abi.encode(publicKeyX, publicKeyY))
|
|
71
|
-
*/
|
|
72
|
-
private computeKeyHash;
|
|
73
|
-
/**
|
|
74
|
-
* Build message for signing (matches Hub chain format)
|
|
75
|
-
*/
|
|
76
|
-
private buildMessage;
|
|
77
|
-
/**
|
|
78
|
-
* Get connection instance for advanced usage
|
|
79
|
-
*/
|
|
80
|
-
getConnection(): Connection;
|
|
81
|
-
/**
|
|
82
|
-
* Get program ID
|
|
83
|
-
*/
|
|
84
|
-
getProgramId(): PublicKey;
|
|
85
|
-
/**
|
|
86
|
-
* Get current slot
|
|
87
|
-
*/
|
|
88
|
-
getSlot(): Promise<number>;
|
|
89
|
-
/**
|
|
90
|
-
* Get transaction status
|
|
91
|
-
*/
|
|
92
|
-
getTransaction(signature: string, commitment?: 'confirmed' | 'finalized'): Promise<_solana_web3_js.VersionedTransactionResponse | null>;
|
|
93
|
-
/**
|
|
94
|
-
* Check if a recovery VAA has been executed on this spoke
|
|
95
|
-
*
|
|
96
|
-
* @param vaaHash - Hash of the recovery VAA
|
|
97
|
-
* @returns Whether the VAA has been processed
|
|
98
|
-
*/
|
|
99
|
-
isRecoveryExecuted(vaaHash: string): Promise<boolean>;
|
|
100
|
-
/**
|
|
101
|
-
* Get vault owner after potential recovery
|
|
102
|
-
*
|
|
103
|
-
* @param vaultAddress - Vault address to check
|
|
104
|
-
* @returns Current owner key hash
|
|
105
|
-
*/
|
|
106
|
-
getVaultOwner(vaultAddress: string): Promise<string>;
|
|
107
|
-
/**
|
|
108
|
-
* Get authorized signers for a vault
|
|
109
|
-
*
|
|
110
|
-
* @param vaultAddress - Vault address to check
|
|
111
|
-
* @returns Array of authorized signer key hashes
|
|
112
|
-
*/
|
|
113
|
-
getAuthorizedSigners(vaultAddress: string): Promise<string[]>;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export { SolanaClient, type SolanaClientConfig };
|