@sip-protocol/sdk 0.2.1 → 0.2.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.
- package/dist/browser.d.mts +2 -1
- package/dist/browser.d.ts +2 -1
- package/dist/browser.js +6662 -7442
- package/dist/browser.mjs +22 -20
- package/dist/chunk-DU7LQDD2.mjs +10148 -0
- package/dist/chunk-UHZKNGIT.mjs +223 -0
- package/dist/chunk-VITVG25F.mjs +982 -0
- package/dist/index.d.mts +4 -466
- package/dist/index.d.ts +4 -466
- package/dist/index.js +3 -1762
- package/dist/index.mjs +17 -17
- package/dist/noir-BHQtFvRk.d.mts +467 -0
- package/dist/noir-BHQtFvRk.d.ts +467 -0
- package/dist/proofs/noir.d.mts +2 -0
- package/dist/proofs/noir.d.ts +2 -0
- package/dist/proofs/noir.js +1862 -0
- package/dist/proofs/noir.mjs +790 -0
- package/package.json +8 -3
- package/src/index.ts +5 -3
- package/src/proofs/index.ts +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { P as ProofProvider, a as ProofFramework, F as FundingProofParams, b as ProofResult, V as ValidityProofParams, c as FulfillmentProofParams } from './noir-BHQtFvRk.js';
|
|
2
|
+
export { N as NoirProviderConfig, O as OracleAttestation, d as ProofGenerationError } from './noir-BHQtFvRk.js';
|
|
1
3
|
import * as _sip_protocol_types from '@sip-protocol/types';
|
|
2
|
-
import { ZKProof,
|
|
4
|
+
import { ZKProof, PrivacyLevel, ShieldedIntent, CreateIntentParams, TrackedIntent, OneClickConfig, OneClickToken, OneClickQuoteRequest, OneClickQuoteResponse, OneClickDepositSubmit, OneClickStatusResponse, OneClickWithdrawal, ChainId, StealthMetaAddress, HexString, StealthAddress, StealthAddressRecovery, DefuseAssetId, Asset, OneClickSwapStatus, Quote, FulfillmentResult, ViewingKey, EncryptedTransaction, Commitment, 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
5
|
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
6
|
|
|
5
7
|
/**
|
|
@@ -285,221 +287,6 @@ declare function wrapError(error: unknown, message: string, code?: ErrorCode, co
|
|
|
285
287
|
*/
|
|
286
288
|
declare function getErrorMessage(error: unknown): string;
|
|
287
289
|
|
|
288
|
-
/**
|
|
289
|
-
* Proof Provider Interface
|
|
290
|
-
*
|
|
291
|
-
* Defines a pluggable interface for ZK proof generation and verification.
|
|
292
|
-
* This allows different backends (Noir, mock for testing) to be swapped.
|
|
293
|
-
*
|
|
294
|
-
* @see docs/specs/ZK-ARCHITECTURE.md for framework decision (Noir)
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Supported proof framework types
|
|
299
|
-
*/
|
|
300
|
-
type ProofFramework = 'noir' | 'mock';
|
|
301
|
-
/**
|
|
302
|
-
* Parameters for generating a Funding Proof
|
|
303
|
-
*
|
|
304
|
-
* Proves: balance >= minimumRequired without revealing balance
|
|
305
|
-
*
|
|
306
|
-
* @see docs/specs/FUNDING-PROOF.md
|
|
307
|
-
*/
|
|
308
|
-
interface FundingProofParams {
|
|
309
|
-
/** User's actual balance (private) */
|
|
310
|
-
balance: bigint;
|
|
311
|
-
/** Minimum amount required for the intent (public) */
|
|
312
|
-
minimumRequired: bigint;
|
|
313
|
-
/** Blinding factor for the commitment (private) */
|
|
314
|
-
blindingFactor: Uint8Array;
|
|
315
|
-
/** Asset identifier (public) */
|
|
316
|
-
assetId: string;
|
|
317
|
-
/** User's address for ownership proof (private) */
|
|
318
|
-
userAddress: string;
|
|
319
|
-
/** Signature proving ownership of the address (private) */
|
|
320
|
-
ownershipSignature: Uint8Array;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Public key coordinates for secp256k1 (X and Y as byte arrays)
|
|
324
|
-
*/
|
|
325
|
-
interface PublicKeyXY {
|
|
326
|
-
/** X coordinate as 32-byte array */
|
|
327
|
-
x: Uint8Array;
|
|
328
|
-
/** Y coordinate as 32-byte array */
|
|
329
|
-
y: Uint8Array;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Parameters for generating a Validity Proof
|
|
333
|
-
*
|
|
334
|
-
* Proves: intent is authorized by sender without revealing sender
|
|
335
|
-
*
|
|
336
|
-
* @see docs/specs/VALIDITY-PROOF.md
|
|
337
|
-
*/
|
|
338
|
-
interface ValidityProofParams {
|
|
339
|
-
/** Hash of the intent (public) */
|
|
340
|
-
intentHash: HexString;
|
|
341
|
-
/** Sender's address (private) */
|
|
342
|
-
senderAddress: string;
|
|
343
|
-
/** Blinding factor for sender commitment (private) */
|
|
344
|
-
senderBlinding: Uint8Array;
|
|
345
|
-
/** Sender's secret key (private) - used to derive public key if senderPublicKey not provided */
|
|
346
|
-
senderSecret: Uint8Array;
|
|
347
|
-
/** Signature authorizing the intent (private) */
|
|
348
|
-
authorizationSignature: Uint8Array;
|
|
349
|
-
/** Nonce for nullifier generation (private) */
|
|
350
|
-
nonce: Uint8Array;
|
|
351
|
-
/** Intent timestamp (public) */
|
|
352
|
-
timestamp: number;
|
|
353
|
-
/** Intent expiry (public) */
|
|
354
|
-
expiry: number;
|
|
355
|
-
/** Optional: Sender's public key. If not provided, derived from senderSecret */
|
|
356
|
-
senderPublicKey?: PublicKeyXY;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Parameters for generating a Fulfillment Proof
|
|
360
|
-
*
|
|
361
|
-
* Proves: solver delivered output >= minimum to correct recipient
|
|
362
|
-
*
|
|
363
|
-
* @see docs/specs/FULFILLMENT-PROOF.md
|
|
364
|
-
*/
|
|
365
|
-
interface FulfillmentProofParams {
|
|
366
|
-
/** Hash of the original intent (public) */
|
|
367
|
-
intentHash: HexString;
|
|
368
|
-
/** Actual output amount delivered (private) */
|
|
369
|
-
outputAmount: bigint;
|
|
370
|
-
/** Blinding factor for output commitment (private) */
|
|
371
|
-
outputBlinding: Uint8Array;
|
|
372
|
-
/** Minimum required output from intent (public) */
|
|
373
|
-
minOutputAmount: bigint;
|
|
374
|
-
/** Recipient's stealth address (public) */
|
|
375
|
-
recipientStealth: HexString;
|
|
376
|
-
/** Solver's identifier (public) */
|
|
377
|
-
solverId: string;
|
|
378
|
-
/** Solver's secret for authorization (private) */
|
|
379
|
-
solverSecret: Uint8Array;
|
|
380
|
-
/** Oracle attestation of delivery (private) */
|
|
381
|
-
oracleAttestation: OracleAttestation;
|
|
382
|
-
/** Time of fulfillment (public) */
|
|
383
|
-
fulfillmentTime: number;
|
|
384
|
-
/** Intent expiry (public) */
|
|
385
|
-
expiry: number;
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Oracle attestation for cross-chain verification
|
|
389
|
-
*/
|
|
390
|
-
interface OracleAttestation {
|
|
391
|
-
/** Recipient who received funds */
|
|
392
|
-
recipient: HexString;
|
|
393
|
-
/** Amount received */
|
|
394
|
-
amount: bigint;
|
|
395
|
-
/** Transaction hash on destination chain */
|
|
396
|
-
txHash: HexString;
|
|
397
|
-
/** Block number containing the transaction */
|
|
398
|
-
blockNumber: bigint;
|
|
399
|
-
/** Oracle signature (threshold signature for multi-oracle) */
|
|
400
|
-
signature: Uint8Array;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Result of proof generation
|
|
404
|
-
*/
|
|
405
|
-
interface ProofResult {
|
|
406
|
-
/** The generated proof */
|
|
407
|
-
proof: ZKProof;
|
|
408
|
-
/** Public inputs used in the proof */
|
|
409
|
-
publicInputs: HexString[];
|
|
410
|
-
/** Commitment (if generated as part of proof) */
|
|
411
|
-
commitment?: Commitment;
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Proof Provider Interface
|
|
415
|
-
*
|
|
416
|
-
* Implementations of this interface provide ZK proof generation and verification.
|
|
417
|
-
* The SDK uses this interface to remain agnostic to the underlying ZK framework.
|
|
418
|
-
*
|
|
419
|
-
* @example
|
|
420
|
-
* ```typescript
|
|
421
|
-
* // Use mock provider for testing
|
|
422
|
-
* const mockProvider = new MockProofProvider()
|
|
423
|
-
*
|
|
424
|
-
* // Use Noir provider for production
|
|
425
|
-
* const noirProvider = new NoirProofProvider()
|
|
426
|
-
*
|
|
427
|
-
* // Configure SIP client with provider
|
|
428
|
-
* const sip = new SIP({
|
|
429
|
-
* network: 'testnet',
|
|
430
|
-
* proofProvider: noirProvider,
|
|
431
|
-
* })
|
|
432
|
-
* ```
|
|
433
|
-
*/
|
|
434
|
-
interface ProofProvider {
|
|
435
|
-
/**
|
|
436
|
-
* The ZK framework this provider uses
|
|
437
|
-
*/
|
|
438
|
-
readonly framework: ProofFramework;
|
|
439
|
-
/**
|
|
440
|
-
* Whether the provider is ready to generate proofs
|
|
441
|
-
* (e.g., circuits compiled, keys loaded)
|
|
442
|
-
*/
|
|
443
|
-
readonly isReady: boolean;
|
|
444
|
-
/**
|
|
445
|
-
* Initialize the provider (compile circuits, load keys, etc.)
|
|
446
|
-
*
|
|
447
|
-
* @throws Error if initialization fails
|
|
448
|
-
*/
|
|
449
|
-
initialize(): Promise<void>;
|
|
450
|
-
/**
|
|
451
|
-
* Generate a Funding Proof
|
|
452
|
-
*
|
|
453
|
-
* Proves that the user has sufficient balance without revealing the exact amount.
|
|
454
|
-
*
|
|
455
|
-
* @param params - Funding proof parameters
|
|
456
|
-
* @returns The generated proof with public inputs
|
|
457
|
-
* @throws ProofGenerationError if proof generation fails
|
|
458
|
-
*
|
|
459
|
-
* @see docs/specs/FUNDING-PROOF.md (~22,000 constraints)
|
|
460
|
-
*/
|
|
461
|
-
generateFundingProof(params: FundingProofParams): Promise<ProofResult>;
|
|
462
|
-
/**
|
|
463
|
-
* Generate a Validity Proof
|
|
464
|
-
*
|
|
465
|
-
* Proves that the intent is authorized without revealing the sender.
|
|
466
|
-
*
|
|
467
|
-
* @param params - Validity proof parameters
|
|
468
|
-
* @returns The generated proof with public inputs
|
|
469
|
-
* @throws ProofGenerationError if proof generation fails
|
|
470
|
-
*
|
|
471
|
-
* @see docs/specs/VALIDITY-PROOF.md (~72,000 constraints)
|
|
472
|
-
*/
|
|
473
|
-
generateValidityProof(params: ValidityProofParams): Promise<ProofResult>;
|
|
474
|
-
/**
|
|
475
|
-
* Generate a Fulfillment Proof
|
|
476
|
-
*
|
|
477
|
-
* Proves that the solver correctly delivered the output.
|
|
478
|
-
*
|
|
479
|
-
* @param params - Fulfillment proof parameters
|
|
480
|
-
* @returns The generated proof with public inputs
|
|
481
|
-
* @throws ProofGenerationError if proof generation fails
|
|
482
|
-
*
|
|
483
|
-
* @see docs/specs/FULFILLMENT-PROOF.md (~22,000 constraints)
|
|
484
|
-
*/
|
|
485
|
-
generateFulfillmentProof(params: FulfillmentProofParams): Promise<ProofResult>;
|
|
486
|
-
/**
|
|
487
|
-
* Verify a proof
|
|
488
|
-
*
|
|
489
|
-
* @param proof - The proof to verify
|
|
490
|
-
* @returns true if the proof is valid, false otherwise
|
|
491
|
-
*/
|
|
492
|
-
verifyProof(proof: ZKProof): Promise<boolean>;
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Error thrown when proof generation fails
|
|
496
|
-
*/
|
|
497
|
-
declare class ProofGenerationError extends Error {
|
|
498
|
-
readonly proofType: 'funding' | 'validity' | 'fulfillment';
|
|
499
|
-
readonly cause?: Error;
|
|
500
|
-
constructor(proofType: 'funding' | 'validity' | 'fulfillment', message: string, cause?: Error);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
290
|
/**
|
|
504
291
|
* Mock Proof Provider
|
|
505
292
|
*
|
|
@@ -575,255 +362,6 @@ declare class MockProofProvider implements ProofProvider {
|
|
|
575
362
|
private hashToHex;
|
|
576
363
|
}
|
|
577
364
|
|
|
578
|
-
/**
|
|
579
|
-
* Noir Proof Provider
|
|
580
|
-
*
|
|
581
|
-
* Production-ready ZK proof provider using Noir (Aztec) circuits.
|
|
582
|
-
*
|
|
583
|
-
* This provider generates cryptographically sound proofs using:
|
|
584
|
-
* - Funding Proof: ~2,000 constraints (docs/specs/FUNDING-PROOF.md)
|
|
585
|
-
* - Validity Proof: ~72,000 constraints (docs/specs/VALIDITY-PROOF.md)
|
|
586
|
-
* - Fulfillment Proof: ~22,000 constraints (docs/specs/FULFILLMENT-PROOF.md)
|
|
587
|
-
*
|
|
588
|
-
* @see docs/specs/ZK-ARCHITECTURE.md for framework decision
|
|
589
|
-
*/
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* Public key coordinates for secp256k1
|
|
593
|
-
*/
|
|
594
|
-
interface PublicKeyCoordinates$1 {
|
|
595
|
-
/** X coordinate as 32-byte array */
|
|
596
|
-
x: number[];
|
|
597
|
-
/** Y coordinate as 32-byte array */
|
|
598
|
-
y: number[];
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Noir Proof Provider Configuration
|
|
602
|
-
*/
|
|
603
|
-
interface NoirProviderConfig {
|
|
604
|
-
/**
|
|
605
|
-
* Path to compiled circuit artifacts
|
|
606
|
-
* If not provided, uses bundled artifacts
|
|
607
|
-
*/
|
|
608
|
-
artifactsPath?: string;
|
|
609
|
-
/**
|
|
610
|
-
* Backend to use for proof generation
|
|
611
|
-
* @default 'barretenberg' (UltraHonk)
|
|
612
|
-
*/
|
|
613
|
-
backend?: 'barretenberg';
|
|
614
|
-
/**
|
|
615
|
-
* Enable verbose logging for debugging
|
|
616
|
-
* @default false
|
|
617
|
-
*/
|
|
618
|
-
verbose?: boolean;
|
|
619
|
-
/**
|
|
620
|
-
* Oracle public key for verifying attestations in fulfillment proofs
|
|
621
|
-
* Required for production use. If not provided, proofs will use placeholder keys.
|
|
622
|
-
*/
|
|
623
|
-
oraclePublicKey?: PublicKeyCoordinates$1;
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* Noir Proof Provider
|
|
627
|
-
*
|
|
628
|
-
* Production ZK proof provider using Noir circuits.
|
|
629
|
-
*
|
|
630
|
-
* @example
|
|
631
|
-
* ```typescript
|
|
632
|
-
* const provider = new NoirProofProvider()
|
|
633
|
-
*
|
|
634
|
-
* await provider.initialize()
|
|
635
|
-
*
|
|
636
|
-
* const result = await provider.generateFundingProof({
|
|
637
|
-
* balance: 100n,
|
|
638
|
-
* minimumRequired: 50n,
|
|
639
|
-
* blindingFactor: new Uint8Array(32),
|
|
640
|
-
* assetId: '0xABCD',
|
|
641
|
-
* userAddress: '0x1234...',
|
|
642
|
-
* ownershipSignature: new Uint8Array(64),
|
|
643
|
-
* })
|
|
644
|
-
* ```
|
|
645
|
-
*/
|
|
646
|
-
declare class NoirProofProvider implements ProofProvider {
|
|
647
|
-
readonly framework: ProofFramework;
|
|
648
|
-
private _isReady;
|
|
649
|
-
private config;
|
|
650
|
-
private fundingNoir;
|
|
651
|
-
private fundingBackend;
|
|
652
|
-
private validityNoir;
|
|
653
|
-
private validityBackend;
|
|
654
|
-
private fulfillmentNoir;
|
|
655
|
-
private fulfillmentBackend;
|
|
656
|
-
constructor(config?: NoirProviderConfig);
|
|
657
|
-
get isReady(): boolean;
|
|
658
|
-
/**
|
|
659
|
-
* Derive secp256k1 public key coordinates from a private key
|
|
660
|
-
*
|
|
661
|
-
* Utility method that can be used to generate public key coordinates
|
|
662
|
-
* for use in ValidityProofParams.senderPublicKey or NoirProviderConfig.oraclePublicKey
|
|
663
|
-
*
|
|
664
|
-
* @param privateKey - 32-byte private key
|
|
665
|
-
* @returns X and Y coordinates as 32-byte arrays
|
|
666
|
-
*
|
|
667
|
-
* @example
|
|
668
|
-
* ```typescript
|
|
669
|
-
* const privateKey = new Uint8Array(32).fill(1) // Your secret key
|
|
670
|
-
* const publicKey = NoirProofProvider.derivePublicKey(privateKey)
|
|
671
|
-
*
|
|
672
|
-
* // Use for oracle configuration
|
|
673
|
-
* const provider = new NoirProofProvider({
|
|
674
|
-
* oraclePublicKey: publicKey
|
|
675
|
-
* })
|
|
676
|
-
*
|
|
677
|
-
* // Or use for validity proof params
|
|
678
|
-
* const validityParams = {
|
|
679
|
-
* // ... other params
|
|
680
|
-
* senderPublicKey: {
|
|
681
|
-
* x: new Uint8Array(publicKey.x),
|
|
682
|
-
* y: new Uint8Array(publicKey.y)
|
|
683
|
-
* }
|
|
684
|
-
* }
|
|
685
|
-
* ```
|
|
686
|
-
*/
|
|
687
|
-
static derivePublicKey(privateKey: Uint8Array): PublicKeyCoordinates$1;
|
|
688
|
-
/**
|
|
689
|
-
* Initialize the Noir provider
|
|
690
|
-
*
|
|
691
|
-
* Loads circuit artifacts and initializes the proving backend.
|
|
692
|
-
*/
|
|
693
|
-
initialize(): Promise<void>;
|
|
694
|
-
/**
|
|
695
|
-
* Generate a Funding Proof using Noir circuits
|
|
696
|
-
*
|
|
697
|
-
* Proves: balance >= minimumRequired without revealing balance
|
|
698
|
-
*
|
|
699
|
-
* @see docs/specs/FUNDING-PROOF.md
|
|
700
|
-
*/
|
|
701
|
-
generateFundingProof(params: FundingProofParams): Promise<ProofResult>;
|
|
702
|
-
/**
|
|
703
|
-
* Generate a Validity Proof using Noir circuits
|
|
704
|
-
*
|
|
705
|
-
* Proves: Intent is authorized by sender without revealing identity
|
|
706
|
-
*
|
|
707
|
-
* @see docs/specs/VALIDITY-PROOF.md
|
|
708
|
-
*/
|
|
709
|
-
generateValidityProof(params: ValidityProofParams): Promise<ProofResult>;
|
|
710
|
-
/**
|
|
711
|
-
* Generate a Fulfillment Proof using Noir circuits
|
|
712
|
-
*
|
|
713
|
-
* Proves: Solver correctly executed the intent and delivered the required
|
|
714
|
-
* output to the recipient, without revealing execution path or liquidity sources.
|
|
715
|
-
*
|
|
716
|
-
* @see docs/specs/FULFILLMENT-PROOF.md
|
|
717
|
-
*/
|
|
718
|
-
generateFulfillmentProof(params: FulfillmentProofParams): Promise<ProofResult>;
|
|
719
|
-
/**
|
|
720
|
-
* Verify a Noir proof
|
|
721
|
-
*/
|
|
722
|
-
verifyProof(proof: ZKProof): Promise<boolean>;
|
|
723
|
-
/**
|
|
724
|
-
* Destroy the provider and free resources
|
|
725
|
-
*/
|
|
726
|
-
destroy(): Promise<void>;
|
|
727
|
-
private ensureReady;
|
|
728
|
-
/**
|
|
729
|
-
* Compute the commitment hash that the circuit expects
|
|
730
|
-
*
|
|
731
|
-
* The circuit computes:
|
|
732
|
-
* 1. commitment = pedersen_commitment([balance, blinding])
|
|
733
|
-
* 2. commitment_hash = pedersen_hash([commitment.x, commitment.y, asset_id])
|
|
734
|
-
*
|
|
735
|
-
* We need to compute this outside to pass as a public input.
|
|
736
|
-
*
|
|
737
|
-
* **IMPORTANT**: This SDK uses SHA256 as a deterministic stand-in for Pedersen hash.
|
|
738
|
-
* Both the SDK and circuit MUST use the same hash function. The bundled circuit
|
|
739
|
-
* artifacts are configured to use SHA256 for compatibility. If you use custom
|
|
740
|
-
* circuits with actual Pedersen hashing, you must update this implementation.
|
|
741
|
-
*
|
|
742
|
-
* @see docs/specs/HASH-COMPATIBILITY.md for hash function requirements
|
|
743
|
-
*/
|
|
744
|
-
private computeCommitmentHash;
|
|
745
|
-
/**
|
|
746
|
-
* Convert asset ID to field element
|
|
747
|
-
*/
|
|
748
|
-
private assetIdToField;
|
|
749
|
-
/**
|
|
750
|
-
* Convert bytes to field element string
|
|
751
|
-
*/
|
|
752
|
-
private bytesToField;
|
|
753
|
-
/**
|
|
754
|
-
* Convert bigint to bytes
|
|
755
|
-
*/
|
|
756
|
-
private bigintToBytes;
|
|
757
|
-
/**
|
|
758
|
-
* Convert hex string to bytes
|
|
759
|
-
*/
|
|
760
|
-
private hexToBytes;
|
|
761
|
-
/**
|
|
762
|
-
* Convert hex string to field element string
|
|
763
|
-
*/
|
|
764
|
-
private hexToField;
|
|
765
|
-
/**
|
|
766
|
-
* Convert field string to 32-byte array
|
|
767
|
-
*/
|
|
768
|
-
private fieldToBytes32;
|
|
769
|
-
/**
|
|
770
|
-
* Compute sender commitment for validity proof
|
|
771
|
-
*
|
|
772
|
-
* Uses SHA256 for SDK-side computation. The bundled circuit artifacts
|
|
773
|
-
* are compiled to use SHA256 for compatibility with this SDK.
|
|
774
|
-
*
|
|
775
|
-
* @see computeCommitmentHash for hash function compatibility notes
|
|
776
|
-
*/
|
|
777
|
-
private computeSenderCommitment;
|
|
778
|
-
/**
|
|
779
|
-
* Compute nullifier for validity proof
|
|
780
|
-
*
|
|
781
|
-
* Uses SHA256 for SDK-side computation. The bundled circuit artifacts
|
|
782
|
-
* are compiled to use SHA256 for compatibility with this SDK.
|
|
783
|
-
*
|
|
784
|
-
* @see computeCommitmentHash for hash function compatibility notes
|
|
785
|
-
*/
|
|
786
|
-
private computeNullifier;
|
|
787
|
-
/**
|
|
788
|
-
* Compute output commitment for fulfillment proof
|
|
789
|
-
*
|
|
790
|
-
* Uses SHA256 for SDK-side computation. The bundled circuit artifacts
|
|
791
|
-
* are compiled to use SHA256 for compatibility with this SDK.
|
|
792
|
-
*
|
|
793
|
-
* @see computeCommitmentHash for hash function compatibility notes
|
|
794
|
-
*/
|
|
795
|
-
private computeOutputCommitment;
|
|
796
|
-
/**
|
|
797
|
-
* Compute solver ID from solver secret
|
|
798
|
-
*
|
|
799
|
-
* Uses SHA256 for SDK-side computation. The bundled circuit artifacts
|
|
800
|
-
* are compiled to use SHA256 for compatibility with this SDK.
|
|
801
|
-
*
|
|
802
|
-
* @see computeCommitmentHash for hash function compatibility notes
|
|
803
|
-
*/
|
|
804
|
-
private computeSolverId;
|
|
805
|
-
/**
|
|
806
|
-
* Compute oracle message hash for fulfillment proof
|
|
807
|
-
*
|
|
808
|
-
* Hash of attestation data that oracle signs
|
|
809
|
-
*/
|
|
810
|
-
private computeOracleMessageHash;
|
|
811
|
-
/**
|
|
812
|
-
* Derive secp256k1 public key coordinates from a private key
|
|
813
|
-
*
|
|
814
|
-
* @param privateKey - 32-byte private key as Uint8Array
|
|
815
|
-
* @returns X and Y coordinates as 32-byte arrays
|
|
816
|
-
*/
|
|
817
|
-
private getPublicKeyCoordinates;
|
|
818
|
-
/**
|
|
819
|
-
* Derive public key coordinates from a field string (private key)
|
|
820
|
-
*
|
|
821
|
-
* @param privateKeyField - Private key as hex field string
|
|
822
|
-
* @returns X and Y coordinates as 32-byte arrays
|
|
823
|
-
*/
|
|
824
|
-
private getPublicKeyFromField;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
365
|
/**
|
|
828
366
|
* Browser-compatible utilities for proof generation
|
|
829
367
|
*
|
|
@@ -6041,4 +5579,4 @@ declare function createMockLedgerAdapter(config: Omit<MockHardwareConfig, 'devic
|
|
|
6041
5579
|
*/
|
|
6042
5580
|
declare function createMockTrezorAdapter(config: Omit<MockHardwareConfig, 'deviceType'>): MockTrezorAdapter;
|
|
6043
5581
|
|
|
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,
|
|
5582
|
+
export { ATTESTATION_VERSION, type AttestationRequest, type AttestationResult, BrowserNoirProvider as B, BaseWalletAdapter, type BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, type CommitmentPoint, ComplianceManager, type CreateIntentOptions, type CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, type EIP1193ConnectInfo, type EIP1193Event, type EIP1193Provider, type EIP1193ProviderRpcError, type EIP1193RequestArguments, type EIP712Domain, type EIP712TypeDefinition, type EIP712TypedData, type EIP712Types, EncryptionNotImplementedError, ErrorCode, type EthereumAdapterConfig, EthereumChainId, type EthereumChainIdType, type EthereumChainMetadata, type EthereumTokenMetadata, type EthereumTransactionReceipt, type EthereumTransactionRequest, EthereumWalletAdapter, type EthereumWalletName, type ExportedViewingKey, FulfillmentProofParams, FundingProofParams, type HardwareAccount, type HardwareConnectionStatus, type HardwareDeviceInfo, HardwareErrorCode, type HardwareErrorCodeType, type HardwareEthereumTx, type HardwareSignRequest, type HardwareSignature, type HardwareTransport, type HardwareWalletConfig, HardwareWalletError, type HardwareWalletType, IntentBuilder, IntentError, type LedgerConfig, type LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, type MockEthereumAdapterConfig, type MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, type MockSolanaAdapterConfig, MockSolver, type MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, type NEARIntentsAdapterConfig, NetworkError, ORACLE_DOMAIN, OneClickClient, type OracleAttestationMessage, type OracleId, type OracleInfo, type OracleRegistry, type OracleRegistryConfig, type OracleSignature, type OracleStatus, PaymentBuilder, type PedersenCommitment, type PreparedSwap, type PrivacyConfig, type ProductionQuote, ProofError, ProofFramework, ProofNotImplementedError, type ProofProgressCallback, ProofProvider, ProofResult, type ReceivedNote, SIP, type SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, type SerializedError, type ShieldedBalance, type ShieldedSendParams, type ShieldedSendResult, type SignedOracleAttestation, type SolanaAdapterConfig, type SolanaCluster, type SolanaConnection, type SolanaPublicKey, type SolanaSendOptions, type SolanaSignature, type SolanaTransaction, type SolanaUnsignedTransaction, type SolanaVersionedTransaction, SolanaWalletAdapter, type SolanaWalletName, type SolanaWalletProvider, type StablecoinInfo, type StealthCurve, type SwapRequest, type SwapResult, type TransactionData, type TransportType, Treasury, type TrezorConfig, type TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, type VerificationResult, type WalletAdapter, WalletError, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, type ZcashShieldedServiceConfig, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, bytesToHex as browserBytesToHex, hexToBytes as browserHexToBytes, checkEd25519StealthAddress, checkStealthAddress, commit, commitZero, computeAttestationHash, createCommitment, createEthereumAdapter, createLedgerAdapter, createMockEthereumAdapter, createMockEthereumProvider, createMockLedgerAdapter, createMockSolanaAdapter, createMockSolanaConnection, createMockSolanaProvider, createMockSolver, createMockTrezorAdapter, createNEARIntentsAdapter, createOracleRegistry, createProductionSIP, createSIP, createShieldedIntent, createShieldedPayment, createSolanaAdapter, createTrezorAdapter, createWalletFactory, createZcashClient, createZcashShieldedService, decodeStealthMetaAddress, decryptMemo, decryptWithViewing, deriveEd25519StealthPrivateKey, deriveOracleId, deriveStealthPrivateKey, deriveViewingKey, deserializeAttestationMessage, deserializeIntent, deserializePayment, detectEthereumWallets, detectSolanaWallets, ed25519PublicKeyToNearAddress, ed25519PublicKeyToSolanaAddress, encodeStealthMetaAddress, encryptForViewing, featureNotSupportedError, formatStablecoinAmount, fromHex, fromStablecoinUnits, generateBlinding, generateEd25519StealthAddress, generateEd25519StealthMetaAddress, generateIntentId, generateRandomBytes, generateStealthAddress, generateStealthMetaAddress, generateViewingKey, getActiveOracles, getAvailableTransports, getBrowserInfo, getChainNumericId, getChainsForStablecoin, getCurveForChain, getDefaultRpcEndpoint, getDerivationPath, getErrorMessage, getEthereumProvider, getGenerators, getIntentSummary, getPaymentSummary, getPaymentTimeRemaining, getPrivacyConfig, getPrivacyDescription, getSolanaProvider, getStablecoin, getStablecoinInfo, getStablecoinsForChain, getSupportedStablecoins, getTimeRemaining, hasEnoughOracles, hasErrorCode, hasRequiredProofs, hash, hexToNumber, isBrowser, isEd25519Chain, isExpired, isNonNegativeAmount, isPaymentExpired, isPrivateWalletAdapter, isSIPError, isStablecoin, isStablecoinOnChain, isValidAmount, isValidChainId, isValidCompressedPublicKey, isValidEd25519PublicKey, isValidHex, isValidHexLength, isValidNearAccountId, isValidNearImplicitAddress, isValidPrivacyLevel, isValidPrivateKey, isValidScalar, isValidSlippage, isValidSolanaAddress, isValidStealthMetaAddress, nearAddressToEd25519PublicKey, normalizeAddress, notConnectedError, publicKeyToEthAddress, registerWallet, removeOracle, secureWipe, secureWipeAll, serializeAttestationMessage, serializeIntent, serializePayment, signAttestationMessage, solanaAddressToEd25519PublicKey, solanaPublicKeyToHex, subtractBlindings, subtractCommitments, supportsSharedArrayBuffer, supportsWebBluetooth, supportsWebHID, supportsWebUSB, supportsWebWorkers, toHex, toStablecoinUnits, trackIntent, trackPayment, updateOracleStatus, validateAsset, validateCreateIntentParams, validateIntentInput, validateIntentOutput, validateScalar, validateViewingKey, verifyAttestation, verifyCommitment, verifyOpening, verifyOracleSignature, walletRegistry, withSecureBuffer, withSecureBufferSync, wrapError };
|