@sip-protocol/sdk 0.1.9 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _sip_protocol_types from '@sip-protocol/types';
2
- import { ZKProof, HexString, Commitment, PrivacyLevel, ShieldedIntent, CreateIntentParams, TrackedIntent, OneClickConfig, OneClickToken, OneClickQuoteRequest, OneClickQuoteResponse, OneClickDepositSubmit, OneClickStatusResponse, OneClickWithdrawal, DefuseAssetId, Asset, StealthMetaAddress, OneClickSwapStatus, ChainId, Quote, FulfillmentResult, ViewingKey, StealthAddress, StealthAddressRecovery, EncryptedTransaction, Hash, IntentInput, IntentOutput, SIPSolver, Solver, SolverCapabilities, SolverVisibleIntent, SolverQuote, FulfillmentStatus, ZcashConfig, ZcashAddressInfo, ZcashNewAccount, ZcashReceiverType, ZcashAccountAddress, ZcashAccountBalance, ZcashUnspentNote, ZcashShieldedSendParams, ZcashOperation, ZcashBlockHeader, ZcashBlock, ZcashBlockchainInfo, ZcashNetworkInfo, StablecoinSymbol, PaymentPurpose, ShieldedPayment, CreatePaymentParams, TrackedPayment, CreateTreasuryParams, TreasuryConfig, TreasuryMember, CreatePaymentProposalParams, TreasuryProposal, CreateBatchProposalParams, AuditorViewingKey, TreasuryBalance, CreateComplianceConfigParams, ComplianceConfig, RegisterAuditorParams, AuditorRegistration, AuditScope, DisclosedTransaction, DisclosureRequest, GenerateReportParams, ComplianceReport, AuditLogEntry, WalletAdapter as WalletAdapter$1, WalletConnectionState, WalletEventType, WalletEventHandler, WalletEvent, Signature, UnsignedTransaction, SignedTransaction, TransactionReceipt, WalletErrorCodeType, WalletRegistryEntry, WalletInfo, PrivateWalletAdapter, WalletAdapterFactory } from '@sip-protocol/types';
2
+ import { ZKProof, HexString, Commitment, PrivacyLevel, ShieldedIntent, CreateIntentParams, TrackedIntent, OneClickConfig, OneClickToken, OneClickQuoteRequest, OneClickQuoteResponse, OneClickDepositSubmit, OneClickStatusResponse, OneClickWithdrawal, ChainId, StealthMetaAddress, StealthAddress, StealthAddressRecovery, DefuseAssetId, Asset, OneClickSwapStatus, Quote, FulfillmentResult, ViewingKey, EncryptedTransaction, Hash, IntentInput, IntentOutput, SIPSolver, Solver, SolverCapabilities, SolverVisibleIntent, SolverQuote, FulfillmentStatus, ZcashConfig, ZcashAddressInfo, ZcashNewAccount, ZcashReceiverType, ZcashAccountAddress, ZcashAccountBalance, ZcashUnspentNote, ZcashShieldedSendParams, ZcashOperation, ZcashBlockHeader, ZcashBlock, ZcashBlockchainInfo, ZcashNetworkInfo, StablecoinSymbol, PaymentPurpose, ShieldedPayment, CreatePaymentParams, TrackedPayment, CreateTreasuryParams, TreasuryConfig, TreasuryMember, CreatePaymentProposalParams, TreasuryProposal, CreateBatchProposalParams, AuditorViewingKey, TreasuryBalance, CreateComplianceConfigParams, ComplianceConfig, RegisterAuditorParams, AuditorRegistration, AuditScope, DisclosedTransaction, DisclosureRequest, GenerateReportParams, ComplianceReport, AuditLogEntry, WalletAdapter as WalletAdapter$1, WalletConnectionState, WalletEventType, WalletEventHandler, WalletEvent, Signature, UnsignedTransaction, SignedTransaction, TransactionReceipt, WalletErrorCodeType, WalletRegistryEntry, WalletInfo, PrivateWalletAdapter, WalletAdapterFactory } from '@sip-protocol/types';
3
3
  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';
4
4
 
5
5
  /**
@@ -591,7 +591,7 @@ declare class MockProofProvider implements ProofProvider {
591
591
  /**
592
592
  * Public key coordinates for secp256k1
593
593
  */
594
- interface PublicKeyCoordinates {
594
+ interface PublicKeyCoordinates$1 {
595
595
  /** X coordinate as 32-byte array */
596
596
  x: number[];
597
597
  /** Y coordinate as 32-byte array */
@@ -620,7 +620,7 @@ interface NoirProviderConfig {
620
620
  * Oracle public key for verifying attestations in fulfillment proofs
621
621
  * Required for production use. If not provided, proofs will use placeholder keys.
622
622
  */
623
- oraclePublicKey?: PublicKeyCoordinates;
623
+ oraclePublicKey?: PublicKeyCoordinates$1;
624
624
  }
625
625
  /**
626
626
  * Noir Proof Provider
@@ -684,7 +684,7 @@ declare class NoirProofProvider implements ProofProvider {
684
684
  * }
685
685
  * ```
686
686
  */
687
- static derivePublicKey(privateKey: Uint8Array): PublicKeyCoordinates;
687
+ static derivePublicKey(privateKey: Uint8Array): PublicKeyCoordinates$1;
688
688
  /**
689
689
  * Initialize the Noir provider
690
690
  *
@@ -824,6 +824,219 @@ declare class NoirProofProvider implements ProofProvider {
824
824
  private getPublicKeyFromField;
825
825
  }
826
826
 
827
+ /**
828
+ * Browser-compatible utilities for proof generation
829
+ *
830
+ * These utilities replace Node.js-specific functions (like Buffer)
831
+ * with browser-compatible alternatives using Web APIs.
832
+ *
833
+ * @module proofs/browser-utils
834
+ */
835
+ /**
836
+ * Convert hex string to Uint8Array (browser-compatible)
837
+ */
838
+ declare function hexToBytes(hex: string): Uint8Array;
839
+ /**
840
+ * Convert Uint8Array to hex string (browser-compatible)
841
+ */
842
+ declare function bytesToHex(bytes: Uint8Array): string;
843
+ /**
844
+ * Check if running in browser environment
845
+ */
846
+ declare function isBrowser(): boolean;
847
+ /**
848
+ * Check if Web Workers are available
849
+ */
850
+ declare function supportsWebWorkers(): boolean;
851
+ /**
852
+ * Check if SharedArrayBuffer is available (required for some WASM operations)
853
+ */
854
+ declare function supportsSharedArrayBuffer(): boolean;
855
+ /**
856
+ * Get browser info for diagnostics
857
+ */
858
+ declare function getBrowserInfo(): {
859
+ isBrowser: boolean;
860
+ supportsWorkers: boolean;
861
+ supportsSharedArrayBuffer: boolean;
862
+ userAgent: string | null;
863
+ };
864
+
865
+ /**
866
+ * Browser Noir Proof Provider
867
+ *
868
+ * Production-ready ZK proof provider for browser environments.
869
+ * Uses Web Workers for non-blocking proof generation and WASM for computation.
870
+ *
871
+ * @example
872
+ * ```typescript
873
+ * import { BrowserNoirProvider } from '@sip-protocol/sdk/browser'
874
+ *
875
+ * const provider = new BrowserNoirProvider()
876
+ * await provider.initialize() // Loads WASM
877
+ *
878
+ * const proof = await provider.generateFundingProof(inputs)
879
+ * ```
880
+ *
881
+ * @see docs/specs/ZK-ARCHITECTURE.md
882
+ * @see https://github.com/sip-protocol/sip-protocol/issues/121
883
+ */
884
+
885
+ /**
886
+ * Public key coordinates for secp256k1
887
+ */
888
+ interface PublicKeyCoordinates {
889
+ /** X coordinate as 32-byte array */
890
+ x: number[];
891
+ /** Y coordinate as 32-byte array */
892
+ y: number[];
893
+ }
894
+ /**
895
+ * Browser Noir Provider Configuration
896
+ */
897
+ interface BrowserNoirProviderConfig {
898
+ /**
899
+ * Use Web Workers for proof generation (non-blocking)
900
+ * @default true
901
+ */
902
+ useWorker?: boolean;
903
+ /**
904
+ * Enable verbose logging for debugging
905
+ * @default false
906
+ */
907
+ verbose?: boolean;
908
+ /**
909
+ * Oracle public key for verifying attestations in fulfillment proofs
910
+ * Required for production use.
911
+ */
912
+ oraclePublicKey?: PublicKeyCoordinates;
913
+ /**
914
+ * Maximum time for proof generation before timeout (ms)
915
+ * @default 60000 (60 seconds)
916
+ */
917
+ timeout?: number;
918
+ }
919
+ /**
920
+ * Proof generation progress callback
921
+ */
922
+ type ProofProgressCallback = (progress: {
923
+ stage: 'initializing' | 'witness' | 'proving' | 'verifying' | 'complete';
924
+ percent: number;
925
+ message: string;
926
+ }) => void;
927
+ /**
928
+ * Browser-compatible Noir Proof Provider
929
+ *
930
+ * Designed for browser environments with:
931
+ * - WASM-based proof generation
932
+ * - Optional Web Worker support for non-blocking UI
933
+ * - Memory-efficient initialization
934
+ * - Progress callbacks for UX
935
+ *
936
+ * @example
937
+ * ```typescript
938
+ * const provider = new BrowserNoirProvider({ useWorker: true })
939
+ *
940
+ * await provider.initialize((progress) => {
941
+ * console.log(`${progress.stage}: ${progress.percent}%`)
942
+ * })
943
+ *
944
+ * const result = await provider.generateFundingProof(params, (progress) => {
945
+ * updateProgressBar(progress.percent)
946
+ * })
947
+ * ```
948
+ */
949
+ declare class BrowserNoirProvider implements ProofProvider {
950
+ readonly framework: ProofFramework;
951
+ private _isReady;
952
+ private config;
953
+ private fundingNoir;
954
+ private fundingBackend;
955
+ private validityNoir;
956
+ private validityBackend;
957
+ private fulfillmentNoir;
958
+ private fulfillmentBackend;
959
+ private worker;
960
+ private workerPending;
961
+ constructor(config?: BrowserNoirProviderConfig);
962
+ get isReady(): boolean;
963
+ /**
964
+ * Get browser environment info
965
+ */
966
+ static getBrowserInfo(): {
967
+ isBrowser: boolean;
968
+ supportsWorkers: boolean;
969
+ supportsSharedArrayBuffer: boolean;
970
+ userAgent: string | null;
971
+ };
972
+ /**
973
+ * Check if browser supports all required features
974
+ */
975
+ static checkBrowserSupport(): {
976
+ supported: boolean;
977
+ missing: string[];
978
+ };
979
+ /**
980
+ * Derive secp256k1 public key coordinates from a private key
981
+ */
982
+ static derivePublicKey(privateKey: Uint8Array): PublicKeyCoordinates;
983
+ /**
984
+ * Initialize the browser provider
985
+ *
986
+ * Loads WASM and circuit artifacts. This should be called before any
987
+ * proof generation. Consider showing a loading indicator during init.
988
+ *
989
+ * @param onProgress - Optional progress callback
990
+ */
991
+ initialize(onProgress?: ProofProgressCallback): Promise<void>;
992
+ /**
993
+ * Initialize Web Worker for off-main-thread proof generation
994
+ */
995
+ private initializeWorker;
996
+ /**
997
+ * Generate a Funding Proof
998
+ *
999
+ * Proves: balance >= minimumRequired without revealing balance
1000
+ *
1001
+ * @param params - Funding proof parameters
1002
+ * @param onProgress - Optional progress callback
1003
+ */
1004
+ generateFundingProof(params: FundingProofParams, onProgress?: ProofProgressCallback): Promise<ProofResult>;
1005
+ /**
1006
+ * Generate a Validity Proof
1007
+ *
1008
+ * Proves: Intent is authorized by sender without revealing identity
1009
+ */
1010
+ generateValidityProof(params: ValidityProofParams, onProgress?: ProofProgressCallback): Promise<ProofResult>;
1011
+ /**
1012
+ * Generate a Fulfillment Proof
1013
+ *
1014
+ * Proves: Solver correctly executed the intent
1015
+ */
1016
+ generateFulfillmentProof(params: FulfillmentProofParams, onProgress?: ProofProgressCallback): Promise<ProofResult>;
1017
+ /**
1018
+ * Verify a proof
1019
+ */
1020
+ verifyProof(proof: ZKProof): Promise<boolean>;
1021
+ /**
1022
+ * Destroy the provider and free resources
1023
+ */
1024
+ destroy(): Promise<void>;
1025
+ private ensureReady;
1026
+ private computeCommitmentHash;
1027
+ private assetIdToField;
1028
+ private bytesToField;
1029
+ private bigintToBytes;
1030
+ private hexToField;
1031
+ private fieldToBytes32;
1032
+ private computeSenderCommitment;
1033
+ private computeNullifier;
1034
+ private computeOutputCommitment;
1035
+ private computeSolverId;
1036
+ private computeOracleMessageHash;
1037
+ private getPublicKeyCoordinates;
1038
+ }
1039
+
827
1040
  /**
828
1041
  * Options for creating a shielded intent
829
1042
  */
@@ -1090,11 +1303,310 @@ declare class OneClickClient {
1090
1303
  private delay;
1091
1304
  }
1092
1305
 
1306
+ /**
1307
+ * Stealth Address Generation for SIP Protocol
1308
+ *
1309
+ * Implements EIP-5564 style stealth addresses using secp256k1.
1310
+ * Provides unlinkable one-time addresses for privacy-preserving transactions.
1311
+ *
1312
+ * Flow:
1313
+ * 1. Recipient generates stealth meta-address (spending key P, viewing key Q)
1314
+ * 2. Sender generates ephemeral keypair (r, R = r*G)
1315
+ * 3. Sender computes shared secret: S = r * P
1316
+ * 4. Sender derives stealth address: A = Q + hash(S)*G
1317
+ * 5. Recipient scans: for each R, compute S = p * R, check if A matches
1318
+ */
1319
+
1320
+ /**
1321
+ * Generate a new stealth meta-address keypair
1322
+ *
1323
+ * @param chain - Target chain for the addresses
1324
+ * @param label - Optional human-readable label
1325
+ * @returns Stealth meta-address and private keys
1326
+ * @throws {ValidationError} If chain is invalid
1327
+ */
1328
+ declare function generateStealthMetaAddress(chain: ChainId, label?: string): {
1329
+ metaAddress: StealthMetaAddress;
1330
+ spendingPrivateKey: HexString;
1331
+ viewingPrivateKey: HexString;
1332
+ };
1333
+ /**
1334
+ * Generate a one-time stealth address for a recipient
1335
+ *
1336
+ * @param recipientMetaAddress - Recipient's published stealth meta-address
1337
+ * @returns Stealth address data (address + ephemeral key for publication)
1338
+ * @throws {ValidationError} If recipientMetaAddress is invalid
1339
+ */
1340
+ declare function generateStealthAddress(recipientMetaAddress: StealthMetaAddress): {
1341
+ stealthAddress: StealthAddress;
1342
+ sharedSecret: HexString;
1343
+ };
1344
+ /**
1345
+ * Derive the private key for a stealth address (for recipient to claim funds)
1346
+ *
1347
+ * @param stealthAddress - The stealth address to recover
1348
+ * @param spendingPrivateKey - Recipient's spending private key
1349
+ * @param viewingPrivateKey - Recipient's viewing private key
1350
+ * @returns Recovery data including derived private key
1351
+ * @throws {ValidationError} If any input is invalid
1352
+ */
1353
+ declare function deriveStealthPrivateKey(stealthAddress: StealthAddress, spendingPrivateKey: HexString, viewingPrivateKey: HexString): StealthAddressRecovery;
1354
+ /**
1355
+ * Check if a stealth address was intended for this recipient
1356
+ * Uses view tag for efficient filtering before full computation
1357
+ *
1358
+ * @param stealthAddress - Stealth address to check
1359
+ * @param spendingPrivateKey - Recipient's spending private key
1360
+ * @param viewingPrivateKey - Recipient's viewing private key
1361
+ * @returns true if this address belongs to the recipient
1362
+ * @throws {ValidationError} If any input is invalid
1363
+ */
1364
+ declare function checkStealthAddress(stealthAddress: StealthAddress, spendingPrivateKey: HexString, viewingPrivateKey: HexString): boolean;
1365
+ /**
1366
+ * Encode a stealth meta-address as a string
1367
+ * Format: sip:{chain}:{spendingKey}:{viewingKey}
1368
+ */
1369
+ declare function encodeStealthMetaAddress(metaAddress: StealthMetaAddress): string;
1370
+ /**
1371
+ * Decode a stealth meta-address from a string
1372
+ *
1373
+ * @param encoded - Encoded stealth meta-address (format: sip:<chain>:<spendingKey>:<viewingKey>)
1374
+ * @returns Decoded StealthMetaAddress
1375
+ * @throws {ValidationError} If format is invalid or keys are malformed
1376
+ */
1377
+ declare function decodeStealthMetaAddress(encoded: string): StealthMetaAddress;
1378
+ /**
1379
+ * Convert a secp256k1 public key to an Ethereum address
1380
+ *
1381
+ * Algorithm (EIP-5564 style):
1382
+ * 1. Decompress the public key to uncompressed form (65 bytes)
1383
+ * 2. Remove the 0x04 prefix (take last 64 bytes)
1384
+ * 3. keccak256 hash of the 64 bytes
1385
+ * 4. Take the last 20 bytes as the address
1386
+ *
1387
+ * @param publicKey - Compressed (33 bytes) or uncompressed (65 bytes) public key
1388
+ * @returns Ethereum address (20 bytes, checksummed)
1389
+ */
1390
+ declare function publicKeyToEthAddress(publicKey: HexString): HexString;
1391
+ /**
1392
+ * Check if a chain uses ed25519 for stealth addresses
1393
+ */
1394
+ declare function isEd25519Chain(chain: ChainId): boolean;
1395
+ /**
1396
+ * Curve type used for stealth addresses
1397
+ */
1398
+ type StealthCurve = 'secp256k1' | 'ed25519';
1399
+ /**
1400
+ * Get the curve type used by a chain for stealth addresses
1401
+ *
1402
+ * @param chain - Chain identifier
1403
+ * @returns 'ed25519' for Solana/NEAR, 'secp256k1' for EVM chains
1404
+ */
1405
+ declare function getCurveForChain(chain: ChainId): StealthCurve;
1406
+ /**
1407
+ * Generate a new ed25519 stealth meta-address keypair
1408
+ *
1409
+ * @param chain - Target chain (must be ed25519-compatible: solana, near)
1410
+ * @param label - Optional human-readable label
1411
+ * @returns Stealth meta-address and private keys
1412
+ * @throws {ValidationError} If chain is invalid or not ed25519-compatible
1413
+ */
1414
+ declare function generateEd25519StealthMetaAddress(chain: ChainId, label?: string): {
1415
+ metaAddress: StealthMetaAddress;
1416
+ spendingPrivateKey: HexString;
1417
+ viewingPrivateKey: HexString;
1418
+ };
1419
+ /**
1420
+ * Generate a one-time ed25519 stealth address for a recipient
1421
+ *
1422
+ * Algorithm (DKSAP for ed25519):
1423
+ * 1. Generate ephemeral keypair (r, R = r*G)
1424
+ * 2. Compute shared secret: S = r * P_spend (ephemeral scalar * spending public)
1425
+ * 3. Hash shared secret: h = SHA256(S)
1426
+ * 4. Derive stealth public key: P_stealth = P_view + h*G
1427
+ *
1428
+ * @param recipientMetaAddress - Recipient's published stealth meta-address
1429
+ * @returns Stealth address data (address + ephemeral key for publication)
1430
+ * @throws {ValidationError} If recipientMetaAddress is invalid
1431
+ */
1432
+ declare function generateEd25519StealthAddress(recipientMetaAddress: StealthMetaAddress): {
1433
+ stealthAddress: StealthAddress;
1434
+ sharedSecret: HexString;
1435
+ };
1436
+ /**
1437
+ * Derive the private key for an ed25519 stealth address (for recipient to claim funds)
1438
+ *
1439
+ * Algorithm:
1440
+ * 1. Compute shared secret: S = spend_scalar * R (spending scalar * ephemeral public)
1441
+ * 2. Hash shared secret: h = SHA256(S)
1442
+ * 3. Derive stealth private key: s_stealth = s_view + h (mod L)
1443
+ *
1444
+ * **IMPORTANT: Derived Key Format**
1445
+ *
1446
+ * The returned `privateKey` is a **raw scalar** in little-endian format, NOT a standard
1447
+ * ed25519 seed. This is because the stealth private key is derived mathematically
1448
+ * (s_view + hash), not generated from a seed.
1449
+ *
1450
+ * To compute the public key from the derived private key:
1451
+ * ```typescript
1452
+ * // CORRECT: Direct scalar multiplication
1453
+ * const scalar = bytesToBigIntLE(hexToBytes(privateKey.slice(2)))
1454
+ * const publicKey = ed25519.ExtendedPoint.BASE.multiply(scalar)
1455
+ *
1456
+ * // WRONG: Do NOT use ed25519.getPublicKey() - it will hash and clamp the input,
1457
+ * // producing a different (incorrect) public key
1458
+ * ```
1459
+ *
1460
+ * @param stealthAddress - The stealth address to recover
1461
+ * @param spendingPrivateKey - Recipient's spending private key
1462
+ * @param viewingPrivateKey - Recipient's viewing private key
1463
+ * @returns Recovery data including derived private key (raw scalar, little-endian)
1464
+ * @throws {ValidationError} If any input is invalid
1465
+ */
1466
+ declare function deriveEd25519StealthPrivateKey(stealthAddress: StealthAddress, spendingPrivateKey: HexString, viewingPrivateKey: HexString): StealthAddressRecovery;
1467
+ /**
1468
+ * Check if an ed25519 stealth address was intended for this recipient
1469
+ * Uses view tag for efficient filtering before full computation
1470
+ *
1471
+ * @param stealthAddress - Stealth address to check
1472
+ * @param spendingPrivateKey - Recipient's spending private key
1473
+ * @param viewingPrivateKey - Recipient's viewing private key
1474
+ * @returns true if this address belongs to the recipient
1475
+ * @throws {ValidationError} If any input is invalid
1476
+ */
1477
+ declare function checkEd25519StealthAddress(stealthAddress: StealthAddress, spendingPrivateKey: HexString, viewingPrivateKey: HexString): boolean;
1478
+ /**
1479
+ * Convert an ed25519 public key (hex) to a Solana address (base58)
1480
+ *
1481
+ * Solana addresses are base58-encoded 32-byte ed25519 public keys.
1482
+ *
1483
+ * @param publicKey - 32-byte ed25519 public key as hex string (with 0x prefix)
1484
+ * @returns Base58-encoded Solana address
1485
+ * @throws {ValidationError} If public key is invalid
1486
+ *
1487
+ * @example
1488
+ * ```typescript
1489
+ * const { stealthAddress } = generateEd25519StealthAddress(metaAddress)
1490
+ * const solanaAddress = ed25519PublicKeyToSolanaAddress(stealthAddress.address)
1491
+ * // Returns: "7Vbmv1jt4vyuqBZcpYPpnVhrqVe5e6ZPBJCyqLqzQPvN" (example)
1492
+ * ```
1493
+ */
1494
+ declare function ed25519PublicKeyToSolanaAddress(publicKey: HexString): string;
1495
+ /**
1496
+ * Validate a Solana address format
1497
+ *
1498
+ * Checks that the address:
1499
+ * - Is a valid base58 string
1500
+ * - Decodes to exactly 32 bytes (ed25519 public key size)
1501
+ *
1502
+ * @param address - Base58-encoded Solana address
1503
+ * @returns true if valid, false otherwise
1504
+ *
1505
+ * @example
1506
+ * ```typescript
1507
+ * isValidSolanaAddress('7Vbmv1jt4vyuqBZcpYPpnVhrqVe5e6ZPBJCyqLqzQPvN') // true
1508
+ * isValidSolanaAddress('invalid') // false
1509
+ * ```
1510
+ */
1511
+ declare function isValidSolanaAddress(address: string): boolean;
1512
+ /**
1513
+ * Convert a Solana address (base58) back to ed25519 public key (hex)
1514
+ *
1515
+ * @param address - Base58-encoded Solana address
1516
+ * @returns 32-byte ed25519 public key as hex string (with 0x prefix)
1517
+ * @throws {ValidationError} If address is invalid
1518
+ *
1519
+ * @example
1520
+ * ```typescript
1521
+ * const publicKey = solanaAddressToEd25519PublicKey('7Vbmv1jt4vyuqBZcpYPpnVhrqVe5e6ZPBJCyqLqzQPvN')
1522
+ * // Returns: "0x..." (64 hex characters)
1523
+ * ```
1524
+ */
1525
+ declare function solanaAddressToEd25519PublicKey(address: string): HexString;
1526
+ /**
1527
+ * Convert ed25519 public key to NEAR implicit account address
1528
+ *
1529
+ * NEAR implicit accounts are lowercase hex-encoded ed25519 public keys (64 characters).
1530
+ * No prefix, just raw 32 bytes as lowercase hex.
1531
+ *
1532
+ * @param publicKey - 32-byte ed25519 public key as hex string (with 0x prefix)
1533
+ * @returns NEAR implicit account address (64 lowercase hex characters, no prefix)
1534
+ * @throws {ValidationError} If public key is invalid
1535
+ *
1536
+ * @example
1537
+ * ```typescript
1538
+ * const { stealthAddress } = generateEd25519StealthAddress(metaAddress)
1539
+ * const nearAddress = ed25519PublicKeyToNearAddress(stealthAddress.address)
1540
+ * // Returns: "ab12cd34..." (64 hex chars)
1541
+ * ```
1542
+ */
1543
+ declare function ed25519PublicKeyToNearAddress(publicKey: HexString): string;
1544
+ /**
1545
+ * Convert NEAR implicit account address back to ed25519 public key
1546
+ *
1547
+ * @param address - NEAR implicit account address (64 hex characters)
1548
+ * @returns ed25519 public key as HexString (with 0x prefix)
1549
+ * @throws {ValidationError} If address is invalid
1550
+ *
1551
+ * @example
1552
+ * ```typescript
1553
+ * const publicKey = nearAddressToEd25519PublicKey("ab12cd34...")
1554
+ * // Returns: "0xab12cd34..."
1555
+ * ```
1556
+ */
1557
+ declare function nearAddressToEd25519PublicKey(address: string): HexString;
1558
+ /**
1559
+ * Validate a NEAR implicit account address
1560
+ *
1561
+ * NEAR implicit accounts are:
1562
+ * - Exactly 64 lowercase hex characters
1563
+ * - No prefix (no "0x")
1564
+ * - Represent a 32-byte ed25519 public key
1565
+ *
1566
+ * @param address - Address to validate
1567
+ * @returns true if valid NEAR implicit account address
1568
+ *
1569
+ * @example
1570
+ * ```typescript
1571
+ * isValidNearImplicitAddress("ab12cd34ef...") // true (64 hex chars)
1572
+ * isValidNearImplicitAddress("0xab12...") // false (has prefix)
1573
+ * isValidNearImplicitAddress("alice.near") // false (named account)
1574
+ * isValidNearImplicitAddress("AB12CD...") // false (uppercase)
1575
+ * ```
1576
+ */
1577
+ declare function isValidNearImplicitAddress(address: string): boolean;
1578
+ /**
1579
+ * Check if a string is a valid NEAR account ID (named or implicit)
1580
+ *
1581
+ * Supports both:
1582
+ * - Named accounts: alice.near, bob.testnet
1583
+ * - Implicit accounts: 64 hex characters
1584
+ *
1585
+ * @param accountId - Account ID to validate
1586
+ * @returns true if valid NEAR account ID
1587
+ *
1588
+ * @example
1589
+ * ```typescript
1590
+ * isValidNearAccountId("alice.near") // true
1591
+ * isValidNearAccountId("bob.testnet") // true
1592
+ * isValidNearAccountId("ab12cd34...") // true (64 hex chars)
1593
+ * isValidNearAccountId("ALICE.near") // false (uppercase)
1594
+ * isValidNearAccountId("a") // false (too short)
1595
+ * ```
1596
+ */
1597
+ declare function isValidNearAccountId(accountId: string): boolean;
1598
+
1093
1599
  /**
1094
1600
  * NEAR Intents Adapter for SIP Protocol
1095
1601
  *
1096
1602
  * Bridges SIP SDK with NEAR 1Click API, providing privacy-preserving
1097
1603
  * cross-chain swaps using stealth addresses.
1604
+ *
1605
+ * IMPORTANT: NEAR Intents (1Click API) operates on MAINNET ONLY.
1606
+ * There is no testnet deployment. For testing:
1607
+ * - Use `dry: true` for quote-only mode (real quotes, no execution)
1608
+ * - Use MockSolver for unit tests
1609
+ * - Use small mainnet amounts ($5-10) for integration testing
1098
1610
  */
1099
1611
 
1100
1612
  /**
@@ -1130,6 +1642,10 @@ interface PreparedSwap {
1130
1642
  };
1131
1643
  /** Shared secret for stealth address derivation (keep private!) */
1132
1644
  sharedSecret?: HexString;
1645
+ /** Curve used for stealth address (for cross-chain compatibility) */
1646
+ curve?: StealthCurve;
1647
+ /** Native recipient address (converted from stealth public key) */
1648
+ nativeRecipientAddress?: string;
1133
1649
  }
1134
1650
  /**
1135
1651
  * Result of executing a swap
@@ -1538,92 +2054,6 @@ declare function createProductionSIP(config: {
1538
2054
  proofProvider?: ProofProvider;
1539
2055
  }): SIP;
1540
2056
 
1541
- /**
1542
- * Stealth Address Generation for SIP Protocol
1543
- *
1544
- * Implements EIP-5564 style stealth addresses using secp256k1.
1545
- * Provides unlinkable one-time addresses for privacy-preserving transactions.
1546
- *
1547
- * Flow:
1548
- * 1. Recipient generates stealth meta-address (spending key P, viewing key Q)
1549
- * 2. Sender generates ephemeral keypair (r, R = r*G)
1550
- * 3. Sender computes shared secret: S = r * P
1551
- * 4. Sender derives stealth address: A = Q + hash(S)*G
1552
- * 5. Recipient scans: for each R, compute S = p * R, check if A matches
1553
- */
1554
-
1555
- /**
1556
- * Generate a new stealth meta-address keypair
1557
- *
1558
- * @param chain - Target chain for the addresses
1559
- * @param label - Optional human-readable label
1560
- * @returns Stealth meta-address and private keys
1561
- * @throws {ValidationError} If chain is invalid
1562
- */
1563
- declare function generateStealthMetaAddress(chain: ChainId, label?: string): {
1564
- metaAddress: StealthMetaAddress;
1565
- spendingPrivateKey: HexString;
1566
- viewingPrivateKey: HexString;
1567
- };
1568
- /**
1569
- * Generate a one-time stealth address for a recipient
1570
- *
1571
- * @param recipientMetaAddress - Recipient's published stealth meta-address
1572
- * @returns Stealth address data (address + ephemeral key for publication)
1573
- * @throws {ValidationError} If recipientMetaAddress is invalid
1574
- */
1575
- declare function generateStealthAddress(recipientMetaAddress: StealthMetaAddress): {
1576
- stealthAddress: StealthAddress;
1577
- sharedSecret: HexString;
1578
- };
1579
- /**
1580
- * Derive the private key for a stealth address (for recipient to claim funds)
1581
- *
1582
- * @param stealthAddress - The stealth address to recover
1583
- * @param spendingPrivateKey - Recipient's spending private key
1584
- * @param viewingPrivateKey - Recipient's viewing private key
1585
- * @returns Recovery data including derived private key
1586
- * @throws {ValidationError} If any input is invalid
1587
- */
1588
- declare function deriveStealthPrivateKey(stealthAddress: StealthAddress, spendingPrivateKey: HexString, viewingPrivateKey: HexString): StealthAddressRecovery;
1589
- /**
1590
- * Check if a stealth address was intended for this recipient
1591
- * Uses view tag for efficient filtering before full computation
1592
- *
1593
- * @param stealthAddress - Stealth address to check
1594
- * @param spendingPrivateKey - Recipient's spending private key
1595
- * @param viewingPrivateKey - Recipient's viewing private key
1596
- * @returns true if this address belongs to the recipient
1597
- * @throws {ValidationError} If any input is invalid
1598
- */
1599
- declare function checkStealthAddress(stealthAddress: StealthAddress, spendingPrivateKey: HexString, viewingPrivateKey: HexString): boolean;
1600
- /**
1601
- * Encode a stealth meta-address as a string
1602
- * Format: sip:{chain}:{spendingKey}:{viewingKey}
1603
- */
1604
- declare function encodeStealthMetaAddress(metaAddress: StealthMetaAddress): string;
1605
- /**
1606
- * Decode a stealth meta-address from a string
1607
- *
1608
- * @param encoded - Encoded stealth meta-address (format: sip:<chain>:<spendingKey>:<viewingKey>)
1609
- * @returns Decoded StealthMetaAddress
1610
- * @throws {ValidationError} If format is invalid or keys are malformed
1611
- */
1612
- declare function decodeStealthMetaAddress(encoded: string): StealthMetaAddress;
1613
- /**
1614
- * Convert a secp256k1 public key to an Ethereum address
1615
- *
1616
- * Algorithm (EIP-5564 style):
1617
- * 1. Decompress the public key to uncompressed form (65 bytes)
1618
- * 2. Remove the 0x04 prefix (take last 64 bytes)
1619
- * 3. keccak256 hash of the 64 bytes
1620
- * 4. Take the last 20 bytes as the address
1621
- *
1622
- * @param publicKey - Compressed (33 bytes) or uncompressed (65 bytes) public key
1623
- * @returns Ethereum address (20 bytes, checksummed)
1624
- */
1625
- declare function publicKeyToEthAddress(publicKey: HexString): HexString;
1626
-
1627
2057
  /**
1628
2058
  * Privacy level handling for SIP Protocol
1629
2059
  *
@@ -2074,6 +2504,10 @@ declare function isValidStealthMetaAddress(addr: string): boolean;
2074
2504
  * Check if a public key is valid (compressed secp256k1: 33 bytes)
2075
2505
  */
2076
2506
  declare function isValidCompressedPublicKey(key: string): boolean;
2507
+ /**
2508
+ * Check if a public key is valid ed25519 (32 bytes)
2509
+ */
2510
+ declare function isValidEd25519PublicKey(key: string): boolean;
2077
2511
  /**
2078
2512
  * Check if a private key is valid (32 bytes)
2079
2513
  */
@@ -2107,6 +2541,281 @@ declare function isValidScalar(value: bigint): boolean;
2107
2541
  */
2108
2542
  declare function validateScalar(value: unknown, field: string): asserts value is bigint;
2109
2543
 
2544
+ /**
2545
+ * Oracle Attestation Types
2546
+ *
2547
+ * Type definitions for the oracle attestation protocol.
2548
+ *
2549
+ * @see docs/specs/ORACLE-ATTESTATION.md
2550
+ */
2551
+
2552
+ /**
2553
+ * Oracle identifier (SHA256 hash of public key)
2554
+ */
2555
+ type OracleId = HexString;
2556
+ /**
2557
+ * Oracle status in the registry
2558
+ */
2559
+ type OracleStatus = 'active' | 'suspended' | 'removed';
2560
+ /**
2561
+ * Oracle information stored in registry
2562
+ */
2563
+ interface OracleInfo {
2564
+ /** Unique oracle identifier (hash of public key) */
2565
+ id: OracleId;
2566
+ /** Oracle's Ed25519 public key (32 bytes) */
2567
+ publicKey: HexString;
2568
+ /** Human-readable name */
2569
+ name: string;
2570
+ /** Supported destination chains */
2571
+ supportedChains: ChainId[];
2572
+ /** Oracle endpoint URL */
2573
+ endpoint: string;
2574
+ /** Registration timestamp (Unix seconds) */
2575
+ registeredAt: number;
2576
+ /** Current status */
2577
+ status: OracleStatus;
2578
+ /** Reputation score (0-100) */
2579
+ reputation: number;
2580
+ /** Staked amount in smallest unit */
2581
+ stake: bigint;
2582
+ }
2583
+ /**
2584
+ * The canonical message format that oracles sign
2585
+ *
2586
+ * This structure is serialized deterministically for signing.
2587
+ * Total serialized size: 197 bytes
2588
+ */
2589
+ interface OracleAttestationMessage {
2590
+ /** Protocol version (current: 1) */
2591
+ version: number;
2592
+ /** Destination chain numeric ID */
2593
+ chainId: number;
2594
+ /** Hash of original intent (32 bytes) */
2595
+ intentHash: HexString;
2596
+ /** Recipient address, normalized to 32 bytes */
2597
+ recipient: HexString;
2598
+ /** Amount delivered in smallest unit */
2599
+ amount: bigint;
2600
+ /** Asset identifier hash (32 bytes) */
2601
+ assetId: HexString;
2602
+ /** Transaction hash on destination chain (32 bytes) */
2603
+ txHash: HexString;
2604
+ /** Block number containing transaction */
2605
+ blockNumber: bigint;
2606
+ /** Block hash for finality verification (32 bytes) */
2607
+ blockHash: HexString;
2608
+ /** Unix timestamp of attestation creation */
2609
+ timestamp: number;
2610
+ }
2611
+ /**
2612
+ * A single oracle's signature on an attestation
2613
+ */
2614
+ interface OracleSignature {
2615
+ /** Oracle that produced this signature */
2616
+ oracleId: OracleId;
2617
+ /** Ed25519 signature (64 bytes) */
2618
+ signature: HexString;
2619
+ }
2620
+ /**
2621
+ * Complete attestation with message and signatures
2622
+ */
2623
+ interface SignedOracleAttestation {
2624
+ /** The attested message */
2625
+ message: OracleAttestationMessage;
2626
+ /** Signatures from k-of-n oracles */
2627
+ signatures: OracleSignature[];
2628
+ }
2629
+ /**
2630
+ * Oracle registry containing all registered oracles
2631
+ */
2632
+ interface OracleRegistry {
2633
+ /** Registered oracles indexed by ID */
2634
+ oracles: Map<OracleId, OracleInfo>;
2635
+ /** Required signature threshold (k in k-of-n) */
2636
+ threshold: number;
2637
+ /** Total number of oracles (n in k-of-n) */
2638
+ totalOracles: number;
2639
+ /** Registry version for upgrades */
2640
+ version: number;
2641
+ /** Last update timestamp */
2642
+ lastUpdated: number;
2643
+ }
2644
+ /**
2645
+ * Oracle registry configuration
2646
+ */
2647
+ interface OracleRegistryConfig {
2648
+ /** Minimum required signatures (default: 3) */
2649
+ threshold?: number;
2650
+ /** Oracle endpoint timeout in ms (default: 30000) */
2651
+ timeout?: number;
2652
+ /** Custom registry data (for testing) */
2653
+ customOracles?: OracleInfo[];
2654
+ }
2655
+ /**
2656
+ * Request for oracle attestation
2657
+ */
2658
+ interface AttestationRequest {
2659
+ /** Intent hash to attest */
2660
+ intentHash: HexString;
2661
+ /** Destination chain */
2662
+ destinationChain: ChainId;
2663
+ /** Expected recipient address */
2664
+ expectedRecipient: HexString;
2665
+ /** Expected asset identifier */
2666
+ expectedAsset: HexString;
2667
+ /** Minimum amount expected */
2668
+ minAmount: bigint;
2669
+ /** Deadline for fulfillment (Unix timestamp) */
2670
+ deadline: number;
2671
+ }
2672
+ /**
2673
+ * Result of attestation request
2674
+ */
2675
+ interface AttestationResult {
2676
+ /** Whether attestation was successful */
2677
+ success: boolean;
2678
+ /** The signed attestation (if successful) */
2679
+ attestation?: SignedOracleAttestation;
2680
+ /** Error message (if failed) */
2681
+ error?: string;
2682
+ /** Number of oracles that responded */
2683
+ oracleResponses: number;
2684
+ /** Number of valid signatures collected */
2685
+ validSignatures: number;
2686
+ }
2687
+ /**
2688
+ * Result of attestation verification
2689
+ */
2690
+ interface VerificationResult {
2691
+ /** Whether verification passed */
2692
+ valid: boolean;
2693
+ /** Number of valid signatures found */
2694
+ validSignatures: number;
2695
+ /** Required threshold */
2696
+ threshold: number;
2697
+ /** List of oracle IDs with valid signatures */
2698
+ validOracles: OracleId[];
2699
+ /** Error details (if invalid) */
2700
+ errors?: string[];
2701
+ }
2702
+ /**
2703
+ * Domain separator for attestation signing
2704
+ */
2705
+ declare const ORACLE_DOMAIN = "SIP-ORACLE-ATTESTATION-V1";
2706
+ /**
2707
+ * Current attestation protocol version
2708
+ */
2709
+ declare const ATTESTATION_VERSION = 1;
2710
+ /**
2711
+ * Default signature threshold
2712
+ */
2713
+ declare const DEFAULT_THRESHOLD = 3;
2714
+ /**
2715
+ * Default total oracles
2716
+ */
2717
+ declare const DEFAULT_TOTAL_ORACLES = 5;
2718
+ /**
2719
+ * Chain numeric IDs for attestation message
2720
+ */
2721
+ declare const CHAIN_NUMERIC_IDS: Record<ChainId, number>;
2722
+
2723
+ /**
2724
+ * Oracle Attestation Verification
2725
+ *
2726
+ * Verification of oracle signatures on attestation messages.
2727
+ *
2728
+ * @see docs/specs/ORACLE-ATTESTATION.md Section 4
2729
+ */
2730
+
2731
+ /**
2732
+ * Derive oracle ID from public key
2733
+ *
2734
+ * OracleId = SHA256(publicKey)
2735
+ */
2736
+ declare function deriveOracleId(publicKey: HexString | Uint8Array): OracleId;
2737
+ /**
2738
+ * Verify a signed oracle attestation
2739
+ *
2740
+ * Checks:
2741
+ * 1. Sufficient signatures (>= threshold)
2742
+ * 2. All signatures are from registered, active oracles
2743
+ * 3. All signatures are valid Ed25519 signatures
2744
+ * 4. No duplicate oracles
2745
+ */
2746
+ declare function verifyAttestation(attestation: SignedOracleAttestation, registry: OracleRegistry): VerificationResult;
2747
+ /**
2748
+ * Verify a single oracle signature
2749
+ */
2750
+ declare function verifyOracleSignature(signature: OracleSignature, messageHash: Uint8Array, oracle: OracleInfo): boolean;
2751
+ /**
2752
+ * Sign an attestation message (for oracle implementations)
2753
+ */
2754
+ declare function signAttestationMessage(messageHash: Uint8Array, privateKey: Uint8Array): OracleSignature;
2755
+ /**
2756
+ * Create a new oracle registry
2757
+ */
2758
+ declare function createOracleRegistry(config?: OracleRegistryConfig): OracleRegistry;
2759
+ /**
2760
+ * Add an oracle to the registry
2761
+ */
2762
+ declare function addOracle(registry: OracleRegistry, oracle: OracleInfo): void;
2763
+ /**
2764
+ * Remove an oracle from the registry
2765
+ */
2766
+ declare function removeOracle(registry: OracleRegistry, oracleId: OracleId): boolean;
2767
+ /**
2768
+ * Update oracle status
2769
+ */
2770
+ declare function updateOracleStatus(registry: OracleRegistry, oracleId: OracleId, status: OracleInfo['status']): boolean;
2771
+ /**
2772
+ * Get all active oracles
2773
+ */
2774
+ declare function getActiveOracles(registry: OracleRegistry): OracleInfo[];
2775
+ /**
2776
+ * Check if registry has enough active oracles for threshold
2777
+ */
2778
+ declare function hasEnoughOracles(registry: OracleRegistry): boolean;
2779
+
2780
+ /**
2781
+ * Oracle Attestation Serialization
2782
+ *
2783
+ * Canonical serialization of attestation messages for signing and verification.
2784
+ *
2785
+ * @see docs/specs/ORACLE-ATTESTATION.md Section 2.2
2786
+ */
2787
+
2788
+ /**
2789
+ * Serialize an attestation message to canonical byte format
2790
+ *
2791
+ * Layout (197 bytes total):
2792
+ * - version: 1 byte
2793
+ * - chainId: 4 bytes (big-endian)
2794
+ * - intentHash: 32 bytes
2795
+ * - recipient: 32 bytes
2796
+ * - amount: 16 bytes (big-endian u128)
2797
+ * - assetId: 32 bytes
2798
+ * - txHash: 32 bytes
2799
+ * - blockNumber: 8 bytes (big-endian)
2800
+ * - blockHash: 32 bytes
2801
+ * - timestamp: 8 bytes (big-endian)
2802
+ */
2803
+ declare function serializeAttestationMessage(message: OracleAttestationMessage): Uint8Array;
2804
+ /**
2805
+ * Deserialize bytes back to attestation message
2806
+ */
2807
+ declare function deserializeAttestationMessage(bytes: Uint8Array): OracleAttestationMessage;
2808
+ /**
2809
+ * Compute the hash to be signed for an attestation
2810
+ *
2811
+ * hash = SHA256(domain || serialized_message)
2812
+ */
2813
+ declare function computeAttestationHash(message: OracleAttestationMessage): Uint8Array;
2814
+ /**
2815
+ * Get the numeric chain ID for a chain identifier
2816
+ */
2817
+ declare function getChainNumericId(chain: string): number;
2818
+
2110
2819
  /**
2111
2820
  * Mock Solver Implementation
2112
2821
  *
@@ -5332,4 +6041,4 @@ declare function createMockLedgerAdapter(config: Omit<MockHardwareConfig, 'devic
5332
6041
  */
5333
6042
  declare function createMockTrezorAdapter(config: Omit<MockHardwareConfig, 'deviceType'>): MockTrezorAdapter;
5334
6043
 
5335
- export { BaseWalletAdapter, type CommitmentPoint, ComplianceManager, type CreateIntentOptions, type CreatePaymentOptions, CryptoError, 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, type FulfillmentProofParams, type 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, NoirProofProvider, type NoirProviderConfig, OneClickClient, type OracleAttestation, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PrivacyConfig, type ProductionQuote, ProofError, type ProofFramework, ProofGenerationError, ProofNotImplementedError, type ProofProvider, type ProofResult, type ReceivedNote, SIP, type SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, type SerializedError, type ShieldedBalance, type ShieldedSendParams, type ShieldedSendResult, 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 SwapRequest, type SwapResult, type TransactionData, type TransportType, Treasury, type TrezorConfig, type TrezorModel, TrezorWalletAdapter, ValidationError, type ValidityProofParams, type WalletAdapter, WalletError, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, type ZcashShieldedServiceConfig, addBlindings, addCommitments, attachProofs, base58ToHex, checkStealthAddress, commit, commitZero, createCommitment, createEthereumAdapter, createLedgerAdapter, createMockEthereumAdapter, createMockEthereumProvider, createMockLedgerAdapter, createMockSolanaAdapter, createMockSolanaConnection, createMockSolanaProvider, createMockSolver, createMockTrezorAdapter, createNEARIntentsAdapter, createProductionSIP, createSIP, createShieldedIntent, createShieldedPayment, createSolanaAdapter, createTrezorAdapter, createWalletFactory, createZcashClient, createZcashShieldedService, decodeStealthMetaAddress, decryptMemo, decryptWithViewing, deriveStealthPrivateKey, deriveViewingKey, deserializeIntent, deserializePayment, detectEthereumWallets, detectSolanaWallets, encodeStealthMetaAddress, encryptForViewing, featureNotSupportedError, formatStablecoinAmount, fromHex, fromStablecoinUnits, generateBlinding, generateIntentId, generateRandomBytes, generateStealthAddress, generateStealthMetaAddress, generateViewingKey, getAvailableTransports, getChainsForStablecoin, getDefaultRpcEndpoint, getDerivationPath, getErrorMessage, getEthereumProvider, getGenerators, getIntentSummary, getPaymentSummary, getPaymentTimeRemaining, getPrivacyConfig, getPrivacyDescription, getSolanaProvider, getStablecoin, getStablecoinInfo, getStablecoinsForChain, getSupportedStablecoins, getTimeRemaining, hasErrorCode, hasRequiredProofs, hash, hexToNumber, isExpired, isNonNegativeAmount, isPaymentExpired, isPrivateWalletAdapter, isSIPError, isStablecoin, isStablecoinOnChain, isValidAmount, isValidChainId, isValidCompressedPublicKey, isValidHex, isValidHexLength, isValidPrivacyLevel, isValidPrivateKey, isValidScalar, isValidSlippage, isValidStealthMetaAddress, normalizeAddress, notConnectedError, publicKeyToEthAddress, registerWallet, secureWipe, secureWipeAll, serializeIntent, serializePayment, solanaPublicKeyToHex, subtractBlindings, subtractCommitments, supportsWebBluetooth, supportsWebHID, supportsWebUSB, toHex, toStablecoinUnits, trackIntent, trackPayment, validateAsset, validateCreateIntentParams, validateIntentInput, validateIntentOutput, validateScalar, validateViewingKey, verifyCommitment, verifyOpening, walletRegistry, withSecureBuffer, withSecureBufferSync, wrapError };
6044
+ 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, type FulfillmentProofParams, type 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, NoirProofProvider, type NoirProviderConfig, ORACLE_DOMAIN, OneClickClient, type OracleAttestation, type OracleAttestationMessage, type OracleId, type OracleInfo, type OracleRegistry, type OracleRegistryConfig, type OracleSignature, type OracleStatus, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PrivacyConfig, type ProductionQuote, ProofError, type ProofFramework, ProofGenerationError, ProofNotImplementedError, type ProofProgressCallback, type ProofProvider, type 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, type 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 };