@sip-protocol/sdk 0.6.24 → 0.6.26
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 +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +51 -14
- package/dist/browser.mjs +1 -1
- package/dist/chunk-46TH5SRE.mjs +17077 -0
- package/dist/chunk-EMOAOF5P.mjs +17084 -0
- package/dist/chunk-GE566OLO.mjs +17059 -0
- package/dist/chunk-GFSLU6SP.mjs +17077 -0
- package/dist/chunk-JK4FDH74.mjs +17059 -0
- package/dist/chunk-TSOCBT73.mjs +17067 -0
- package/dist/chunk-ZEYNCEIE.mjs +17084 -0
- package/dist/index-BYZbDjal.d.ts +11390 -0
- package/dist/index-CRz9S3eE.d.mts +11390 -0
- package/dist/index-DO9Az5n4.d.ts +11390 -0
- package/dist/index-Dex_NSYv.d.mts +11390 -0
- package/dist/index-DhThjSB5.d.ts +11390 -0
- package/dist/index-xbWjohNq.d.mts +11390 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +51 -14
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/adapters/near-intents.ts +28 -5
- package/src/adapters/oneclick-client.ts +28 -2
- package/src/intent.ts +22 -2
- package/src/sip.ts +6 -2
- package/src/wallet/solana/adapter.ts +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { bH as ATTESTATION_VERSION, az as AptosStealthResult, al as AptosStealthService, bT as AttestationRequest, bU as AttestationResult, dB as AuditReport, dx as AuditorKeyDerivation, dy as AuditorType, cf as BackendCapabilities, e7 as BaseWalletAdapter, dX as BidReceipt, d2 as BitcoinNetwork, cP as BridgeProvider, t as BrowserNoirProviderConfig, bK as CHAIN_NUMERIC_IDS, aG as COSMOS_CHAIN_PREFIXES, dM as CSVExport, e2 as CastVoteParams, b8 as CommitmentPoint, dt as ComplianceManager, du as ComplianceReporter, dw as ConditionalDisclosure, aH as CosmosChainId, aI as CosmosStealthResult, aB as CosmosStealthService, dY as CreateBidParams, $ as CreateIntentOptions, dq as CreatePaymentOptions, C as CryptoError, bI as DEFAULT_THRESHOLD, bJ as DEFAULT_TOTAL_ORACLES, dC as DecryptedTransaction, eF as DerivationPath, dP as DeriveMultipleParams, dO as DeriveViewingKeyParams, dN as DerivedViewingKey, f6 as EIP1193ConnectInfo, f5 as EIP1193Event, f3 as EIP1193Provider, f7 as EIP1193ProviderRpcError, f4 as EIP1193RequestArguments, f8 as EIP712Domain, f9 as EIP712TypeDefinition, fb as EIP712TypedData, fa as EIP712Types, e0 as EncryptedVote, w as EncryptionNotImplementedError, E as ErrorCode, fh as EthereumAdapterConfig, eC as EthereumChainId, fi as EthereumChainIdType, ff as EthereumChainMetadata, fe as EthereumTokenMetadata, fd as EthereumTransactionReceipt, fc as EthereumTransactionRequest, eq as EthereumWalletAdapter, fg as EthereumWalletName, dE as ExportForRegulatorParams, cG as ExportedViewingKey, dI as FATFExport, dJ as FATFTransaction, dK as FINCENExport, dL as FINCENTransaction, co as FindBestRouteParams, dA as GenerateAuditReportParams, fw as HardwareAccount, fn as HardwareConnectionStatus, fp as HardwareDeviceInfo, eD as HardwareErrorCode, fy as HardwareErrorCodeType, fu as HardwareEthereumTx, ft as HardwareSignRequest, fv as HardwareSignature, fx as HardwareTransport, fq as HardwareWalletConfig, eE as HardwareWalletError, fk as HardwareWalletType, L as IntentBuilder, I as IntentError, dH as Jurisdiction, fr as LedgerConfig, fl as LedgerModel, eL as LedgerWalletAdapter, es as MockEthereumAdapter, fj as MockEthereumAdapterConfig, fz as MockHardwareConfig, eP as MockLedgerAdapter, br as MockProofProvider, ei as MockSolanaAdapter, f2 as MockSolanaAdapterConfig, c1 as MockSolver, c3 as MockSolverConfig, eQ as MockTrezorAdapter, e8 as MockWalletAdapter, bX as NEARIntentsAdapter, c0 as NEARIntentsAdapterConfig, cp as NEARIntentsBackend, N as NetworkError, bG as ORACLE_DOMAIN, bW as OneClickClient, bO as OracleAttestationMessage, bL as OracleId, bN as OracleInfo, bR as OracleRegistry, bS as OracleRegistryConfig, bP as OracleSignature, bM as OracleStatus, d3 as PaymentBuilder, dD as PdfExportOptions, b7 as PedersenCommitment, b_ as PreparedSwap, cQ as PriceFeed, aP as PrivacyConfig, e3 as PrivateNFT, d_ as PrivateVoting, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, cn as QuoteComparison, cE as ReceivedNote, dF as RegulatoryExport, dG as RegulatoryFormat, e1 as RevealedVote, cj as Route, cm as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, dd as STABLECOIN_ADDRESSES, de as STABLECOIN_DECIMALS, dc as STABLECOIN_INFO, dW as SealedBid, dU as SealedBidAuction, D as SerializedError, cg as SettlementBackend, ch as SettlementBackendFactory, c7 as SettlementBackendName, ci as SettlementBackendRegistry, c9 as SettlementQuote, c8 as SettlementQuoteParams, c5 as SettlementRegistry, c6 as SettlementRegistryError, cc as SettlementSwapParams, cd as SettlementSwapResult, ca as SettlementSwapRoute, cb as SettlementSwapRouteStep, cF as ShieldedBalance, cC as ShieldedSendParams, cD as ShieldedSendResult, bQ as SignedOracleAttestation, ck as SmartRouter, eZ as SolanaAdapterConfig, eY as SolanaCluster, e_ as SolanaConnection, eT as SolanaPublicKey, e$ as SolanaSendOptions, f1 as SolanaSignature, eU as SolanaTransaction, f0 as SolanaUnsignedTransaction, eV as SolanaVersionedTransaction, eg as SolanaWalletAdapter, eX as SolanaWalletName, eW as SolanaWalletProvider, dr as StablecoinInfo, ak as StealthCurve, aA as SuiStealthResult, as as SuiStealthService, bZ as SwapRequest, b$ as SwapResult, c4 as SwapStatus, ce as SwapStatusResponse, d1 as TapScript, d0 as TaprootOutput, dQ as ThresholdShares, dz as ThresholdViewingKey, dT as TimeLockParams, dR as TimeLockResult, aQ as TransactionData, fo as TransportType, ds as Treasury, fs as TrezorConfig, fm as TrezorModel, eN as TrezorWalletAdapter, dS as UnlockResult, V as ValidationError, bV as VerificationResult, dZ as VerifyBidParams, W as WalletAdapter, e9 as WalletError, cr as ZcashNativeBackend, ct as ZcashNativeBackendConfig, cL as ZcashQuote, cK as ZcashQuoteParams, cu as ZcashRPCClient, cv as ZcashRPCError, cx as ZcashShieldedService, cB as ZcashShieldedServiceConfig, cM as ZcashSwapParams, cN as ZcashSwapResult, cz as ZcashSwapService, cH as ZcashSwapServiceConfig, cI as ZcashSwapSourceChain, cJ as ZcashSwapSourceToken, cO as ZcashSwapStatus, b3 as addBlindings, b1 as addCommitments, bx as addOracle, aq as aptosAddressToAuthKey, Q as attachProofs, ep as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ao as checkAptosStealthAddress, ac as checkEd25519StealthAddress, a3 as checkStealthAddress, av as checkSuiStealthAddress, a_ as commit, b0 as commitZero, bE as computeAttestationHash, cW as computeTweakedKey, aR as createCommitment, er as createEthereumAdapter, cY as createKeySpendOnlyOutput, eM as createLedgerAdapter, et as createMockEthereumAdapter, eu as createMockEthereumProvider, eR as createMockLedgerAdapter, ej as createMockSolanaAdapter, el as createMockSolanaConnection, ek as createMockSolanaProvider, c2 as createMockSolver, eS as createMockTrezorAdapter, bY as createNEARIntentsAdapter, cq as createNEARIntentsBackend, bw as createOracleRegistry, e4 as createPrivateOwnership, d$ as createPrivateVoting, H as createProductionSIP, G as createSIP, dV as createSealedBidAuction, O as createShieldedIntent, d4 as createShieldedPayment, cl as createSmartRouter, eh as createSolanaAdapter, cX as createTaprootOutput, eO as createTrezorAdapter, ee as createWalletFactory, cw as createZcashClient, cs as createZcashNativeBackend, cy as createZcashShieldedService, cA as createZcashSwapService, a5 as decodeStealthMetaAddress, c_ as decodeTaprootAddress, d5 as decryptMemo, aN as decryptWithViewing, an as deriveAptosStealthPrivateKey, ab as deriveEd25519StealthPrivateKey, bv as deriveOracleId, a2 as deriveStealthPrivateKey, au as deriveSuiStealthPrivateKey, aL as deriveViewingKey, bD as deserializeAttestationMessage, Z as deserializeIntent, da as deserializePayment, ew as detectEthereumWallets, en as detectSolanaWallets, ap as ed25519PublicKeyToAptosAddress, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, aw as ed25519PublicKeyToSuiAddress, a4 as encodeStealthMetaAddress, aM as encryptForViewing, eb as featureNotSupportedError, dp as formatStablecoinAmount, ey as fromHex, dn as fromStablecoinUnits, am as generateAptosStealthAddress, b6 as generateBlinding, aD as generateCosmosStealthAddress, aC as generateCosmosStealthMetaAddress, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, aT as generateIntentId, dv as generatePdfReport, aV as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, at as generateSuiStealthAddress, aK as generateViewingKey, bA as getActiveOracles, eK as getAvailableTransports, g as getBrowserInfo, bF as getChainNumericId, dl as getChainsForStablecoin, a8 as getCurveForChain, eB as getDefaultRpcEndpoint, eG as getDerivationPath, A as getErrorMessage, ev as getEthereumProvider, b5 as getGenerators, _ as getIntentSummary, db as getPaymentSummary, d8 as getPaymentTimeRemaining, aJ as getPrivacyConfig, aO as getPrivacyDescription, em as getSolanaProvider, df as getStablecoin, di as getStablecoinInfo, dg as getStablecoinsForChain, dj as getSupportedStablecoins, X as getTimeRemaining, cV as getXOnlyPublicKey, bB as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aU as hash, ez as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, be as isNonNegativeAmount, d7 as isPaymentExpired, ef as isPrivateWalletAdapter, x as isSIPError, dh as isStablecoin, dk as isStablecoinOnChain, bd as isValidAmount, ar as isValidAptosAddress, b9 as isValidChainId, bh as isValidCompressedPublicKey, aF as isValidCosmosAddress, bi as isValidEd25519PublicKey, bb as isValidHex, bc as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, ba as isValidPrivacyLevel, bj as isValidPrivateKey, bk as isValidScalar, bf as isValidSlippage, af as isValidSolanaAddress, bg as isValidStealthMetaAddress, ay as isValidSuiAddress, c$ as isValidTaprootAddress, ah as nearAddressToEd25519PublicKey, eA as normalizeAddress, ax as normalizeSuiAddress, ea as notConnectedError, e5 as proveOwnership, a6 as publicKeyToEthAddress, ed as registerWallet, by as removeOracle, cR as schnorrSign, cT as schnorrSignHex, cS as schnorrVerify, cU as schnorrVerifyHex, aW as secureWipe, aX as secureWipeAll, bC as serializeAttestationMessage, Y as serializeIntent, d9 as serializePayment, bu as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, eo as solanaPublicKeyToHex, aE as stealthKeyToCosmosAddress, b4 as subtractBlindings, b2 as subtractCommitments, a as supportsSharedArrayBuffer, eJ as supportsWebBluetooth, eI as supportsWebHID, eH as supportsWebUSB, s as supportsWebWorkers, cZ as taprootAddress, ex as toHex, dm as toStablecoinUnits, T as trackIntent, d6 as trackPayment, bz as updateOracleStatus, bm as validateAsset, bl as validateCreateIntentParams, bn as validateIntentInput, bo as validateIntentOutput, bq as validateScalar, bp as validateViewingKey, bs as verifyAttestation, aS as verifyCommitment, a$ as verifyOpening, bt as verifyOracleSignature, e6 as verifyOwnership, ec as walletRegistry, aY as withSecureBuffer, aZ as withSecureBufferSync, z as wrapError } from './index-DKJ81T9L.mjs';
|
|
1
|
+
export { bH as ATTESTATION_VERSION, az as AptosStealthResult, al as AptosStealthService, bT as AttestationRequest, bU as AttestationResult, dB as AuditReport, dx as AuditorKeyDerivation, dy as AuditorType, cf as BackendCapabilities, e7 as BaseWalletAdapter, dX as BidReceipt, d2 as BitcoinNetwork, cP as BridgeProvider, t as BrowserNoirProviderConfig, bK as CHAIN_NUMERIC_IDS, aG as COSMOS_CHAIN_PREFIXES, dM as CSVExport, e2 as CastVoteParams, b8 as CommitmentPoint, dt as ComplianceManager, du as ComplianceReporter, dw as ConditionalDisclosure, aH as CosmosChainId, aI as CosmosStealthResult, aB as CosmosStealthService, dY as CreateBidParams, $ as CreateIntentOptions, dq as CreatePaymentOptions, C as CryptoError, bI as DEFAULT_THRESHOLD, bJ as DEFAULT_TOTAL_ORACLES, dC as DecryptedTransaction, eF as DerivationPath, dP as DeriveMultipleParams, dO as DeriveViewingKeyParams, dN as DerivedViewingKey, f6 as EIP1193ConnectInfo, f5 as EIP1193Event, f3 as EIP1193Provider, f7 as EIP1193ProviderRpcError, f4 as EIP1193RequestArguments, f8 as EIP712Domain, f9 as EIP712TypeDefinition, fb as EIP712TypedData, fa as EIP712Types, e0 as EncryptedVote, w as EncryptionNotImplementedError, E as ErrorCode, fh as EthereumAdapterConfig, eC as EthereumChainId, fi as EthereumChainIdType, ff as EthereumChainMetadata, fe as EthereumTokenMetadata, fd as EthereumTransactionReceipt, fc as EthereumTransactionRequest, eq as EthereumWalletAdapter, fg as EthereumWalletName, dE as ExportForRegulatorParams, cG as ExportedViewingKey, dI as FATFExport, dJ as FATFTransaction, dK as FINCENExport, dL as FINCENTransaction, co as FindBestRouteParams, dA as GenerateAuditReportParams, fw as HardwareAccount, fn as HardwareConnectionStatus, fp as HardwareDeviceInfo, eD as HardwareErrorCode, fy as HardwareErrorCodeType, fu as HardwareEthereumTx, ft as HardwareSignRequest, fv as HardwareSignature, fx as HardwareTransport, fq as HardwareWalletConfig, eE as HardwareWalletError, fk as HardwareWalletType, L as IntentBuilder, I as IntentError, dH as Jurisdiction, fr as LedgerConfig, fl as LedgerModel, eL as LedgerWalletAdapter, es as MockEthereumAdapter, fj as MockEthereumAdapterConfig, fz as MockHardwareConfig, eP as MockLedgerAdapter, br as MockProofProvider, ei as MockSolanaAdapter, f2 as MockSolanaAdapterConfig, c1 as MockSolver, c3 as MockSolverConfig, eQ as MockTrezorAdapter, e8 as MockWalletAdapter, bX as NEARIntentsAdapter, c0 as NEARIntentsAdapterConfig, cp as NEARIntentsBackend, N as NetworkError, bG as ORACLE_DOMAIN, bW as OneClickClient, bO as OracleAttestationMessage, bL as OracleId, bN as OracleInfo, bR as OracleRegistry, bS as OracleRegistryConfig, bP as OracleSignature, bM as OracleStatus, d3 as PaymentBuilder, dD as PdfExportOptions, b7 as PedersenCommitment, b_ as PreparedSwap, cQ as PriceFeed, aP as PrivacyConfig, e3 as PrivateNFT, d_ as PrivateVoting, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, cn as QuoteComparison, cE as ReceivedNote, dF as RegulatoryExport, dG as RegulatoryFormat, e1 as RevealedVote, cj as Route, cm as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, dd as STABLECOIN_ADDRESSES, de as STABLECOIN_DECIMALS, dc as STABLECOIN_INFO, dW as SealedBid, dU as SealedBidAuction, D as SerializedError, cg as SettlementBackend, ch as SettlementBackendFactory, c7 as SettlementBackendName, ci as SettlementBackendRegistry, c9 as SettlementQuote, c8 as SettlementQuoteParams, c5 as SettlementRegistry, c6 as SettlementRegistryError, cc as SettlementSwapParams, cd as SettlementSwapResult, ca as SettlementSwapRoute, cb as SettlementSwapRouteStep, cF as ShieldedBalance, cC as ShieldedSendParams, cD as ShieldedSendResult, bQ as SignedOracleAttestation, ck as SmartRouter, eZ as SolanaAdapterConfig, eY as SolanaCluster, e_ as SolanaConnection, eT as SolanaPublicKey, e$ as SolanaSendOptions, f1 as SolanaSignature, eU as SolanaTransaction, f0 as SolanaUnsignedTransaction, eV as SolanaVersionedTransaction, eg as SolanaWalletAdapter, eX as SolanaWalletName, eW as SolanaWalletProvider, dr as StablecoinInfo, ak as StealthCurve, aA as SuiStealthResult, as as SuiStealthService, bZ as SwapRequest, b$ as SwapResult, c4 as SwapStatus, ce as SwapStatusResponse, d1 as TapScript, d0 as TaprootOutput, dQ as ThresholdShares, dz as ThresholdViewingKey, dT as TimeLockParams, dR as TimeLockResult, aQ as TransactionData, fo as TransportType, ds as Treasury, fs as TrezorConfig, fm as TrezorModel, eN as TrezorWalletAdapter, dS as UnlockResult, V as ValidationError, bV as VerificationResult, dZ as VerifyBidParams, W as WalletAdapter, e9 as WalletError, cr as ZcashNativeBackend, ct as ZcashNativeBackendConfig, cL as ZcashQuote, cK as ZcashQuoteParams, cu as ZcashRPCClient, cv as ZcashRPCError, cx as ZcashShieldedService, cB as ZcashShieldedServiceConfig, cM as ZcashSwapParams, cN as ZcashSwapResult, cz as ZcashSwapService, cH as ZcashSwapServiceConfig, cI as ZcashSwapSourceChain, cJ as ZcashSwapSourceToken, cO as ZcashSwapStatus, b3 as addBlindings, b1 as addCommitments, bx as addOracle, aq as aptosAddressToAuthKey, Q as attachProofs, ep as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ao as checkAptosStealthAddress, ac as checkEd25519StealthAddress, a3 as checkStealthAddress, av as checkSuiStealthAddress, a_ as commit, b0 as commitZero, bE as computeAttestationHash, cW as computeTweakedKey, aR as createCommitment, er as createEthereumAdapter, cY as createKeySpendOnlyOutput, eM as createLedgerAdapter, et as createMockEthereumAdapter, eu as createMockEthereumProvider, eR as createMockLedgerAdapter, ej as createMockSolanaAdapter, el as createMockSolanaConnection, ek as createMockSolanaProvider, c2 as createMockSolver, eS as createMockTrezorAdapter, bY as createNEARIntentsAdapter, cq as createNEARIntentsBackend, bw as createOracleRegistry, e4 as createPrivateOwnership, d$ as createPrivateVoting, H as createProductionSIP, G as createSIP, dV as createSealedBidAuction, O as createShieldedIntent, d4 as createShieldedPayment, cl as createSmartRouter, eh as createSolanaAdapter, cX as createTaprootOutput, eO as createTrezorAdapter, ee as createWalletFactory, cw as createZcashClient, cs as createZcashNativeBackend, cy as createZcashShieldedService, cA as createZcashSwapService, a5 as decodeStealthMetaAddress, c_ as decodeTaprootAddress, d5 as decryptMemo, aN as decryptWithViewing, an as deriveAptosStealthPrivateKey, ab as deriveEd25519StealthPrivateKey, bv as deriveOracleId, a2 as deriveStealthPrivateKey, au as deriveSuiStealthPrivateKey, aL as deriveViewingKey, bD as deserializeAttestationMessage, Z as deserializeIntent, da as deserializePayment, ew as detectEthereumWallets, en as detectSolanaWallets, ap as ed25519PublicKeyToAptosAddress, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, aw as ed25519PublicKeyToSuiAddress, a4 as encodeStealthMetaAddress, aM as encryptForViewing, eb as featureNotSupportedError, dp as formatStablecoinAmount, ey as fromHex, dn as fromStablecoinUnits, am as generateAptosStealthAddress, b6 as generateBlinding, aD as generateCosmosStealthAddress, aC as generateCosmosStealthMetaAddress, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, aT as generateIntentId, dv as generatePdfReport, aV as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, at as generateSuiStealthAddress, aK as generateViewingKey, bA as getActiveOracles, eK as getAvailableTransports, g as getBrowserInfo, bF as getChainNumericId, dl as getChainsForStablecoin, a8 as getCurveForChain, eB as getDefaultRpcEndpoint, eG as getDerivationPath, A as getErrorMessage, ev as getEthereumProvider, b5 as getGenerators, _ as getIntentSummary, db as getPaymentSummary, d8 as getPaymentTimeRemaining, aJ as getPrivacyConfig, aO as getPrivacyDescription, em as getSolanaProvider, df as getStablecoin, di as getStablecoinInfo, dg as getStablecoinsForChain, dj as getSupportedStablecoins, X as getTimeRemaining, cV as getXOnlyPublicKey, bB as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aU as hash, ez as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, be as isNonNegativeAmount, d7 as isPaymentExpired, ef as isPrivateWalletAdapter, x as isSIPError, dh as isStablecoin, dk as isStablecoinOnChain, bd as isValidAmount, ar as isValidAptosAddress, b9 as isValidChainId, bh as isValidCompressedPublicKey, aF as isValidCosmosAddress, bi as isValidEd25519PublicKey, bb as isValidHex, bc as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, ba as isValidPrivacyLevel, bj as isValidPrivateKey, bk as isValidScalar, bf as isValidSlippage, af as isValidSolanaAddress, bg as isValidStealthMetaAddress, ay as isValidSuiAddress, c$ as isValidTaprootAddress, ah as nearAddressToEd25519PublicKey, eA as normalizeAddress, ax as normalizeSuiAddress, ea as notConnectedError, e5 as proveOwnership, a6 as publicKeyToEthAddress, ed as registerWallet, by as removeOracle, cR as schnorrSign, cT as schnorrSignHex, cS as schnorrVerify, cU as schnorrVerifyHex, aW as secureWipe, aX as secureWipeAll, bC as serializeAttestationMessage, Y as serializeIntent, d9 as serializePayment, bu as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, eo as solanaPublicKeyToHex, aE as stealthKeyToCosmosAddress, b4 as subtractBlindings, b2 as subtractCommitments, a as supportsSharedArrayBuffer, eJ as supportsWebBluetooth, eI as supportsWebHID, eH as supportsWebUSB, s as supportsWebWorkers, cZ as taprootAddress, ex as toHex, dm as toStablecoinUnits, T as trackIntent, d6 as trackPayment, bz as updateOracleStatus, bm as validateAsset, bl as validateCreateIntentParams, bn as validateIntentInput, bo as validateIntentOutput, bq as validateScalar, bp as validateViewingKey, bs as verifyAttestation, aS as verifyCommitment, a$ as verifyOpening, bt as verifyOracleSignature, e6 as verifyOwnership, ec as walletRegistry, aY as withSecureBuffer, aZ as withSecureBufferSync, z as wrapError } from './index-xbWjohNq.mjs';
|
|
2
2
|
export { Asset, AuditLogEntry, AuditScope, AuditorRegistration, AuditorViewingKey, BatchPaymentRecipient, BatchPaymentRequest, ChainId, Commitment, ComplianceConfig, ComplianceReport, ComplianceRole, CreateBatchProposalParams, CreateComplianceConfigParams, CreateIntentParams, CreatePaymentParams, CreatePaymentProposalParams, CreatePrivateOwnershipParams, 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, OwnershipProof, OwnershipVerification, PaymentPurpose, PaymentReceipt, PaymentStatus, PaymentStatusType, PrivacyLevel, PrivateNFTOwnership, PrivateWalletAdapter, ProposalSignature, ProposalStatus, ProposalStatusType, ProposalType, ProveOwnershipParams, 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';
|
|
3
3
|
export { a as FulfillmentProofParams, F as FundingProofParams, N as NoirProviderConfig, O as OracleAttestation, d as ProofFramework, b as ProofGenerationError, c as ProofProvider, P as ProofResult, V as ValidityProofParams } from './noir-DKfEzWy9.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { bH as ATTESTATION_VERSION, az as AptosStealthResult, al as AptosStealthService, bT as AttestationRequest, bU as AttestationResult, dB as AuditReport, dx as AuditorKeyDerivation, dy as AuditorType, cf as BackendCapabilities, e7 as BaseWalletAdapter, dX as BidReceipt, d2 as BitcoinNetwork, cP as BridgeProvider, t as BrowserNoirProviderConfig, bK as CHAIN_NUMERIC_IDS, aG as COSMOS_CHAIN_PREFIXES, dM as CSVExport, e2 as CastVoteParams, b8 as CommitmentPoint, dt as ComplianceManager, du as ComplianceReporter, dw as ConditionalDisclosure, aH as CosmosChainId, aI as CosmosStealthResult, aB as CosmosStealthService, dY as CreateBidParams, $ as CreateIntentOptions, dq as CreatePaymentOptions, C as CryptoError, bI as DEFAULT_THRESHOLD, bJ as DEFAULT_TOTAL_ORACLES, dC as DecryptedTransaction, eF as DerivationPath, dP as DeriveMultipleParams, dO as DeriveViewingKeyParams, dN as DerivedViewingKey, f6 as EIP1193ConnectInfo, f5 as EIP1193Event, f3 as EIP1193Provider, f7 as EIP1193ProviderRpcError, f4 as EIP1193RequestArguments, f8 as EIP712Domain, f9 as EIP712TypeDefinition, fb as EIP712TypedData, fa as EIP712Types, e0 as EncryptedVote, w as EncryptionNotImplementedError, E as ErrorCode, fh as EthereumAdapterConfig, eC as EthereumChainId, fi as EthereumChainIdType, ff as EthereumChainMetadata, fe as EthereumTokenMetadata, fd as EthereumTransactionReceipt, fc as EthereumTransactionRequest, eq as EthereumWalletAdapter, fg as EthereumWalletName, dE as ExportForRegulatorParams, cG as ExportedViewingKey, dI as FATFExport, dJ as FATFTransaction, dK as FINCENExport, dL as FINCENTransaction, co as FindBestRouteParams, dA as GenerateAuditReportParams, fw as HardwareAccount, fn as HardwareConnectionStatus, fp as HardwareDeviceInfo, eD as HardwareErrorCode, fy as HardwareErrorCodeType, fu as HardwareEthereumTx, ft as HardwareSignRequest, fv as HardwareSignature, fx as HardwareTransport, fq as HardwareWalletConfig, eE as HardwareWalletError, fk as HardwareWalletType, L as IntentBuilder, I as IntentError, dH as Jurisdiction, fr as LedgerConfig, fl as LedgerModel, eL as LedgerWalletAdapter, es as MockEthereumAdapter, fj as MockEthereumAdapterConfig, fz as MockHardwareConfig, eP as MockLedgerAdapter, br as MockProofProvider, ei as MockSolanaAdapter, f2 as MockSolanaAdapterConfig, c1 as MockSolver, c3 as MockSolverConfig, eQ as MockTrezorAdapter, e8 as MockWalletAdapter, bX as NEARIntentsAdapter, c0 as NEARIntentsAdapterConfig, cp as NEARIntentsBackend, N as NetworkError, bG as ORACLE_DOMAIN, bW as OneClickClient, bO as OracleAttestationMessage, bL as OracleId, bN as OracleInfo, bR as OracleRegistry, bS as OracleRegistryConfig, bP as OracleSignature, bM as OracleStatus, d3 as PaymentBuilder, dD as PdfExportOptions, b7 as PedersenCommitment, b_ as PreparedSwap, cQ as PriceFeed, aP as PrivacyConfig, e3 as PrivateNFT, d_ as PrivateVoting, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, cn as QuoteComparison, cE as ReceivedNote, dF as RegulatoryExport, dG as RegulatoryFormat, e1 as RevealedVote, cj as Route, cm as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, dd as STABLECOIN_ADDRESSES, de as STABLECOIN_DECIMALS, dc as STABLECOIN_INFO, dW as SealedBid, dU as SealedBidAuction, D as SerializedError, cg as SettlementBackend, ch as SettlementBackendFactory, c7 as SettlementBackendName, ci as SettlementBackendRegistry, c9 as SettlementQuote, c8 as SettlementQuoteParams, c5 as SettlementRegistry, c6 as SettlementRegistryError, cc as SettlementSwapParams, cd as SettlementSwapResult, ca as SettlementSwapRoute, cb as SettlementSwapRouteStep, cF as ShieldedBalance, cC as ShieldedSendParams, cD as ShieldedSendResult, bQ as SignedOracleAttestation, ck as SmartRouter, eZ as SolanaAdapterConfig, eY as SolanaCluster, e_ as SolanaConnection, eT as SolanaPublicKey, e$ as SolanaSendOptions, f1 as SolanaSignature, eU as SolanaTransaction, f0 as SolanaUnsignedTransaction, eV as SolanaVersionedTransaction, eg as SolanaWalletAdapter, eX as SolanaWalletName, eW as SolanaWalletProvider, dr as StablecoinInfo, ak as StealthCurve, aA as SuiStealthResult, as as SuiStealthService, bZ as SwapRequest, b$ as SwapResult, c4 as SwapStatus, ce as SwapStatusResponse, d1 as TapScript, d0 as TaprootOutput, dQ as ThresholdShares, dz as ThresholdViewingKey, dT as TimeLockParams, dR as TimeLockResult, aQ as TransactionData, fo as TransportType, ds as Treasury, fs as TrezorConfig, fm as TrezorModel, eN as TrezorWalletAdapter, dS as UnlockResult, V as ValidationError, bV as VerificationResult, dZ as VerifyBidParams, W as WalletAdapter, e9 as WalletError, cr as ZcashNativeBackend, ct as ZcashNativeBackendConfig, cL as ZcashQuote, cK as ZcashQuoteParams, cu as ZcashRPCClient, cv as ZcashRPCError, cx as ZcashShieldedService, cB as ZcashShieldedServiceConfig, cM as ZcashSwapParams, cN as ZcashSwapResult, cz as ZcashSwapService, cH as ZcashSwapServiceConfig, cI as ZcashSwapSourceChain, cJ as ZcashSwapSourceToken, cO as ZcashSwapStatus, b3 as addBlindings, b1 as addCommitments, bx as addOracle, aq as aptosAddressToAuthKey, Q as attachProofs, ep as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ao as checkAptosStealthAddress, ac as checkEd25519StealthAddress, a3 as checkStealthAddress, av as checkSuiStealthAddress, a_ as commit, b0 as commitZero, bE as computeAttestationHash, cW as computeTweakedKey, aR as createCommitment, er as createEthereumAdapter, cY as createKeySpendOnlyOutput, eM as createLedgerAdapter, et as createMockEthereumAdapter, eu as createMockEthereumProvider, eR as createMockLedgerAdapter, ej as createMockSolanaAdapter, el as createMockSolanaConnection, ek as createMockSolanaProvider, c2 as createMockSolver, eS as createMockTrezorAdapter, bY as createNEARIntentsAdapter, cq as createNEARIntentsBackend, bw as createOracleRegistry, e4 as createPrivateOwnership, d$ as createPrivateVoting, H as createProductionSIP, G as createSIP, dV as createSealedBidAuction, O as createShieldedIntent, d4 as createShieldedPayment, cl as createSmartRouter, eh as createSolanaAdapter, cX as createTaprootOutput, eO as createTrezorAdapter, ee as createWalletFactory, cw as createZcashClient, cs as createZcashNativeBackend, cy as createZcashShieldedService, cA as createZcashSwapService, a5 as decodeStealthMetaAddress, c_ as decodeTaprootAddress, d5 as decryptMemo, aN as decryptWithViewing, an as deriveAptosStealthPrivateKey, ab as deriveEd25519StealthPrivateKey, bv as deriveOracleId, a2 as deriveStealthPrivateKey, au as deriveSuiStealthPrivateKey, aL as deriveViewingKey, bD as deserializeAttestationMessage, Z as deserializeIntent, da as deserializePayment, ew as detectEthereumWallets, en as detectSolanaWallets, ap as ed25519PublicKeyToAptosAddress, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, aw as ed25519PublicKeyToSuiAddress, a4 as encodeStealthMetaAddress, aM as encryptForViewing, eb as featureNotSupportedError, dp as formatStablecoinAmount, ey as fromHex, dn as fromStablecoinUnits, am as generateAptosStealthAddress, b6 as generateBlinding, aD as generateCosmosStealthAddress, aC as generateCosmosStealthMetaAddress, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, aT as generateIntentId, dv as generatePdfReport, aV as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, at as generateSuiStealthAddress, aK as generateViewingKey, bA as getActiveOracles, eK as getAvailableTransports, g as getBrowserInfo, bF as getChainNumericId, dl as getChainsForStablecoin, a8 as getCurveForChain, eB as getDefaultRpcEndpoint, eG as getDerivationPath, A as getErrorMessage, ev as getEthereumProvider, b5 as getGenerators, _ as getIntentSummary, db as getPaymentSummary, d8 as getPaymentTimeRemaining, aJ as getPrivacyConfig, aO as getPrivacyDescription, em as getSolanaProvider, df as getStablecoin, di as getStablecoinInfo, dg as getStablecoinsForChain, dj as getSupportedStablecoins, X as getTimeRemaining, cV as getXOnlyPublicKey, bB as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aU as hash, ez as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, be as isNonNegativeAmount, d7 as isPaymentExpired, ef as isPrivateWalletAdapter, x as isSIPError, dh as isStablecoin, dk as isStablecoinOnChain, bd as isValidAmount, ar as isValidAptosAddress, b9 as isValidChainId, bh as isValidCompressedPublicKey, aF as isValidCosmosAddress, bi as isValidEd25519PublicKey, bb as isValidHex, bc as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, ba as isValidPrivacyLevel, bj as isValidPrivateKey, bk as isValidScalar, bf as isValidSlippage, af as isValidSolanaAddress, bg as isValidStealthMetaAddress, ay as isValidSuiAddress, c$ as isValidTaprootAddress, ah as nearAddressToEd25519PublicKey, eA as normalizeAddress, ax as normalizeSuiAddress, ea as notConnectedError, e5 as proveOwnership, a6 as publicKeyToEthAddress, ed as registerWallet, by as removeOracle, cR as schnorrSign, cT as schnorrSignHex, cS as schnorrVerify, cU as schnorrVerifyHex, aW as secureWipe, aX as secureWipeAll, bC as serializeAttestationMessage, Y as serializeIntent, d9 as serializePayment, bu as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, eo as solanaPublicKeyToHex, aE as stealthKeyToCosmosAddress, b4 as subtractBlindings, b2 as subtractCommitments, a as supportsSharedArrayBuffer, eJ as supportsWebBluetooth, eI as supportsWebHID, eH as supportsWebUSB, s as supportsWebWorkers, cZ as taprootAddress, ex as toHex, dm as toStablecoinUnits, T as trackIntent, d6 as trackPayment, bz as updateOracleStatus, bm as validateAsset, bl as validateCreateIntentParams, bn as validateIntentInput, bo as validateIntentOutput, bq as validateScalar, bp as validateViewingKey, bs as verifyAttestation, aS as verifyCommitment, a$ as verifyOpening, bt as verifyOracleSignature, e6 as verifyOwnership, ec as walletRegistry, aY as withSecureBuffer, aZ as withSecureBufferSync, z as wrapError } from './index-BZxo_8F3.js';
|
|
1
|
+
export { bH as ATTESTATION_VERSION, az as AptosStealthResult, al as AptosStealthService, bT as AttestationRequest, bU as AttestationResult, dB as AuditReport, dx as AuditorKeyDerivation, dy as AuditorType, cf as BackendCapabilities, e7 as BaseWalletAdapter, dX as BidReceipt, d2 as BitcoinNetwork, cP as BridgeProvider, t as BrowserNoirProviderConfig, bK as CHAIN_NUMERIC_IDS, aG as COSMOS_CHAIN_PREFIXES, dM as CSVExport, e2 as CastVoteParams, b8 as CommitmentPoint, dt as ComplianceManager, du as ComplianceReporter, dw as ConditionalDisclosure, aH as CosmosChainId, aI as CosmosStealthResult, aB as CosmosStealthService, dY as CreateBidParams, $ as CreateIntentOptions, dq as CreatePaymentOptions, C as CryptoError, bI as DEFAULT_THRESHOLD, bJ as DEFAULT_TOTAL_ORACLES, dC as DecryptedTransaction, eF as DerivationPath, dP as DeriveMultipleParams, dO as DeriveViewingKeyParams, dN as DerivedViewingKey, f6 as EIP1193ConnectInfo, f5 as EIP1193Event, f3 as EIP1193Provider, f7 as EIP1193ProviderRpcError, f4 as EIP1193RequestArguments, f8 as EIP712Domain, f9 as EIP712TypeDefinition, fb as EIP712TypedData, fa as EIP712Types, e0 as EncryptedVote, w as EncryptionNotImplementedError, E as ErrorCode, fh as EthereumAdapterConfig, eC as EthereumChainId, fi as EthereumChainIdType, ff as EthereumChainMetadata, fe as EthereumTokenMetadata, fd as EthereumTransactionReceipt, fc as EthereumTransactionRequest, eq as EthereumWalletAdapter, fg as EthereumWalletName, dE as ExportForRegulatorParams, cG as ExportedViewingKey, dI as FATFExport, dJ as FATFTransaction, dK as FINCENExport, dL as FINCENTransaction, co as FindBestRouteParams, dA as GenerateAuditReportParams, fw as HardwareAccount, fn as HardwareConnectionStatus, fp as HardwareDeviceInfo, eD as HardwareErrorCode, fy as HardwareErrorCodeType, fu as HardwareEthereumTx, ft as HardwareSignRequest, fv as HardwareSignature, fx as HardwareTransport, fq as HardwareWalletConfig, eE as HardwareWalletError, fk as HardwareWalletType, L as IntentBuilder, I as IntentError, dH as Jurisdiction, fr as LedgerConfig, fl as LedgerModel, eL as LedgerWalletAdapter, es as MockEthereumAdapter, fj as MockEthereumAdapterConfig, fz as MockHardwareConfig, eP as MockLedgerAdapter, br as MockProofProvider, ei as MockSolanaAdapter, f2 as MockSolanaAdapterConfig, c1 as MockSolver, c3 as MockSolverConfig, eQ as MockTrezorAdapter, e8 as MockWalletAdapter, bX as NEARIntentsAdapter, c0 as NEARIntentsAdapterConfig, cp as NEARIntentsBackend, N as NetworkError, bG as ORACLE_DOMAIN, bW as OneClickClient, bO as OracleAttestationMessage, bL as OracleId, bN as OracleInfo, bR as OracleRegistry, bS as OracleRegistryConfig, bP as OracleSignature, bM as OracleStatus, d3 as PaymentBuilder, dD as PdfExportOptions, b7 as PedersenCommitment, b_ as PreparedSwap, cQ as PriceFeed, aP as PrivacyConfig, e3 as PrivateNFT, d_ as PrivateVoting, K as ProductionQuote, u as ProofError, v as ProofNotImplementedError, P as ProofProgressCallback, cn as QuoteComparison, cE as ReceivedNote, dF as RegulatoryExport, dG as RegulatoryFormat, e1 as RevealedVote, cj as Route, cm as RouteWithQuote, F as SIP, J as SIPConfig, S as SIPError, dd as STABLECOIN_ADDRESSES, de as STABLECOIN_DECIMALS, dc as STABLECOIN_INFO, dW as SealedBid, dU as SealedBidAuction, D as SerializedError, cg as SettlementBackend, ch as SettlementBackendFactory, c7 as SettlementBackendName, ci as SettlementBackendRegistry, c9 as SettlementQuote, c8 as SettlementQuoteParams, c5 as SettlementRegistry, c6 as SettlementRegistryError, cc as SettlementSwapParams, cd as SettlementSwapResult, ca as SettlementSwapRoute, cb as SettlementSwapRouteStep, cF as ShieldedBalance, cC as ShieldedSendParams, cD as ShieldedSendResult, bQ as SignedOracleAttestation, ck as SmartRouter, eZ as SolanaAdapterConfig, eY as SolanaCluster, e_ as SolanaConnection, eT as SolanaPublicKey, e$ as SolanaSendOptions, f1 as SolanaSignature, eU as SolanaTransaction, f0 as SolanaUnsignedTransaction, eV as SolanaVersionedTransaction, eg as SolanaWalletAdapter, eX as SolanaWalletName, eW as SolanaWalletProvider, dr as StablecoinInfo, ak as StealthCurve, aA as SuiStealthResult, as as SuiStealthService, bZ as SwapRequest, b$ as SwapResult, c4 as SwapStatus, ce as SwapStatusResponse, d1 as TapScript, d0 as TaprootOutput, dQ as ThresholdShares, dz as ThresholdViewingKey, dT as TimeLockParams, dR as TimeLockResult, aQ as TransactionData, fo as TransportType, ds as Treasury, fs as TrezorConfig, fm as TrezorModel, eN as TrezorWalletAdapter, dS as UnlockResult, V as ValidationError, bV as VerificationResult, dZ as VerifyBidParams, W as WalletAdapter, e9 as WalletError, cr as ZcashNativeBackend, ct as ZcashNativeBackendConfig, cL as ZcashQuote, cK as ZcashQuoteParams, cu as ZcashRPCClient, cv as ZcashRPCError, cx as ZcashShieldedService, cB as ZcashShieldedServiceConfig, cM as ZcashSwapParams, cN as ZcashSwapResult, cz as ZcashSwapService, cH as ZcashSwapServiceConfig, cI as ZcashSwapSourceChain, cJ as ZcashSwapSourceToken, cO as ZcashSwapStatus, b3 as addBlindings, b1 as addCommitments, bx as addOracle, aq as aptosAddressToAuthKey, Q as attachProofs, ep as base58ToHex, b as browserBytesToHex, h as browserHexToBytes, ao as checkAptosStealthAddress, ac as checkEd25519StealthAddress, a3 as checkStealthAddress, av as checkSuiStealthAddress, a_ as commit, b0 as commitZero, bE as computeAttestationHash, cW as computeTweakedKey, aR as createCommitment, er as createEthereumAdapter, cY as createKeySpendOnlyOutput, eM as createLedgerAdapter, et as createMockEthereumAdapter, eu as createMockEthereumProvider, eR as createMockLedgerAdapter, ej as createMockSolanaAdapter, el as createMockSolanaConnection, ek as createMockSolanaProvider, c2 as createMockSolver, eS as createMockTrezorAdapter, bY as createNEARIntentsAdapter, cq as createNEARIntentsBackend, bw as createOracleRegistry, e4 as createPrivateOwnership, d$ as createPrivateVoting, H as createProductionSIP, G as createSIP, dV as createSealedBidAuction, O as createShieldedIntent, d4 as createShieldedPayment, cl as createSmartRouter, eh as createSolanaAdapter, cX as createTaprootOutput, eO as createTrezorAdapter, ee as createWalletFactory, cw as createZcashClient, cs as createZcashNativeBackend, cy as createZcashShieldedService, cA as createZcashSwapService, a5 as decodeStealthMetaAddress, c_ as decodeTaprootAddress, d5 as decryptMemo, aN as decryptWithViewing, an as deriveAptosStealthPrivateKey, ab as deriveEd25519StealthPrivateKey, bv as deriveOracleId, a2 as deriveStealthPrivateKey, au as deriveSuiStealthPrivateKey, aL as deriveViewingKey, bD as deserializeAttestationMessage, Z as deserializeIntent, da as deserializePayment, ew as detectEthereumWallets, en as detectSolanaWallets, ap as ed25519PublicKeyToAptosAddress, ag as ed25519PublicKeyToNearAddress, ad as ed25519PublicKeyToSolanaAddress, aw as ed25519PublicKeyToSuiAddress, a4 as encodeStealthMetaAddress, aM as encryptForViewing, eb as featureNotSupportedError, dp as formatStablecoinAmount, ey as fromHex, dn as fromStablecoinUnits, am as generateAptosStealthAddress, b6 as generateBlinding, aD as generateCosmosStealthAddress, aC as generateCosmosStealthMetaAddress, aa as generateEd25519StealthAddress, a9 as generateEd25519StealthMetaAddress, aT as generateIntentId, dv as generatePdfReport, aV as generateRandomBytes, a1 as generateStealthAddress, a0 as generateStealthMetaAddress, at as generateSuiStealthAddress, aK as generateViewingKey, bA as getActiveOracles, eK as getAvailableTransports, g as getBrowserInfo, bF as getChainNumericId, dl as getChainsForStablecoin, a8 as getCurveForChain, eB as getDefaultRpcEndpoint, eG as getDerivationPath, A as getErrorMessage, ev as getEthereumProvider, b5 as getGenerators, _ as getIntentSummary, db as getPaymentSummary, d8 as getPaymentTimeRemaining, aJ as getPrivacyConfig, aO as getPrivacyDescription, em as getSolanaProvider, df as getStablecoin, di as getStablecoinInfo, dg as getStablecoinsForChain, dj as getSupportedStablecoins, X as getTimeRemaining, cV as getXOnlyPublicKey, bB as hasEnoughOracles, y as hasErrorCode, R as hasRequiredProofs, aU as hash, ez as hexToNumber, i as isBrowser, a7 as isEd25519Chain, U as isExpired, be as isNonNegativeAmount, d7 as isPaymentExpired, ef as isPrivateWalletAdapter, x as isSIPError, dh as isStablecoin, dk as isStablecoinOnChain, bd as isValidAmount, ar as isValidAptosAddress, b9 as isValidChainId, bh as isValidCompressedPublicKey, aF as isValidCosmosAddress, bi as isValidEd25519PublicKey, bb as isValidHex, bc as isValidHexLength, aj as isValidNearAccountId, ai as isValidNearImplicitAddress, ba as isValidPrivacyLevel, bj as isValidPrivateKey, bk as isValidScalar, bf as isValidSlippage, af as isValidSolanaAddress, bg as isValidStealthMetaAddress, ay as isValidSuiAddress, c$ as isValidTaprootAddress, ah as nearAddressToEd25519PublicKey, eA as normalizeAddress, ax as normalizeSuiAddress, ea as notConnectedError, e5 as proveOwnership, a6 as publicKeyToEthAddress, ed as registerWallet, by as removeOracle, cR as schnorrSign, cT as schnorrSignHex, cS as schnorrVerify, cU as schnorrVerifyHex, aW as secureWipe, aX as secureWipeAll, bC as serializeAttestationMessage, Y as serializeIntent, d9 as serializePayment, bu as signAttestationMessage, ae as solanaAddressToEd25519PublicKey, eo as solanaPublicKeyToHex, aE as stealthKeyToCosmosAddress, b4 as subtractBlindings, b2 as subtractCommitments, a as supportsSharedArrayBuffer, eJ as supportsWebBluetooth, eI as supportsWebHID, eH as supportsWebUSB, s as supportsWebWorkers, cZ as taprootAddress, ex as toHex, dm as toStablecoinUnits, T as trackIntent, d6 as trackPayment, bz as updateOracleStatus, bm as validateAsset, bl as validateCreateIntentParams, bn as validateIntentInput, bo as validateIntentOutput, bq as validateScalar, bp as validateViewingKey, bs as verifyAttestation, aS as verifyCommitment, a$ as verifyOpening, bt as verifyOracleSignature, e6 as verifyOwnership, ec as walletRegistry, aY as withSecureBuffer, aZ as withSecureBufferSync, z as wrapError } from './index-BYZbDjal.js';
|
|
2
2
|
export { Asset, AuditLogEntry, AuditScope, AuditorRegistration, AuditorViewingKey, BatchPaymentRecipient, BatchPaymentRequest, ChainId, Commitment, ComplianceConfig, ComplianceReport, ComplianceRole, CreateBatchProposalParams, CreateComplianceConfigParams, CreateIntentParams, CreatePaymentParams, CreatePaymentProposalParams, CreatePrivateOwnershipParams, 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, OwnershipProof, OwnershipVerification, PaymentPurpose, PaymentReceipt, PaymentStatus, PaymentStatusType, PrivacyLevel, PrivateNFTOwnership, PrivateWalletAdapter, ProposalSignature, ProposalStatus, ProposalStatusType, ProposalType, ProveOwnershipParams, 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';
|
|
3
3
|
export { a as FulfillmentProofParams, F as FundingProofParams, N as NoirProviderConfig, O as OracleAttestation, d as ProofFramework, b as ProofGenerationError, c as ProofProvider, P as ProofResult, V as ValidityProofParams } from './noir-DKfEzWy9.js';
|
package/dist/index.js
CHANGED
|
@@ -5418,8 +5418,20 @@ async function createShieldedIntent(params, options) {
|
|
|
5418
5418
|
return (0, import_utils6.hexToBytes)(cleanHex);
|
|
5419
5419
|
};
|
|
5420
5420
|
const effectiveSenderSecret = senderSecret ?? (0, import_utils6.randomBytes)(32);
|
|
5421
|
-
const
|
|
5421
|
+
const rawIntentHashBytes = (0, import_sha2565.sha256)(new TextEncoder().encode(intentId));
|
|
5422
5422
|
const intentHashHex = hash(intentId);
|
|
5423
|
+
const BN254_MODULUS = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
|
|
5424
|
+
let hashValue = 0n;
|
|
5425
|
+
for (const byte of rawIntentHashBytes) {
|
|
5426
|
+
hashValue = hashValue * 256n + BigInt(byte);
|
|
5427
|
+
}
|
|
5428
|
+
const reducedHashValue = hashValue % BN254_MODULUS;
|
|
5429
|
+
const intentHashBytes = new Uint8Array(32);
|
|
5430
|
+
let temp = reducedHashValue;
|
|
5431
|
+
for (let i = 31; i >= 0; i--) {
|
|
5432
|
+
intentHashBytes[i] = Number(temp & 0xffn);
|
|
5433
|
+
temp = temp >> 8n;
|
|
5434
|
+
}
|
|
5423
5435
|
let effectiveOwnershipSig;
|
|
5424
5436
|
let effectiveAuthSig;
|
|
5425
5437
|
if (ownershipSignature && authorizationSignature) {
|
|
@@ -5615,7 +5627,7 @@ var OneClickClient = class {
|
|
|
5615
5627
|
*
|
|
5616
5628
|
* @param depositAddress - Deposit address from quote
|
|
5617
5629
|
* @param depositMemo - Optional memo for memo-based deposits
|
|
5618
|
-
* @returns Current swap status
|
|
5630
|
+
* @returns Current swap status with normalized transaction hashes
|
|
5619
5631
|
*/
|
|
5620
5632
|
async getStatus(depositAddress, depositMemo) {
|
|
5621
5633
|
if (!depositAddress) {
|
|
@@ -5625,7 +5637,14 @@ var OneClickClient = class {
|
|
|
5625
5637
|
if (depositMemo) {
|
|
5626
5638
|
params.set("depositMemo", depositMemo);
|
|
5627
5639
|
}
|
|
5628
|
-
|
|
5640
|
+
const rawStatus = await this.get(`/v0/status?${params.toString()}`);
|
|
5641
|
+
const settlementTxHash = rawStatus.settlementTxHash ?? rawStatus.swapDetails?.destinationChainTxHashes?.[0]?.hash ?? rawStatus.destinationChainTxHashes?.[0]?.hash;
|
|
5642
|
+
const depositTxHash = rawStatus.depositTxHash ?? rawStatus.swapDetails?.originChainTxHashes?.[0]?.hash ?? rawStatus.originChainTxHashes?.[0]?.hash;
|
|
5643
|
+
return {
|
|
5644
|
+
...rawStatus,
|
|
5645
|
+
settlementTxHash,
|
|
5646
|
+
depositTxHash
|
|
5647
|
+
};
|
|
5629
5648
|
}
|
|
5630
5649
|
/**
|
|
5631
5650
|
* Poll status until terminal state or timeout
|
|
@@ -6177,9 +6196,10 @@ var NEARIntentsAdapter = class {
|
|
|
6177
6196
|
* @param request - Swap request parameters
|
|
6178
6197
|
* @param recipientMetaAddress - Recipient's stealth meta-address (for privacy modes)
|
|
6179
6198
|
* @param senderAddress - Sender's address for refunds
|
|
6199
|
+
* @param transparentRecipient - Explicit recipient address for transparent mode (defaults to senderAddress)
|
|
6180
6200
|
* @returns Prepared swap with quote request
|
|
6181
6201
|
*/
|
|
6182
|
-
async prepareSwap(request, recipientMetaAddress, senderAddress) {
|
|
6202
|
+
async prepareSwap(request, recipientMetaAddress, senderAddress, transparentRecipient) {
|
|
6183
6203
|
this.validateRequest(request);
|
|
6184
6204
|
const inputChain = request.inputAsset.chain;
|
|
6185
6205
|
if (senderAddress) {
|
|
@@ -6309,13 +6329,28 @@ var NEARIntentsAdapter = class {
|
|
|
6309
6329
|
}
|
|
6310
6330
|
}
|
|
6311
6331
|
} else {
|
|
6312
|
-
|
|
6332
|
+
const directRecipient = transparentRecipient ?? senderAddress;
|
|
6333
|
+
if (!directRecipient) {
|
|
6334
|
+
throw new ValidationError(
|
|
6335
|
+
"recipientAddress or senderAddress is required for transparent mode (or use stealth address)",
|
|
6336
|
+
"recipientAddress"
|
|
6337
|
+
);
|
|
6338
|
+
}
|
|
6339
|
+
const outputChain = request.outputAsset.chain;
|
|
6340
|
+
if (!isAddressValidForChain(directRecipient, outputChain)) {
|
|
6341
|
+
const outputChainType = getChainAddressType(outputChain);
|
|
6342
|
+
const recipientFormat = directRecipient.startsWith("0x") ? "EVM" : /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(directRecipient) ? "Solana" : /^[0-9a-f]{64}$/.test(directRecipient) || /^[a-z0-9._-]+$/.test(directRecipient) ? "NEAR" : "unknown";
|
|
6313
6343
|
throw new ValidationError(
|
|
6314
|
-
|
|
6315
|
-
"
|
|
6344
|
+
`Recipient address format doesn't match output chain. You're swapping TO ${outputChain} (${outputChainType} format) but the recipient address uses ${recipientFormat} format. Please provide a recipient address that matches the destination chain (${outputChain}).`,
|
|
6345
|
+
"recipientAddress",
|
|
6346
|
+
{
|
|
6347
|
+
outputChain,
|
|
6348
|
+
expectedFormat: outputChainType,
|
|
6349
|
+
actualFormat: recipientFormat
|
|
6350
|
+
}
|
|
6316
6351
|
);
|
|
6317
6352
|
}
|
|
6318
|
-
recipientAddress =
|
|
6353
|
+
recipientAddress = directRecipient;
|
|
6319
6354
|
}
|
|
6320
6355
|
const quoteRequest = this.buildQuoteRequest(request, recipientAddress, refundAddress);
|
|
6321
6356
|
return {
|
|
@@ -6703,9 +6738,10 @@ var SIP = class {
|
|
|
6703
6738
|
* @param params - Intent parameters (CreateIntentParams for production, ShieldedIntent/CreateIntentParams for demo)
|
|
6704
6739
|
* @param recipientMetaAddress - Optional stealth meta-address for privacy modes
|
|
6705
6740
|
* @param senderAddress - Optional sender wallet address for cross-curve refunds
|
|
6741
|
+
* @param transparentRecipient - Optional explicit recipient address for transparent mode (defaults to senderAddress)
|
|
6706
6742
|
* @returns Array of quotes (with deposit info in production mode)
|
|
6707
6743
|
*/
|
|
6708
|
-
async getQuotes(params, recipientMetaAddress, senderAddress) {
|
|
6744
|
+
async getQuotes(params, recipientMetaAddress, senderAddress, transparentRecipient) {
|
|
6709
6745
|
if (this.isProductionMode()) {
|
|
6710
6746
|
if (!("input" in params)) {
|
|
6711
6747
|
throw new ValidationError(
|
|
@@ -6713,7 +6749,7 @@ var SIP = class {
|
|
|
6713
6749
|
"params"
|
|
6714
6750
|
);
|
|
6715
6751
|
}
|
|
6716
|
-
return this.getQuotesProduction(params, recipientMetaAddress, senderAddress);
|
|
6752
|
+
return this.getQuotesProduction(params, recipientMetaAddress, senderAddress, transparentRecipient);
|
|
6717
6753
|
}
|
|
6718
6754
|
return this.getQuotesDemo(params);
|
|
6719
6755
|
}
|
|
@@ -6753,7 +6789,7 @@ var SIP = class {
|
|
|
6753
6789
|
return this.config.network;
|
|
6754
6790
|
}
|
|
6755
6791
|
// ─── Production Mode Implementation ─────────────────────────────────────────
|
|
6756
|
-
async getQuotesProduction(params, recipientMetaAddress, senderAddress) {
|
|
6792
|
+
async getQuotesProduction(params, recipientMetaAddress, senderAddress, transparentRecipient) {
|
|
6757
6793
|
if (!this.intentsAdapter) {
|
|
6758
6794
|
throw new ValidationError(
|
|
6759
6795
|
"NEAR Intents adapter not configured. Set intentsAdapter in config for production mode.",
|
|
@@ -6780,7 +6816,8 @@ var SIP = class {
|
|
|
6780
6816
|
const prepared = await this.intentsAdapter.prepareSwap(
|
|
6781
6817
|
swapRequest,
|
|
6782
6818
|
metaAddr,
|
|
6783
|
-
senderAddress ?? this.wallet?.address
|
|
6819
|
+
senderAddress ?? this.wallet?.address,
|
|
6820
|
+
transparentRecipient
|
|
6784
6821
|
);
|
|
6785
6822
|
const rawQuote = await this.intentsAdapter.getQuote(prepared);
|
|
6786
6823
|
if (!rawQuote.amountOut || !rawQuote.amountIn) {
|
|
@@ -6832,7 +6869,7 @@ var SIP = class {
|
|
|
6832
6869
|
depositTxHash = await options.onDepositRequired(depositAddress, rawQuote.amountIn);
|
|
6833
6870
|
if (!depositTxHash || !this.isValidTxHash(depositTxHash)) {
|
|
6834
6871
|
throw new ValidationError(
|
|
6835
|
-
"Invalid deposit transaction hash. Expected 0x-prefixed hex
|
|
6872
|
+
"Invalid deposit transaction hash. Expected 0x-prefixed hex (64-132 chars) or base58 (32-88 chars).",
|
|
6836
6873
|
"depositTxHash",
|
|
6837
6874
|
{ received: depositTxHash }
|
|
6838
6875
|
);
|
|
@@ -17106,7 +17143,7 @@ var SolanaWalletAdapter = class extends BaseWalletAdapter {
|
|
|
17106
17143
|
const sendOptions = tx.metadata?.sendOptions;
|
|
17107
17144
|
const { signature } = await this.provider.signAndSendTransaction(solTx, sendOptions);
|
|
17108
17145
|
return {
|
|
17109
|
-
txHash:
|
|
17146
|
+
txHash: signature,
|
|
17110
17147
|
status: "pending",
|
|
17111
17148
|
// Transaction is sent but not confirmed yet
|
|
17112
17149
|
timestamp: Date.now()
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sip-protocol/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.26",
|
|
4
4
|
"description": "Core SDK for Shielded Intents Protocol - Privacy layer for cross-chain transactions",
|
|
5
5
|
"author": "SIP Protocol <hello@sip-protocol.org>",
|
|
6
6
|
"homepage": "https://sip-protocol.org",
|
|
@@ -275,12 +275,14 @@ export class NEARIntentsAdapter {
|
|
|
275
275
|
* @param request - Swap request parameters
|
|
276
276
|
* @param recipientMetaAddress - Recipient's stealth meta-address (for privacy modes)
|
|
277
277
|
* @param senderAddress - Sender's address for refunds
|
|
278
|
+
* @param transparentRecipient - Explicit recipient address for transparent mode (defaults to senderAddress)
|
|
278
279
|
* @returns Prepared swap with quote request
|
|
279
280
|
*/
|
|
280
281
|
async prepareSwap(
|
|
281
282
|
request: SwapRequest,
|
|
282
283
|
recipientMetaAddress?: StealthMetaAddress | string,
|
|
283
284
|
senderAddress?: string,
|
|
285
|
+
transparentRecipient?: string,
|
|
284
286
|
): Promise<PreparedSwap> {
|
|
285
287
|
// Validate request
|
|
286
288
|
this.validateRequest(request)
|
|
@@ -467,14 +469,35 @@ export class NEARIntentsAdapter {
|
|
|
467
469
|
}
|
|
468
470
|
}
|
|
469
471
|
} else {
|
|
470
|
-
// Transparent mode uses
|
|
471
|
-
|
|
472
|
+
// Transparent mode uses explicit recipient or falls back to sender
|
|
473
|
+
const directRecipient = transparentRecipient ?? senderAddress
|
|
474
|
+
if (!directRecipient) {
|
|
475
|
+
throw new ValidationError(
|
|
476
|
+
'recipientAddress or senderAddress is required for transparent mode (or use stealth address)',
|
|
477
|
+
'recipientAddress'
|
|
478
|
+
)
|
|
479
|
+
}
|
|
480
|
+
// Validate recipient address matches output chain
|
|
481
|
+
const outputChain = request.outputAsset.chain
|
|
482
|
+
if (!isAddressValidForChain(directRecipient, outputChain)) {
|
|
483
|
+
const outputChainType = getChainAddressType(outputChain)
|
|
484
|
+
const recipientFormat = directRecipient.startsWith('0x') ? 'EVM' :
|
|
485
|
+
/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(directRecipient) ? 'Solana' :
|
|
486
|
+
/^[0-9a-f]{64}$/.test(directRecipient) || /^[a-z0-9._-]+$/.test(directRecipient) ? 'NEAR' : 'unknown'
|
|
487
|
+
|
|
472
488
|
throw new ValidationError(
|
|
473
|
-
|
|
474
|
-
'
|
|
489
|
+
`Recipient address format doesn't match output chain. ` +
|
|
490
|
+
`You're swapping TO ${outputChain} (${outputChainType} format) but the recipient address uses ${recipientFormat} format. ` +
|
|
491
|
+
`Please provide a recipient address that matches the destination chain (${outputChain}).`,
|
|
492
|
+
'recipientAddress',
|
|
493
|
+
{
|
|
494
|
+
outputChain,
|
|
495
|
+
expectedFormat: outputChainType,
|
|
496
|
+
actualFormat: recipientFormat,
|
|
497
|
+
}
|
|
475
498
|
)
|
|
476
499
|
}
|
|
477
|
-
recipientAddress =
|
|
500
|
+
recipientAddress = directRecipient
|
|
478
501
|
}
|
|
479
502
|
|
|
480
503
|
// Build quote request
|
|
@@ -161,7 +161,7 @@ export class OneClickClient {
|
|
|
161
161
|
*
|
|
162
162
|
* @param depositAddress - Deposit address from quote
|
|
163
163
|
* @param depositMemo - Optional memo for memo-based deposits
|
|
164
|
-
* @returns Current swap status
|
|
164
|
+
* @returns Current swap status with normalized transaction hashes
|
|
165
165
|
*/
|
|
166
166
|
async getStatus(depositAddress: string, depositMemo?: string): Promise<OneClickStatusResponse> {
|
|
167
167
|
if (!depositAddress) {
|
|
@@ -173,7 +173,33 @@ export class OneClickClient {
|
|
|
173
173
|
params.set('depositMemo', depositMemo)
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
// Type for raw API response with nested swapDetails
|
|
177
|
+
interface RawStatusResponse extends OneClickStatusResponse {
|
|
178
|
+
swapDetails?: {
|
|
179
|
+
destinationChainTxHashes?: { hash: string; explorerUrl: string }[]
|
|
180
|
+
originChainTxHashes?: { hash: string; explorerUrl: string }[]
|
|
181
|
+
nearTxHashes?: string[]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const rawStatus = await this.get<RawStatusResponse>(`/v0/status?${params.toString()}`)
|
|
186
|
+
|
|
187
|
+
// Normalize response: extract settlement tx hash from swapDetails.destinationChainTxHashes
|
|
188
|
+
// The 1Click API returns tx hashes nested inside swapDetails object
|
|
189
|
+
const settlementTxHash = rawStatus.settlementTxHash
|
|
190
|
+
?? rawStatus.swapDetails?.destinationChainTxHashes?.[0]?.hash
|
|
191
|
+
?? rawStatus.destinationChainTxHashes?.[0]?.hash // fallback for flat response
|
|
192
|
+
|
|
193
|
+
// Extract deposit tx hash from swapDetails.originChainTxHashes if not already present
|
|
194
|
+
const depositTxHash = rawStatus.depositTxHash
|
|
195
|
+
?? rawStatus.swapDetails?.originChainTxHashes?.[0]?.hash
|
|
196
|
+
?? rawStatus.originChainTxHashes?.[0]?.hash // fallback for flat response
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
...rawStatus,
|
|
200
|
+
settlementTxHash,
|
|
201
|
+
depositTxHash,
|
|
202
|
+
}
|
|
177
203
|
}
|
|
178
204
|
|
|
179
205
|
/**
|
package/src/intent.ts
CHANGED
|
@@ -560,11 +560,31 @@ export async function createShieldedIntent(
|
|
|
560
560
|
const effectiveSenderSecret = senderSecret ?? randomBytes(32)
|
|
561
561
|
|
|
562
562
|
// Compute the intent hash that will be used in the circuit
|
|
563
|
-
|
|
563
|
+
// IMPORTANT: Noir uses BN254 field, so hash values >= field modulus get reduced.
|
|
564
|
+
// We must sign the REDUCED hash to match what the circuit verifies.
|
|
565
|
+
const rawIntentHashBytes = sha256(new TextEncoder().encode(intentId))
|
|
564
566
|
const intentHashHex = hash(intentId) as HexString
|
|
565
567
|
|
|
568
|
+
// BN254 scalar field modulus (must match browser.ts and the circuit)
|
|
569
|
+
const BN254_MODULUS = 21888242871839275222246405745257275088548364400416034343698204186575808495617n
|
|
570
|
+
|
|
571
|
+
// Convert hash bytes to bigint and reduce modulo BN254
|
|
572
|
+
let hashValue = 0n
|
|
573
|
+
for (const byte of rawIntentHashBytes) {
|
|
574
|
+
hashValue = hashValue * 256n + BigInt(byte)
|
|
575
|
+
}
|
|
576
|
+
const reducedHashValue = hashValue % BN254_MODULUS
|
|
577
|
+
|
|
578
|
+
// Convert reduced value back to 32-byte array (big-endian)
|
|
579
|
+
const intentHashBytes = new Uint8Array(32)
|
|
580
|
+
let temp = reducedHashValue
|
|
581
|
+
for (let i = 31; i >= 0; i--) {
|
|
582
|
+
intentHashBytes[i] = Number(temp & 0xffn)
|
|
583
|
+
temp = temp >> 8n
|
|
584
|
+
}
|
|
585
|
+
|
|
566
586
|
// Generate ECDSA signatures using senderSecret if not provided
|
|
567
|
-
// This ensures the signature matches the intentHash computed internally
|
|
587
|
+
// This ensures the signature matches the intentHash computed internally (after BN254 reduction)
|
|
568
588
|
let effectiveOwnershipSig: Uint8Array
|
|
569
589
|
let effectiveAuthSig: Uint8Array
|
|
570
590
|
|
package/src/sip.ts
CHANGED
|
@@ -639,12 +639,14 @@ export class SIP {
|
|
|
639
639
|
* @param params - Intent parameters (CreateIntentParams for production, ShieldedIntent/CreateIntentParams for demo)
|
|
640
640
|
* @param recipientMetaAddress - Optional stealth meta-address for privacy modes
|
|
641
641
|
* @param senderAddress - Optional sender wallet address for cross-curve refunds
|
|
642
|
+
* @param transparentRecipient - Optional explicit recipient address for transparent mode (defaults to senderAddress)
|
|
642
643
|
* @returns Array of quotes (with deposit info in production mode)
|
|
643
644
|
*/
|
|
644
645
|
async getQuotes(
|
|
645
646
|
params: CreateIntentParams | ShieldedIntent,
|
|
646
647
|
recipientMetaAddress?: StealthMetaAddress | string,
|
|
647
648
|
senderAddress?: string,
|
|
649
|
+
transparentRecipient?: string,
|
|
648
650
|
): Promise<ProductionQuote[]> {
|
|
649
651
|
// Production mode - use real NEAR Intents
|
|
650
652
|
if (this.isProductionMode()) {
|
|
@@ -655,7 +657,7 @@ export class SIP {
|
|
|
655
657
|
'params'
|
|
656
658
|
)
|
|
657
659
|
}
|
|
658
|
-
return this.getQuotesProduction(params, recipientMetaAddress, senderAddress)
|
|
660
|
+
return this.getQuotesProduction(params, recipientMetaAddress, senderAddress, transparentRecipient)
|
|
659
661
|
}
|
|
660
662
|
|
|
661
663
|
// Demo mode - return mock quotes
|
|
@@ -721,6 +723,7 @@ export class SIP {
|
|
|
721
723
|
params: CreateIntentParams,
|
|
722
724
|
recipientMetaAddress?: StealthMetaAddress | string,
|
|
723
725
|
senderAddress?: string,
|
|
726
|
+
transparentRecipient?: string,
|
|
724
727
|
): Promise<ProductionQuote[]> {
|
|
725
728
|
if (!this.intentsAdapter) {
|
|
726
729
|
throw new ValidationError(
|
|
@@ -763,6 +766,7 @@ export class SIP {
|
|
|
763
766
|
swapRequest,
|
|
764
767
|
metaAddr,
|
|
765
768
|
senderAddress ?? this.wallet?.address,
|
|
769
|
+
transparentRecipient,
|
|
766
770
|
)
|
|
767
771
|
const rawQuote = await this.intentsAdapter.getQuote(prepared)
|
|
768
772
|
|
|
@@ -839,7 +843,7 @@ export class SIP {
|
|
|
839
843
|
// Validate txHash format before proceeding
|
|
840
844
|
if (!depositTxHash || !this.isValidTxHash(depositTxHash)) {
|
|
841
845
|
throw new ValidationError(
|
|
842
|
-
'Invalid deposit transaction hash. Expected 0x-prefixed hex
|
|
846
|
+
'Invalid deposit transaction hash. Expected 0x-prefixed hex (64-132 chars) or base58 (32-88 chars).',
|
|
843
847
|
'depositTxHash',
|
|
844
848
|
{ received: depositTxHash }
|
|
845
849
|
)
|
|
@@ -293,8 +293,11 @@ export class SolanaWalletAdapter extends BaseWalletAdapter {
|
|
|
293
293
|
|
|
294
294
|
const { signature } = await this.provider.signAndSendTransaction(solTx, sendOptions)
|
|
295
295
|
|
|
296
|
+
// Phantom/Solflare return signature as base58 string
|
|
297
|
+
// The SDK validation accepts both base58 (32-88 chars) and 0x-prefixed hex formats
|
|
298
|
+
// Return the base58 signature directly - no need to convert
|
|
296
299
|
return {
|
|
297
|
-
txHash:
|
|
300
|
+
txHash: signature as HexString,
|
|
298
301
|
status: 'pending', // Transaction is sent but not confirmed yet
|
|
299
302
|
timestamp: Date.now(),
|
|
300
303
|
}
|