@sip-protocol/sdk 0.1.9 → 0.2.0
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/LICENSE +21 -0
- package/dist/browser.d.mts +2 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +12925 -0
- package/dist/browser.mjs +432 -0
- package/dist/chunk-O4Y2ZUDL.mjs +12721 -0
- package/dist/index.d.mts +800 -91
- package/dist/index.d.ts +800 -91
- package/dist/index.js +1854 -378
- package/dist/index.mjs +262 -11114
- package/package.json +23 -14
- package/src/adapters/near-intents.ts +138 -30
- package/src/browser.ts +33 -0
- package/src/commitment.ts +4 -4
- package/src/index.ts +71 -0
- package/src/oracle/index.ts +12 -0
- package/src/oracle/serialization.ts +237 -0
- package/src/oracle/types.ts +257 -0
- package/src/oracle/verification.ts +257 -0
- package/src/proofs/browser-utils.ts +141 -0
- package/src/proofs/browser.ts +884 -0
- package/src/proofs/index.ts +14 -0
- package/src/stealth.ts +868 -12
- package/src/validation.ts +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 RECTOR Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ATTESTATION_VERSION, AttestationRequest, AttestationResult, BaseWalletAdapter, BrowserNoirProvider, BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, CommitmentPoint, ComplianceManager, CreateIntentOptions, CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, EIP1193ConnectInfo, EIP1193Event, EIP1193Provider, EIP1193ProviderRpcError, EIP1193RequestArguments, EIP712Domain, EIP712TypeDefinition, EIP712TypedData, EIP712Types, EncryptionNotImplementedError, ErrorCode, EthereumAdapterConfig, EthereumChainId, EthereumChainIdType, EthereumChainMetadata, EthereumTokenMetadata, EthereumTransactionReceipt, EthereumTransactionRequest, EthereumWalletAdapter, EthereumWalletName, ExportedViewingKey, FulfillmentProofParams, FundingProofParams, HardwareAccount, HardwareConnectionStatus, HardwareDeviceInfo, HardwareErrorCode, HardwareErrorCodeType, HardwareEthereumTx, HardwareSignRequest, HardwareSignature, HardwareTransport, HardwareWalletConfig, HardwareWalletError, HardwareWalletType, IntentBuilder, IntentError, LedgerConfig, LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, MockEthereumAdapterConfig, MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, MockSolanaAdapterConfig, MockSolver, MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, NEARIntentsAdapterConfig, NetworkError, NoirProofProvider, NoirProviderConfig, ORACLE_DOMAIN, OneClickClient, OracleAttestation, OracleAttestationMessage, OracleId, OracleInfo, OracleRegistry, OracleRegistryConfig, OracleSignature, OracleStatus, PaymentBuilder, PedersenCommitment, PreparedSwap, PrivacyConfig, ProductionQuote, ProofError, ProofFramework, ProofGenerationError, ProofNotImplementedError, ProofProgressCallback, ProofProvider, ProofResult, ReceivedNote, SIP, SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, SerializedError, ShieldedBalance, ShieldedSendParams, ShieldedSendResult, SignedOracleAttestation, SolanaAdapterConfig, SolanaCluster, SolanaConnection, SolanaPublicKey, SolanaSendOptions, SolanaSignature, SolanaTransaction, SolanaUnsignedTransaction, SolanaVersionedTransaction, SolanaWalletAdapter, SolanaWalletName, SolanaWalletProvider, StablecoinInfo, StealthCurve, SwapRequest, SwapResult, TransactionData, TransportType, Treasury, TrezorConfig, TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, VerificationResult, WalletAdapter, WalletError, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, ZcashShieldedServiceConfig, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, browserBytesToHex, 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 } from './index.mjs';
|
|
2
|
+
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';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ATTESTATION_VERSION, AttestationRequest, AttestationResult, BaseWalletAdapter, BrowserNoirProvider, BrowserNoirProviderConfig, CHAIN_NUMERIC_IDS, CommitmentPoint, ComplianceManager, CreateIntentOptions, CreatePaymentOptions, CryptoError, DEFAULT_THRESHOLD, DEFAULT_TOTAL_ORACLES, DerivationPath, EIP1193ConnectInfo, EIP1193Event, EIP1193Provider, EIP1193ProviderRpcError, EIP1193RequestArguments, EIP712Domain, EIP712TypeDefinition, EIP712TypedData, EIP712Types, EncryptionNotImplementedError, ErrorCode, EthereumAdapterConfig, EthereumChainId, EthereumChainIdType, EthereumChainMetadata, EthereumTokenMetadata, EthereumTransactionReceipt, EthereumTransactionRequest, EthereumWalletAdapter, EthereumWalletName, ExportedViewingKey, FulfillmentProofParams, FundingProofParams, HardwareAccount, HardwareConnectionStatus, HardwareDeviceInfo, HardwareErrorCode, HardwareErrorCodeType, HardwareEthereumTx, HardwareSignRequest, HardwareSignature, HardwareTransport, HardwareWalletConfig, HardwareWalletError, HardwareWalletType, IntentBuilder, IntentError, LedgerConfig, LedgerModel, LedgerWalletAdapter, MockEthereumAdapter, MockEthereumAdapterConfig, MockHardwareConfig, MockLedgerAdapter, MockProofProvider, MockSolanaAdapter, MockSolanaAdapterConfig, MockSolver, MockSolverConfig, MockTrezorAdapter, MockWalletAdapter, NEARIntentsAdapter, NEARIntentsAdapterConfig, NetworkError, NoirProofProvider, NoirProviderConfig, ORACLE_DOMAIN, OneClickClient, OracleAttestation, OracleAttestationMessage, OracleId, OracleInfo, OracleRegistry, OracleRegistryConfig, OracleSignature, OracleStatus, PaymentBuilder, PedersenCommitment, PreparedSwap, PrivacyConfig, ProductionQuote, ProofError, ProofFramework, ProofGenerationError, ProofNotImplementedError, ProofProgressCallback, ProofProvider, ProofResult, ReceivedNote, SIP, SIPConfig, SIPError, STABLECOIN_ADDRESSES, STABLECOIN_DECIMALS, STABLECOIN_INFO, SerializedError, ShieldedBalance, ShieldedSendParams, ShieldedSendResult, SignedOracleAttestation, SolanaAdapterConfig, SolanaCluster, SolanaConnection, SolanaPublicKey, SolanaSendOptions, SolanaSignature, SolanaTransaction, SolanaUnsignedTransaction, SolanaVersionedTransaction, SolanaWalletAdapter, SolanaWalletName, SolanaWalletProvider, StablecoinInfo, StealthCurve, SwapRequest, SwapResult, TransactionData, TransportType, Treasury, TrezorConfig, TrezorModel, TrezorWalletAdapter, ValidationError, ValidityProofParams, VerificationResult, WalletAdapter, WalletError, ZcashRPCClient, ZcashRPCError, ZcashShieldedService, ZcashShieldedServiceConfig, addBlindings, addCommitments, addOracle, attachProofs, base58ToHex, browserBytesToHex, 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 } from './index.js';
|
|
2
|
+
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';
|