@veridex/sdk 1.0.0-beta.16 → 1.0.0-beta.17

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/index.d.ts CHANGED
@@ -1,17 +1,26 @@
1
- import { c as WalletManagerConfig, P as PasskeyCredential, U as UnifiedIdentity, d as ChainAddress, B as BridgeParams, a as ChainConfig, e as VAA, f as VeridexPayload, g as PreparedTransfer, h as PreparedBridge, i as VeridexConfig, C as ChainClient, T as TransferParams, E as ExecuteParams, D as DispatchResult, j as BridgeResult, k as TransferResult, l as ReceiveAddress, m as VaultInfo, V as VaultCreationResult, I as IdentityState, A as AuthorizedKey, n as AddBackupKeyResult, o as RemoveKeyResult } from './types-ChIsqCiw.js';
2
- export { u as ActionPayload, r as BridgeAction, t as ConfigAction, p as ConfigParams, y as CrossChainFees, s as ExecuteAction, w as TestResult, x as TransactionHistoryEntry, q as TransferAction, v as VAASignature } from './types-ChIsqCiw.js';
3
- import { P as PasskeyManager, a as PasskeyCredential$1, W as WebAuthnSignature } from './index-ruSjoF2m.js';
4
- export { E as EVMHubClientAdapter, H as HubClient, b as PasskeyManagerConfig, S as SessionManager, d as detectRpId } from './index-ruSjoF2m.js';
1
+ import { W as WalletManagerConfig, P as PasskeyCredential, U as UnifiedIdentity, C as ChainAddress, B as BridgeParams, a as ChainConfig, V as VAA, b as VeridexPayload, c as PreparedTransfer, d as PreparedBridge, e as VeridexConfig, f as ChainClient, T as TransferParams, E as ExecuteParams, D as DispatchResult, g as BridgeResult, h as TransferResult, R as ReceiveAddress, i as VaultInfo, j as VaultCreationResult, I as IdentityState, A as AuthorizedKey, k as AddBackupKeyResult, l as RemoveKeyResult } from './types-DE2ICQik.js';
2
+ export { r as ActionPayload, o as BridgeAction, q as ConfigAction, m as ConfigParams, v as CrossChainFees, p as ExecuteAction, t as TestResult, u as TransactionHistoryEntry, n as TransferAction, s as VAASignature } from './types-DE2ICQik.js';
3
+ import { P as PasskeyManager, a as PasskeyCredential$1, W as WebAuthnSignature } from './index-BXcR_ypI.js';
4
+ export { E as EVMClient, e as EVMClientConfig, c as EVMHubClientAdapter, H as HubClient, b as PasskeyManagerConfig, S as SessionManager, V as VERIDEX_RP_ID, d as detectRpId, s as supportsRelatedOrigins } from './index-BXcR_ypI.js';
5
5
  import { ethers } from 'ethers';
6
6
  import { BridgeParams as BridgeParams$1, ChainConfig as ChainConfig$1 } from './types.js';
7
7
  export { AddGuardianResult, ApproveRecoveryResult, CancelRecoveryResult, ExecuteRecoveryResult, ExecutionPath, GuardianConfig, InitiateRecoveryResult, QueryProof, QuerySubmissionResult, RecoveryStatus, RegisterSessionParams, RemoveGuardianResult, RevokeSessionParams, SessionKey, SessionValidationResult, SetupGuardiansResult } from './types.js';
8
- import { a as SessionStorage, S as SessionKey } from './types-FJL7j6gQ.js';
9
- export { A as ActionParams, b as SessionConfig, i as SessionError, h as SessionErrorCode, e as SessionEvent, f as SessionEventCallback, d as SessionManagerConfig, c as SessionSignature, g as SessionSignedAction } from './types-FJL7j6gQ.js';
8
+ export { SolanaClient, SolanaClientConfig } from './chains/solana/index.js';
9
+ export { AptosClient, AptosClientConfig } from './chains/aptos/index.js';
10
+ export { SuiClient, SuiClientConfig } from './chains/sui/index.js';
11
+ export { StarknetClient, StarknetClientConfig } from './chains/starknet/index.js';
12
+ export { FtPostCondition, NftPostCondition, PostConditionComparison, STACKS_ACTION_TYPES, StacksClient, StacksClientConfig, PostCondition as StacksPostCondition, StxPostCondition, buildSbtcWithdrawalPostConditions, buildExecutePostConditions as buildStacksExecutePostConditions, buildStxDepositPostConditions, buildStxWithdrawalPostConditions, getContractPrincipal as getStacksContractPrincipal, getStacksExplorerAddressUrl, getStacksExplorerTxUrl, getNetworkFromAddress as getStacksNetworkFromAddress, isContractPrincipal as isStacksContractPrincipal, isValidContractName as isValidStacksContractName, isValidStacksPrincipal, isValidStandardPrincipal as isValidStacksStandardPrincipal, parseContractPrincipal as parseStacksContractPrincipal, buildExecuteHash as stacksBuildExecuteHash, buildRegistrationHash as stacksBuildRegistrationHash, buildRevocationHash as stacksBuildRevocationHash, buildSessionRegistrationHash as stacksBuildSessionRegistrationHash, buildWithdrawalHash as stacksBuildWithdrawalHash, compressPublicKey as stacksCompressPublicKey, computeKeyHash as stacksComputeKeyHash, computeKeyHashFromCoords as stacksComputeKeyHashFromCoords, derToCompactSignature as stacksDerToCompactSignature, rsToCompactSignature as stacksRsToCompactSignature, validatePostConditions as validateStacksPostConditions } from './chains/stacks/index.js';
13
+ import { S as SessionStorage, a as SessionKey } from './types-DvFRnIBd.js';
14
+ export { A as ActionParams, b as SessionConfig, i as SessionError, h as SessionErrorCode, e as SessionEvent, f as SessionEventCallback, d as SessionManagerConfig, c as SessionSignature, g as SessionSignedAction } from './types-DvFRnIBd.js';
10
15
  export { ACTION_BRIDGE, ACTION_CONFIG, ACTION_EXECUTE, ACTION_TRANSFER, ACTION_TYPES, HUB_ABI, MAINNET_CHAINS, PROTOCOL_VERSION, TESTNET_CHAINS, VAULT_ABI, VAULT_FACTORY_ABI, WORMHOLE_API, WORMHOLE_CHAIN_IDS, WORMHOLE_CHAIN_IDS_FLAT } from './constants.js';
11
16
  export { base64URLDecode, base64URLEncode, computeKeyHash, encodeSignatureForSolidity, getAddressExplorerUrl, getChainByEvmId, getChainByWormholeId, getTxExplorerUrl, isEvmChain, isValidBytes32, isValidEvmAddress, isValidWormholeChainId, parseDERSignature, retryWithBackoff } from './utils.js';
12
17
  export { buildChallenge, buildGaslessChallenge, createGaslessMessageHash, createMessageHash, decodeActionPayload, decodeBridgeAction, decodeExecuteAction, decodeTransferAction, encodeAptosTransferAction, encodeBridgeAction, encodeConfigAction, encodeExecuteAction, encodeSolanaTransferAction, encodeSuiTransferAction, encodeTransferAction, encodeVeridexPayload, formatAmount, generateNonce, padTo32Bytes, parseAmount, solanaAddressToBytes32, trimTo20Bytes } from './payload.js';
13
18
  export { HubStateQuery, HubStateResult, PortfolioChainErrorCode, PortfolioChainResult, PortfolioQuery, PortfolioResult, QueryConfig, QueryHubStateError, QueryHubStateErrorCode, QueryHubStateNetwork, QueryHubStateOptions, QueryNetwork, QueryOperation, QueryOperationType, QueryPortfolioError, QueryPortfolioErrorCode, QueryPortfolioNetwork, QueryPortfolioOptions, QueryRequest, QueryResponse, WORMHOLE_QUERY_CHAIN_IDS, WORMHOLE_QUERY_PROXY_URLS, WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND, queryHubState, queryPortfolio } from './queries/index.js';
14
19
  export { CONSISTENCY_LEVELS, FetchVAAOptions, GUARDIAN_CONFIG, WaitForSignaturesOptions, emitterToEvmAddress, encodeVAAForSolana, encodeVAAToBytes, evmAddressToBytes32, fetchVAA, fetchVAAByTxHash, fetchVAAByTxHashFallback, getSequenceFromTxReceipt, getWormholeCoreBridge, getWormholeRelayer, getWormholeTokenBridge, hasQuorum, normalizeEmitterAddress, parseVAA, parseVAABytes, parseVeridexPayload, supportsRelayer, validateEmitter, waitForGuardianSignatures } from './wormhole.js';
20
+ import '@solana/web3.js';
21
+ import '@aptos-labs/ts-sdk';
22
+ import '@mysten/sui/client';
23
+ import 'starknet';
15
24
  import '@wormhole-foundation/wormhole-query-sdk';
16
25
 
17
26
  /**
@@ -2111,6 +2120,7 @@ declare const CHAIN_NAMES: {
2111
2120
  readonly APTOS: "aptos";
2112
2121
  readonly SUI: "sui";
2113
2122
  readonly STARKNET: "starknet";
2123
+ readonly STACKS: "stacks";
2114
2124
  readonly NEAR: "near";
2115
2125
  readonly SEI: "sei";
2116
2126
  };
@@ -2120,7 +2130,7 @@ interface ChainPreset {
2120
2130
  /** Human-readable chain name */
2121
2131
  displayName: string;
2122
2132
  /** Chain type for client selection */
2123
- type: 'evm' | 'solana' | 'aptos' | 'sui' | 'starknet' | 'near' | 'cosmos';
2133
+ type: 'evm' | 'solana' | 'aptos' | 'sui' | 'starknet' | 'stacks' | 'near' | 'cosmos';
2124
2134
  /** Whether this chain can be a hub */
2125
2135
  canBeHub: boolean;
2126
2136
  /** Testnet configuration */
@@ -2261,7 +2271,7 @@ interface SessionConfig {
2261
2271
  *
2262
2272
  * // With relayer for gasless transactions
2263
2273
  * const gaslessSdk = await createSDK('base', {
2264
- * relayerUrl: 'https://relayer.veridex.io',
2274
+ * relayerUrl: 'https://relayer.veridex.network',
2265
2275
  * relayerApiKey: 'your-api-key',
2266
2276
  * });
2267
2277
  * ```
@@ -2369,10 +2379,10 @@ declare function createSessionSDK(chain?: ChainName, config?: SimpleSDKConfig):
2369
2379
  * ```
2370
2380
  */
2371
2381
 
2372
- /** The canonical Veridex RP ID for cross-origin passkeys */
2373
- declare const VERIDEX_RP_ID = "veridex.network";
2374
2382
  /** Default auth portal URL */
2375
2383
  declare const DEFAULT_AUTH_PORTAL_URL = "https://auth.veridex.network";
2384
+ /** Default relayer API URL for server-side session tokens */
2385
+ declare const DEFAULT_RELAYER_URL = "https://amused-kameko-veridex-demo-37453117.koyeb.app/api/v1";
2376
2386
  /** Message types for postMessage communication */
2377
2387
  declare const AUTH_MESSAGE_TYPES: {
2378
2388
  readonly AUTH_REQUEST: "VERIDEX_AUTH_REQUEST";
@@ -2384,6 +2394,8 @@ interface CrossOriginAuthConfig {
2384
2394
  rpId?: string;
2385
2395
  /** Auth portal URL for popup/redirect flow */
2386
2396
  authPortalUrl?: string;
2397
+ /** Relayer API URL for server-side session tokens */
2398
+ relayerUrl?: string;
2387
2399
  /** Authentication mode: popup or redirect */
2388
2400
  mode?: 'popup' | 'redirect';
2389
2401
  /** Popup window features */
@@ -2406,6 +2418,17 @@ interface CrossOriginSession {
2406
2418
  signature: WebAuthnSignature;
2407
2419
  /** The credential used */
2408
2420
  credential: PasskeyCredential$1;
2421
+ /** Server-validated session token ID (from relayer) */
2422
+ serverSessionId?: string;
2423
+ }
2424
+ /** Server-side session token returned by the relayer */
2425
+ interface ServerSessionToken {
2426
+ id: string;
2427
+ keyHash: string;
2428
+ appOrigin: string;
2429
+ permissions: string[];
2430
+ expiresAt: number;
2431
+ createdAt: number;
2409
2432
  }
2410
2433
  interface AuthPortalMessage {
2411
2434
  type: typeof AUTH_MESSAGE_TYPES[keyof typeof AUTH_MESSAGE_TYPES];
@@ -2483,6 +2506,35 @@ declare class CrossOriginAuth {
2483
2506
  * Get the auth portal URL.
2484
2507
  */
2485
2508
  getAuthPortalUrl(): string;
2509
+ /**
2510
+ * Create a server-validated session token via the relayer.
2511
+ * Call this after authenticating (via ROR or auth portal) to get a
2512
+ * server-side session that the relayer can verify on subsequent requests.
2513
+ */
2514
+ createServerSession(session: CrossOriginSession, options?: {
2515
+ permissions?: string[];
2516
+ expiresInMs?: number;
2517
+ }): Promise<ServerSessionToken>;
2518
+ /**
2519
+ * Validate an existing server session token.
2520
+ * Returns the session details if valid, null if expired/revoked.
2521
+ */
2522
+ validateServerSession(sessionId: string): Promise<ServerSessionToken | null>;
2523
+ /**
2524
+ * Revoke a server session token.
2525
+ */
2526
+ revokeServerSession(sessionId: string): Promise<boolean>;
2527
+ /**
2528
+ * Full authentication flow: authenticate + create server session.
2529
+ * Automatically detects ROR support and falls back to auth portal.
2530
+ */
2531
+ authenticateAndCreateSession(options?: {
2532
+ permissions?: string[];
2533
+ expiresInMs?: number;
2534
+ }): Promise<{
2535
+ session: CrossOriginSession;
2536
+ serverSession: ServerSessionToken;
2537
+ }>;
2486
2538
  }
2487
2539
  /**
2488
2540
  * Create a CrossOriginAuth instance for third-party app integration.
@@ -3309,4 +3361,4 @@ type AuthenticateAndPrepareResult = {
3309
3361
  */
3310
3362
  declare function authenticateAndPrepare(userParams: AuthenticateAndPrepareParams, apiKey: string): Promise<AuthenticateAndPrepareResult>;
3311
3363
 
3312
- export { ARBITRUM_SEPOLIA_TOKENS, AUTH_MESSAGE_TYPES, type ActionDetails, type ActionDisplayType, AddBackupKeyResult, type AuthPortalMessage, type AuthenticateAndPrepareParams, type AuthenticateAndPrepareResult, AuthorizedKey, BASE_SEPOLIA_TOKENS, BalanceManager, type BalanceManagerConfig, type BridgeDetails, BridgeParams, BridgeResult, CHAIN_DISPLAY_INFO, CHAIN_NAMES, CHAIN_PRESETS, CONFIG_TYPE, ChainAddress, type ChainAddressConfig, ChainClient, ChainConfig, type ChainDeploymentConfig, ChainDetector, type ChainDetectorConfig, type ChainDisplay, type ChainName, type ChainTokenList, type ConfigDetails, type CrossChainConfig, CrossChainManager, type CrossChainProgress, type CrossChainProgressCallback, type CrossChainResult, type CrossChainStatus, CrossOriginAuth, type CrossOriginAuthConfig, type CrossOriginSession, DEFAULT_AUTH_PORTAL_URL, DEFAULT_REFRESH_BUFFER, DEFAULT_SESSION_DURATION, type DailySpendingSummary, DispatchResult, type DurationDisplay, ERROR_MESSAGES, ERROR_RANGES, ETHEREUM_SEPOLIA_TOKENS, EVM_ZERO_ADDRESS, type ExecuteDetails, ExecuteParams, type FormattedSpendingLimits, GasSponsor, type GasSponsorConfig, IdentityState, IndexedDBSessionStorage, type KeyPair, LIMIT_PRESETS, type LimitCheckResult, type LimitPreset, type LimitViolationSuggestion, type LimitViolationType, LocalStorageSessionStorage, MAX_SESSION_DURATION, MIN_SESSION_DURATION, type MultiChainVaultResult, NATIVE_TOKEN_ADDRESS, type NativeBalanceCapable, type NetworkType, OPTIMISM_SEPOLIA_TOKENS, PasskeyCredential$1 as PasskeyCredential, PasskeyManager, type PortfolioBalance, PreparedBridge, PreparedTransfer, ReceiveAddress, type RecipientDisplay, type RelayFeeQuote, type RelayRequest, type RelayRoute, type RelayStatus, RelayerClient, type RelayerClientConfig, type RelayerInfo, RemoveKeyResult, type RiskLevel, type RiskWarning, type RiskWarningType, SessionStorage, type SetDailyLimitParams, type SetTransactionLimitParams, type SimpleSDKConfig, type SessionConfig as SimpleSessionConfig, type SpendingLimitChangedEvent, type SpendingLimitConfig, type SpendingLimitEventCallback, type SpendingLimits, SpendingLimitsManager, type SpendingLimitsManagerConfig, type SpendingTransaction, type SponsoredVaultResult, type SponsorshipSource, type SubmitActionResult, type SubmitQueryRequest, type SubmitQueryResult, type SubmitSignedActionRequest, TOKEN_REGISTRY, type TokenBalance, type TokenDisplay, type TokenInfo$1 as TokenInfo, type TrackerConfig, type TransactionAuditEntry, type TransactionCallback, TransactionParser, type TransactionParserConfig, type TransactionState, type TransactionStatus, type TransactionSummary, TransactionTracker, type TransferDetails, TransferParams, TransferResult, UnifiedIdentity, VAA, VERIDEX_ERRORS, VERIDEX_RP_ID, VaultCreationResult, VaultInfo, VeridexConfig, type VeridexErrorCode, VeridexPayload, VeridexSDK, WalletManager, WalletManagerConfig, WebAuthnSignature, authenticateAndPrepare, calculatePercentage, computeSessionKeyHash, createAuditEntry, createChainDetector, createCrossOriginAuth, createGasSponsor, createHubSDK, createMainnetSDK, createRelayerClient, createSDK, createSessionSDK, createSessionStorage, createSpendingLimitsManager, createTestnetSDK, createTransactionParser, crossChainManager, decrypt, VeridexSDK as default, deriveEncryptionKey, encrypt, formatDuration, formatLargeAmount, formatTransactionState, generateSecp256k1KeyPair, getAllTokens, getChainConfig, getChainDisplay, getChainName, getChainPreset, getConfigTypeName, getDefaultHub, getErrorCategory, getErrorMessage, getExplorerUrl, getHubChains, getSuggestedAction, getSupportedChainIds, getSupportedChains, getTokenByAddress, getTokenBySymbol, getTokenList, hashAction, isAbiError, isChainSupported, isCoreError, isNativeToken, isQueryError, isQueryExecutionError, isQueryParsingError, isRetryableError, logTransactionSummary, parseVeridexError, sendAuthError, sendAuthResponse, signWithSessionKey, validateSessionConfig, verifySessionSignature };
3364
+ export { ARBITRUM_SEPOLIA_TOKENS, AUTH_MESSAGE_TYPES, type ActionDetails, type ActionDisplayType, AddBackupKeyResult, type AuthPortalMessage, type AuthenticateAndPrepareParams, type AuthenticateAndPrepareResult, AuthorizedKey, BASE_SEPOLIA_TOKENS, BalanceManager, type BalanceManagerConfig, type BridgeDetails, BridgeParams, BridgeResult, CHAIN_DISPLAY_INFO, CHAIN_NAMES, CHAIN_PRESETS, CONFIG_TYPE, ChainAddress, type ChainAddressConfig, ChainClient, ChainConfig, type ChainDeploymentConfig, ChainDetector, type ChainDetectorConfig, type ChainDisplay, type ChainName, type ChainTokenList, type ConfigDetails, type CrossChainConfig, CrossChainManager, type CrossChainProgress, type CrossChainProgressCallback, type CrossChainResult, type CrossChainStatus, CrossOriginAuth, type CrossOriginAuthConfig, type CrossOriginSession, DEFAULT_AUTH_PORTAL_URL, DEFAULT_REFRESH_BUFFER, DEFAULT_RELAYER_URL, DEFAULT_SESSION_DURATION, type DailySpendingSummary, DispatchResult, type DurationDisplay, ERROR_MESSAGES, ERROR_RANGES, ETHEREUM_SEPOLIA_TOKENS, EVM_ZERO_ADDRESS, type ExecuteDetails, ExecuteParams, type FormattedSpendingLimits, GasSponsor, type GasSponsorConfig, IdentityState, IndexedDBSessionStorage, type KeyPair, LIMIT_PRESETS, type LimitCheckResult, type LimitPreset, type LimitViolationSuggestion, type LimitViolationType, LocalStorageSessionStorage, MAX_SESSION_DURATION, MIN_SESSION_DURATION, type MultiChainVaultResult, NATIVE_TOKEN_ADDRESS, type NativeBalanceCapable, type NetworkType, OPTIMISM_SEPOLIA_TOKENS, PasskeyCredential$1 as PasskeyCredential, PasskeyManager, type PortfolioBalance, PreparedBridge, PreparedTransfer, ReceiveAddress, type RecipientDisplay, type RelayFeeQuote, type RelayRequest, type RelayRoute, type RelayStatus, RelayerClient, type RelayerClientConfig, type RelayerInfo, RemoveKeyResult, type RiskLevel, type RiskWarning, type RiskWarningType, type ServerSessionToken, SessionStorage, type SetDailyLimitParams, type SetTransactionLimitParams, type SimpleSDKConfig, type SessionConfig as SimpleSessionConfig, type SpendingLimitChangedEvent, type SpendingLimitConfig, type SpendingLimitEventCallback, type SpendingLimits, SpendingLimitsManager, type SpendingLimitsManagerConfig, type SpendingTransaction, type SponsoredVaultResult, type SponsorshipSource, type SubmitActionResult, type SubmitQueryRequest, type SubmitQueryResult, type SubmitSignedActionRequest, TOKEN_REGISTRY, type TokenBalance, type TokenDisplay, type TokenInfo$1 as TokenInfo, type TrackerConfig, type TransactionAuditEntry, type TransactionCallback, TransactionParser, type TransactionParserConfig, type TransactionState, type TransactionStatus, type TransactionSummary, TransactionTracker, type TransferDetails, TransferParams, TransferResult, UnifiedIdentity, VAA, VERIDEX_ERRORS, VaultCreationResult, VaultInfo, VeridexConfig, type VeridexErrorCode, VeridexPayload, VeridexSDK, WalletManager, WalletManagerConfig, WebAuthnSignature, authenticateAndPrepare, calculatePercentage, computeSessionKeyHash, createAuditEntry, createChainDetector, createCrossOriginAuth, createGasSponsor, createHubSDK, createMainnetSDK, createRelayerClient, createSDK, createSessionSDK, createSessionStorage, createSpendingLimitsManager, createTestnetSDK, createTransactionParser, crossChainManager, decrypt, VeridexSDK as default, deriveEncryptionKey, encrypt, formatDuration, formatLargeAmount, formatTransactionState, generateSecp256k1KeyPair, getAllTokens, getChainConfig, getChainDisplay, getChainName, getChainPreset, getConfigTypeName, getDefaultHub, getErrorCategory, getErrorMessage, getExplorerUrl, getHubChains, getSuggestedAction, getSupportedChainIds, getSupportedChains, getTokenByAddress, getTokenBySymbol, getTokenList, hashAction, isAbiError, isChainSupported, isCoreError, isNativeToken, isQueryError, isQueryExecutionError, isQueryParsingError, isRetryableError, logTransactionSummary, parseVeridexError, sendAuthError, sendAuthResponse, signWithSessionKey, validateSessionConfig, verifySessionSignature };