@sip-protocol/sdk 0.3.0 → 0.3.2

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.
@@ -1,4 +1,4 @@
1
- export { bj as ATTESTATION_VERSION, bv as AttestationRequest, bw as AttestationResult, bT as BackendCapabilities, cT as BaseWalletAdapter, cr as BridgeProvider, B as BrowserNoirProvider, t as BrowserNoirProviderConfig, bm as CHAIN_NUMERIC_IDS, aM as CommitmentPoint, cS as ComplianceManager, $ as CreateIntentOptions, cP as CreatePaymentOptions, C as CryptoError, bk as DEFAULT_THRESHOLD, bl as DEFAULT_TOTAL_ORACLES, dq as DerivationPath, dT as EIP1193ConnectInfo, dS as EIP1193Event, dQ as EIP1193Provider, dU as EIP1193ProviderRpcError, dR as EIP1193RequestArguments, dV as EIP712Domain, dW as EIP712TypeDefinition, dY as EIP712TypedData, dX as EIP712Types, w as EncryptionNotImplementedError, E as ErrorCode, e2 as EthereumAdapterConfig, dm as EthereumChainId, e3 as EthereumChainIdType, e0 as EthereumChainMetadata, d$ as EthereumTokenMetadata, d_ as EthereumTransactionReceipt, dZ as EthereumTransactionRequest, da as EthereumWalletAdapter, e1 as EthereumWalletName, ci as ExportedViewingKey, c0 as FindBestRouteParams, eh as HardwareAccount, e8 as HardwareConnectionStatus, ea as HardwareDeviceInfo, dn as HardwareErrorCode, ej as HardwareErrorCodeType, ef as HardwareEthereumTx, ee as HardwareSignRequest, eg as HardwareSignature, ei as HardwareTransport, eb as HardwareWalletConfig, dp as HardwareWalletError, e5 as HardwareWalletType, L as IntentBuilder, I as IntentError, ec as LedgerConfig, e6 as LedgerModel, dw as LedgerWalletAdapter, p as MobileBrowser, q as MobileDeviceInfo, M as MobilePlatform, r as MobileWASMCompatibility, dc as MockEthereumAdapter, e4 as MockEthereumAdapterConfig, ek as MockHardwareConfig, dA as MockLedgerAdapter, b3 as MockProofProvider, d2 as MockSolanaAdapter, dP as MockSolanaAdapterConfig, bF as MockSolver, bH as MockSolverConfig, dB as MockTrezorAdapter, cU as MockWalletAdapter, bz as NEARIntentsAdapter, bE as NEARIntentsAdapterConfig, c1 as NEARIntentsBackend, N as NetworkError, bi as ORACLE_DOMAIN, by as OneClickClient, bq as OracleAttestationMessage, bn as OracleId, bp as OracleInfo, bt as OracleRegistry, bu as OracleRegistryConfig, br as OracleSignature, bo as OracleStatus, ct as PaymentBuilder, aL as PedersenCommitment, bC as PreparedSwap, cs as PriceFeed, ar as PrivacyConfig, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, b$ as QuoteComparison, cg as ReceivedNote, bX as Route, b_ as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, cD as STABLECOIN_ADDRESSES, cE as STABLECOIN_DECIMALS, cC as STABLECOIN_INFO, D as SerializedError, bU as SettlementBackend, bV as SettlementBackendFactory, bL as SettlementBackendName, bW as SettlementBackendRegistry, bN as SettlementQuote, bM as SettlementQuoteParams, bJ as SettlementRegistry, bK as SettlementRegistryError, bQ as SettlementSwapParams, bR as SettlementSwapResult, bO as SettlementSwapRoute, bP as SettlementSwapRouteStep, ch as ShieldedBalance, ce as ShieldedSendParams, cf as ShieldedSendResult, bs as SignedOracleAttestation, bY as SmartRouter, dK as SolanaAdapterConfig, dJ as SolanaCluster, dL as SolanaConnection, dE as SolanaPublicKey, dM as SolanaSendOptions, dO as SolanaSignature, dF as SolanaTransaction, dN as SolanaUnsignedTransaction, dG as SolanaVersionedTransaction, d0 as SolanaWalletAdapter, dI as SolanaWalletName, dH as SolanaWalletProvider, cQ as StablecoinInfo, ak as StealthCurve, bB as SwapRequest, bD as SwapResult, bI as SwapStatus, bS as SwapStatusResponse, as as TransactionData, e9 as TransportType, cR as Treasury, ed as TrezorConfig, e7 as TrezorModel, dy as TrezorWalletAdapter, V as ValidationError, bx as VerificationResult, W as WalletAdapter, cV as WalletError, c3 as ZcashNativeBackend, c5 as ZcashNativeBackendConfig, cn as ZcashQuote, cm as ZcashQuoteParams, c6 as ZcashRPCClient, c7 as ZcashRPCError, c9 as ZcashShieldedService, cd as ZcashShieldedServiceConfig, co as ZcashSwapParams, cp as ZcashSwapResult, cb as ZcashSwapService, cj as ZcashSwapServiceConfig, ck as ZcashSwapSourceChain, cl as ZcashSwapSourceToken, cq as ZcashSwapStatus, aH as addBlindings, aF as addCommitments, b9 as addOracle, Q as attachProofs, d9 as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ac as checkEd25519StealthAddress, f as checkMobileWASMCompatibility, a3 as checkStealthAddress, aC as commit, aE as commitZero, bg as computeAttestationHash, at as createCommitment, db as createEthereumAdapter, dx as createLedgerAdapter, dd as createMockEthereumAdapter, de as createMockEthereumProvider, dC as createMockLedgerAdapter, d3 as createMockSolanaAdapter, d5 as createMockSolanaConnection, d4 as createMockSolanaProvider, bG as createMockSolver, dD as createMockTrezorAdapter, bA as createNEARIntentsAdapter, c2 as createNEARIntentsBackend, b8 as createOracleRegistry, H as createProductionSIP, G as createSIP, O as createShieldedIntent, cu as createShieldedPayment, bZ as createSmartRouter, d1 as createSolanaAdapter, dz as createTrezorAdapter, c_ as createWalletFactory, c8 as createZcashClient, c4 as createZcashNativeBackend, ca as createZcashShieldedService, cc as createZcashSwapService, a5 as decodeStealthMetaAddress, cv as decryptMemo, ap as decryptWithViewing, ab as deriveEd25519StealthPrivateKey, b7 as deriveOracleId, a2 as deriveStealthPrivateKey, an as deriveViewingKey, bf as deserializeAttestationMessage, Z as deserializeIntent, cA as deserializePayment, dg as detectEthereumWallets, c as detectMobileBrowser, d as detectMobilePlatform, d7 as detectSolanaWallets, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, a4 as encodeStealthMetaAddress, ao as encryptForViewing, cX as featureNotSupportedError, cO as formatStablecoinAmount, di as fromHex, cN as fromStablecoinUnits, aK as generateBlinding, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, av as generateIntentId, ax as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, am as generateViewingKey, bc as getActiveOracles, dv as getAvailableTransports, g as getBrowserInfo, j as getBrowserVersion, bh as getChainNumericId, cL as getChainsForStablecoin, a8 as getCurveForChain, dl as getDefaultRpcEndpoint, dr as getDerivationPath, A as getErrorMessage, df as getEthereumProvider, aJ as getGenerators, _ as getIntentSummary, e as getMobileDeviceInfo, k as getOSVersion, cB as getPaymentSummary, cy as getPaymentTimeRemaining, al as getPrivacyConfig, aq as getPrivacyDescription, d6 as getSolanaProvider, cF as getStablecoin, cI as getStablecoinInfo, cG as getStablecoinsForChain, cJ as getSupportedStablecoins, X as getTimeRemaining, bd as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aw as hash, dj as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, aS as isNonNegativeAmount, cx as isPaymentExpired, c$ as isPrivateWalletAdapter, x as isSIPError, cH as isStablecoin, cK as isStablecoinOnChain, l as isTablet, aR as isValidAmount, aN as isValidChainId, aV as isValidCompressedPublicKey, aW as isValidEd25519PublicKey, aP as isValidHex, aQ as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, aO as isValidPrivacyLevel, aX as isValidPrivateKey, aY as isValidScalar, aT as isValidSlippage, af as isValidSolanaAddress, aU as isValidStealthMetaAddress, ah as nearAddressToEd25519PublicKey, dk as normalizeAddress, cW as notConnectedError, a6 as publicKeyToEthAddress, cZ as registerWallet, ba as removeOracle, ay as secureWipe, az as secureWipeAll, be as serializeAttestationMessage, Y as serializeIntent, cz as serializePayment, b6 as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, d8 as solanaPublicKeyToHex, aI as subtractBlindings, aG as subtractCommitments, a as supportsSharedArrayBuffer, m as supportsTouch, o as supportsWASMBulkMemory, n as supportsWASMSimd, du as supportsWebBluetooth, dt as supportsWebHID, ds as supportsWebUSB, s as supportsWebWorkers, dh as toHex, cM as toStablecoinUnits, T as trackIntent, cw as trackPayment, bb as updateOracleStatus, a_ as validateAsset, aZ as validateCreateIntentParams, a$ as validateIntentInput, b0 as validateIntentOutput, b2 as validateScalar, b1 as validateViewingKey, b4 as verifyAttestation, au as verifyCommitment, aD as verifyOpening, b5 as verifyOracleSignature, cY as walletRegistry, aA as withSecureBuffer, aB as withSecureBufferSync, z as wrapError } from './index-Co26-vbG.mjs';
1
+ export { bj as ATTESTATION_VERSION, bv as AttestationRequest, bw as AttestationResult, bT as BackendCapabilities, cT as BaseWalletAdapter, cr as BridgeProvider, B as BrowserNoirProvider, t as BrowserNoirProviderConfig, bm as CHAIN_NUMERIC_IDS, aM as CommitmentPoint, cS as ComplianceManager, $ as CreateIntentOptions, cP as CreatePaymentOptions, C as CryptoError, bk as DEFAULT_THRESHOLD, bl as DEFAULT_TOTAL_ORACLES, dq as DerivationPath, dT as EIP1193ConnectInfo, dS as EIP1193Event, dQ as EIP1193Provider, dU as EIP1193ProviderRpcError, dR as EIP1193RequestArguments, dV as EIP712Domain, dW as EIP712TypeDefinition, dY as EIP712TypedData, dX as EIP712Types, w as EncryptionNotImplementedError, E as ErrorCode, e2 as EthereumAdapterConfig, dm as EthereumChainId, e3 as EthereumChainIdType, e0 as EthereumChainMetadata, d$ as EthereumTokenMetadata, d_ as EthereumTransactionReceipt, dZ as EthereumTransactionRequest, da as EthereumWalletAdapter, e1 as EthereumWalletName, ci as ExportedViewingKey, c0 as FindBestRouteParams, eh as HardwareAccount, e8 as HardwareConnectionStatus, ea as HardwareDeviceInfo, dn as HardwareErrorCode, ej as HardwareErrorCodeType, ef as HardwareEthereumTx, ee as HardwareSignRequest, eg as HardwareSignature, ei as HardwareTransport, eb as HardwareWalletConfig, dp as HardwareWalletError, e5 as HardwareWalletType, L as IntentBuilder, I as IntentError, ec as LedgerConfig, e6 as LedgerModel, dw as LedgerWalletAdapter, p as MobileBrowser, q as MobileDeviceInfo, M as MobilePlatform, r as MobileWASMCompatibility, dc as MockEthereumAdapter, e4 as MockEthereumAdapterConfig, ek as MockHardwareConfig, dA as MockLedgerAdapter, b3 as MockProofProvider, d2 as MockSolanaAdapter, dP as MockSolanaAdapterConfig, bF as MockSolver, bH as MockSolverConfig, dB as MockTrezorAdapter, cU as MockWalletAdapter, bz as NEARIntentsAdapter, bE as NEARIntentsAdapterConfig, c1 as NEARIntentsBackend, N as NetworkError, bi as ORACLE_DOMAIN, by as OneClickClient, bq as OracleAttestationMessage, bn as OracleId, bp as OracleInfo, bt as OracleRegistry, bu as OracleRegistryConfig, br as OracleSignature, bo as OracleStatus, ct as PaymentBuilder, aL as PedersenCommitment, bC as PreparedSwap, cs as PriceFeed, ar as PrivacyConfig, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, b$ as QuoteComparison, cg as ReceivedNote, bX as Route, b_ as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, cD as STABLECOIN_ADDRESSES, cE as STABLECOIN_DECIMALS, cC as STABLECOIN_INFO, D as SerializedError, bU as SettlementBackend, bV as SettlementBackendFactory, bL as SettlementBackendName, bW as SettlementBackendRegistry, bN as SettlementQuote, bM as SettlementQuoteParams, bJ as SettlementRegistry, bK as SettlementRegistryError, bQ as SettlementSwapParams, bR as SettlementSwapResult, bO as SettlementSwapRoute, bP as SettlementSwapRouteStep, ch as ShieldedBalance, ce as ShieldedSendParams, cf as ShieldedSendResult, bs as SignedOracleAttestation, bY as SmartRouter, dK as SolanaAdapterConfig, dJ as SolanaCluster, dL as SolanaConnection, dE as SolanaPublicKey, dM as SolanaSendOptions, dO as SolanaSignature, dF as SolanaTransaction, dN as SolanaUnsignedTransaction, dG as SolanaVersionedTransaction, d0 as SolanaWalletAdapter, dI as SolanaWalletName, dH as SolanaWalletProvider, cQ as StablecoinInfo, ak as StealthCurve, bB as SwapRequest, bD as SwapResult, bI as SwapStatus, bS as SwapStatusResponse, as as TransactionData, e9 as TransportType, cR as Treasury, ed as TrezorConfig, e7 as TrezorModel, dy as TrezorWalletAdapter, V as ValidationError, bx as VerificationResult, W as WalletAdapter, cV as WalletError, c3 as ZcashNativeBackend, c5 as ZcashNativeBackendConfig, cn as ZcashQuote, cm as ZcashQuoteParams, c6 as ZcashRPCClient, c7 as ZcashRPCError, c9 as ZcashShieldedService, cd as ZcashShieldedServiceConfig, co as ZcashSwapParams, cp as ZcashSwapResult, cb as ZcashSwapService, cj as ZcashSwapServiceConfig, ck as ZcashSwapSourceChain, cl as ZcashSwapSourceToken, cq as ZcashSwapStatus, aH as addBlindings, aF as addCommitments, b9 as addOracle, Q as attachProofs, d9 as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ac as checkEd25519StealthAddress, f as checkMobileWASMCompatibility, a3 as checkStealthAddress, aC as commit, aE as commitZero, bg as computeAttestationHash, at as createCommitment, db as createEthereumAdapter, dx as createLedgerAdapter, dd as createMockEthereumAdapter, de as createMockEthereumProvider, dC as createMockLedgerAdapter, d3 as createMockSolanaAdapter, d5 as createMockSolanaConnection, d4 as createMockSolanaProvider, bG as createMockSolver, dD as createMockTrezorAdapter, bA as createNEARIntentsAdapter, c2 as createNEARIntentsBackend, b8 as createOracleRegistry, H as createProductionSIP, G as createSIP, O as createShieldedIntent, cu as createShieldedPayment, bZ as createSmartRouter, d1 as createSolanaAdapter, dz as createTrezorAdapter, c_ as createWalletFactory, c8 as createZcashClient, c4 as createZcashNativeBackend, ca as createZcashShieldedService, cc as createZcashSwapService, a5 as decodeStealthMetaAddress, cv as decryptMemo, ap as decryptWithViewing, ab as deriveEd25519StealthPrivateKey, b7 as deriveOracleId, a2 as deriveStealthPrivateKey, an as deriveViewingKey, bf as deserializeAttestationMessage, Z as deserializeIntent, cA as deserializePayment, dg as detectEthereumWallets, c as detectMobileBrowser, d as detectMobilePlatform, d7 as detectSolanaWallets, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, a4 as encodeStealthMetaAddress, ao as encryptForViewing, cX as featureNotSupportedError, cO as formatStablecoinAmount, di as fromHex, cN as fromStablecoinUnits, aK as generateBlinding, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, av as generateIntentId, ax as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, am as generateViewingKey, bc as getActiveOracles, dv as getAvailableTransports, g as getBrowserInfo, j as getBrowserVersion, bh as getChainNumericId, cL as getChainsForStablecoin, a8 as getCurveForChain, dl as getDefaultRpcEndpoint, dr as getDerivationPath, A as getErrorMessage, df as getEthereumProvider, aJ as getGenerators, _ as getIntentSummary, e as getMobileDeviceInfo, k as getOSVersion, cB as getPaymentSummary, cy as getPaymentTimeRemaining, al as getPrivacyConfig, aq as getPrivacyDescription, d6 as getSolanaProvider, cF as getStablecoin, cI as getStablecoinInfo, cG as getStablecoinsForChain, cJ as getSupportedStablecoins, X as getTimeRemaining, bd as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aw as hash, dj as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, aS as isNonNegativeAmount, cx as isPaymentExpired, c$ as isPrivateWalletAdapter, x as isSIPError, cH as isStablecoin, cK as isStablecoinOnChain, l as isTablet, aR as isValidAmount, aN as isValidChainId, aV as isValidCompressedPublicKey, aW as isValidEd25519PublicKey, aP as isValidHex, aQ as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, aO as isValidPrivacyLevel, aX as isValidPrivateKey, aY as isValidScalar, aT as isValidSlippage, af as isValidSolanaAddress, aU as isValidStealthMetaAddress, ah as nearAddressToEd25519PublicKey, dk as normalizeAddress, cW as notConnectedError, a6 as publicKeyToEthAddress, cZ as registerWallet, ba as removeOracle, ay as secureWipe, az as secureWipeAll, be as serializeAttestationMessage, Y as serializeIntent, cz as serializePayment, b6 as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, d8 as solanaPublicKeyToHex, aI as subtractBlindings, aG as subtractCommitments, a as supportsSharedArrayBuffer, m as supportsTouch, o as supportsWASMBulkMemory, n as supportsWASMSimd, du as supportsWebBluetooth, dt as supportsWebHID, ds as supportsWebUSB, s as supportsWebWorkers, dh as toHex, cM as toStablecoinUnits, T as trackIntent, cw as trackPayment, bb as updateOracleStatus, a_ as validateAsset, aZ as validateCreateIntentParams, a$ as validateIntentInput, b0 as validateIntentOutput, b2 as validateScalar, b1 as validateViewingKey, b4 as verifyAttestation, au as verifyCommitment, aD as verifyOpening, b5 as verifyOracleSignature, cY as walletRegistry, aA as withSecureBuffer, aB as withSecureBufferSync, z as wrapError } from './index-DW7AQwcU.mjs';
2
2
  import { F as FundingProofParams, V as ValidityProofParams, a as FulfillmentProofParams, P as ProofResult } from './noir-BTyLXLlZ.mjs';
3
3
  export { N as NoirProviderConfig, O as OracleAttestation, d as ProofFramework, b as ProofGenerationError, c as ProofProvider } from './noir-BTyLXLlZ.mjs';
4
4
  export { Asset, AuditLogEntry, AuditScope, AuditorRegistration, AuditorViewingKey, BatchPaymentRecipient, BatchPaymentRequest, ChainId, Commitment, ComplianceConfig, ComplianceReport, ComplianceRole, CreateBatchProposalParams, CreateComplianceConfigParams, CreateIntentParams, CreatePaymentParams, CreatePaymentProposalParams, CreateTreasuryParams, DefuseAssetId, DisclosedTransaction, DisclosureRequest, FulfillmentCommitment, FulfillmentProof, FulfillmentRequest, FulfillmentResult, FulfillmentStatus, GenerateReportParams, Hash, HexString, WalletAdapter as IWalletAdapter, IntentStatus, NATIVE_TOKENS, OneClickConfig, OneClickDepositMode, OneClickErrorCode, OneClickQuoteRequest, OneClickQuoteResponse, OneClickStatusResponse, OneClickSwapStatus, OneClickSwapType, PaymentPurpose, PaymentReceipt, PaymentStatus, PaymentStatusType, PrivacyLevel, PrivateWalletAdapter, ProposalSignature, ProposalStatus, ProposalStatusType, ProposalType, Quote, RegisterAuditorParams, ReportData, ReportFormat, ReportStatus, ReportStatusType, ReportType, SIPSolver, SIP_VERSION, ShieldedIntent, ShieldedPayment, Signature, SignedTransaction, Solver, SolverCapabilities, SolverEvent, SolverEventListener, SolverQuote, SolverVisibleIntent, StablecoinSymbol, StealthAddress, StealthAddressRecovery, StealthMetaAddress, SwapRoute, SwapRouteStep, TrackedIntent, TrackedPayment, TransactionReceipt, TreasuryBalance, TreasuryConfig, TreasuryMember, TreasuryProposal, TreasuryRole, TreasuryTransaction, UnsignedTransaction, ViewingKey, WalletAccountChangedEvent, WalletAdapterFactory, WalletChainChangedEvent, WalletConnectEvent, WalletConnectionState, WalletDisconnectEvent, WalletErrorCode, WalletErrorEvent, WalletEvent, WalletEventHandler, WalletEventType, WalletInfo, WalletRegistryEntry, WalletShieldedSendParams, WalletShieldedSendResult, ZKProof, ZcashAccountAddress, ZcashAccountBalance, ZcashAddressInfo, ZcashAddressType, ZcashBlock, ZcashBlockHeader, ZcashBlockchainInfo, ZcashConfig, ZcashErrorCode, ZcashNetwork, ZcashNetworkInfo, ZcashNewAccount, ZcashOperation, ZcashOperationError, ZcashOperationStatus, ZcashOperationTxResult, ZcashPool, ZcashPoolBalance, ZcashPrivacyPolicy, ZcashReceiverType, ZcashSendRecipient, ZcashShieldedSendParams, ZcashUnspentNote, isPrivate, supportsViewingKey } from '@sip-protocol/types';
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { bj as ATTESTATION_VERSION, bv as AttestationRequest, bw as AttestationResult, bT as BackendCapabilities, cT as BaseWalletAdapter, cr as BridgeProvider, B as BrowserNoirProvider, t as BrowserNoirProviderConfig, bm as CHAIN_NUMERIC_IDS, aM as CommitmentPoint, cS as ComplianceManager, $ as CreateIntentOptions, cP as CreatePaymentOptions, C as CryptoError, bk as DEFAULT_THRESHOLD, bl as DEFAULT_TOTAL_ORACLES, dq as DerivationPath, dT as EIP1193ConnectInfo, dS as EIP1193Event, dQ as EIP1193Provider, dU as EIP1193ProviderRpcError, dR as EIP1193RequestArguments, dV as EIP712Domain, dW as EIP712TypeDefinition, dY as EIP712TypedData, dX as EIP712Types, w as EncryptionNotImplementedError, E as ErrorCode, e2 as EthereumAdapterConfig, dm as EthereumChainId, e3 as EthereumChainIdType, e0 as EthereumChainMetadata, d$ as EthereumTokenMetadata, d_ as EthereumTransactionReceipt, dZ as EthereumTransactionRequest, da as EthereumWalletAdapter, e1 as EthereumWalletName, ci as ExportedViewingKey, c0 as FindBestRouteParams, eh as HardwareAccount, e8 as HardwareConnectionStatus, ea as HardwareDeviceInfo, dn as HardwareErrorCode, ej as HardwareErrorCodeType, ef as HardwareEthereumTx, ee as HardwareSignRequest, eg as HardwareSignature, ei as HardwareTransport, eb as HardwareWalletConfig, dp as HardwareWalletError, e5 as HardwareWalletType, L as IntentBuilder, I as IntentError, ec as LedgerConfig, e6 as LedgerModel, dw as LedgerWalletAdapter, p as MobileBrowser, q as MobileDeviceInfo, M as MobilePlatform, r as MobileWASMCompatibility, dc as MockEthereumAdapter, e4 as MockEthereumAdapterConfig, ek as MockHardwareConfig, dA as MockLedgerAdapter, b3 as MockProofProvider, d2 as MockSolanaAdapter, dP as MockSolanaAdapterConfig, bF as MockSolver, bH as MockSolverConfig, dB as MockTrezorAdapter, cU as MockWalletAdapter, bz as NEARIntentsAdapter, bE as NEARIntentsAdapterConfig, c1 as NEARIntentsBackend, N as NetworkError, bi as ORACLE_DOMAIN, by as OneClickClient, bq as OracleAttestationMessage, bn as OracleId, bp as OracleInfo, bt as OracleRegistry, bu as OracleRegistryConfig, br as OracleSignature, bo as OracleStatus, ct as PaymentBuilder, aL as PedersenCommitment, bC as PreparedSwap, cs as PriceFeed, ar as PrivacyConfig, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, b$ as QuoteComparison, cg as ReceivedNote, bX as Route, b_ as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, cD as STABLECOIN_ADDRESSES, cE as STABLECOIN_DECIMALS, cC as STABLECOIN_INFO, D as SerializedError, bU as SettlementBackend, bV as SettlementBackendFactory, bL as SettlementBackendName, bW as SettlementBackendRegistry, bN as SettlementQuote, bM as SettlementQuoteParams, bJ as SettlementRegistry, bK as SettlementRegistryError, bQ as SettlementSwapParams, bR as SettlementSwapResult, bO as SettlementSwapRoute, bP as SettlementSwapRouteStep, ch as ShieldedBalance, ce as ShieldedSendParams, cf as ShieldedSendResult, bs as SignedOracleAttestation, bY as SmartRouter, dK as SolanaAdapterConfig, dJ as SolanaCluster, dL as SolanaConnection, dE as SolanaPublicKey, dM as SolanaSendOptions, dO as SolanaSignature, dF as SolanaTransaction, dN as SolanaUnsignedTransaction, dG as SolanaVersionedTransaction, d0 as SolanaWalletAdapter, dI as SolanaWalletName, dH as SolanaWalletProvider, cQ as StablecoinInfo, ak as StealthCurve, bB as SwapRequest, bD as SwapResult, bI as SwapStatus, bS as SwapStatusResponse, as as TransactionData, e9 as TransportType, cR as Treasury, ed as TrezorConfig, e7 as TrezorModel, dy as TrezorWalletAdapter, V as ValidationError, bx as VerificationResult, W as WalletAdapter, cV as WalletError, c3 as ZcashNativeBackend, c5 as ZcashNativeBackendConfig, cn as ZcashQuote, cm as ZcashQuoteParams, c6 as ZcashRPCClient, c7 as ZcashRPCError, c9 as ZcashShieldedService, cd as ZcashShieldedServiceConfig, co as ZcashSwapParams, cp as ZcashSwapResult, cb as ZcashSwapService, cj as ZcashSwapServiceConfig, ck as ZcashSwapSourceChain, cl as ZcashSwapSourceToken, cq as ZcashSwapStatus, aH as addBlindings, aF as addCommitments, b9 as addOracle, Q as attachProofs, d9 as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ac as checkEd25519StealthAddress, f as checkMobileWASMCompatibility, a3 as checkStealthAddress, aC as commit, aE as commitZero, bg as computeAttestationHash, at as createCommitment, db as createEthereumAdapter, dx as createLedgerAdapter, dd as createMockEthereumAdapter, de as createMockEthereumProvider, dC as createMockLedgerAdapter, d3 as createMockSolanaAdapter, d5 as createMockSolanaConnection, d4 as createMockSolanaProvider, bG as createMockSolver, dD as createMockTrezorAdapter, bA as createNEARIntentsAdapter, c2 as createNEARIntentsBackend, b8 as createOracleRegistry, H as createProductionSIP, G as createSIP, O as createShieldedIntent, cu as createShieldedPayment, bZ as createSmartRouter, d1 as createSolanaAdapter, dz as createTrezorAdapter, c_ as createWalletFactory, c8 as createZcashClient, c4 as createZcashNativeBackend, ca as createZcashShieldedService, cc as createZcashSwapService, a5 as decodeStealthMetaAddress, cv as decryptMemo, ap as decryptWithViewing, ab as deriveEd25519StealthPrivateKey, b7 as deriveOracleId, a2 as deriveStealthPrivateKey, an as deriveViewingKey, bf as deserializeAttestationMessage, Z as deserializeIntent, cA as deserializePayment, dg as detectEthereumWallets, c as detectMobileBrowser, d as detectMobilePlatform, d7 as detectSolanaWallets, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, a4 as encodeStealthMetaAddress, ao as encryptForViewing, cX as featureNotSupportedError, cO as formatStablecoinAmount, di as fromHex, cN as fromStablecoinUnits, aK as generateBlinding, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, av as generateIntentId, ax as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, am as generateViewingKey, bc as getActiveOracles, dv as getAvailableTransports, g as getBrowserInfo, j as getBrowserVersion, bh as getChainNumericId, cL as getChainsForStablecoin, a8 as getCurveForChain, dl as getDefaultRpcEndpoint, dr as getDerivationPath, A as getErrorMessage, df as getEthereumProvider, aJ as getGenerators, _ as getIntentSummary, e as getMobileDeviceInfo, k as getOSVersion, cB as getPaymentSummary, cy as getPaymentTimeRemaining, al as getPrivacyConfig, aq as getPrivacyDescription, d6 as getSolanaProvider, cF as getStablecoin, cI as getStablecoinInfo, cG as getStablecoinsForChain, cJ as getSupportedStablecoins, X as getTimeRemaining, bd as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aw as hash, dj as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, aS as isNonNegativeAmount, cx as isPaymentExpired, c$ as isPrivateWalletAdapter, x as isSIPError, cH as isStablecoin, cK as isStablecoinOnChain, l as isTablet, aR as isValidAmount, aN as isValidChainId, aV as isValidCompressedPublicKey, aW as isValidEd25519PublicKey, aP as isValidHex, aQ as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, aO as isValidPrivacyLevel, aX as isValidPrivateKey, aY as isValidScalar, aT as isValidSlippage, af as isValidSolanaAddress, aU as isValidStealthMetaAddress, ah as nearAddressToEd25519PublicKey, dk as normalizeAddress, cW as notConnectedError, a6 as publicKeyToEthAddress, cZ as registerWallet, ba as removeOracle, ay as secureWipe, az as secureWipeAll, be as serializeAttestationMessage, Y as serializeIntent, cz as serializePayment, b6 as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, d8 as solanaPublicKeyToHex, aI as subtractBlindings, aG as subtractCommitments, a as supportsSharedArrayBuffer, m as supportsTouch, o as supportsWASMBulkMemory, n as supportsWASMSimd, du as supportsWebBluetooth, dt as supportsWebHID, ds as supportsWebUSB, s as supportsWebWorkers, dh as toHex, cM as toStablecoinUnits, T as trackIntent, cw as trackPayment, bb as updateOracleStatus, a_ as validateAsset, aZ as validateCreateIntentParams, a$ as validateIntentInput, b0 as validateIntentOutput, b2 as validateScalar, b1 as validateViewingKey, b4 as verifyAttestation, au as verifyCommitment, aD as verifyOpening, b5 as verifyOracleSignature, cY as walletRegistry, aA as withSecureBuffer, aB as withSecureBufferSync, z as wrapError } from './index-Ba7njCU3.js';
1
+ export { bj as ATTESTATION_VERSION, bv as AttestationRequest, bw as AttestationResult, bT as BackendCapabilities, cT as BaseWalletAdapter, cr as BridgeProvider, B as BrowserNoirProvider, t as BrowserNoirProviderConfig, bm as CHAIN_NUMERIC_IDS, aM as CommitmentPoint, cS as ComplianceManager, $ as CreateIntentOptions, cP as CreatePaymentOptions, C as CryptoError, bk as DEFAULT_THRESHOLD, bl as DEFAULT_TOTAL_ORACLES, dq as DerivationPath, dT as EIP1193ConnectInfo, dS as EIP1193Event, dQ as EIP1193Provider, dU as EIP1193ProviderRpcError, dR as EIP1193RequestArguments, dV as EIP712Domain, dW as EIP712TypeDefinition, dY as EIP712TypedData, dX as EIP712Types, w as EncryptionNotImplementedError, E as ErrorCode, e2 as EthereumAdapterConfig, dm as EthereumChainId, e3 as EthereumChainIdType, e0 as EthereumChainMetadata, d$ as EthereumTokenMetadata, d_ as EthereumTransactionReceipt, dZ as EthereumTransactionRequest, da as EthereumWalletAdapter, e1 as EthereumWalletName, ci as ExportedViewingKey, c0 as FindBestRouteParams, eh as HardwareAccount, e8 as HardwareConnectionStatus, ea as HardwareDeviceInfo, dn as HardwareErrorCode, ej as HardwareErrorCodeType, ef as HardwareEthereumTx, ee as HardwareSignRequest, eg as HardwareSignature, ei as HardwareTransport, eb as HardwareWalletConfig, dp as HardwareWalletError, e5 as HardwareWalletType, L as IntentBuilder, I as IntentError, ec as LedgerConfig, e6 as LedgerModel, dw as LedgerWalletAdapter, p as MobileBrowser, q as MobileDeviceInfo, M as MobilePlatform, r as MobileWASMCompatibility, dc as MockEthereumAdapter, e4 as MockEthereumAdapterConfig, ek as MockHardwareConfig, dA as MockLedgerAdapter, b3 as MockProofProvider, d2 as MockSolanaAdapter, dP as MockSolanaAdapterConfig, bF as MockSolver, bH as MockSolverConfig, dB as MockTrezorAdapter, cU as MockWalletAdapter, bz as NEARIntentsAdapter, bE as NEARIntentsAdapterConfig, c1 as NEARIntentsBackend, N as NetworkError, bi as ORACLE_DOMAIN, by as OneClickClient, bq as OracleAttestationMessage, bn as OracleId, bp as OracleInfo, bt as OracleRegistry, bu as OracleRegistryConfig, br as OracleSignature, bo as OracleStatus, ct as PaymentBuilder, aL as PedersenCommitment, bC as PreparedSwap, cs as PriceFeed, ar as PrivacyConfig, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, b$ as QuoteComparison, cg as ReceivedNote, bX as Route, b_ as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, cD as STABLECOIN_ADDRESSES, cE as STABLECOIN_DECIMALS, cC as STABLECOIN_INFO, D as SerializedError, bU as SettlementBackend, bV as SettlementBackendFactory, bL as SettlementBackendName, bW as SettlementBackendRegistry, bN as SettlementQuote, bM as SettlementQuoteParams, bJ as SettlementRegistry, bK as SettlementRegistryError, bQ as SettlementSwapParams, bR as SettlementSwapResult, bO as SettlementSwapRoute, bP as SettlementSwapRouteStep, ch as ShieldedBalance, ce as ShieldedSendParams, cf as ShieldedSendResult, bs as SignedOracleAttestation, bY as SmartRouter, dK as SolanaAdapterConfig, dJ as SolanaCluster, dL as SolanaConnection, dE as SolanaPublicKey, dM as SolanaSendOptions, dO as SolanaSignature, dF as SolanaTransaction, dN as SolanaUnsignedTransaction, dG as SolanaVersionedTransaction, d0 as SolanaWalletAdapter, dI as SolanaWalletName, dH as SolanaWalletProvider, cQ as StablecoinInfo, ak as StealthCurve, bB as SwapRequest, bD as SwapResult, bI as SwapStatus, bS as SwapStatusResponse, as as TransactionData, e9 as TransportType, cR as Treasury, ed as TrezorConfig, e7 as TrezorModel, dy as TrezorWalletAdapter, V as ValidationError, bx as VerificationResult, W as WalletAdapter, cV as WalletError, c3 as ZcashNativeBackend, c5 as ZcashNativeBackendConfig, cn as ZcashQuote, cm as ZcashQuoteParams, c6 as ZcashRPCClient, c7 as ZcashRPCError, c9 as ZcashShieldedService, cd as ZcashShieldedServiceConfig, co as ZcashSwapParams, cp as ZcashSwapResult, cb as ZcashSwapService, cj as ZcashSwapServiceConfig, ck as ZcashSwapSourceChain, cl as ZcashSwapSourceToken, cq as ZcashSwapStatus, aH as addBlindings, aF as addCommitments, b9 as addOracle, Q as attachProofs, d9 as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ac as checkEd25519StealthAddress, f as checkMobileWASMCompatibility, a3 as checkStealthAddress, aC as commit, aE as commitZero, bg as computeAttestationHash, at as createCommitment, db as createEthereumAdapter, dx as createLedgerAdapter, dd as createMockEthereumAdapter, de as createMockEthereumProvider, dC as createMockLedgerAdapter, d3 as createMockSolanaAdapter, d5 as createMockSolanaConnection, d4 as createMockSolanaProvider, bG as createMockSolver, dD as createMockTrezorAdapter, bA as createNEARIntentsAdapter, c2 as createNEARIntentsBackend, b8 as createOracleRegistry, H as createProductionSIP, G as createSIP, O as createShieldedIntent, cu as createShieldedPayment, bZ as createSmartRouter, d1 as createSolanaAdapter, dz as createTrezorAdapter, c_ as createWalletFactory, c8 as createZcashClient, c4 as createZcashNativeBackend, ca as createZcashShieldedService, cc as createZcashSwapService, a5 as decodeStealthMetaAddress, cv as decryptMemo, ap as decryptWithViewing, ab as deriveEd25519StealthPrivateKey, b7 as deriveOracleId, a2 as deriveStealthPrivateKey, an as deriveViewingKey, bf as deserializeAttestationMessage, Z as deserializeIntent, cA as deserializePayment, dg as detectEthereumWallets, c as detectMobileBrowser, d as detectMobilePlatform, d7 as detectSolanaWallets, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, a4 as encodeStealthMetaAddress, ao as encryptForViewing, cX as featureNotSupportedError, cO as formatStablecoinAmount, di as fromHex, cN as fromStablecoinUnits, aK as generateBlinding, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, av as generateIntentId, ax as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, am as generateViewingKey, bc as getActiveOracles, dv as getAvailableTransports, g as getBrowserInfo, j as getBrowserVersion, bh as getChainNumericId, cL as getChainsForStablecoin, a8 as getCurveForChain, dl as getDefaultRpcEndpoint, dr as getDerivationPath, A as getErrorMessage, df as getEthereumProvider, aJ as getGenerators, _ as getIntentSummary, e as getMobileDeviceInfo, k as getOSVersion, cB as getPaymentSummary, cy as getPaymentTimeRemaining, al as getPrivacyConfig, aq as getPrivacyDescription, d6 as getSolanaProvider, cF as getStablecoin, cI as getStablecoinInfo, cG as getStablecoinsForChain, cJ as getSupportedStablecoins, X as getTimeRemaining, bd as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aw as hash, dj as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, aS as isNonNegativeAmount, cx as isPaymentExpired, c$ as isPrivateWalletAdapter, x as isSIPError, cH as isStablecoin, cK as isStablecoinOnChain, l as isTablet, aR as isValidAmount, aN as isValidChainId, aV as isValidCompressedPublicKey, aW as isValidEd25519PublicKey, aP as isValidHex, aQ as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, aO as isValidPrivacyLevel, aX as isValidPrivateKey, aY as isValidScalar, aT as isValidSlippage, af as isValidSolanaAddress, aU as isValidStealthMetaAddress, ah as nearAddressToEd25519PublicKey, dk as normalizeAddress, cW as notConnectedError, a6 as publicKeyToEthAddress, cZ as registerWallet, ba as removeOracle, ay as secureWipe, az as secureWipeAll, be as serializeAttestationMessage, Y as serializeIntent, cz as serializePayment, b6 as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, d8 as solanaPublicKeyToHex, aI as subtractBlindings, aG as subtractCommitments, a as supportsSharedArrayBuffer, m as supportsTouch, o as supportsWASMBulkMemory, n as supportsWASMSimd, du as supportsWebBluetooth, dt as supportsWebHID, ds as supportsWebUSB, s as supportsWebWorkers, dh as toHex, cM as toStablecoinUnits, T as trackIntent, cw as trackPayment, bb as updateOracleStatus, a_ as validateAsset, aZ as validateCreateIntentParams, a$ as validateIntentInput, b0 as validateIntentOutput, b2 as validateScalar, b1 as validateViewingKey, b4 as verifyAttestation, au as verifyCommitment, aD as verifyOpening, b5 as verifyOracleSignature, cY as walletRegistry, aA as withSecureBuffer, aB as withSecureBufferSync, z as wrapError } from './index-DAgedMrt.js';
2
2
  import { F as FundingProofParams, V as ValidityProofParams, a as FulfillmentProofParams, P as ProofResult } from './noir-BTyLXLlZ.js';
3
3
  export { N as NoirProviderConfig, O as OracleAttestation, d as ProofFramework, b as ProofGenerationError, c as ProofProvider } from './noir-BTyLXLlZ.js';
4
4
  export { Asset, AuditLogEntry, AuditScope, AuditorRegistration, AuditorViewingKey, BatchPaymentRecipient, BatchPaymentRequest, ChainId, Commitment, ComplianceConfig, ComplianceReport, ComplianceRole, CreateBatchProposalParams, CreateComplianceConfigParams, CreateIntentParams, CreatePaymentParams, CreatePaymentProposalParams, CreateTreasuryParams, DefuseAssetId, DisclosedTransaction, DisclosureRequest, FulfillmentCommitment, FulfillmentProof, FulfillmentRequest, FulfillmentResult, FulfillmentStatus, GenerateReportParams, Hash, HexString, WalletAdapter as IWalletAdapter, IntentStatus, NATIVE_TOKENS, OneClickConfig, OneClickDepositMode, OneClickErrorCode, OneClickQuoteRequest, OneClickQuoteResponse, OneClickStatusResponse, OneClickSwapStatus, OneClickSwapType, PaymentPurpose, PaymentReceipt, PaymentStatus, PaymentStatusType, PrivacyLevel, PrivateWalletAdapter, ProposalSignature, ProposalStatus, ProposalStatusType, ProposalType, Quote, RegisterAuditorParams, ReportData, ReportFormat, ReportStatus, ReportStatusType, ReportType, SIPSolver, SIP_VERSION, ShieldedIntent, ShieldedPayment, Signature, SignedTransaction, Solver, SolverCapabilities, SolverEvent, SolverEventListener, SolverQuote, SolverVisibleIntent, StablecoinSymbol, StealthAddress, StealthAddressRecovery, StealthMetaAddress, SwapRoute, SwapRouteStep, TrackedIntent, TrackedPayment, TransactionReceipt, TreasuryBalance, TreasuryConfig, TreasuryMember, TreasuryProposal, TreasuryRole, TreasuryTransaction, UnsignedTransaction, ViewingKey, WalletAccountChangedEvent, WalletAdapterFactory, WalletChainChangedEvent, WalletConnectEvent, WalletConnectionState, WalletDisconnectEvent, WalletErrorCode, WalletErrorEvent, WalletEvent, WalletEventHandler, WalletEventType, WalletInfo, WalletRegistryEntry, WalletShieldedSendParams, WalletShieldedSendResult, ZKProof, ZcashAccountAddress, ZcashAccountBalance, ZcashAddressInfo, ZcashAddressType, ZcashBlock, ZcashBlockHeader, ZcashBlockchainInfo, ZcashConfig, ZcashErrorCode, ZcashNetwork, ZcashNetworkInfo, ZcashNewAccount, ZcashOperation, ZcashOperationError, ZcashOperationStatus, ZcashOperationTxResult, ZcashPool, ZcashPoolBalance, ZcashPrivacyPolicy, ZcashReceiverType, ZcashSendRecipient, ZcashShieldedSendParams, ZcashUnspentNote, isPrivate, supportsViewingKey } from '@sip-protocol/types';
package/dist/browser.js CHANGED
@@ -4986,6 +4986,15 @@ var NEARIntentsBackend = class {
4986
4986
  "senderAddress"
4987
4987
  );
4988
4988
  }
4989
+ if (params.slippageTolerance !== void 0) {
4990
+ if (params.slippageTolerance < 0 || params.slippageTolerance > 1e4) {
4991
+ throw new ValidationError(
4992
+ "slippageTolerance must be between 0-10000 basis points (0-100%)",
4993
+ "slippageTolerance",
4994
+ { provided: params.slippageTolerance, validRange: "0-10000" }
4995
+ );
4996
+ }
4997
+ }
4989
4998
  if (!this.capabilities.supportedSourceChains.includes(params.fromChain)) {
4990
4999
  throw new ValidationError(
4991
5000
  `Source chain ${params.fromChain} is not supported`,
@@ -6248,6 +6257,12 @@ var ZcashSwapService = class {
6248
6257
  quotes = /* @__PURE__ */ new Map();
6249
6258
  swaps = /* @__PURE__ */ new Map();
6250
6259
  constructor(config) {
6260
+ if (config.mode === "production" && !config.bridgeProvider) {
6261
+ throw new IntentError(
6262
+ "Bridge provider required for production mode",
6263
+ "SIP_5004" /* INTENT_INVALID_STATE */
6264
+ );
6265
+ }
6251
6266
  this.config = {
6252
6267
  mode: config.mode,
6253
6268
  defaultSlippage: config.defaultSlippage ?? 100,
@@ -14115,6 +14130,211 @@ function createWorkerBlobURL() {
14115
14130
  }
14116
14131
  }
14117
14132
 
14133
+ // Generate validity proof
14134
+ async function generateValidityProof(id, params) {
14135
+ if (!isReady) {
14136
+ sendError(id, new Error('Worker not initialized'));
14137
+ return;
14138
+ }
14139
+
14140
+ try {
14141
+ sendProgress(id, 'witness', 20, 'Preparing validity witness...');
14142
+
14143
+ // Import noble crypto for hashing
14144
+ const { sha256 } = await import('@noble/hashes/sha256');
14145
+
14146
+ // Convert inputs to field elements
14147
+ const intentHashField = hexToField(params.intentHash);
14148
+ const senderAddressField = hexToField(params.senderAddress);
14149
+ const senderBlindingField = bytesToField(params.senderBlinding);
14150
+ const senderSecretField = bytesToField(params.senderSecret);
14151
+ const nonceField = bytesToField(params.nonce);
14152
+
14153
+ // Compute sender commitment
14154
+ const addressBytes = hexToBytes(senderAddressField);
14155
+ const blindingBytes = hexToBytes(senderBlindingField.padStart(64, '0'));
14156
+ const commitmentPreimage = new Uint8Array([...addressBytes, ...blindingBytes]);
14157
+ const commitmentHash = sha256(commitmentPreimage);
14158
+ const commitmentX = bytesToHex(commitmentHash.slice(0, 16)).padStart(64, '0');
14159
+ const commitmentY = bytesToHex(commitmentHash.slice(16, 32)).padStart(64, '0');
14160
+
14161
+ // Compute nullifier
14162
+ const secretBytes = hexToBytes(senderSecretField.padStart(64, '0'));
14163
+ const intentBytes = hexToBytes(intentHashField);
14164
+ const nonceBytes = hexToBytes(nonceField.padStart(64, '0'));
14165
+ const nullifierPreimage = new Uint8Array([...secretBytes, ...intentBytes, ...nonceBytes]);
14166
+ const nullifierHash = sha256(nullifierPreimage);
14167
+ const nullifier = bytesToHex(nullifierHash);
14168
+
14169
+ const signature = Array.from(params.authorizationSignature);
14170
+ const messageHash = fieldToBytes32(intentHashField);
14171
+
14172
+ // Get public key coordinates
14173
+ let pubKeyX, pubKeyY;
14174
+ if (params.senderPublicKey) {
14175
+ pubKeyX = Array.from(params.senderPublicKey.x);
14176
+ pubKeyY = Array.from(params.senderPublicKey.y);
14177
+ } else {
14178
+ // Derive from secret
14179
+ const { secp256k1 } = await import('@noble/curves/secp256k1');
14180
+ const uncompressedPubKey = secp256k1.getPublicKey(params.senderSecret, false);
14181
+ pubKeyX = Array.from(uncompressedPubKey.slice(1, 33));
14182
+ pubKeyY = Array.from(uncompressedPubKey.slice(33, 65));
14183
+ }
14184
+
14185
+ const witnessInputs = {
14186
+ intent_hash: intentHashField,
14187
+ sender_commitment_x: commitmentX,
14188
+ sender_commitment_y: commitmentY,
14189
+ nullifier: nullifier,
14190
+ timestamp: params.timestamp.toString(),
14191
+ expiry: params.expiry.toString(),
14192
+ sender_address: senderAddressField,
14193
+ sender_blinding: senderBlindingField,
14194
+ sender_secret: senderSecretField,
14195
+ pub_key_x: pubKeyX,
14196
+ pub_key_y: pubKeyY,
14197
+ signature: signature,
14198
+ message_hash: messageHash,
14199
+ nonce: nonceField,
14200
+ };
14201
+
14202
+ sendProgress(id, 'witness', 40, 'Executing validity circuit...');
14203
+ const { witness } = await validityNoir.execute(witnessInputs);
14204
+
14205
+ sendProgress(id, 'proving', 60, 'Generating validity proof...');
14206
+ const proofData = await validityBackend.generateProof(witness);
14207
+
14208
+ sendProgress(id, 'complete', 100, 'Validity proof generated');
14209
+
14210
+ const publicInputs = [
14211
+ '0x' + intentHashField,
14212
+ '0x' + commitmentX,
14213
+ '0x' + commitmentY,
14214
+ '0x' + nullifier,
14215
+ '0x' + params.timestamp.toString(16).padStart(16, '0'),
14216
+ '0x' + params.expiry.toString(16).padStart(16, '0'),
14217
+ ];
14218
+
14219
+ const proof = {
14220
+ type: 'validity',
14221
+ proof: '0x' + bytesToHex(proofData.proof),
14222
+ publicInputs,
14223
+ };
14224
+
14225
+ sendSuccess(id, { proof, publicInputs });
14226
+ } catch (error) {
14227
+ sendError(id, error);
14228
+ }
14229
+ }
14230
+
14231
+ // Generate fulfillment proof
14232
+ async function generateFulfillmentProof(id, params) {
14233
+ if (!isReady) {
14234
+ sendError(id, new Error('Worker not initialized'));
14235
+ return;
14236
+ }
14237
+
14238
+ try {
14239
+ sendProgress(id, 'witness', 20, 'Preparing fulfillment witness...');
14240
+
14241
+ // Import noble crypto for hashing
14242
+ const { sha256 } = await import('@noble/hashes/sha256');
14243
+
14244
+ const intentHashField = hexToField(params.intentHash);
14245
+ const recipientStealthField = hexToField(params.recipientStealth);
14246
+
14247
+ // Compute output commitment
14248
+ const amountBytes = bigintToBytes(params.outputAmount, 8);
14249
+ const blindingBytes = params.outputBlinding.slice(0, 32);
14250
+ const outputPreimage = new Uint8Array([...amountBytes, ...blindingBytes]);
14251
+ const outputHash = sha256(outputPreimage);
14252
+ const commitmentX = bytesToHex(outputHash.slice(0, 16)).padStart(64, '0');
14253
+ const commitmentY = bytesToHex(outputHash.slice(16, 32)).padStart(64, '0');
14254
+
14255
+ const solverSecretField = bytesToField(params.solverSecret);
14256
+
14257
+ // Compute solver ID
14258
+ const solverSecretBytes = hexToBytes(solverSecretField.padStart(64, '0'));
14259
+ const solverIdHash = sha256(solverSecretBytes);
14260
+ const solverId = bytesToHex(solverIdHash);
14261
+
14262
+ const outputBlindingField = bytesToField(params.outputBlinding);
14263
+
14264
+ const attestation = params.oracleAttestation;
14265
+ const attestationRecipientField = hexToField(attestation.recipient);
14266
+ const attestationTxHashField = hexToField(attestation.txHash);
14267
+ const oracleSignature = Array.from(attestation.signature);
14268
+
14269
+ // Compute oracle message hash
14270
+ const recipientBytes = hexToBytes(attestationRecipientField);
14271
+ const attestationAmountBytes = bigintToBytes(attestation.amount, 8);
14272
+ const txHashBytes = hexToBytes(attestationTxHashField);
14273
+ const blockBytes = bigintToBytes(attestation.blockNumber, 8);
14274
+ const oraclePreimage = new Uint8Array([
14275
+ ...recipientBytes,
14276
+ ...attestationAmountBytes,
14277
+ ...txHashBytes,
14278
+ ...blockBytes,
14279
+ ]);
14280
+ const oracleMessageHash = Array.from(sha256(oraclePreimage));
14281
+
14282
+ const oraclePubKeyX = config.oraclePublicKey?.x ?? new Array(32).fill(0);
14283
+ const oraclePubKeyY = config.oraclePublicKey?.y ?? new Array(32).fill(0);
14284
+
14285
+ const witnessInputs = {
14286
+ intent_hash: intentHashField,
14287
+ output_commitment_x: commitmentX,
14288
+ output_commitment_y: commitmentY,
14289
+ recipient_stealth: recipientStealthField,
14290
+ min_output_amount: params.minOutputAmount.toString(),
14291
+ solver_id: solverId,
14292
+ fulfillment_time: params.fulfillmentTime.toString(),
14293
+ expiry: params.expiry.toString(),
14294
+ output_amount: params.outputAmount.toString(),
14295
+ output_blinding: outputBlindingField,
14296
+ solver_secret: solverSecretField,
14297
+ attestation_recipient: attestationRecipientField,
14298
+ attestation_amount: attestation.amount.toString(),
14299
+ attestation_tx_hash: attestationTxHashField,
14300
+ attestation_block: attestation.blockNumber.toString(),
14301
+ oracle_signature: oracleSignature,
14302
+ oracle_message_hash: oracleMessageHash,
14303
+ oracle_pub_key_x: oraclePubKeyX,
14304
+ oracle_pub_key_y: oraclePubKeyY,
14305
+ };
14306
+
14307
+ sendProgress(id, 'witness', 40, 'Executing fulfillment circuit...');
14308
+ const { witness } = await fulfillmentNoir.execute(witnessInputs);
14309
+
14310
+ sendProgress(id, 'proving', 60, 'Generating fulfillment proof...');
14311
+ const proofData = await fulfillmentBackend.generateProof(witness);
14312
+
14313
+ sendProgress(id, 'complete', 100, 'Fulfillment proof generated');
14314
+
14315
+ const publicInputs = [
14316
+ '0x' + intentHashField,
14317
+ '0x' + commitmentX,
14318
+ '0x' + commitmentY,
14319
+ '0x' + recipientStealthField,
14320
+ '0x' + params.minOutputAmount.toString(16).padStart(16, '0'),
14321
+ '0x' + solverId,
14322
+ '0x' + params.fulfillmentTime.toString(16).padStart(16, '0'),
14323
+ '0x' + params.expiry.toString(16).padStart(16, '0'),
14324
+ ];
14325
+
14326
+ const proof = {
14327
+ type: 'fulfillment',
14328
+ proof: '0x' + bytesToHex(proofData.proof),
14329
+ publicInputs,
14330
+ };
14331
+
14332
+ sendSuccess(id, { proof, publicInputs });
14333
+ } catch (error) {
14334
+ sendError(id, error);
14335
+ }
14336
+ }
14337
+
14118
14338
  // Helper functions
14119
14339
  function bytesToField(bytes) {
14120
14340
  let result = 0n;
@@ -14142,6 +14362,39 @@ function createWorkerBlobURL() {
14142
14362
  return Array.from(bytes).map(b => b.toString(16).padStart(2, '0')).join('');
14143
14363
  }
14144
14364
 
14365
+ function hexToBytes(hex) {
14366
+ const h = hex.startsWith('0x') ? hex.slice(2) : hex;
14367
+ const bytes = new Uint8Array(h.length / 2);
14368
+ for (let i = 0; i < h.length; i += 2) {
14369
+ bytes[i / 2] = parseInt(h.slice(i, i + 2), 16);
14370
+ }
14371
+ return bytes;
14372
+ }
14373
+
14374
+ function hexToField(hex) {
14375
+ const h = hex.startsWith('0x') ? hex.slice(2) : hex;
14376
+ return h.padStart(64, '0');
14377
+ }
14378
+
14379
+ function fieldToBytes32(field) {
14380
+ const hex = field.padStart(64, '0');
14381
+ const bytes = [];
14382
+ for (let i = 0; i < 32; i++) {
14383
+ bytes.push(parseInt(hex.slice(i * 2, i * 2 + 2), 16));
14384
+ }
14385
+ return bytes;
14386
+ }
14387
+
14388
+ function bigintToBytes(value, length) {
14389
+ const bytes = new Uint8Array(length);
14390
+ let v = value;
14391
+ for (let i = length - 1; i >= 0; i--) {
14392
+ bytes[i] = Number(v & 0xffn);
14393
+ v = v >> 8n;
14394
+ }
14395
+ return bytes;
14396
+ }
14397
+
14145
14398
  // Message handler
14146
14399
  self.onmessage = async function(event) {
14147
14400
  const { id, type, params, config: initConfig } = event.data;
@@ -14154,12 +14407,10 @@ function createWorkerBlobURL() {
14154
14407
  await generateFundingProof(id, params);
14155
14408
  break;
14156
14409
  case 'generateValidityProof':
14157
- // TODO: Implement
14158
- sendError(id, new Error('Validity proof not yet implemented in worker'));
14410
+ await generateValidityProof(id, params);
14159
14411
  break;
14160
14412
  case 'generateFulfillmentProof':
14161
- // TODO: Implement
14162
- sendError(id, new Error('Fulfillment proof not yet implemented in worker'));
14413
+ await generateFulfillmentProof(id, params);
14163
14414
  break;
14164
14415
  case 'destroy':
14165
14416
  // Cleanup
package/dist/browser.mjs CHANGED
@@ -218,7 +218,7 @@ import {
218
218
  walletRegistry,
219
219
  withSecureBuffer,
220
220
  withSecureBufferSync
221
- } from "./chunk-7IMRM7LN.mjs";
221
+ } from "./chunk-EU4UEWWG.mjs";
222
222
  import {
223
223
  fulfillment_proof_default,
224
224
  funding_proof_default,
@@ -1129,6 +1129,211 @@ function createWorkerBlobURL() {
1129
1129
  }
1130
1130
  }
1131
1131
 
1132
+ // Generate validity proof
1133
+ async function generateValidityProof(id, params) {
1134
+ if (!isReady) {
1135
+ sendError(id, new Error('Worker not initialized'));
1136
+ return;
1137
+ }
1138
+
1139
+ try {
1140
+ sendProgress(id, 'witness', 20, 'Preparing validity witness...');
1141
+
1142
+ // Import noble crypto for hashing
1143
+ const { sha256 } = await import('@noble/hashes/sha256');
1144
+
1145
+ // Convert inputs to field elements
1146
+ const intentHashField = hexToField(params.intentHash);
1147
+ const senderAddressField = hexToField(params.senderAddress);
1148
+ const senderBlindingField = bytesToField(params.senderBlinding);
1149
+ const senderSecretField = bytesToField(params.senderSecret);
1150
+ const nonceField = bytesToField(params.nonce);
1151
+
1152
+ // Compute sender commitment
1153
+ const addressBytes = hexToBytes(senderAddressField);
1154
+ const blindingBytes = hexToBytes(senderBlindingField.padStart(64, '0'));
1155
+ const commitmentPreimage = new Uint8Array([...addressBytes, ...blindingBytes]);
1156
+ const commitmentHash = sha256(commitmentPreimage);
1157
+ const commitmentX = bytesToHex(commitmentHash.slice(0, 16)).padStart(64, '0');
1158
+ const commitmentY = bytesToHex(commitmentHash.slice(16, 32)).padStart(64, '0');
1159
+
1160
+ // Compute nullifier
1161
+ const secretBytes = hexToBytes(senderSecretField.padStart(64, '0'));
1162
+ const intentBytes = hexToBytes(intentHashField);
1163
+ const nonceBytes = hexToBytes(nonceField.padStart(64, '0'));
1164
+ const nullifierPreimage = new Uint8Array([...secretBytes, ...intentBytes, ...nonceBytes]);
1165
+ const nullifierHash = sha256(nullifierPreimage);
1166
+ const nullifier = bytesToHex(nullifierHash);
1167
+
1168
+ const signature = Array.from(params.authorizationSignature);
1169
+ const messageHash = fieldToBytes32(intentHashField);
1170
+
1171
+ // Get public key coordinates
1172
+ let pubKeyX, pubKeyY;
1173
+ if (params.senderPublicKey) {
1174
+ pubKeyX = Array.from(params.senderPublicKey.x);
1175
+ pubKeyY = Array.from(params.senderPublicKey.y);
1176
+ } else {
1177
+ // Derive from secret
1178
+ const { secp256k1 } = await import('@noble/curves/secp256k1');
1179
+ const uncompressedPubKey = secp256k1.getPublicKey(params.senderSecret, false);
1180
+ pubKeyX = Array.from(uncompressedPubKey.slice(1, 33));
1181
+ pubKeyY = Array.from(uncompressedPubKey.slice(33, 65));
1182
+ }
1183
+
1184
+ const witnessInputs = {
1185
+ intent_hash: intentHashField,
1186
+ sender_commitment_x: commitmentX,
1187
+ sender_commitment_y: commitmentY,
1188
+ nullifier: nullifier,
1189
+ timestamp: params.timestamp.toString(),
1190
+ expiry: params.expiry.toString(),
1191
+ sender_address: senderAddressField,
1192
+ sender_blinding: senderBlindingField,
1193
+ sender_secret: senderSecretField,
1194
+ pub_key_x: pubKeyX,
1195
+ pub_key_y: pubKeyY,
1196
+ signature: signature,
1197
+ message_hash: messageHash,
1198
+ nonce: nonceField,
1199
+ };
1200
+
1201
+ sendProgress(id, 'witness', 40, 'Executing validity circuit...');
1202
+ const { witness } = await validityNoir.execute(witnessInputs);
1203
+
1204
+ sendProgress(id, 'proving', 60, 'Generating validity proof...');
1205
+ const proofData = await validityBackend.generateProof(witness);
1206
+
1207
+ sendProgress(id, 'complete', 100, 'Validity proof generated');
1208
+
1209
+ const publicInputs = [
1210
+ '0x' + intentHashField,
1211
+ '0x' + commitmentX,
1212
+ '0x' + commitmentY,
1213
+ '0x' + nullifier,
1214
+ '0x' + params.timestamp.toString(16).padStart(16, '0'),
1215
+ '0x' + params.expiry.toString(16).padStart(16, '0'),
1216
+ ];
1217
+
1218
+ const proof = {
1219
+ type: 'validity',
1220
+ proof: '0x' + bytesToHex(proofData.proof),
1221
+ publicInputs,
1222
+ };
1223
+
1224
+ sendSuccess(id, { proof, publicInputs });
1225
+ } catch (error) {
1226
+ sendError(id, error);
1227
+ }
1228
+ }
1229
+
1230
+ // Generate fulfillment proof
1231
+ async function generateFulfillmentProof(id, params) {
1232
+ if (!isReady) {
1233
+ sendError(id, new Error('Worker not initialized'));
1234
+ return;
1235
+ }
1236
+
1237
+ try {
1238
+ sendProgress(id, 'witness', 20, 'Preparing fulfillment witness...');
1239
+
1240
+ // Import noble crypto for hashing
1241
+ const { sha256 } = await import('@noble/hashes/sha256');
1242
+
1243
+ const intentHashField = hexToField(params.intentHash);
1244
+ const recipientStealthField = hexToField(params.recipientStealth);
1245
+
1246
+ // Compute output commitment
1247
+ const amountBytes = bigintToBytes(params.outputAmount, 8);
1248
+ const blindingBytes = params.outputBlinding.slice(0, 32);
1249
+ const outputPreimage = new Uint8Array([...amountBytes, ...blindingBytes]);
1250
+ const outputHash = sha256(outputPreimage);
1251
+ const commitmentX = bytesToHex(outputHash.slice(0, 16)).padStart(64, '0');
1252
+ const commitmentY = bytesToHex(outputHash.slice(16, 32)).padStart(64, '0');
1253
+
1254
+ const solverSecretField = bytesToField(params.solverSecret);
1255
+
1256
+ // Compute solver ID
1257
+ const solverSecretBytes = hexToBytes(solverSecretField.padStart(64, '0'));
1258
+ const solverIdHash = sha256(solverSecretBytes);
1259
+ const solverId = bytesToHex(solverIdHash);
1260
+
1261
+ const outputBlindingField = bytesToField(params.outputBlinding);
1262
+
1263
+ const attestation = params.oracleAttestation;
1264
+ const attestationRecipientField = hexToField(attestation.recipient);
1265
+ const attestationTxHashField = hexToField(attestation.txHash);
1266
+ const oracleSignature = Array.from(attestation.signature);
1267
+
1268
+ // Compute oracle message hash
1269
+ const recipientBytes = hexToBytes(attestationRecipientField);
1270
+ const attestationAmountBytes = bigintToBytes(attestation.amount, 8);
1271
+ const txHashBytes = hexToBytes(attestationTxHashField);
1272
+ const blockBytes = bigintToBytes(attestation.blockNumber, 8);
1273
+ const oraclePreimage = new Uint8Array([
1274
+ ...recipientBytes,
1275
+ ...attestationAmountBytes,
1276
+ ...txHashBytes,
1277
+ ...blockBytes,
1278
+ ]);
1279
+ const oracleMessageHash = Array.from(sha256(oraclePreimage));
1280
+
1281
+ const oraclePubKeyX = config.oraclePublicKey?.x ?? new Array(32).fill(0);
1282
+ const oraclePubKeyY = config.oraclePublicKey?.y ?? new Array(32).fill(0);
1283
+
1284
+ const witnessInputs = {
1285
+ intent_hash: intentHashField,
1286
+ output_commitment_x: commitmentX,
1287
+ output_commitment_y: commitmentY,
1288
+ recipient_stealth: recipientStealthField,
1289
+ min_output_amount: params.minOutputAmount.toString(),
1290
+ solver_id: solverId,
1291
+ fulfillment_time: params.fulfillmentTime.toString(),
1292
+ expiry: params.expiry.toString(),
1293
+ output_amount: params.outputAmount.toString(),
1294
+ output_blinding: outputBlindingField,
1295
+ solver_secret: solverSecretField,
1296
+ attestation_recipient: attestationRecipientField,
1297
+ attestation_amount: attestation.amount.toString(),
1298
+ attestation_tx_hash: attestationTxHashField,
1299
+ attestation_block: attestation.blockNumber.toString(),
1300
+ oracle_signature: oracleSignature,
1301
+ oracle_message_hash: oracleMessageHash,
1302
+ oracle_pub_key_x: oraclePubKeyX,
1303
+ oracle_pub_key_y: oraclePubKeyY,
1304
+ };
1305
+
1306
+ sendProgress(id, 'witness', 40, 'Executing fulfillment circuit...');
1307
+ const { witness } = await fulfillmentNoir.execute(witnessInputs);
1308
+
1309
+ sendProgress(id, 'proving', 60, 'Generating fulfillment proof...');
1310
+ const proofData = await fulfillmentBackend.generateProof(witness);
1311
+
1312
+ sendProgress(id, 'complete', 100, 'Fulfillment proof generated');
1313
+
1314
+ const publicInputs = [
1315
+ '0x' + intentHashField,
1316
+ '0x' + commitmentX,
1317
+ '0x' + commitmentY,
1318
+ '0x' + recipientStealthField,
1319
+ '0x' + params.minOutputAmount.toString(16).padStart(16, '0'),
1320
+ '0x' + solverId,
1321
+ '0x' + params.fulfillmentTime.toString(16).padStart(16, '0'),
1322
+ '0x' + params.expiry.toString(16).padStart(16, '0'),
1323
+ ];
1324
+
1325
+ const proof = {
1326
+ type: 'fulfillment',
1327
+ proof: '0x' + bytesToHex(proofData.proof),
1328
+ publicInputs,
1329
+ };
1330
+
1331
+ sendSuccess(id, { proof, publicInputs });
1332
+ } catch (error) {
1333
+ sendError(id, error);
1334
+ }
1335
+ }
1336
+
1132
1337
  // Helper functions
1133
1338
  function bytesToField(bytes) {
1134
1339
  let result = 0n;
@@ -1156,6 +1361,39 @@ function createWorkerBlobURL() {
1156
1361
  return Array.from(bytes).map(b => b.toString(16).padStart(2, '0')).join('');
1157
1362
  }
1158
1363
 
1364
+ function hexToBytes(hex) {
1365
+ const h = hex.startsWith('0x') ? hex.slice(2) : hex;
1366
+ const bytes = new Uint8Array(h.length / 2);
1367
+ for (let i = 0; i < h.length; i += 2) {
1368
+ bytes[i / 2] = parseInt(h.slice(i, i + 2), 16);
1369
+ }
1370
+ return bytes;
1371
+ }
1372
+
1373
+ function hexToField(hex) {
1374
+ const h = hex.startsWith('0x') ? hex.slice(2) : hex;
1375
+ return h.padStart(64, '0');
1376
+ }
1377
+
1378
+ function fieldToBytes32(field) {
1379
+ const hex = field.padStart(64, '0');
1380
+ const bytes = [];
1381
+ for (let i = 0; i < 32; i++) {
1382
+ bytes.push(parseInt(hex.slice(i * 2, i * 2 + 2), 16));
1383
+ }
1384
+ return bytes;
1385
+ }
1386
+
1387
+ function bigintToBytes(value, length) {
1388
+ const bytes = new Uint8Array(length);
1389
+ let v = value;
1390
+ for (let i = length - 1; i >= 0; i--) {
1391
+ bytes[i] = Number(v & 0xffn);
1392
+ v = v >> 8n;
1393
+ }
1394
+ return bytes;
1395
+ }
1396
+
1159
1397
  // Message handler
1160
1398
  self.onmessage = async function(event) {
1161
1399
  const { id, type, params, config: initConfig } = event.data;
@@ -1168,12 +1406,10 @@ function createWorkerBlobURL() {
1168
1406
  await generateFundingProof(id, params);
1169
1407
  break;
1170
1408
  case 'generateValidityProof':
1171
- // TODO: Implement
1172
- sendError(id, new Error('Validity proof not yet implemented in worker'));
1409
+ await generateValidityProof(id, params);
1173
1410
  break;
1174
1411
  case 'generateFulfillmentProof':
1175
- // TODO: Implement
1176
- sendError(id, new Error('Fulfillment proof not yet implemented in worker'));
1412
+ await generateFulfillmentProof(id, params);
1177
1413
  break;
1178
1414
  case 'destroy':
1179
1415
  // Cleanup