@sip-protocol/sdk 0.7.0 → 0.7.2

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.mjs CHANGED
@@ -52,6 +52,7 @@ import {
52
52
  SettlementRegistry,
53
53
  SettlementRegistryError,
54
54
  SmartRouter,
55
+ SolanaSameChainExecutor,
55
56
  SolanaWalletAdapter,
56
57
  SuiStealthService,
57
58
  SwapStatus,
@@ -74,8 +75,6 @@ import {
74
75
  base58ToHex,
75
76
  bytesToHex,
76
77
  checkAptosStealthAddress,
77
- checkEd25519StealthAddress,
78
- checkStealthAddress,
79
78
  checkSuiStealthAddress,
80
79
  commit,
81
80
  commitZero,
@@ -100,6 +99,7 @@ import {
100
99
  createPrivateVoting,
101
100
  createProductionSIP,
102
101
  createSIP,
102
+ createSameChainExecutor,
103
103
  createSealedBidAuction,
104
104
  createShieldedIntent,
105
105
  createShieldedPayment,
@@ -112,14 +112,11 @@ import {
112
112
  createZcashNativeBackend,
113
113
  createZcashShieldedService,
114
114
  createZcashSwapService,
115
- decodeStealthMetaAddress,
116
115
  decodeTaprootAddress,
117
116
  decryptMemo,
118
117
  decryptWithViewing,
119
118
  deriveAptosStealthPrivateKey,
120
- deriveEd25519StealthPrivateKey,
121
119
  deriveOracleId,
122
- deriveStealthPrivateKey,
123
120
  deriveSuiStealthPrivateKey,
124
121
  deriveViewingKey,
125
122
  deserializeAttestationMessage,
@@ -128,10 +125,7 @@ import {
128
125
  detectEthereumWallets,
129
126
  detectSolanaWallets,
130
127
  ed25519PublicKeyToAptosAddress,
131
- ed25519PublicKeyToNearAddress,
132
- ed25519PublicKeyToSolanaAddress,
133
128
  ed25519PublicKeyToSuiAddress,
134
- encodeStealthMetaAddress,
135
129
  encryptForViewing,
136
130
  featureNotSupportedError,
137
131
  formatStablecoinAmount,
@@ -141,13 +135,9 @@ import {
141
135
  generateBlinding,
142
136
  generateCosmosStealthAddress,
143
137
  generateCosmosStealthMetaAddress,
144
- generateEd25519StealthAddress,
145
- generateEd25519StealthMetaAddress,
146
138
  generateIntentId,
147
139
  generatePdfReport,
148
140
  generateRandomBytes,
149
- generateStealthAddress,
150
- generateStealthMetaAddress,
151
141
  generateSuiStealthAddress,
152
142
  generateViewingKey,
153
143
  getActiveOracles,
@@ -155,7 +145,6 @@ import {
155
145
  getBrowserInfo,
156
146
  getChainNumericId,
157
147
  getChainsForStablecoin,
158
- getCurveForChain,
159
148
  getDefaultRpcEndpoint,
160
149
  getDerivationPath,
161
150
  getEthereumProvider,
@@ -169,6 +158,7 @@ import {
169
158
  getStablecoin,
170
159
  getStablecoinInfo,
171
160
  getStablecoinsForChain,
161
+ getSupportedSameChainChains,
172
162
  getSupportedStablecoins,
173
163
  getTimeRemaining,
174
164
  getXOnlyPublicKey,
@@ -178,51 +168,31 @@ import {
178
168
  hexToBytes,
179
169
  hexToNumber,
180
170
  isBrowser,
181
- isEd25519Chain,
182
171
  isExpired,
183
- isNonNegativeAmount,
184
172
  isPaymentExpired,
185
173
  isPrivate,
186
174
  isPrivateWalletAdapter,
175
+ isSameChainSupported,
187
176
  isStablecoin,
188
177
  isStablecoinOnChain,
189
- isValidAmount,
190
178
  isValidAptosAddress,
191
- isValidChainId,
192
- isValidCompressedPublicKey,
193
179
  isValidCosmosAddress,
194
- isValidEd25519PublicKey,
195
- isValidHex,
196
- isValidHexLength,
197
- isValidNearAccountId,
198
- isValidNearImplicitAddress,
199
- isValidPrivacyLevel,
200
- isValidPrivateKey,
201
- isValidScalar,
202
- isValidSlippage,
203
- isValidSolanaAddress,
204
- isValidStealthMetaAddress,
205
180
  isValidSuiAddress,
206
181
  isValidTaprootAddress,
207
- nearAddressToEd25519PublicKey,
208
182
  normalizeAddress,
209
183
  normalizeSuiAddress,
210
184
  notConnectedError,
211
185
  proveOwnership,
212
- publicKeyToEthAddress,
213
186
  registerWallet,
214
187
  removeOracle,
215
188
  schnorrSign,
216
189
  schnorrSignHex,
217
190
  schnorrVerify,
218
191
  schnorrVerifyHex,
219
- secureWipe,
220
- secureWipeAll,
221
192
  serializeAttestationMessage,
222
193
  serializeIntent,
223
194
  serializePayment,
224
195
  signAttestationMessage,
225
- solanaAddressToEd25519PublicKey,
226
196
  solanaPublicKeyToHex,
227
197
  stealthKeyToCosmosAddress,
228
198
  subtractBlindings,
@@ -239,21 +209,68 @@ import {
239
209
  trackIntent,
240
210
  trackPayment,
241
211
  updateOracleStatus,
212
+ verifyAttestation,
213
+ verifyCommitment,
214
+ verifyOpening,
215
+ verifyOracleSignature,
216
+ verifyOwnership,
217
+ walletRegistry
218
+ } from "./chunk-G33LB27A.mjs";
219
+ import {
220
+ ProofGenerationError
221
+ } from "./chunk-HOR7PM3M.mjs";
222
+ import {
223
+ checkEd25519StealthAddress,
224
+ checkStealthAddress,
225
+ claimStealthPayment,
226
+ createAnnouncementMemo,
227
+ decodeStealthMetaAddress,
228
+ deriveEd25519StealthPrivateKey,
229
+ deriveStealthPrivateKey,
230
+ ed25519PublicKeyToNearAddress,
231
+ ed25519PublicKeyToSolanaAddress,
232
+ encodeStealthMetaAddress,
233
+ estimatePrivateTransferFee,
234
+ generateEd25519StealthAddress,
235
+ generateEd25519StealthMetaAddress,
236
+ generateStealthAddress,
237
+ generateStealthMetaAddress,
238
+ getCurveForChain,
239
+ getStealthBalance,
240
+ hasTokenAccount,
241
+ isEd25519Chain,
242
+ isNonNegativeAmount,
243
+ isValidAmount,
244
+ isValidChainId,
245
+ isValidCompressedPublicKey,
246
+ isValidEd25519PublicKey,
247
+ isValidHex,
248
+ isValidHexLength,
249
+ isValidNearAccountId,
250
+ isValidNearImplicitAddress,
251
+ isValidPrivacyLevel,
252
+ isValidPrivateKey,
253
+ isValidScalar,
254
+ isValidSlippage,
255
+ isValidSolanaAddress,
256
+ isValidStealthMetaAddress,
257
+ nearAddressToEd25519PublicKey,
258
+ parseAnnouncement,
259
+ publicKeyToEthAddress,
260
+ scanForPayments,
261
+ secureWipe,
262
+ secureWipeAll,
263
+ sendPrivateSPLTransfer,
264
+ solanaAddressToEd25519PublicKey,
242
265
  validateAsset,
243
266
  validateCreateIntentParams,
244
267
  validateIntentInput,
245
268
  validateIntentOutput,
246
269
  validateScalar,
247
270
  validateViewingKey,
248
- verifyAttestation,
249
- verifyCommitment,
250
- verifyOpening,
251
- verifyOracleSignature,
252
- verifyOwnership,
253
- walletRegistry,
254
271
  withSecureBuffer,
255
272
  withSecureBufferSync
256
- } from "./chunk-3OVABDRH.mjs";
273
+ } from "./chunk-L2K34JCU.mjs";
257
274
  import {
258
275
  CryptoError,
259
276
  EncryptionNotImplementedError,
@@ -261,7 +278,6 @@ import {
261
278
  IntentError,
262
279
  NetworkError,
263
280
  ProofError,
264
- ProofGenerationError,
265
281
  ProofNotImplementedError,
266
282
  SIPError,
267
283
  ValidationError,
@@ -269,7 +285,18 @@ import {
269
285
  hasErrorCode,
270
286
  isSIPError,
271
287
  wrapError
272
- } from "./chunk-HGU6HZRC.mjs";
288
+ } from "./chunk-6WGN57S2.mjs";
289
+ import {
290
+ MEMO_PROGRAM_ID,
291
+ SIP_MEMO_PREFIX,
292
+ SOLANA_EXPLORER_URLS,
293
+ SOLANA_RPC_ENDPOINTS,
294
+ SOLANA_TOKEN_DECIMALS,
295
+ SOLANA_TOKEN_MINTS,
296
+ getExplorerUrl,
297
+ getTokenDecimals,
298
+ getTokenMint
299
+ } from "./chunk-E6SZWREQ.mjs";
273
300
  import "./chunk-UJCSKKID.mjs";
274
301
  export {
275
302
  ATTESTATION_VERSION,
@@ -297,6 +324,7 @@ export {
297
324
  IntentError,
298
325
  IntentStatus,
299
326
  LedgerWalletAdapter,
327
+ MEMO_PROGRAM_ID,
300
328
  MockEthereumAdapter,
301
329
  MockLedgerAdapter,
302
330
  MockProofProvider,
@@ -326,7 +354,12 @@ export {
326
354
  ReportStatus,
327
355
  SIP,
328
356
  SIPError,
357
+ SIP_MEMO_PREFIX,
329
358
  SIP_VERSION,
359
+ SOLANA_EXPLORER_URLS,
360
+ SOLANA_RPC_ENDPOINTS,
361
+ SOLANA_TOKEN_DECIMALS,
362
+ SOLANA_TOKEN_MINTS,
330
363
  STABLECOIN_ADDRESSES,
331
364
  STABLECOIN_DECIMALS,
332
365
  STABLECOIN_INFO,
@@ -334,6 +367,7 @@ export {
334
367
  SettlementRegistry,
335
368
  SettlementRegistryError,
336
369
  SmartRouter,
370
+ SolanaSameChainExecutor,
337
371
  SolanaWalletAdapter,
338
372
  SuiStealthService,
339
373
  SwapStatus,
@@ -361,10 +395,12 @@ export {
361
395
  checkEd25519StealthAddress,
362
396
  checkStealthAddress,
363
397
  checkSuiStealthAddress,
398
+ claimStealthPayment,
364
399
  commit,
365
400
  commitZero,
366
401
  computeAttestationHash,
367
402
  computeTweakedKey,
403
+ createAnnouncementMemo,
368
404
  createCommitment,
369
405
  createEthereumAdapter,
370
406
  createKeySpendOnlyOutput,
@@ -384,6 +420,7 @@ export {
384
420
  createPrivateVoting,
385
421
  createProductionSIP,
386
422
  createSIP,
423
+ createSameChainExecutor,
387
424
  createSealedBidAuction,
388
425
  createShieldedIntent,
389
426
  createShieldedPayment,
@@ -417,6 +454,7 @@ export {
417
454
  ed25519PublicKeyToSuiAddress,
418
455
  encodeStealthMetaAddress,
419
456
  encryptForViewing,
457
+ estimatePrivateTransferFee,
420
458
  featureNotSupportedError,
421
459
  formatStablecoinAmount,
422
460
  fromHex,
@@ -450,16 +488,22 @@ export {
450
488
  getPaymentTimeRemaining,
451
489
  getPrivacyConfig,
452
490
  getPrivacyDescription,
491
+ getExplorerUrl as getSolanaExplorerUrl,
453
492
  getSolanaProvider,
454
493
  getStablecoin,
455
494
  getStablecoinInfo,
456
495
  getStablecoinsForChain,
496
+ getStealthBalance,
497
+ getSupportedSameChainChains,
457
498
  getSupportedStablecoins,
458
499
  getTimeRemaining,
500
+ getTokenDecimals,
501
+ getTokenMint,
459
502
  getXOnlyPublicKey,
460
503
  hasEnoughOracles,
461
504
  hasErrorCode,
462
505
  hasRequiredProofs,
506
+ hasTokenAccount,
463
507
  hash,
464
508
  hexToNumber,
465
509
  isBrowser,
@@ -470,6 +514,7 @@ export {
470
514
  isPrivate,
471
515
  isPrivateWalletAdapter,
472
516
  isSIPError,
517
+ isSameChainSupported,
473
518
  isStablecoin,
474
519
  isStablecoinOnChain,
475
520
  isValidAmount,
@@ -494,16 +539,19 @@ export {
494
539
  normalizeAddress,
495
540
  normalizeSuiAddress,
496
541
  notConnectedError,
542
+ parseAnnouncement,
497
543
  proveOwnership,
498
544
  publicKeyToEthAddress,
499
545
  registerWallet,
500
546
  removeOracle,
547
+ scanForPayments,
501
548
  schnorrSign,
502
549
  schnorrSignHex,
503
550
  schnorrVerify,
504
551
  schnorrVerifyHex,
505
552
  secureWipe,
506
553
  secureWipeAll,
554
+ sendPrivateSPLTransfer,
507
555
  serializeAttestationMessage,
508
556
  serializeIntent,
509
557
  serializePayment,
@@ -4,9 +4,11 @@ import {
4
4
  validity_proof_default
5
5
  } from "../chunk-3INS3PR5.mjs";
6
6
  import {
7
- ProofError,
8
7
  ProofGenerationError
9
- } from "../chunk-HGU6HZRC.mjs";
8
+ } from "../chunk-HOR7PM3M.mjs";
9
+ import {
10
+ ProofError
11
+ } from "../chunk-6WGN57S2.mjs";
10
12
  import "../chunk-UJCSKKID.mjs";
11
13
 
12
14
  // src/proofs/noir.ts
@@ -0,0 +1,46 @@
1
+ import {
2
+ claimStealthPayment,
3
+ createAnnouncementMemo,
4
+ estimatePrivateTransferFee,
5
+ getStealthBalance,
6
+ hasTokenAccount,
7
+ parseAnnouncement,
8
+ scanForPayments,
9
+ sendPrivateSPLTransfer
10
+ } from "./chunk-DLDWZFYC.mjs";
11
+ import "./chunk-6WGN57S2.mjs";
12
+ import {
13
+ ATA_RENT_LAMPORTS,
14
+ ESTIMATED_TX_FEE_LAMPORTS,
15
+ MEMO_PROGRAM_ID,
16
+ SIP_MEMO_PREFIX,
17
+ SOLANA_EXPLORER_URLS,
18
+ SOLANA_RPC_ENDPOINTS,
19
+ SOLANA_TOKEN_DECIMALS,
20
+ SOLANA_TOKEN_MINTS,
21
+ getExplorerUrl,
22
+ getTokenDecimals,
23
+ getTokenMint
24
+ } from "./chunk-E6SZWREQ.mjs";
25
+ import "./chunk-UJCSKKID.mjs";
26
+ export {
27
+ ATA_RENT_LAMPORTS,
28
+ ESTIMATED_TX_FEE_LAMPORTS,
29
+ MEMO_PROGRAM_ID,
30
+ SIP_MEMO_PREFIX,
31
+ SOLANA_EXPLORER_URLS,
32
+ SOLANA_RPC_ENDPOINTS,
33
+ SOLANA_TOKEN_DECIMALS,
34
+ SOLANA_TOKEN_MINTS,
35
+ claimStealthPayment,
36
+ createAnnouncementMemo,
37
+ estimatePrivateTransferFee,
38
+ getExplorerUrl,
39
+ getStealthBalance,
40
+ getTokenDecimals,
41
+ getTokenMint,
42
+ hasTokenAccount,
43
+ parseAnnouncement,
44
+ scanForPayments,
45
+ sendPrivateSPLTransfer
46
+ };
@@ -0,0 +1,46 @@
1
+ import {
2
+ claimStealthPayment,
3
+ createAnnouncementMemo,
4
+ estimatePrivateTransferFee,
5
+ getStealthBalance,
6
+ hasTokenAccount,
7
+ parseAnnouncement,
8
+ scanForPayments,
9
+ sendPrivateSPLTransfer
10
+ } from "./chunk-L2K34JCU.mjs";
11
+ import "./chunk-6WGN57S2.mjs";
12
+ import {
13
+ ATA_RENT_LAMPORTS,
14
+ ESTIMATED_TX_FEE_LAMPORTS,
15
+ MEMO_PROGRAM_ID,
16
+ SIP_MEMO_PREFIX,
17
+ SOLANA_EXPLORER_URLS,
18
+ SOLANA_RPC_ENDPOINTS,
19
+ SOLANA_TOKEN_DECIMALS,
20
+ SOLANA_TOKEN_MINTS,
21
+ getExplorerUrl,
22
+ getTokenDecimals,
23
+ getTokenMint
24
+ } from "./chunk-E6SZWREQ.mjs";
25
+ import "./chunk-UJCSKKID.mjs";
26
+ export {
27
+ ATA_RENT_LAMPORTS,
28
+ ESTIMATED_TX_FEE_LAMPORTS,
29
+ MEMO_PROGRAM_ID,
30
+ SIP_MEMO_PREFIX,
31
+ SOLANA_EXPLORER_URLS,
32
+ SOLANA_RPC_ENDPOINTS,
33
+ SOLANA_TOKEN_DECIMALS,
34
+ SOLANA_TOKEN_MINTS,
35
+ claimStealthPayment,
36
+ createAnnouncementMemo,
37
+ estimatePrivateTransferFee,
38
+ getExplorerUrl,
39
+ getStealthBalance,
40
+ getTokenDecimals,
41
+ getTokenMint,
42
+ hasTokenAccount,
43
+ parseAnnouncement,
44
+ scanForPayments,
45
+ sendPrivateSPLTransfer
46
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sip-protocol/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
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",
@@ -36,6 +36,18 @@
36
36
  "dist",
37
37
  "src"
38
38
  ],
39
+ "scripts": {
40
+ "build": "tsup src/index.ts src/browser.ts src/proofs/noir.ts --format cjs,esm --dts",
41
+ "dev": "tsup src/index.ts src/browser.ts src/proofs/noir.ts --format cjs,esm --dts --watch",
42
+ "lint": "eslint --ext .ts src/",
43
+ "typecheck": "tsc --noEmit",
44
+ "clean": "rm -rf dist",
45
+ "test": "vitest",
46
+ "test:coverage": "vitest run --coverage",
47
+ "bench": "vitest bench --config vitest.bench.config.ts",
48
+ "bench:json": "vitest bench --config vitest.bench.config.ts --outputJson benchmarks/results.json",
49
+ "demo:auction": "tsx examples/auction-demo.ts"
50
+ },
39
51
  "dependencies": {
40
52
  "@aztec/bb.js": "3.0.0-nightly.20251104",
41
53
  "@ethereumjs/rlp": "^10.1.0",
@@ -45,7 +57,9 @@
45
57
  "@noir-lang/noir_js": "1.0.0-beta.15",
46
58
  "@noir-lang/types": "1.0.0-beta.15",
47
59
  "@scure/base": "^2.0.0",
48
- "@sip-protocol/types": "0.2.1"
60
+ "@sip-protocol/types": "^0.2.1",
61
+ "@solana/web3.js": "^1.95.0",
62
+ "@solana/spl-token": "^0.4.0"
49
63
  },
50
64
  "devDependencies": {
51
65
  "@vitest/coverage-v8": "1.6.1",
@@ -62,17 +76,5 @@
62
76
  "stealth-addresses",
63
77
  "zcash"
64
78
  ],
65
- "license": "MIT",
66
- "scripts": {
67
- "build": "tsup src/index.ts src/browser.ts src/proofs/noir.ts --format cjs,esm --dts",
68
- "dev": "tsup src/index.ts src/browser.ts src/proofs/noir.ts --format cjs,esm --dts --watch",
69
- "lint": "eslint --ext .ts src/",
70
- "typecheck": "tsc --noEmit",
71
- "clean": "rm -rf dist",
72
- "test": "vitest",
73
- "test:coverage": "vitest run --coverage",
74
- "bench": "vitest bench --config vitest.bench.config.ts",
75
- "bench:json": "vitest bench --config vitest.bench.config.ts --outputJson benchmarks/results.json",
76
- "demo:auction": "tsx examples/auction-demo.ts"
77
- }
78
- }
79
+ "license": "MIT"
80
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Solana Chain Constants
3
+ *
4
+ * Token mints, RPC endpoints, and configuration for Solana same-chain privacy.
5
+ */
6
+
7
+ /**
8
+ * Common SPL token mint addresses on Solana mainnet
9
+ */
10
+ export const SOLANA_TOKEN_MINTS = {
11
+ /** USD Coin (USDC) - Circle's stablecoin */
12
+ USDC: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
13
+ /** Tether USD (USDT) */
14
+ USDT: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
15
+ /** Wrapped SOL (for SPL token operations with native SOL) */
16
+ WSOL: 'So11111111111111111111111111111111111111112',
17
+ } as const
18
+
19
+ /**
20
+ * Token decimals for Solana tokens
21
+ */
22
+ export const SOLANA_TOKEN_DECIMALS: Record<string, number> = {
23
+ SOL: 9,
24
+ WSOL: 9,
25
+ USDC: 6,
26
+ USDT: 6,
27
+ }
28
+
29
+ /**
30
+ * RPC endpoints for Solana clusters
31
+ */
32
+ export const SOLANA_RPC_ENDPOINTS = {
33
+ 'mainnet-beta': 'https://api.mainnet-beta.solana.com',
34
+ mainnet: 'https://api.mainnet-beta.solana.com',
35
+ devnet: 'https://api.devnet.solana.com',
36
+ testnet: 'https://api.testnet.solana.com',
37
+ localnet: 'http://localhost:8899',
38
+ } as const
39
+
40
+ /**
41
+ * Solana cluster types
42
+ */
43
+ export type SolanaCluster = keyof typeof SOLANA_RPC_ENDPOINTS
44
+
45
+ /**
46
+ * Explorer URLs for transaction viewing
47
+ */
48
+ export const SOLANA_EXPLORER_URLS = {
49
+ 'mainnet-beta': 'https://solscan.io',
50
+ mainnet: 'https://solscan.io',
51
+ devnet: 'https://solscan.io?cluster=devnet',
52
+ testnet: 'https://solscan.io?cluster=testnet',
53
+ localnet: 'http://localhost:3000',
54
+ } as const
55
+
56
+ /**
57
+ * Memo program ID for Solana
58
+ */
59
+ export const MEMO_PROGRAM_ID = 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'
60
+
61
+ /**
62
+ * SIP announcement memo prefix
63
+ * Format: SIP:1:<ephemeral_pubkey_base58>:<view_tag_hex>
64
+ */
65
+ export const SIP_MEMO_PREFIX = 'SIP:1:'
66
+
67
+ /**
68
+ * Estimated transaction fee in lamports
69
+ * Includes base fee + rent for ATA creation
70
+ */
71
+ export const ESTIMATED_TX_FEE_LAMPORTS = 5000n
72
+
73
+ /**
74
+ * Estimated ATA rent in lamports (for creating Associated Token Account)
75
+ */
76
+ export const ATA_RENT_LAMPORTS = 2039280n
77
+
78
+ /**
79
+ * Get explorer URL for a transaction
80
+ */
81
+ export function getExplorerUrl(
82
+ signature: string,
83
+ cluster: SolanaCluster = 'mainnet-beta'
84
+ ): string {
85
+ const baseUrl = SOLANA_EXPLORER_URLS[cluster]
86
+ return `${baseUrl}/tx/${signature}`
87
+ }
88
+
89
+ /**
90
+ * Get token mint address from symbol
91
+ */
92
+ export function getTokenMint(symbol: string): string | undefined {
93
+ return SOLANA_TOKEN_MINTS[symbol as keyof typeof SOLANA_TOKEN_MINTS]
94
+ }
95
+
96
+ /**
97
+ * Get token decimals from symbol
98
+ */
99
+ export function getTokenDecimals(symbol: string): number {
100
+ return SOLANA_TOKEN_DECIMALS[symbol] ?? 9 // Default to 9 (SOL decimals)
101
+ }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Solana Same-Chain Privacy Module
3
+ *
4
+ * Provides privacy-preserving SPL token transfers using stealth addresses.
5
+ *
6
+ * @example Sender flow
7
+ * ```typescript
8
+ * import { sendPrivateSPLTransfer } from '@sip-protocol/sdk'
9
+ *
10
+ * const result = await sendPrivateSPLTransfer({
11
+ * connection,
12
+ * sender: wallet.publicKey,
13
+ * senderTokenAccount: senderATA,
14
+ * recipientMetaAddress: recipientMeta,
15
+ * mint: USDC_MINT,
16
+ * amount: 5_000_000n,
17
+ * signTransaction: wallet.signTransaction,
18
+ * })
19
+ * ```
20
+ *
21
+ * @example Recipient flow
22
+ * ```typescript
23
+ * import { scanForPayments, claimStealthPayment } from '@sip-protocol/sdk'
24
+ *
25
+ * // Scan for incoming payments
26
+ * const payments = await scanForPayments({
27
+ * connection,
28
+ * viewingPrivateKey,
29
+ * spendingPublicKey,
30
+ * })
31
+ *
32
+ * // Claim a payment
33
+ * const result = await claimStealthPayment({
34
+ * connection,
35
+ * stealthAddress: payments[0].stealthAddress,
36
+ * ephemeralPublicKey: payments[0].ephemeralPublicKey,
37
+ * viewingPrivateKey,
38
+ * spendingPrivateKey,
39
+ * destinationAddress: myWallet,
40
+ * mint: USDC_MINT,
41
+ * })
42
+ * ```
43
+ *
44
+ * @packageDocumentation
45
+ */
46
+
47
+ // Constants
48
+ export {
49
+ SOLANA_TOKEN_MINTS,
50
+ SOLANA_TOKEN_DECIMALS,
51
+ SOLANA_RPC_ENDPOINTS,
52
+ SOLANA_EXPLORER_URLS,
53
+ MEMO_PROGRAM_ID,
54
+ SIP_MEMO_PREFIX,
55
+ ESTIMATED_TX_FEE_LAMPORTS,
56
+ ATA_RENT_LAMPORTS,
57
+ getExplorerUrl,
58
+ getTokenMint,
59
+ getTokenDecimals,
60
+ type SolanaCluster,
61
+ } from './constants'
62
+
63
+ // Types
64
+ export type {
65
+ SolanaPrivateTransferParams,
66
+ SolanaPrivateTransferResult,
67
+ SolanaScanParams,
68
+ SolanaScanResult,
69
+ SolanaClaimParams,
70
+ SolanaClaimResult,
71
+ SolanaAnnouncement,
72
+ } from './types'
73
+ export { parseAnnouncement, createAnnouncementMemo } from './types'
74
+
75
+ // Transfer functions
76
+ export {
77
+ sendPrivateSPLTransfer,
78
+ estimatePrivateTransferFee,
79
+ hasTokenAccount,
80
+ } from './transfer'
81
+
82
+ // Scan and claim functions
83
+ export {
84
+ scanForPayments,
85
+ claimStealthPayment,
86
+ getStealthBalance,
87
+ } from './scan'