@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 +9 -13
- package/dist/browser.mjs +1 -1
- package/dist/{chunk-CHC3HKUM.mjs → chunk-C7RM67TH.mjs} +9 -13
- package/dist/index.js +9 -13
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/intent.ts +16 -17
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
|
|
5414
|
-
const
|
|
5415
|
-
|
|
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
|
|
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
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
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
|
@@ -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
|
|
1757
|
-
const
|
|
1758
|
-
|
|
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
|
|
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
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
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
|
|
5401
|
-
const
|
|
5402
|
-
|
|
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
|
|
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
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sip-protocol/sdk",
|
|
3
|
-
"version": "0.6.
|
|
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
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
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
|
|
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
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
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
|