@veridex/sdk 1.0.0-beta.22 → 1.0.0-beta.23

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 (112) hide show
  1. package/dist/EVMClient-CoOR_ywD.d.mts +332 -0
  2. package/dist/auth/prepareAuth.d.mts +1 -1
  3. package/dist/auth/prepareAuth.js +749 -3
  4. package/dist/auth/prepareAuth.js.map +1 -1
  5. package/dist/auth/prepareAuth.mjs +25 -1404
  6. package/dist/auth/prepareAuth.mjs.map +1 -1
  7. package/dist/chains/aptos/index.d.mts +1 -1
  8. package/dist/chains/aptos/index.mjs +5 -574
  9. package/dist/chains/aptos/index.mjs.map +1 -1
  10. package/dist/chains/avalanche/index.d.mts +137 -0
  11. package/dist/chains/avalanche/index.js +1407 -0
  12. package/dist/chains/avalanche/index.js.map +1 -0
  13. package/dist/chains/avalanche/index.mjs +10 -0
  14. package/dist/chains/avalanche/index.mjs.map +1 -0
  15. package/dist/chains/evm/index.d.mts +4 -2
  16. package/dist/chains/evm/index.mjs +8 -1200
  17. package/dist/chains/evm/index.mjs.map +1 -1
  18. package/dist/chains/solana/index.d.mts +1 -1
  19. package/dist/chains/solana/index.mjs +4 -486
  20. package/dist/chains/solana/index.mjs.map +1 -1
  21. package/dist/chains/stacks/index.d.mts +1 -1
  22. package/dist/chains/stacks/index.mjs +36 -1114
  23. package/dist/chains/stacks/index.mjs.map +1 -1
  24. package/dist/chains/starknet/index.d.mts +1 -1
  25. package/dist/chains/starknet/index.mjs +5 -503
  26. package/dist/chains/starknet/index.mjs.map +1 -1
  27. package/dist/chains/sui/index.d.mts +1 -1
  28. package/dist/chains/sui/index.mjs +5 -529
  29. package/dist/chains/sui/index.mjs.map +1 -1
  30. package/dist/chunk-3Q34PMHU.mjs +840 -0
  31. package/dist/chunk-3Q34PMHU.mjs.map +1 -0
  32. package/dist/chunk-72ZA3OYQ.mjs +20 -0
  33. package/dist/chunk-72ZA3OYQ.mjs.map +1 -0
  34. package/dist/chunk-7IEUU6LD.mjs +549 -0
  35. package/dist/chunk-7IEUU6LD.mjs.map +1 -0
  36. package/dist/chunk-ABLEEC5N.mjs +38 -0
  37. package/dist/chunk-ABLEEC5N.mjs.map +1 -0
  38. package/dist/chunk-AORSW75A.mjs +1101 -0
  39. package/dist/chunk-AORSW75A.mjs.map +1 -0
  40. package/dist/chunk-BKTCPT7P.mjs +269 -0
  41. package/dist/chunk-BKTCPT7P.mjs.map +1 -0
  42. package/dist/chunk-CCHASDAI.mjs +330 -0
  43. package/dist/chunk-CCHASDAI.mjs.map +1 -0
  44. package/dist/chunk-FQ2WU7PX.mjs +509 -0
  45. package/dist/chunk-FQ2WU7PX.mjs.map +1 -0
  46. package/dist/chunk-JO74ENTF.mjs +417 -0
  47. package/dist/chunk-JO74ENTF.mjs.map +1 -0
  48. package/dist/chunk-K73Y36KS.mjs +407 -0
  49. package/dist/chunk-K73Y36KS.mjs.map +1 -0
  50. package/dist/chunk-KHV3EP3I.mjs +179 -0
  51. package/dist/chunk-KHV3EP3I.mjs.map +1 -0
  52. package/dist/chunk-MMSTOW4F.mjs +722 -0
  53. package/dist/chunk-MMSTOW4F.mjs.map +1 -0
  54. package/dist/chunk-MWZ5UHCF.mjs +1082 -0
  55. package/dist/chunk-MWZ5UHCF.mjs.map +1 -0
  56. package/dist/chunk-NU6JGI7L.mjs +565 -0
  57. package/dist/chunk-NU6JGI7L.mjs.map +1 -0
  58. package/dist/chunk-PIC2Y5DF.mjs +422 -0
  59. package/dist/chunk-PIC2Y5DF.mjs.map +1 -0
  60. package/dist/chunk-PPN7BG3A.mjs +464 -0
  61. package/dist/chunk-PPN7BG3A.mjs.map +1 -0
  62. package/dist/chunk-RSV7J43V.mjs +438 -0
  63. package/dist/chunk-RSV7J43V.mjs.map +1 -0
  64. package/dist/chunk-UTT6KI7N.mjs +216 -0
  65. package/dist/chunk-UTT6KI7N.mjs.map +1 -0
  66. package/dist/constants.mjs +16 -389
  67. package/dist/constants.mjs.map +1 -1
  68. package/dist/index-Du1PoZqu.d.mts +216 -0
  69. package/dist/index.d.mts +131 -9
  70. package/dist/index.js +12064 -11594
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +4407 -12273
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/passkey.d.mts +142 -0
  75. package/dist/passkey.js +807 -0
  76. package/dist/passkey.js.map +1 -0
  77. package/dist/passkey.mjs +15 -0
  78. package/dist/passkey.mjs.map +1 -0
  79. package/dist/payload.mjs +25 -244
  80. package/dist/payload.mjs.map +1 -1
  81. package/dist/portfolio-UV3LLWKI.mjs +13 -0
  82. package/dist/portfolio-UV3LLWKI.mjs.map +1 -0
  83. package/dist/queries/index.js +39 -1
  84. package/dist/queries/index.js.map +1 -1
  85. package/dist/queries/index.mjs +14 -1591
  86. package/dist/queries/index.mjs.map +1 -1
  87. package/dist/{types-DakHNZIP.d.ts → types-Bmk689Lw.d.mts} +1 -1
  88. package/dist/types.d.mts +10 -0
  89. package/dist/types.js.map +1 -1
  90. package/dist/utils.mjs +19 -385
  91. package/dist/utils.mjs.map +1 -1
  92. package/dist/wormhole.mjs +25 -397
  93. package/dist/wormhole.mjs.map +1 -1
  94. package/package.json +11 -1
  95. package/dist/auth/prepareAuth.d.ts +0 -25
  96. package/dist/chains/aptos/index.d.ts +0 -146
  97. package/dist/chains/evm/index.d.ts +0 -5
  98. package/dist/chains/solana/index.d.ts +0 -116
  99. package/dist/chains/stacks/index.d.ts +0 -559
  100. package/dist/chains/starknet/index.d.ts +0 -172
  101. package/dist/chains/sui/index.d.ts +0 -182
  102. package/dist/constants.d.ts +0 -150
  103. package/dist/index-Dy29mvBf.d.mts +0 -683
  104. package/dist/index-eXXqodd0.d.ts +0 -683
  105. package/dist/index.d.ts +0 -3442
  106. package/dist/payload.d.ts +0 -125
  107. package/dist/queries/index.d.ts +0 -148
  108. package/dist/types-DakHNZIP.d.mts +0 -571
  109. package/dist/types-DvFRnIBd.d.ts +0 -172
  110. package/dist/types.d.ts +0 -413
  111. package/dist/utils.d.ts +0 -81
  112. 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,5 +0,0 @@
1
- export { E as EVMClient, e as EVMClientConfig, c as EVMHubClientAdapter } from '../../index-eXXqodd0.js';
2
- import '../../types.js';
3
- import 'ethers';
4
- import '../../types-DakHNZIP.js';
5
- import '../../types-DvFRnIBd.js';
@@ -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 };