@sip-protocol/sdk 0.2.7 → 0.2.9

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.mts CHANGED
@@ -3100,6 +3100,294 @@ declare class ZcashShieldedService {
3100
3100
  */
3101
3101
  declare function createZcashShieldedService(config: ZcashShieldedServiceConfig): ZcashShieldedService;
3102
3102
 
3103
+ /**
3104
+ * Zcash Swap Service
3105
+ *
3106
+ * Handles cross-chain swaps from ETH/SOL/NEAR to Zcash (ZEC).
3107
+ * Since NEAR Intents doesn't support ZEC as destination chain,
3108
+ * this service provides an alternative path for ZEC swaps.
3109
+ *
3110
+ * @example
3111
+ * ```typescript
3112
+ * const swapService = new ZcashSwapService({
3113
+ * zcashService: zcashShieldedService,
3114
+ * mode: 'demo', // or 'production' when bridge is available
3115
+ * })
3116
+ *
3117
+ * // Get quote for ETH → ZEC swap
3118
+ * const quote = await swapService.getQuote({
3119
+ * sourceChain: 'ethereum',
3120
+ * sourceToken: 'ETH',
3121
+ * amount: 1000000000000000000n, // 1 ETH
3122
+ * recipientZAddress: 'zs1...',
3123
+ * })
3124
+ *
3125
+ * // Execute the swap
3126
+ * const result = await swapService.executeSwapToShielded({
3127
+ * quoteId: quote.quoteId,
3128
+ * sourceChain: 'ethereum',
3129
+ * sourceToken: 'ETH',
3130
+ * amount: 1000000000000000000n,
3131
+ * recipientZAddress: 'zs1...',
3132
+ * })
3133
+ * ```
3134
+ */
3135
+
3136
+ /**
3137
+ * Supported source chains for ZEC swaps
3138
+ */
3139
+ type ZcashSwapSourceChain = 'ethereum' | 'solana' | 'near' | 'polygon' | 'arbitrum' | 'base';
3140
+ /**
3141
+ * Supported source tokens for ZEC swaps
3142
+ */
3143
+ type ZcashSwapSourceToken = 'ETH' | 'SOL' | 'NEAR' | 'USDC' | 'USDT' | 'MATIC';
3144
+ /**
3145
+ * Configuration for ZcashSwapService
3146
+ */
3147
+ interface ZcashSwapServiceConfig {
3148
+ /** Zcash shielded service for receiving ZEC */
3149
+ zcashService?: ZcashShieldedService;
3150
+ /** Operating mode */
3151
+ mode: 'demo' | 'production';
3152
+ /** Bridge provider (for production) */
3153
+ bridgeProvider?: BridgeProvider;
3154
+ /** Price feed for quotes */
3155
+ priceFeed?: PriceFeed;
3156
+ /** Default slippage tolerance (basis points, default: 100 = 1%) */
3157
+ defaultSlippage?: number;
3158
+ /** Quote validity duration in seconds (default: 60) */
3159
+ quoteValiditySeconds?: number;
3160
+ }
3161
+ /**
3162
+ * Bridge provider interface (for production mode)
3163
+ */
3164
+ interface BridgeProvider {
3165
+ /** Provider name */
3166
+ name: string;
3167
+ /** Get quote from bridge */
3168
+ getQuote(params: BridgeQuoteParams): Promise<BridgeQuote>;
3169
+ /** Execute swap through bridge */
3170
+ executeSwap(params: BridgeSwapParams): Promise<BridgeSwapResult>;
3171
+ /** Get supported chains */
3172
+ getSupportedChains(): Promise<ZcashSwapSourceChain[]>;
3173
+ }
3174
+ /**
3175
+ * Price feed interface for quote calculations
3176
+ */
3177
+ interface PriceFeed {
3178
+ /** Get current price in USD */
3179
+ getPrice(token: string): Promise<number>;
3180
+ /** Get ZEC price in USD */
3181
+ getZecPrice(): Promise<number>;
3182
+ }
3183
+ /**
3184
+ * Bridge quote parameters
3185
+ */
3186
+ interface BridgeQuoteParams {
3187
+ sourceChain: ZcashSwapSourceChain;
3188
+ sourceToken: ZcashSwapSourceToken;
3189
+ amount: bigint;
3190
+ recipientAddress: string;
3191
+ }
3192
+ /**
3193
+ * Bridge quote result
3194
+ */
3195
+ interface BridgeQuote {
3196
+ quoteId: string;
3197
+ amountIn: bigint;
3198
+ amountOut: bigint;
3199
+ fee: bigint;
3200
+ exchangeRate: number;
3201
+ validUntil: number;
3202
+ }
3203
+ /**
3204
+ * Bridge swap parameters
3205
+ */
3206
+ interface BridgeSwapParams extends BridgeQuoteParams {
3207
+ quoteId: string;
3208
+ depositAddress: string;
3209
+ }
3210
+ /**
3211
+ * Bridge swap result
3212
+ */
3213
+ interface BridgeSwapResult {
3214
+ txHash: string;
3215
+ status: 'pending' | 'completed' | 'failed';
3216
+ amountReceived?: bigint;
3217
+ }
3218
+ /**
3219
+ * Quote request parameters
3220
+ */
3221
+ interface ZcashQuoteParams {
3222
+ /** Source blockchain */
3223
+ sourceChain: ZcashSwapSourceChain;
3224
+ /** Source token symbol */
3225
+ sourceToken: ZcashSwapSourceToken;
3226
+ /** Amount in smallest unit (wei, lamports, etc.) */
3227
+ amount: bigint;
3228
+ /** Recipient z-address */
3229
+ recipientZAddress: string;
3230
+ /** Custom slippage (basis points) */
3231
+ slippage?: number;
3232
+ }
3233
+ /**
3234
+ * Quote response
3235
+ */
3236
+ interface ZcashQuote {
3237
+ /** Unique quote identifier */
3238
+ quoteId: string;
3239
+ /** Source chain */
3240
+ sourceChain: ZcashSwapSourceChain;
3241
+ /** Source token */
3242
+ sourceToken: ZcashSwapSourceToken;
3243
+ /** Input amount (in source token's smallest unit) */
3244
+ amountIn: bigint;
3245
+ /** Input amount formatted */
3246
+ amountInFormatted: string;
3247
+ /** Output amount in zatoshis (1 ZEC = 100,000,000 zatoshis) */
3248
+ amountOut: bigint;
3249
+ /** Output amount in ZEC */
3250
+ amountOutFormatted: string;
3251
+ /** Exchange rate (ZEC per source token) */
3252
+ exchangeRate: number;
3253
+ /** Network fee in source token */
3254
+ networkFee: bigint;
3255
+ /** Bridge/swap fee in source token */
3256
+ swapFee: bigint;
3257
+ /** Total fee in source token */
3258
+ totalFee: bigint;
3259
+ /** Slippage tolerance (basis points) */
3260
+ slippage: number;
3261
+ /** Minimum output amount after slippage */
3262
+ minimumOutput: bigint;
3263
+ /** Quote expiration timestamp */
3264
+ validUntil: number;
3265
+ /** Deposit address (where to send source tokens) */
3266
+ depositAddress: string;
3267
+ /** Estimated time to completion (seconds) */
3268
+ estimatedTime: number;
3269
+ /** Privacy level for the swap */
3270
+ privacyLevel: PrivacyLevel;
3271
+ }
3272
+ /**
3273
+ * Swap execution parameters
3274
+ */
3275
+ interface ZcashSwapParams {
3276
+ /** Quote ID to execute */
3277
+ quoteId?: string;
3278
+ /** Source blockchain */
3279
+ sourceChain: ZcashSwapSourceChain;
3280
+ /** Source token symbol */
3281
+ sourceToken: ZcashSwapSourceToken;
3282
+ /** Amount in smallest unit */
3283
+ amount: bigint;
3284
+ /** Recipient z-address (shielded) */
3285
+ recipientZAddress: string;
3286
+ /** Optional memo for the transaction */
3287
+ memo?: string;
3288
+ /** Custom slippage (basis points) */
3289
+ slippage?: number;
3290
+ }
3291
+ /**
3292
+ * Swap execution result
3293
+ */
3294
+ interface ZcashSwapResult {
3295
+ /** Swap request ID */
3296
+ requestId: string;
3297
+ /** Quote used */
3298
+ quoteId: string;
3299
+ /** Current status */
3300
+ status: ZcashSwapStatus;
3301
+ /** Source chain transaction hash (deposit tx) */
3302
+ sourceTxHash?: string;
3303
+ /** Zcash transaction ID (if completed) */
3304
+ zcashTxId?: string;
3305
+ /** Amount deposited */
3306
+ amountIn: bigint;
3307
+ /** Amount received in ZEC (zatoshis) */
3308
+ amountOut?: bigint;
3309
+ /** Recipient z-address */
3310
+ recipientZAddress: string;
3311
+ /** Timestamp */
3312
+ timestamp: number;
3313
+ /** Error message if failed */
3314
+ error?: string;
3315
+ }
3316
+ /**
3317
+ * Swap status
3318
+ */
3319
+ type ZcashSwapStatus = 'pending_deposit' | 'deposit_confirmed' | 'swapping' | 'sending_zec' | 'completed' | 'failed' | 'expired';
3320
+ /**
3321
+ * Zcash Swap Service
3322
+ *
3323
+ * Enables cross-chain swaps from ETH/SOL/NEAR to Zcash's shielded pool.
3324
+ */
3325
+ declare class ZcashSwapService {
3326
+ private readonly config;
3327
+ private readonly zcashService?;
3328
+ private readonly bridgeProvider?;
3329
+ private readonly priceFeed?;
3330
+ private readonly quotes;
3331
+ private readonly swaps;
3332
+ constructor(config: ZcashSwapServiceConfig);
3333
+ /**
3334
+ * Get a quote for swapping to ZEC
3335
+ */
3336
+ getQuote(params: ZcashQuoteParams): Promise<ZcashQuote>;
3337
+ /**
3338
+ * Get quote in demo mode (uses mock prices)
3339
+ */
3340
+ private getDemoQuote;
3341
+ /**
3342
+ * Get quote in production mode (uses bridge provider)
3343
+ */
3344
+ private getProductionQuote;
3345
+ /**
3346
+ * Execute a swap to Zcash shielded pool
3347
+ */
3348
+ executeSwapToShielded(params: ZcashSwapParams): Promise<ZcashSwapResult>;
3349
+ /**
3350
+ * Execute swap in demo mode
3351
+ */
3352
+ private executeDemoSwap;
3353
+ /**
3354
+ * Execute swap in production mode
3355
+ */
3356
+ private executeProductionSwap;
3357
+ /**
3358
+ * Get swap status
3359
+ */
3360
+ getSwapStatus(requestId: string): Promise<ZcashSwapResult | null>;
3361
+ /**
3362
+ * Wait for swap completion
3363
+ */
3364
+ waitForCompletion(requestId: string, timeout?: number, pollInterval?: number): Promise<ZcashSwapResult>;
3365
+ /**
3366
+ * Get supported source chains
3367
+ */
3368
+ getSupportedChains(): Promise<ZcashSwapSourceChain[]>;
3369
+ /**
3370
+ * Get supported source tokens for a chain
3371
+ */
3372
+ getSupportedTokens(chain: ZcashSwapSourceChain): ZcashSwapSourceToken[];
3373
+ /**
3374
+ * Check if a swap route is supported
3375
+ */
3376
+ isRouteSupported(chain: ZcashSwapSourceChain, token: ZcashSwapSourceToken): boolean;
3377
+ private validateQuoteParams;
3378
+ private isValidZAddressFormat;
3379
+ private generateMockDepositAddress;
3380
+ private getEstimatedTime;
3381
+ private formatAmount;
3382
+ private randomHex;
3383
+ private randomBase58;
3384
+ private delay;
3385
+ }
3386
+ /**
3387
+ * Create a Zcash swap service instance
3388
+ */
3389
+ declare function createZcashSwapService(config: ZcashSwapServiceConfig): ZcashSwapService;
3390
+
3103
3391
  /**
3104
3392
  * Shielded Payments for SIP Protocol
3105
3393
  *
@@ -5607,4 +5895,4 @@ declare function createMockLedgerAdapter(config: Omit<MockHardwareConfig, 'devic
5607
5895
  */
5608
5896
  declare function createMockTrezorAdapter(config: Omit<MockHardwareConfig, 'deviceType'>): MockTrezorAdapter;
5609
5897
 
5610
- export { ATTESTATION_VERSION, type AttestationRequest, type AttestationResult, BrowserNoirProvider as B, BaseWalletAdapter, type BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, type CommitmentPoint, ComplianceManager, type CreateIntentOptions, type CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, type EIP1193ConnectInfo, type EIP1193Event, type EIP1193Provider, type EIP1193ProviderRpcError, type EIP1193RequestArguments, type EIP712Domain, type EIP712TypeDefinition, type EIP712TypedData, type EIP712Types, EncryptionNotImplementedError, ErrorCode, type EthereumAdapterConfig, EthereumChainId, type EthereumChainIdType, type EthereumChainMetadata, type EthereumTokenMetadata, type EthereumTransactionReceipt, type EthereumTransactionRequest, EthereumWalletAdapter, type EthereumWalletName, type ExportedViewingKey, FulfillmentProofParams, FundingProofParams, type HardwareAccount, type HardwareConnectionStatus, type HardwareDeviceInfo, HardwareErrorCode, type HardwareErrorCodeType, type HardwareEthereumTx, type HardwareSignRequest, type HardwareSignature, type HardwareTransport, type HardwareWalletConfig, HardwareWalletError, type HardwareWalletType, IntentBuilder, IntentError, type LedgerConfig, type LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, type MockEthereumAdapterConfig, type MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, type MockSolanaAdapterConfig, MockSolver, type MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, type NEARIntentsAdapterConfig, NetworkError, ORACLE_DOMAIN, OneClickClient, type OracleAttestationMessage, type OracleId, type OracleInfo, type OracleRegistry, type OracleRegistryConfig, type OracleSignature, type OracleStatus, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PrivacyConfig, type ProductionQuote, ProofError, ProofFramework, ProofNotImplementedError, type ProofProgressCallback, ProofProvider, ProofResult, type ReceivedNote, SIP, type SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, type SerializedError, type ShieldedBalance, type ShieldedSendParams, type ShieldedSendResult, type SignedOracleAttestation, type SolanaAdapterConfig, type SolanaCluster, type SolanaConnection, type SolanaPublicKey, type SolanaSendOptions, type SolanaSignature, type SolanaTransaction, type SolanaUnsignedTransaction, type SolanaVersionedTransaction, SolanaWalletAdapter, type SolanaWalletName, type SolanaWalletProvider, type StablecoinInfo, type StealthCurve, type SwapRequest, type SwapResult, type TransactionData, type TransportType, Treasury, type TrezorConfig, type TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, type VerificationResult, type WalletAdapter, WalletError, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, type ZcashShieldedServiceConfig, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, bytesToHex as browserBytesToHex, hexToBytes as browserHexToBytes, checkEd25519StealthAddress, checkStealthAddress, commit, commitZero, computeAttestationHash, createCommitment, createEthereumAdapter, createLedgerAdapter, createMockEthereumAdapter, createMockEthereumProvider, createMockLedgerAdapter, createMockSolanaAdapter, createMockSolanaConnection, createMockSolanaProvider, createMockSolver, createMockTrezorAdapter, createNEARIntentsAdapter, createOracleRegistry, createProductionSIP, createSIP, createShieldedIntent, createShieldedPayment, createSolanaAdapter, createTrezorAdapter, createWalletFactory, createZcashClient, createZcashShieldedService, decodeStealthMetaAddress, decryptMemo, decryptWithViewing, deriveEd25519StealthPrivateKey, deriveOracleId, deriveStealthPrivateKey, deriveViewingKey, deserializeAttestationMessage, deserializeIntent, deserializePayment, detectEthereumWallets, detectSolanaWallets, ed25519PublicKeyToNearAddress, ed25519PublicKeyToSolanaAddress, encodeStealthMetaAddress, encryptForViewing, featureNotSupportedError, formatStablecoinAmount, fromHex, fromStablecoinUnits, generateBlinding, generateEd25519StealthAddress, generateEd25519StealthMetaAddress, generateIntentId, generateRandomBytes, generateStealthAddress, generateStealthMetaAddress, generateViewingKey, getActiveOracles, getAvailableTransports, getBrowserInfo, getChainNumericId, getChainsForStablecoin, getCurveForChain, getDefaultRpcEndpoint, getDerivationPath, getErrorMessage, getEthereumProvider, getGenerators, getIntentSummary, getPaymentSummary, getPaymentTimeRemaining, getPrivacyConfig, getPrivacyDescription, getSolanaProvider, getStablecoin, getStablecoinInfo, getStablecoinsForChain, getSupportedStablecoins, getTimeRemaining, hasEnoughOracles, hasErrorCode, hasRequiredProofs, hash, hexToNumber, isBrowser, isEd25519Chain, isExpired, isNonNegativeAmount, isPaymentExpired, isPrivateWalletAdapter, isSIPError, isStablecoin, isStablecoinOnChain, isValidAmount, isValidChainId, isValidCompressedPublicKey, isValidEd25519PublicKey, isValidHex, isValidHexLength, isValidNearAccountId, isValidNearImplicitAddress, isValidPrivacyLevel, isValidPrivateKey, isValidScalar, isValidSlippage, isValidSolanaAddress, isValidStealthMetaAddress, nearAddressToEd25519PublicKey, normalizeAddress, notConnectedError, publicKeyToEthAddress, registerWallet, removeOracle, secureWipe, secureWipeAll, serializeAttestationMessage, serializeIntent, serializePayment, signAttestationMessage, solanaAddressToEd25519PublicKey, solanaPublicKeyToHex, subtractBlindings, subtractCommitments, supportsSharedArrayBuffer, supportsWebBluetooth, supportsWebHID, supportsWebUSB, supportsWebWorkers, toHex, toStablecoinUnits, trackIntent, trackPayment, updateOracleStatus, validateAsset, validateCreateIntentParams, validateIntentInput, validateIntentOutput, validateScalar, validateViewingKey, verifyAttestation, verifyCommitment, verifyOpening, verifyOracleSignature, walletRegistry, withSecureBuffer, withSecureBufferSync, wrapError };
5898
+ export { ATTESTATION_VERSION, type AttestationRequest, type AttestationResult, BrowserNoirProvider as B, BaseWalletAdapter, type BridgeProvider, type BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, type CommitmentPoint, ComplianceManager, type CreateIntentOptions, type CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, type EIP1193ConnectInfo, type EIP1193Event, type EIP1193Provider, type EIP1193ProviderRpcError, type EIP1193RequestArguments, type EIP712Domain, type EIP712TypeDefinition, type EIP712TypedData, type EIP712Types, EncryptionNotImplementedError, ErrorCode, type EthereumAdapterConfig, EthereumChainId, type EthereumChainIdType, type EthereumChainMetadata, type EthereumTokenMetadata, type EthereumTransactionReceipt, type EthereumTransactionRequest, EthereumWalletAdapter, type EthereumWalletName, type ExportedViewingKey, FulfillmentProofParams, FundingProofParams, type HardwareAccount, type HardwareConnectionStatus, type HardwareDeviceInfo, HardwareErrorCode, type HardwareErrorCodeType, type HardwareEthereumTx, type HardwareSignRequest, type HardwareSignature, type HardwareTransport, type HardwareWalletConfig, HardwareWalletError, type HardwareWalletType, IntentBuilder, IntentError, type LedgerConfig, type LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, type MockEthereumAdapterConfig, type MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, type MockSolanaAdapterConfig, MockSolver, type MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, type NEARIntentsAdapterConfig, NetworkError, ORACLE_DOMAIN, OneClickClient, type OracleAttestationMessage, type OracleId, type OracleInfo, type OracleRegistry, type OracleRegistryConfig, type OracleSignature, type OracleStatus, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PriceFeed, type PrivacyConfig, type ProductionQuote, ProofError, ProofFramework, ProofNotImplementedError, type ProofProgressCallback, ProofProvider, ProofResult, type ReceivedNote, SIP, type SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, type SerializedError, type ShieldedBalance, type ShieldedSendParams, type ShieldedSendResult, type SignedOracleAttestation, type SolanaAdapterConfig, type SolanaCluster, type SolanaConnection, type SolanaPublicKey, type SolanaSendOptions, type SolanaSignature, type SolanaTransaction, type SolanaUnsignedTransaction, type SolanaVersionedTransaction, SolanaWalletAdapter, type SolanaWalletName, type SolanaWalletProvider, type StablecoinInfo, type StealthCurve, type SwapRequest, type SwapResult, type TransactionData, type TransportType, Treasury, type TrezorConfig, type TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, type VerificationResult, type WalletAdapter, WalletError, type ZcashQuote, type ZcashQuoteParams, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, type ZcashShieldedServiceConfig, type ZcashSwapParams, type ZcashSwapResult, ZcashSwapService, type ZcashSwapServiceConfig, type ZcashSwapSourceChain, type ZcashSwapSourceToken, type ZcashSwapStatus, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, bytesToHex as browserBytesToHex, hexToBytes as browserHexToBytes, checkEd25519StealthAddress, checkStealthAddress, commit, commitZero, computeAttestationHash, createCommitment, createEthereumAdapter, createLedgerAdapter, createMockEthereumAdapter, createMockEthereumProvider, createMockLedgerAdapter, createMockSolanaAdapter, createMockSolanaConnection, createMockSolanaProvider, createMockSolver, createMockTrezorAdapter, createNEARIntentsAdapter, createOracleRegistry, createProductionSIP, createSIP, createShieldedIntent, createShieldedPayment, createSolanaAdapter, createTrezorAdapter, createWalletFactory, createZcashClient, createZcashShieldedService, createZcashSwapService, decodeStealthMetaAddress, decryptMemo, decryptWithViewing, deriveEd25519StealthPrivateKey, deriveOracleId, deriveStealthPrivateKey, deriveViewingKey, deserializeAttestationMessage, deserializeIntent, deserializePayment, detectEthereumWallets, detectSolanaWallets, ed25519PublicKeyToNearAddress, ed25519PublicKeyToSolanaAddress, encodeStealthMetaAddress, encryptForViewing, featureNotSupportedError, formatStablecoinAmount, fromHex, fromStablecoinUnits, generateBlinding, generateEd25519StealthAddress, generateEd25519StealthMetaAddress, generateIntentId, generateRandomBytes, generateStealthAddress, generateStealthMetaAddress, generateViewingKey, getActiveOracles, getAvailableTransports, getBrowserInfo, getChainNumericId, getChainsForStablecoin, getCurveForChain, getDefaultRpcEndpoint, getDerivationPath, getErrorMessage, getEthereumProvider, getGenerators, getIntentSummary, getPaymentSummary, getPaymentTimeRemaining, getPrivacyConfig, getPrivacyDescription, getSolanaProvider, getStablecoin, getStablecoinInfo, getStablecoinsForChain, getSupportedStablecoins, getTimeRemaining, hasEnoughOracles, hasErrorCode, hasRequiredProofs, hash, hexToNumber, isBrowser, isEd25519Chain, isExpired, isNonNegativeAmount, isPaymentExpired, isPrivateWalletAdapter, isSIPError, isStablecoin, isStablecoinOnChain, isValidAmount, isValidChainId, isValidCompressedPublicKey, isValidEd25519PublicKey, isValidHex, isValidHexLength, isValidNearAccountId, isValidNearImplicitAddress, isValidPrivacyLevel, isValidPrivateKey, isValidScalar, isValidSlippage, isValidSolanaAddress, isValidStealthMetaAddress, nearAddressToEd25519PublicKey, normalizeAddress, notConnectedError, publicKeyToEthAddress, registerWallet, removeOracle, secureWipe, secureWipeAll, serializeAttestationMessage, serializeIntent, serializePayment, signAttestationMessage, solanaAddressToEd25519PublicKey, solanaPublicKeyToHex, subtractBlindings, subtractCommitments, supportsSharedArrayBuffer, supportsWebBluetooth, supportsWebHID, supportsWebUSB, supportsWebWorkers, toHex, toStablecoinUnits, trackIntent, trackPayment, updateOracleStatus, validateAsset, validateCreateIntentParams, validateIntentInput, validateIntentOutput, validateScalar, validateViewingKey, verifyAttestation, verifyCommitment, verifyOpening, verifyOracleSignature, walletRegistry, withSecureBuffer, withSecureBufferSync, wrapError };
package/dist/index.d.ts CHANGED
@@ -3100,6 +3100,294 @@ declare class ZcashShieldedService {
3100
3100
  */
3101
3101
  declare function createZcashShieldedService(config: ZcashShieldedServiceConfig): ZcashShieldedService;
3102
3102
 
3103
+ /**
3104
+ * Zcash Swap Service
3105
+ *
3106
+ * Handles cross-chain swaps from ETH/SOL/NEAR to Zcash (ZEC).
3107
+ * Since NEAR Intents doesn't support ZEC as destination chain,
3108
+ * this service provides an alternative path for ZEC swaps.
3109
+ *
3110
+ * @example
3111
+ * ```typescript
3112
+ * const swapService = new ZcashSwapService({
3113
+ * zcashService: zcashShieldedService,
3114
+ * mode: 'demo', // or 'production' when bridge is available
3115
+ * })
3116
+ *
3117
+ * // Get quote for ETH → ZEC swap
3118
+ * const quote = await swapService.getQuote({
3119
+ * sourceChain: 'ethereum',
3120
+ * sourceToken: 'ETH',
3121
+ * amount: 1000000000000000000n, // 1 ETH
3122
+ * recipientZAddress: 'zs1...',
3123
+ * })
3124
+ *
3125
+ * // Execute the swap
3126
+ * const result = await swapService.executeSwapToShielded({
3127
+ * quoteId: quote.quoteId,
3128
+ * sourceChain: 'ethereum',
3129
+ * sourceToken: 'ETH',
3130
+ * amount: 1000000000000000000n,
3131
+ * recipientZAddress: 'zs1...',
3132
+ * })
3133
+ * ```
3134
+ */
3135
+
3136
+ /**
3137
+ * Supported source chains for ZEC swaps
3138
+ */
3139
+ type ZcashSwapSourceChain = 'ethereum' | 'solana' | 'near' | 'polygon' | 'arbitrum' | 'base';
3140
+ /**
3141
+ * Supported source tokens for ZEC swaps
3142
+ */
3143
+ type ZcashSwapSourceToken = 'ETH' | 'SOL' | 'NEAR' | 'USDC' | 'USDT' | 'MATIC';
3144
+ /**
3145
+ * Configuration for ZcashSwapService
3146
+ */
3147
+ interface ZcashSwapServiceConfig {
3148
+ /** Zcash shielded service for receiving ZEC */
3149
+ zcashService?: ZcashShieldedService;
3150
+ /** Operating mode */
3151
+ mode: 'demo' | 'production';
3152
+ /** Bridge provider (for production) */
3153
+ bridgeProvider?: BridgeProvider;
3154
+ /** Price feed for quotes */
3155
+ priceFeed?: PriceFeed;
3156
+ /** Default slippage tolerance (basis points, default: 100 = 1%) */
3157
+ defaultSlippage?: number;
3158
+ /** Quote validity duration in seconds (default: 60) */
3159
+ quoteValiditySeconds?: number;
3160
+ }
3161
+ /**
3162
+ * Bridge provider interface (for production mode)
3163
+ */
3164
+ interface BridgeProvider {
3165
+ /** Provider name */
3166
+ name: string;
3167
+ /** Get quote from bridge */
3168
+ getQuote(params: BridgeQuoteParams): Promise<BridgeQuote>;
3169
+ /** Execute swap through bridge */
3170
+ executeSwap(params: BridgeSwapParams): Promise<BridgeSwapResult>;
3171
+ /** Get supported chains */
3172
+ getSupportedChains(): Promise<ZcashSwapSourceChain[]>;
3173
+ }
3174
+ /**
3175
+ * Price feed interface for quote calculations
3176
+ */
3177
+ interface PriceFeed {
3178
+ /** Get current price in USD */
3179
+ getPrice(token: string): Promise<number>;
3180
+ /** Get ZEC price in USD */
3181
+ getZecPrice(): Promise<number>;
3182
+ }
3183
+ /**
3184
+ * Bridge quote parameters
3185
+ */
3186
+ interface BridgeQuoteParams {
3187
+ sourceChain: ZcashSwapSourceChain;
3188
+ sourceToken: ZcashSwapSourceToken;
3189
+ amount: bigint;
3190
+ recipientAddress: string;
3191
+ }
3192
+ /**
3193
+ * Bridge quote result
3194
+ */
3195
+ interface BridgeQuote {
3196
+ quoteId: string;
3197
+ amountIn: bigint;
3198
+ amountOut: bigint;
3199
+ fee: bigint;
3200
+ exchangeRate: number;
3201
+ validUntil: number;
3202
+ }
3203
+ /**
3204
+ * Bridge swap parameters
3205
+ */
3206
+ interface BridgeSwapParams extends BridgeQuoteParams {
3207
+ quoteId: string;
3208
+ depositAddress: string;
3209
+ }
3210
+ /**
3211
+ * Bridge swap result
3212
+ */
3213
+ interface BridgeSwapResult {
3214
+ txHash: string;
3215
+ status: 'pending' | 'completed' | 'failed';
3216
+ amountReceived?: bigint;
3217
+ }
3218
+ /**
3219
+ * Quote request parameters
3220
+ */
3221
+ interface ZcashQuoteParams {
3222
+ /** Source blockchain */
3223
+ sourceChain: ZcashSwapSourceChain;
3224
+ /** Source token symbol */
3225
+ sourceToken: ZcashSwapSourceToken;
3226
+ /** Amount in smallest unit (wei, lamports, etc.) */
3227
+ amount: bigint;
3228
+ /** Recipient z-address */
3229
+ recipientZAddress: string;
3230
+ /** Custom slippage (basis points) */
3231
+ slippage?: number;
3232
+ }
3233
+ /**
3234
+ * Quote response
3235
+ */
3236
+ interface ZcashQuote {
3237
+ /** Unique quote identifier */
3238
+ quoteId: string;
3239
+ /** Source chain */
3240
+ sourceChain: ZcashSwapSourceChain;
3241
+ /** Source token */
3242
+ sourceToken: ZcashSwapSourceToken;
3243
+ /** Input amount (in source token's smallest unit) */
3244
+ amountIn: bigint;
3245
+ /** Input amount formatted */
3246
+ amountInFormatted: string;
3247
+ /** Output amount in zatoshis (1 ZEC = 100,000,000 zatoshis) */
3248
+ amountOut: bigint;
3249
+ /** Output amount in ZEC */
3250
+ amountOutFormatted: string;
3251
+ /** Exchange rate (ZEC per source token) */
3252
+ exchangeRate: number;
3253
+ /** Network fee in source token */
3254
+ networkFee: bigint;
3255
+ /** Bridge/swap fee in source token */
3256
+ swapFee: bigint;
3257
+ /** Total fee in source token */
3258
+ totalFee: bigint;
3259
+ /** Slippage tolerance (basis points) */
3260
+ slippage: number;
3261
+ /** Minimum output amount after slippage */
3262
+ minimumOutput: bigint;
3263
+ /** Quote expiration timestamp */
3264
+ validUntil: number;
3265
+ /** Deposit address (where to send source tokens) */
3266
+ depositAddress: string;
3267
+ /** Estimated time to completion (seconds) */
3268
+ estimatedTime: number;
3269
+ /** Privacy level for the swap */
3270
+ privacyLevel: PrivacyLevel;
3271
+ }
3272
+ /**
3273
+ * Swap execution parameters
3274
+ */
3275
+ interface ZcashSwapParams {
3276
+ /** Quote ID to execute */
3277
+ quoteId?: string;
3278
+ /** Source blockchain */
3279
+ sourceChain: ZcashSwapSourceChain;
3280
+ /** Source token symbol */
3281
+ sourceToken: ZcashSwapSourceToken;
3282
+ /** Amount in smallest unit */
3283
+ amount: bigint;
3284
+ /** Recipient z-address (shielded) */
3285
+ recipientZAddress: string;
3286
+ /** Optional memo for the transaction */
3287
+ memo?: string;
3288
+ /** Custom slippage (basis points) */
3289
+ slippage?: number;
3290
+ }
3291
+ /**
3292
+ * Swap execution result
3293
+ */
3294
+ interface ZcashSwapResult {
3295
+ /** Swap request ID */
3296
+ requestId: string;
3297
+ /** Quote used */
3298
+ quoteId: string;
3299
+ /** Current status */
3300
+ status: ZcashSwapStatus;
3301
+ /** Source chain transaction hash (deposit tx) */
3302
+ sourceTxHash?: string;
3303
+ /** Zcash transaction ID (if completed) */
3304
+ zcashTxId?: string;
3305
+ /** Amount deposited */
3306
+ amountIn: bigint;
3307
+ /** Amount received in ZEC (zatoshis) */
3308
+ amountOut?: bigint;
3309
+ /** Recipient z-address */
3310
+ recipientZAddress: string;
3311
+ /** Timestamp */
3312
+ timestamp: number;
3313
+ /** Error message if failed */
3314
+ error?: string;
3315
+ }
3316
+ /**
3317
+ * Swap status
3318
+ */
3319
+ type ZcashSwapStatus = 'pending_deposit' | 'deposit_confirmed' | 'swapping' | 'sending_zec' | 'completed' | 'failed' | 'expired';
3320
+ /**
3321
+ * Zcash Swap Service
3322
+ *
3323
+ * Enables cross-chain swaps from ETH/SOL/NEAR to Zcash's shielded pool.
3324
+ */
3325
+ declare class ZcashSwapService {
3326
+ private readonly config;
3327
+ private readonly zcashService?;
3328
+ private readonly bridgeProvider?;
3329
+ private readonly priceFeed?;
3330
+ private readonly quotes;
3331
+ private readonly swaps;
3332
+ constructor(config: ZcashSwapServiceConfig);
3333
+ /**
3334
+ * Get a quote for swapping to ZEC
3335
+ */
3336
+ getQuote(params: ZcashQuoteParams): Promise<ZcashQuote>;
3337
+ /**
3338
+ * Get quote in demo mode (uses mock prices)
3339
+ */
3340
+ private getDemoQuote;
3341
+ /**
3342
+ * Get quote in production mode (uses bridge provider)
3343
+ */
3344
+ private getProductionQuote;
3345
+ /**
3346
+ * Execute a swap to Zcash shielded pool
3347
+ */
3348
+ executeSwapToShielded(params: ZcashSwapParams): Promise<ZcashSwapResult>;
3349
+ /**
3350
+ * Execute swap in demo mode
3351
+ */
3352
+ private executeDemoSwap;
3353
+ /**
3354
+ * Execute swap in production mode
3355
+ */
3356
+ private executeProductionSwap;
3357
+ /**
3358
+ * Get swap status
3359
+ */
3360
+ getSwapStatus(requestId: string): Promise<ZcashSwapResult | null>;
3361
+ /**
3362
+ * Wait for swap completion
3363
+ */
3364
+ waitForCompletion(requestId: string, timeout?: number, pollInterval?: number): Promise<ZcashSwapResult>;
3365
+ /**
3366
+ * Get supported source chains
3367
+ */
3368
+ getSupportedChains(): Promise<ZcashSwapSourceChain[]>;
3369
+ /**
3370
+ * Get supported source tokens for a chain
3371
+ */
3372
+ getSupportedTokens(chain: ZcashSwapSourceChain): ZcashSwapSourceToken[];
3373
+ /**
3374
+ * Check if a swap route is supported
3375
+ */
3376
+ isRouteSupported(chain: ZcashSwapSourceChain, token: ZcashSwapSourceToken): boolean;
3377
+ private validateQuoteParams;
3378
+ private isValidZAddressFormat;
3379
+ private generateMockDepositAddress;
3380
+ private getEstimatedTime;
3381
+ private formatAmount;
3382
+ private randomHex;
3383
+ private randomBase58;
3384
+ private delay;
3385
+ }
3386
+ /**
3387
+ * Create a Zcash swap service instance
3388
+ */
3389
+ declare function createZcashSwapService(config: ZcashSwapServiceConfig): ZcashSwapService;
3390
+
3103
3391
  /**
3104
3392
  * Shielded Payments for SIP Protocol
3105
3393
  *
@@ -5607,4 +5895,4 @@ declare function createMockLedgerAdapter(config: Omit<MockHardwareConfig, 'devic
5607
5895
  */
5608
5896
  declare function createMockTrezorAdapter(config: Omit<MockHardwareConfig, 'deviceType'>): MockTrezorAdapter;
5609
5897
 
5610
- export { ATTESTATION_VERSION, type AttestationRequest, type AttestationResult, BrowserNoirProvider as B, BaseWalletAdapter, type BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, type CommitmentPoint, ComplianceManager, type CreateIntentOptions, type CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, type EIP1193ConnectInfo, type EIP1193Event, type EIP1193Provider, type EIP1193ProviderRpcError, type EIP1193RequestArguments, type EIP712Domain, type EIP712TypeDefinition, type EIP712TypedData, type EIP712Types, EncryptionNotImplementedError, ErrorCode, type EthereumAdapterConfig, EthereumChainId, type EthereumChainIdType, type EthereumChainMetadata, type EthereumTokenMetadata, type EthereumTransactionReceipt, type EthereumTransactionRequest, EthereumWalletAdapter, type EthereumWalletName, type ExportedViewingKey, FulfillmentProofParams, FundingProofParams, type HardwareAccount, type HardwareConnectionStatus, type HardwareDeviceInfo, HardwareErrorCode, type HardwareErrorCodeType, type HardwareEthereumTx, type HardwareSignRequest, type HardwareSignature, type HardwareTransport, type HardwareWalletConfig, HardwareWalletError, type HardwareWalletType, IntentBuilder, IntentError, type LedgerConfig, type LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, type MockEthereumAdapterConfig, type MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, type MockSolanaAdapterConfig, MockSolver, type MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, type NEARIntentsAdapterConfig, NetworkError, ORACLE_DOMAIN, OneClickClient, type OracleAttestationMessage, type OracleId, type OracleInfo, type OracleRegistry, type OracleRegistryConfig, type OracleSignature, type OracleStatus, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PrivacyConfig, type ProductionQuote, ProofError, ProofFramework, ProofNotImplementedError, type ProofProgressCallback, ProofProvider, ProofResult, type ReceivedNote, SIP, type SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, type SerializedError, type ShieldedBalance, type ShieldedSendParams, type ShieldedSendResult, type SignedOracleAttestation, type SolanaAdapterConfig, type SolanaCluster, type SolanaConnection, type SolanaPublicKey, type SolanaSendOptions, type SolanaSignature, type SolanaTransaction, type SolanaUnsignedTransaction, type SolanaVersionedTransaction, SolanaWalletAdapter, type SolanaWalletName, type SolanaWalletProvider, type StablecoinInfo, type StealthCurve, type SwapRequest, type SwapResult, type TransactionData, type TransportType, Treasury, type TrezorConfig, type TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, type VerificationResult, type WalletAdapter, WalletError, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, type ZcashShieldedServiceConfig, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, bytesToHex as browserBytesToHex, hexToBytes as browserHexToBytes, checkEd25519StealthAddress, checkStealthAddress, commit, commitZero, computeAttestationHash, createCommitment, createEthereumAdapter, createLedgerAdapter, createMockEthereumAdapter, createMockEthereumProvider, createMockLedgerAdapter, createMockSolanaAdapter, createMockSolanaConnection, createMockSolanaProvider, createMockSolver, createMockTrezorAdapter, createNEARIntentsAdapter, createOracleRegistry, createProductionSIP, createSIP, createShieldedIntent, createShieldedPayment, createSolanaAdapter, createTrezorAdapter, createWalletFactory, createZcashClient, createZcashShieldedService, decodeStealthMetaAddress, decryptMemo, decryptWithViewing, deriveEd25519StealthPrivateKey, deriveOracleId, deriveStealthPrivateKey, deriveViewingKey, deserializeAttestationMessage, deserializeIntent, deserializePayment, detectEthereumWallets, detectSolanaWallets, ed25519PublicKeyToNearAddress, ed25519PublicKeyToSolanaAddress, encodeStealthMetaAddress, encryptForViewing, featureNotSupportedError, formatStablecoinAmount, fromHex, fromStablecoinUnits, generateBlinding, generateEd25519StealthAddress, generateEd25519StealthMetaAddress, generateIntentId, generateRandomBytes, generateStealthAddress, generateStealthMetaAddress, generateViewingKey, getActiveOracles, getAvailableTransports, getBrowserInfo, getChainNumericId, getChainsForStablecoin, getCurveForChain, getDefaultRpcEndpoint, getDerivationPath, getErrorMessage, getEthereumProvider, getGenerators, getIntentSummary, getPaymentSummary, getPaymentTimeRemaining, getPrivacyConfig, getPrivacyDescription, getSolanaProvider, getStablecoin, getStablecoinInfo, getStablecoinsForChain, getSupportedStablecoins, getTimeRemaining, hasEnoughOracles, hasErrorCode, hasRequiredProofs, hash, hexToNumber, isBrowser, isEd25519Chain, isExpired, isNonNegativeAmount, isPaymentExpired, isPrivateWalletAdapter, isSIPError, isStablecoin, isStablecoinOnChain, isValidAmount, isValidChainId, isValidCompressedPublicKey, isValidEd25519PublicKey, isValidHex, isValidHexLength, isValidNearAccountId, isValidNearImplicitAddress, isValidPrivacyLevel, isValidPrivateKey, isValidScalar, isValidSlippage, isValidSolanaAddress, isValidStealthMetaAddress, nearAddressToEd25519PublicKey, normalizeAddress, notConnectedError, publicKeyToEthAddress, registerWallet, removeOracle, secureWipe, secureWipeAll, serializeAttestationMessage, serializeIntent, serializePayment, signAttestationMessage, solanaAddressToEd25519PublicKey, solanaPublicKeyToHex, subtractBlindings, subtractCommitments, supportsSharedArrayBuffer, supportsWebBluetooth, supportsWebHID, supportsWebUSB, supportsWebWorkers, toHex, toStablecoinUnits, trackIntent, trackPayment, updateOracleStatus, validateAsset, validateCreateIntentParams, validateIntentInput, validateIntentOutput, validateScalar, validateViewingKey, verifyAttestation, verifyCommitment, verifyOpening, verifyOracleSignature, walletRegistry, withSecureBuffer, withSecureBufferSync, wrapError };
5898
+ export { ATTESTATION_VERSION, type AttestationRequest, type AttestationResult, BrowserNoirProvider as B, BaseWalletAdapter, type BridgeProvider, type BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, type CommitmentPoint, ComplianceManager, type CreateIntentOptions, type CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, type EIP1193ConnectInfo, type EIP1193Event, type EIP1193Provider, type EIP1193ProviderRpcError, type EIP1193RequestArguments, type EIP712Domain, type EIP712TypeDefinition, type EIP712TypedData, type EIP712Types, EncryptionNotImplementedError, ErrorCode, type EthereumAdapterConfig, EthereumChainId, type EthereumChainIdType, type EthereumChainMetadata, type EthereumTokenMetadata, type EthereumTransactionReceipt, type EthereumTransactionRequest, EthereumWalletAdapter, type EthereumWalletName, type ExportedViewingKey, FulfillmentProofParams, FundingProofParams, type HardwareAccount, type HardwareConnectionStatus, type HardwareDeviceInfo, HardwareErrorCode, type HardwareErrorCodeType, type HardwareEthereumTx, type HardwareSignRequest, type HardwareSignature, type HardwareTransport, type HardwareWalletConfig, HardwareWalletError, type HardwareWalletType, IntentBuilder, IntentError, type LedgerConfig, type LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, type MockEthereumAdapterConfig, type MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, type MockSolanaAdapterConfig, MockSolver, type MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, type NEARIntentsAdapterConfig, NetworkError, ORACLE_DOMAIN, OneClickClient, type OracleAttestationMessage, type OracleId, type OracleInfo, type OracleRegistry, type OracleRegistryConfig, type OracleSignature, type OracleStatus, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PriceFeed, type PrivacyConfig, type ProductionQuote, ProofError, ProofFramework, ProofNotImplementedError, type ProofProgressCallback, ProofProvider, ProofResult, type ReceivedNote, SIP, type SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, type SerializedError, type ShieldedBalance, type ShieldedSendParams, type ShieldedSendResult, type SignedOracleAttestation, type SolanaAdapterConfig, type SolanaCluster, type SolanaConnection, type SolanaPublicKey, type SolanaSendOptions, type SolanaSignature, type SolanaTransaction, type SolanaUnsignedTransaction, type SolanaVersionedTransaction, SolanaWalletAdapter, type SolanaWalletName, type SolanaWalletProvider, type StablecoinInfo, type StealthCurve, type SwapRequest, type SwapResult, type TransactionData, type TransportType, Treasury, type TrezorConfig, type TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, type VerificationResult, type WalletAdapter, WalletError, type ZcashQuote, type ZcashQuoteParams, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, type ZcashShieldedServiceConfig, type ZcashSwapParams, type ZcashSwapResult, ZcashSwapService, type ZcashSwapServiceConfig, type ZcashSwapSourceChain, type ZcashSwapSourceToken, type ZcashSwapStatus, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, bytesToHex as browserBytesToHex, hexToBytes as browserHexToBytes, checkEd25519StealthAddress, checkStealthAddress, commit, commitZero, computeAttestationHash, createCommitment, createEthereumAdapter, createLedgerAdapter, createMockEthereumAdapter, createMockEthereumProvider, createMockLedgerAdapter, createMockSolanaAdapter, createMockSolanaConnection, createMockSolanaProvider, createMockSolver, createMockTrezorAdapter, createNEARIntentsAdapter, createOracleRegistry, createProductionSIP, createSIP, createShieldedIntent, createShieldedPayment, createSolanaAdapter, createTrezorAdapter, createWalletFactory, createZcashClient, createZcashShieldedService, createZcashSwapService, decodeStealthMetaAddress, decryptMemo, decryptWithViewing, deriveEd25519StealthPrivateKey, deriveOracleId, deriveStealthPrivateKey, deriveViewingKey, deserializeAttestationMessage, deserializeIntent, deserializePayment, detectEthereumWallets, detectSolanaWallets, ed25519PublicKeyToNearAddress, ed25519PublicKeyToSolanaAddress, encodeStealthMetaAddress, encryptForViewing, featureNotSupportedError, formatStablecoinAmount, fromHex, fromStablecoinUnits, generateBlinding, generateEd25519StealthAddress, generateEd25519StealthMetaAddress, generateIntentId, generateRandomBytes, generateStealthAddress, generateStealthMetaAddress, generateViewingKey, getActiveOracles, getAvailableTransports, getBrowserInfo, getChainNumericId, getChainsForStablecoin, getCurveForChain, getDefaultRpcEndpoint, getDerivationPath, getErrorMessage, getEthereumProvider, getGenerators, getIntentSummary, getPaymentSummary, getPaymentTimeRemaining, getPrivacyConfig, getPrivacyDescription, getSolanaProvider, getStablecoin, getStablecoinInfo, getStablecoinsForChain, getSupportedStablecoins, getTimeRemaining, hasEnoughOracles, hasErrorCode, hasRequiredProofs, hash, hexToNumber, isBrowser, isEd25519Chain, isExpired, isNonNegativeAmount, isPaymentExpired, isPrivateWalletAdapter, isSIPError, isStablecoin, isStablecoinOnChain, isValidAmount, isValidChainId, isValidCompressedPublicKey, isValidEd25519PublicKey, isValidHex, isValidHexLength, isValidNearAccountId, isValidNearImplicitAddress, isValidPrivacyLevel, isValidPrivateKey, isValidScalar, isValidSlippage, isValidSolanaAddress, isValidStealthMetaAddress, nearAddressToEd25519PublicKey, normalizeAddress, notConnectedError, publicKeyToEthAddress, registerWallet, removeOracle, secureWipe, secureWipeAll, serializeAttestationMessage, serializeIntent, serializePayment, signAttestationMessage, solanaAddressToEd25519PublicKey, solanaPublicKeyToHex, subtractBlindings, subtractCommitments, supportsSharedArrayBuffer, supportsWebBluetooth, supportsWebHID, supportsWebUSB, supportsWebWorkers, toHex, toStablecoinUnits, trackIntent, trackPayment, updateOracleStatus, validateAsset, validateCreateIntentParams, validateIntentInput, validateIntentOutput, validateScalar, validateViewingKey, verifyAttestation, verifyCommitment, verifyOpening, verifyOracleSignature, walletRegistry, withSecureBuffer, withSecureBufferSync, wrapError };