@sip-protocol/sdk 0.6.23 → 0.6.24

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.js CHANGED
@@ -5410,26 +5410,22 @@ async function createShieldedIntent(params, options) {
5410
5410
  let validityProof;
5411
5411
  const requiresProofs = privacy !== import_types.PrivacyLevel.TRANSPARENT;
5412
5412
  if (requiresProofs && proofProvider && proofProvider.isReady) {
5413
- const hasSignatures = ownershipSignature && senderSecret && authorizationSignature;
5414
- const usingPlaceholders = !hasSignatures;
5415
- if (usingPlaceholders && !allowPlaceholders) {
5413
+ const hasAllSignatures = ownershipSignature && senderSecret && authorizationSignature;
5414
+ const canGenerateSignatures = senderSecret && !ownershipSignature && !authorizationSignature;
5415
+ const hasValidConfig = hasAllSignatures || canGenerateSignatures || allowPlaceholders;
5416
+ if (!hasValidConfig) {
5416
5417
  throw new ValidationError(
5417
- "Proof generation requires signatures. Provide ownershipSignature, senderSecret, and authorizationSignature in options, or set allowPlaceholders: true for development/testing.",
5418
+ "Proof generation requires either: (1) senderSecret alone (SDK generates signatures), (2) all three: ownershipSignature, senderSecret, authorizationSignature, or (3) set allowPlaceholders: true for development/testing.",
5418
5419
  "options",
5419
5420
  {
5420
- missing: [
5421
- !ownershipSignature && "ownershipSignature",
5422
- !senderSecret && "senderSecret",
5423
- !authorizationSignature && "authorizationSignature"
5421
+ provided: [
5422
+ ownershipSignature && "ownershipSignature",
5423
+ senderSecret && "senderSecret",
5424
+ authorizationSignature && "authorizationSignature"
5424
5425
  ].filter(Boolean)
5425
5426
  }
5426
5427
  );
5427
5428
  }
5428
- if (usingPlaceholders) {
5429
- console.warn(
5430
- "[createShieldedIntent] WARNING: Using placeholder signatures for proof generation. These proofs are NOT cryptographically valid. Do NOT use in production!"
5431
- );
5432
- }
5433
5429
  const hexToUint8 = (hex) => {
5434
5430
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
5435
5431
  return (0, import_utils6.hexToBytes)(cleanHex);
package/dist/browser.mjs CHANGED
@@ -263,7 +263,7 @@ import {
263
263
  walletRegistry,
264
264
  withSecureBuffer,
265
265
  withSecureBufferSync
266
- } from "./chunk-CHC3HKUM.mjs";
266
+ } from "./chunk-C7RM67TH.mjs";
267
267
  import {
268
268
  fulfillment_proof_default,
269
269
  funding_proof_default,
@@ -1753,26 +1753,22 @@ async function createShieldedIntent(params, options) {
1753
1753
  let validityProof;
1754
1754
  const requiresProofs = privacy !== PrivacyLevelEnum.TRANSPARENT;
1755
1755
  if (requiresProofs && proofProvider && proofProvider.isReady) {
1756
- const hasSignatures = ownershipSignature && senderSecret && authorizationSignature;
1757
- const usingPlaceholders = !hasSignatures;
1758
- if (usingPlaceholders && !allowPlaceholders) {
1756
+ const hasAllSignatures = ownershipSignature && senderSecret && authorizationSignature;
1757
+ const canGenerateSignatures = senderSecret && !ownershipSignature && !authorizationSignature;
1758
+ const hasValidConfig = hasAllSignatures || canGenerateSignatures || allowPlaceholders;
1759
+ if (!hasValidConfig) {
1759
1760
  throw new ValidationError(
1760
- "Proof generation requires signatures. Provide ownershipSignature, senderSecret, and authorizationSignature in options, or set allowPlaceholders: true for development/testing.",
1761
+ "Proof generation requires either: (1) senderSecret alone (SDK generates signatures), (2) all three: ownershipSignature, senderSecret, authorizationSignature, or (3) set allowPlaceholders: true for development/testing.",
1761
1762
  "options",
1762
1763
  {
1763
- missing: [
1764
- !ownershipSignature && "ownershipSignature",
1765
- !senderSecret && "senderSecret",
1766
- !authorizationSignature && "authorizationSignature"
1764
+ provided: [
1765
+ ownershipSignature && "ownershipSignature",
1766
+ senderSecret && "senderSecret",
1767
+ authorizationSignature && "authorizationSignature"
1767
1768
  ].filter(Boolean)
1768
1769
  }
1769
1770
  );
1770
1771
  }
1771
- if (usingPlaceholders) {
1772
- console.warn(
1773
- "[createShieldedIntent] WARNING: Using placeholder signatures for proof generation. These proofs are NOT cryptographically valid. Do NOT use in production!"
1774
- );
1775
- }
1776
1772
  const hexToUint8 = (hex) => {
1777
1773
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
1778
1774
  return hexToBytes4(cleanHex);
package/dist/index.js CHANGED
@@ -5397,26 +5397,22 @@ async function createShieldedIntent(params, options) {
5397
5397
  let validityProof;
5398
5398
  const requiresProofs = privacy !== import_types.PrivacyLevel.TRANSPARENT;
5399
5399
  if (requiresProofs && proofProvider && proofProvider.isReady) {
5400
- const hasSignatures = ownershipSignature && senderSecret && authorizationSignature;
5401
- const usingPlaceholders = !hasSignatures;
5402
- if (usingPlaceholders && !allowPlaceholders) {
5400
+ const hasAllSignatures = ownershipSignature && senderSecret && authorizationSignature;
5401
+ const canGenerateSignatures = senderSecret && !ownershipSignature && !authorizationSignature;
5402
+ const hasValidConfig = hasAllSignatures || canGenerateSignatures || allowPlaceholders;
5403
+ if (!hasValidConfig) {
5403
5404
  throw new ValidationError(
5404
- "Proof generation requires signatures. Provide ownershipSignature, senderSecret, and authorizationSignature in options, or set allowPlaceholders: true for development/testing.",
5405
+ "Proof generation requires either: (1) senderSecret alone (SDK generates signatures), (2) all three: ownershipSignature, senderSecret, authorizationSignature, or (3) set allowPlaceholders: true for development/testing.",
5405
5406
  "options",
5406
5407
  {
5407
- missing: [
5408
- !ownershipSignature && "ownershipSignature",
5409
- !senderSecret && "senderSecret",
5410
- !authorizationSignature && "authorizationSignature"
5408
+ provided: [
5409
+ ownershipSignature && "ownershipSignature",
5410
+ senderSecret && "senderSecret",
5411
+ authorizationSignature && "authorizationSignature"
5411
5412
  ].filter(Boolean)
5412
5413
  }
5413
5414
  );
5414
5415
  }
5415
- if (usingPlaceholders) {
5416
- console.warn(
5417
- "[createShieldedIntent] WARNING: Using placeholder signatures for proof generation. These proofs are NOT cryptographically valid. Do NOT use in production!"
5418
- );
5419
- }
5420
5416
  const hexToUint8 = (hex) => {
5421
5417
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
5422
5418
  return (0, import_utils6.hexToBytes)(cleanHex);
package/dist/index.mjs CHANGED
@@ -253,7 +253,7 @@ import {
253
253
  walletRegistry,
254
254
  withSecureBuffer,
255
255
  withSecureBufferSync
256
- } from "./chunk-CHC3HKUM.mjs";
256
+ } from "./chunk-C7RM67TH.mjs";
257
257
  import {
258
258
  CryptoError,
259
259
  EncryptionNotImplementedError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sip-protocol/sdk",
3
- "version": "0.6.23",
3
+ "version": "0.6.24",
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",
package/src/intent.ts CHANGED
@@ -524,31 +524,30 @@ export async function createShieldedIntent(
524
524
  const requiresProofs = privacy !== PrivacyLevelEnum.TRANSPARENT
525
525
 
526
526
  if (requiresProofs && proofProvider && proofProvider.isReady) {
527
- // Check if signatures are provided or placeholders are allowed
528
- const hasSignatures = ownershipSignature && senderSecret && authorizationSignature
529
- const usingPlaceholders = !hasSignatures
530
-
531
- if (usingPlaceholders && !allowPlaceholders) {
527
+ // Check if we can generate valid proofs:
528
+ // - Option 1: All signatures provided (ownershipSignature + senderSecret + authorizationSignature)
529
+ // - Option 2: Just senderSecret provided (SDK generates signatures internally)
530
+ // - Option 3: allowPlaceholders: true (random bytes, won't verify - dev/test only)
531
+ const hasAllSignatures = ownershipSignature && senderSecret && authorizationSignature
532
+ const canGenerateSignatures = senderSecret && !ownershipSignature && !authorizationSignature
533
+ const hasValidConfig = hasAllSignatures || canGenerateSignatures || allowPlaceholders
534
+
535
+ if (!hasValidConfig) {
532
536
  throw new ValidationError(
533
- 'Proof generation requires signatures. Provide ownershipSignature, senderSecret, and authorizationSignature in options, or set allowPlaceholders: true for development/testing.',
537
+ 'Proof generation requires either: (1) senderSecret alone (SDK generates signatures), ' +
538
+ '(2) all three: ownershipSignature, senderSecret, authorizationSignature, or ' +
539
+ '(3) set allowPlaceholders: true for development/testing.',
534
540
  'options',
535
541
  {
536
- missing: [
537
- !ownershipSignature && 'ownershipSignature',
538
- !senderSecret && 'senderSecret',
539
- !authorizationSignature && 'authorizationSignature',
542
+ provided: [
543
+ ownershipSignature && 'ownershipSignature',
544
+ senderSecret && 'senderSecret',
545
+ authorizationSignature && 'authorizationSignature',
540
546
  ].filter(Boolean),
541
547
  }
542
548
  )
543
549
  }
544
550
 
545
- if (usingPlaceholders) {
546
- console.warn(
547
- '[createShieldedIntent] WARNING: Using placeholder signatures for proof generation. ' +
548
- 'These proofs are NOT cryptographically valid. Do NOT use in production!'
549
- )
550
- }
551
-
552
551
  // Helper to convert HexString to Uint8Array
553
552
  const hexToUint8 = (hex: HexString): Uint8Array => {
554
553
  const cleanHex = hex.startsWith('0x') ? hex.slice(2) : hex