@sip-protocol/sdk 0.1.8 → 0.1.9
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/index.js +7 -4
- package/dist/index.mjs +7 -4
- package/package.json +1 -1
- package/src/adapters/near-intents.ts +15 -6
package/dist/index.js
CHANGED
|
@@ -1983,11 +1983,14 @@ var NEARIntentsAdapter = class {
|
|
|
1983
1983
|
const metaAddr = typeof recipientMetaAddress === "string" ? decodeStealthMetaAddress(recipientMetaAddress) : recipientMetaAddress;
|
|
1984
1984
|
const { stealthAddress, sharedSecret: secret } = generateStealthAddress(metaAddr);
|
|
1985
1985
|
const outputChainType = CHAIN_BLOCKCHAIN_MAP[request.outputAsset.chain];
|
|
1986
|
-
if (outputChainType
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1986
|
+
if (outputChainType !== "evm") {
|
|
1987
|
+
throw new ValidationError(
|
|
1988
|
+
`Stealth addresses are not supported for ${request.outputAsset.chain} output. SIP stealth addresses use secp256k1 (EIP-5564 style) which only works for EVM chains. For ${request.outputAsset.chain} output, please connect a wallet or use an EVM output chain.`,
|
|
1989
|
+
"outputAsset",
|
|
1990
|
+
{ outputChain: request.outputAsset.chain, outputChainType }
|
|
1991
|
+
);
|
|
1990
1992
|
}
|
|
1993
|
+
recipientAddress = publicKeyToEthAddress(stealthAddress.address);
|
|
1991
1994
|
stealthData = stealthAddress;
|
|
1992
1995
|
sharedSecret = secret;
|
|
1993
1996
|
if (!senderAddress) {
|
package/dist/index.mjs
CHANGED
|
@@ -1792,11 +1792,14 @@ var NEARIntentsAdapter = class {
|
|
|
1792
1792
|
const metaAddr = typeof recipientMetaAddress === "string" ? decodeStealthMetaAddress(recipientMetaAddress) : recipientMetaAddress;
|
|
1793
1793
|
const { stealthAddress, sharedSecret: secret } = generateStealthAddress(metaAddr);
|
|
1794
1794
|
const outputChainType = CHAIN_BLOCKCHAIN_MAP[request.outputAsset.chain];
|
|
1795
|
-
if (outputChainType
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1795
|
+
if (outputChainType !== "evm") {
|
|
1796
|
+
throw new ValidationError(
|
|
1797
|
+
`Stealth addresses are not supported for ${request.outputAsset.chain} output. SIP stealth addresses use secp256k1 (EIP-5564 style) which only works for EVM chains. For ${request.outputAsset.chain} output, please connect a wallet or use an EVM output chain.`,
|
|
1798
|
+
"outputAsset",
|
|
1799
|
+
{ outputChain: request.outputAsset.chain, outputChainType }
|
|
1800
|
+
);
|
|
1799
1801
|
}
|
|
1802
|
+
recipientAddress = publicKeyToEthAddress(stealthAddress.address);
|
|
1800
1803
|
stealthData = stealthAddress;
|
|
1801
1804
|
sharedSecret = secret;
|
|
1802
1805
|
if (!senderAddress) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sip-protocol/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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",
|
|
@@ -250,14 +250,23 @@ export class NEARIntentsAdapter {
|
|
|
250
250
|
// Generate stealth address for recipient (output chain)
|
|
251
251
|
const { stealthAddress, sharedSecret: secret } = generateStealthAddress(metaAddr)
|
|
252
252
|
|
|
253
|
-
//
|
|
254
|
-
//
|
|
253
|
+
// Stealth addresses are secp256k1-based (EIP-5564 style) and only work for EVM chains.
|
|
254
|
+
// Non-EVM chains (Solana, Bitcoin, etc.) use different cryptographic schemes
|
|
255
|
+
// and cannot receive funds at secp256k1-derived addresses.
|
|
255
256
|
const outputChainType = CHAIN_BLOCKCHAIN_MAP[request.outputAsset.chain]
|
|
256
|
-
if (outputChainType
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
if (outputChainType !== 'evm') {
|
|
258
|
+
throw new ValidationError(
|
|
259
|
+
`Stealth addresses are not supported for ${request.outputAsset.chain} output. ` +
|
|
260
|
+
`SIP stealth addresses use secp256k1 (EIP-5564 style) which only works for EVM chains. ` +
|
|
261
|
+
`For ${request.outputAsset.chain} output, please connect a wallet or use an EVM output chain.`,
|
|
262
|
+
'outputAsset',
|
|
263
|
+
{ outputChain: request.outputAsset.chain, outputChainType }
|
|
264
|
+
)
|
|
260
265
|
}
|
|
266
|
+
|
|
267
|
+
// For EVM chains, convert stealth public key to ETH address format
|
|
268
|
+
// The 1Click API expects 20-byte Ethereum addresses, not 33-byte secp256k1 public keys
|
|
269
|
+
recipientAddress = publicKeyToEthAddress(stealthAddress.address)
|
|
261
270
|
stealthData = stealthAddress
|
|
262
271
|
sharedSecret = secret
|
|
263
272
|
|