@sip-protocol/sdk 0.6.2 → 0.6.4
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 +4 -2
- package/dist/browser.mjs +1 -1
- package/dist/chunk-AB3SCLVT.mjs +17026 -0
- package/dist/chunk-H5W3IPDU.mjs +17028 -0
- package/dist/index.js +4 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/intent.ts +10 -2
- package/src/sip.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -5383,7 +5383,7 @@ async function createShieldedIntent(params, options) {
|
|
|
5383
5383
|
let recipientStealth;
|
|
5384
5384
|
if (privacyConfig.useStealth && recipientMetaAddress) {
|
|
5385
5385
|
const metaAddress = decodeStealthMetaAddress(recipientMetaAddress);
|
|
5386
|
-
const { stealthAddress } = generateStealthAddress(metaAddress);
|
|
5386
|
+
const { stealthAddress } = isEd25519Chain(metaAddress.chain) ? generateEd25519StealthAddress(metaAddress) : generateStealthAddress(metaAddress);
|
|
5387
5387
|
recipientStealth = stealthAddress;
|
|
5388
5388
|
} else {
|
|
5389
5389
|
recipientStealth = {
|
|
@@ -6669,7 +6669,9 @@ var SIP = class {
|
|
|
6669
6669
|
async createIntent(params) {
|
|
6670
6670
|
const intent = await createShieldedIntent(params, {
|
|
6671
6671
|
senderAddress: this.wallet?.address,
|
|
6672
|
-
proofProvider: this.proofProvider
|
|
6672
|
+
proofProvider: this.proofProvider,
|
|
6673
|
+
// Allow placeholder signatures in demo mode for development/testing
|
|
6674
|
+
allowPlaceholders: this.config.mode === "demo"
|
|
6673
6675
|
});
|
|
6674
6676
|
return trackIntent(intent);
|
|
6675
6677
|
}
|
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.4",
|
|
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
|
@@ -20,7 +20,12 @@ import {
|
|
|
20
20
|
type PrivacyLevel,
|
|
21
21
|
type ChainId,
|
|
22
22
|
} from '@sip-protocol/types'
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
generateStealthAddress,
|
|
25
|
+
generateEd25519StealthAddress,
|
|
26
|
+
decodeStealthMetaAddress,
|
|
27
|
+
isEd25519Chain,
|
|
28
|
+
} from './stealth'
|
|
24
29
|
import {
|
|
25
30
|
createCommitment,
|
|
26
31
|
generateIntentId,
|
|
@@ -496,7 +501,10 @@ export async function createShieldedIntent(
|
|
|
496
501
|
let recipientStealth
|
|
497
502
|
if (privacyConfig.useStealth && recipientMetaAddress) {
|
|
498
503
|
const metaAddress = decodeStealthMetaAddress(recipientMetaAddress)
|
|
499
|
-
|
|
504
|
+
// Use appropriate stealth address generator based on chain's curve type
|
|
505
|
+
const { stealthAddress } = isEd25519Chain(metaAddress.chain)
|
|
506
|
+
? generateEd25519StealthAddress(metaAddress)
|
|
507
|
+
: generateStealthAddress(metaAddress)
|
|
500
508
|
recipientStealth = stealthAddress
|
|
501
509
|
} else {
|
|
502
510
|
// For transparent mode, create a placeholder
|
package/src/sip.ts
CHANGED
|
@@ -607,6 +607,8 @@ export class SIP {
|
|
|
607
607
|
const intent = await createShieldedIntent(params, {
|
|
608
608
|
senderAddress: this.wallet?.address,
|
|
609
609
|
proofProvider: this.proofProvider,
|
|
610
|
+
// Allow placeholder signatures in demo mode for development/testing
|
|
611
|
+
allowPlaceholders: this.config.mode === 'demo',
|
|
610
612
|
})
|
|
611
613
|
return trackIntent(intent)
|
|
612
614
|
}
|