@sip-protocol/sdk 0.3.2 → 0.5.0

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.
Files changed (64) hide show
  1. package/dist/browser.d.mts +2 -2
  2. package/dist/browser.d.ts +2 -2
  3. package/dist/browser.js +2881 -295
  4. package/dist/browser.mjs +62 -2
  5. package/dist/chunk-AOZIY3GU.mjs +12995 -0
  6. package/dist/chunk-BCLIX5T2.mjs +12940 -0
  7. package/dist/chunk-DMHBKRWV.mjs +14712 -0
  8. package/dist/chunk-FKXPHKYD.mjs +12955 -0
  9. package/dist/chunk-HGU6HZRC.mjs +231 -0
  10. package/dist/chunk-J4Q4NJ2U.mjs +13544 -0
  11. package/dist/chunk-OPQ2GQIO.mjs +13013 -0
  12. package/dist/chunk-W2B7T6WU.mjs +14714 -0
  13. package/dist/index-5jAdWMA-.d.ts +8973 -0
  14. package/dist/index-B9Vkpaao.d.mts +8973 -0
  15. package/dist/index-BcWNakUD.d.ts +7990 -0
  16. package/dist/index-BsKY3Hr0.d.mts +7990 -0
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +2852 -266
  20. package/dist/index.mjs +62 -2
  21. package/dist/proofs/noir.mjs +1 -1
  22. package/package.json +2 -1
  23. package/src/adapters/near-intents.ts +8 -0
  24. package/src/bitcoin/index.ts +51 -0
  25. package/src/bitcoin/silent-payments.ts +865 -0
  26. package/src/bitcoin/taproot.ts +590 -0
  27. package/src/compliance/compliance-manager.ts +87 -0
  28. package/src/compliance/conditional-threshold.ts +379 -0
  29. package/src/compliance/conditional.ts +382 -0
  30. package/src/compliance/derivation.ts +489 -0
  31. package/src/compliance/index.ts +50 -8
  32. package/src/compliance/pdf.ts +365 -0
  33. package/src/compliance/reports.ts +644 -0
  34. package/src/compliance/threshold.ts +529 -0
  35. package/src/compliance/types.ts +223 -0
  36. package/src/cosmos/ibc-stealth.ts +825 -0
  37. package/src/cosmos/index.ts +83 -0
  38. package/src/cosmos/stealth.ts +487 -0
  39. package/src/errors.ts +8 -0
  40. package/src/index.ts +80 -1
  41. package/src/move/aptos.ts +369 -0
  42. package/src/move/index.ts +35 -0
  43. package/src/move/sui.ts +367 -0
  44. package/src/oracle/types.ts +8 -0
  45. package/src/settlement/backends/direct-chain.ts +8 -0
  46. package/src/stealth.ts +3 -3
  47. package/src/validation.ts +42 -1
  48. package/src/wallet/aptos/adapter.ts +422 -0
  49. package/src/wallet/aptos/index.ts +10 -0
  50. package/src/wallet/aptos/mock.ts +410 -0
  51. package/src/wallet/aptos/types.ts +278 -0
  52. package/src/wallet/bitcoin/adapter.ts +470 -0
  53. package/src/wallet/bitcoin/index.ts +38 -0
  54. package/src/wallet/bitcoin/mock.ts +516 -0
  55. package/src/wallet/bitcoin/types.ts +274 -0
  56. package/src/wallet/cosmos/adapter.ts +484 -0
  57. package/src/wallet/cosmos/index.ts +63 -0
  58. package/src/wallet/cosmos/mock.ts +596 -0
  59. package/src/wallet/cosmos/types.ts +462 -0
  60. package/src/wallet/index.ts +127 -0
  61. package/src/wallet/sui/adapter.ts +471 -0
  62. package/src/wallet/sui/index.ts +10 -0
  63. package/src/wallet/sui/mock.ts +439 -0
  64. package/src/wallet/sui/types.ts +245 -0
package/dist/index.mjs CHANGED
@@ -1,8 +1,15 @@
1
1
  import {
2
2
  ATTESTATION_VERSION,
3
+ AptosStealthService,
4
+ AuditorKeyDerivation,
5
+ AuditorType,
3
6
  BaseWalletAdapter,
4
7
  CHAIN_NUMERIC_IDS,
8
+ CHAIN_PREFIXES,
5
9
  ComplianceManager,
10
+ ComplianceReporter,
11
+ ConditionalDisclosure,
12
+ CosmosStealthService,
6
13
  DEFAULT_THRESHOLD,
7
14
  DEFAULT_TOTAL_ORACLES,
8
15
  DerivationPath,
@@ -44,6 +51,7 @@ import {
44
51
  SmartRouter,
45
52
  SolanaWalletAdapter,
46
53
  SwapStatus,
54
+ ThresholdViewingKey,
47
55
  Treasury,
48
56
  TrezorWalletAdapter,
49
57
  WalletError,
@@ -57,16 +65,20 @@ import {
57
65
  addBlindings,
58
66
  addCommitments,
59
67
  addOracle,
68
+ aptosAddressToAuthKey,
60
69
  attachProofs,
61
70
  base58ToHex,
62
71
  bytesToHex,
72
+ checkAptosStealthAddress,
63
73
  checkEd25519StealthAddress,
64
74
  checkStealthAddress,
65
75
  commit,
66
76
  commitZero,
67
77
  computeAttestationHash,
78
+ computeTweakedKey,
68
79
  createCommitment,
69
80
  createEthereumAdapter,
81
+ createKeySpendOnlyOutput,
70
82
  createLedgerAdapter,
71
83
  createMockEthereumAdapter,
72
84
  createMockEthereumProvider,
@@ -85,6 +97,7 @@ import {
85
97
  createShieldedPayment,
86
98
  createSmartRouter,
87
99
  createSolanaAdapter,
100
+ createTaprootOutput,
88
101
  createTrezorAdapter,
89
102
  createWalletFactory,
90
103
  createZcashClient,
@@ -92,8 +105,10 @@ import {
92
105
  createZcashShieldedService,
93
106
  createZcashSwapService,
94
107
  decodeStealthMetaAddress,
108
+ decodeTaprootAddress,
95
109
  decryptMemo,
96
110
  decryptWithViewing,
111
+ deriveAptosStealthPrivateKey,
97
112
  deriveEd25519StealthPrivateKey,
98
113
  deriveOracleId,
99
114
  deriveStealthPrivateKey,
@@ -103,6 +118,7 @@ import {
103
118
  deserializePayment,
104
119
  detectEthereumWallets,
105
120
  detectSolanaWallets,
121
+ ed25519PublicKeyToAptosAddress,
106
122
  ed25519PublicKeyToNearAddress,
107
123
  ed25519PublicKeyToSolanaAddress,
108
124
  encodeStealthMetaAddress,
@@ -111,10 +127,14 @@ import {
111
127
  formatStablecoinAmount,
112
128
  fromHex,
113
129
  fromStablecoinUnits,
130
+ generateAptosStealthAddress,
114
131
  generateBlinding,
132
+ generateCosmosStealthAddress,
133
+ generateCosmosStealthMetaAddress,
115
134
  generateEd25519StealthAddress,
116
135
  generateEd25519StealthMetaAddress,
117
136
  generateIntentId,
137
+ generatePdfReport,
118
138
  generateRandomBytes,
119
139
  generateStealthAddress,
120
140
  generateStealthMetaAddress,
@@ -140,6 +160,7 @@ import {
140
160
  getStablecoinsForChain,
141
161
  getSupportedStablecoins,
142
162
  getTimeRemaining,
163
+ getXOnlyPublicKey,
143
164
  hasEnoughOracles,
144
165
  hasRequiredProofs,
145
166
  hash,
@@ -155,8 +176,10 @@ import {
155
176
  isStablecoin,
156
177
  isStablecoinOnChain,
157
178
  isValidAmount,
179
+ isValidAptosAddress,
158
180
  isValidChainId,
159
181
  isValidCompressedPublicKey,
182
+ isValidCosmosAddress,
160
183
  isValidEd25519PublicKey,
161
184
  isValidHex,
162
185
  isValidHexLength,
@@ -168,12 +191,17 @@ import {
168
191
  isValidSlippage,
169
192
  isValidSolanaAddress,
170
193
  isValidStealthMetaAddress,
194
+ isValidTaprootAddress,
171
195
  nearAddressToEd25519PublicKey,
172
196
  normalizeAddress,
173
197
  notConnectedError,
174
198
  publicKeyToEthAddress,
175
199
  registerWallet,
176
200
  removeOracle,
201
+ schnorrSign,
202
+ schnorrSignHex,
203
+ schnorrVerify,
204
+ schnorrVerifyHex,
177
205
  secureWipe,
178
206
  secureWipeAll,
179
207
  serializeAttestationMessage,
@@ -182,6 +210,7 @@ import {
182
210
  signAttestationMessage,
183
211
  solanaAddressToEd25519PublicKey,
184
212
  solanaPublicKeyToHex,
213
+ stealthKeyToCosmosAddress,
185
214
  subtractBlindings,
186
215
  subtractCommitments,
187
216
  supportsSharedArrayBuffer,
@@ -190,6 +219,7 @@ import {
190
219
  supportsWebHID,
191
220
  supportsWebUSB,
192
221
  supportsWebWorkers,
222
+ taprootAddress,
193
223
  toHex,
194
224
  toStablecoinUnits,
195
225
  trackIntent,
@@ -208,7 +238,7 @@ import {
208
238
  walletRegistry,
209
239
  withSecureBuffer,
210
240
  withSecureBufferSync
211
- } from "./chunk-EU4UEWWG.mjs";
241
+ } from "./chunk-DMHBKRWV.mjs";
212
242
  import {
213
243
  CryptoError,
214
244
  EncryptionNotImplementedError,
@@ -224,12 +254,19 @@ import {
224
254
  hasErrorCode,
225
255
  isSIPError,
226
256
  wrapError
227
- } from "./chunk-UHZKNGIT.mjs";
257
+ } from "./chunk-HGU6HZRC.mjs";
228
258
  export {
229
259
  ATTESTATION_VERSION,
260
+ AptosStealthService,
261
+ AuditorKeyDerivation,
262
+ AuditorType,
230
263
  BaseWalletAdapter,
231
264
  CHAIN_NUMERIC_IDS,
265
+ CHAIN_PREFIXES as COSMOS_CHAIN_PREFIXES,
232
266
  ComplianceManager,
267
+ ComplianceReporter,
268
+ ConditionalDisclosure,
269
+ CosmosStealthService,
233
270
  CryptoError,
234
271
  DEFAULT_THRESHOLD,
235
272
  DEFAULT_TOTAL_ORACLES,
@@ -280,6 +317,7 @@ export {
280
317
  SmartRouter,
281
318
  SolanaWalletAdapter,
282
319
  SwapStatus,
320
+ ThresholdViewingKey,
283
321
  Treasury,
284
322
  TrezorWalletAdapter,
285
323
  ValidationError,
@@ -294,17 +332,21 @@ export {
294
332
  addBlindings,
295
333
  addCommitments,
296
334
  addOracle,
335
+ aptosAddressToAuthKey,
297
336
  attachProofs,
298
337
  base58ToHex,
299
338
  bytesToHex as browserBytesToHex,
300
339
  hexToBytes as browserHexToBytes,
340
+ checkAptosStealthAddress,
301
341
  checkEd25519StealthAddress,
302
342
  checkStealthAddress,
303
343
  commit,
304
344
  commitZero,
305
345
  computeAttestationHash,
346
+ computeTweakedKey,
306
347
  createCommitment,
307
348
  createEthereumAdapter,
349
+ createKeySpendOnlyOutput,
308
350
  createLedgerAdapter,
309
351
  createMockEthereumAdapter,
310
352
  createMockEthereumProvider,
@@ -323,6 +365,7 @@ export {
323
365
  createShieldedPayment,
324
366
  createSmartRouter,
325
367
  createSolanaAdapter,
368
+ createTaprootOutput,
326
369
  createTrezorAdapter,
327
370
  createWalletFactory,
328
371
  createZcashClient,
@@ -330,8 +373,10 @@ export {
330
373
  createZcashShieldedService,
331
374
  createZcashSwapService,
332
375
  decodeStealthMetaAddress,
376
+ decodeTaprootAddress,
333
377
  decryptMemo,
334
378
  decryptWithViewing,
379
+ deriveAptosStealthPrivateKey,
335
380
  deriveEd25519StealthPrivateKey,
336
381
  deriveOracleId,
337
382
  deriveStealthPrivateKey,
@@ -341,6 +386,7 @@ export {
341
386
  deserializePayment,
342
387
  detectEthereumWallets,
343
388
  detectSolanaWallets,
389
+ ed25519PublicKeyToAptosAddress,
344
390
  ed25519PublicKeyToNearAddress,
345
391
  ed25519PublicKeyToSolanaAddress,
346
392
  encodeStealthMetaAddress,
@@ -349,10 +395,14 @@ export {
349
395
  formatStablecoinAmount,
350
396
  fromHex,
351
397
  fromStablecoinUnits,
398
+ generateAptosStealthAddress,
352
399
  generateBlinding,
400
+ generateCosmosStealthAddress,
401
+ generateCosmosStealthMetaAddress,
353
402
  generateEd25519StealthAddress,
354
403
  generateEd25519StealthMetaAddress,
355
404
  generateIntentId,
405
+ generatePdfReport,
356
406
  generateRandomBytes,
357
407
  generateStealthAddress,
358
408
  generateStealthMetaAddress,
@@ -379,6 +429,7 @@ export {
379
429
  getStablecoinsForChain,
380
430
  getSupportedStablecoins,
381
431
  getTimeRemaining,
432
+ getXOnlyPublicKey,
382
433
  hasEnoughOracles,
383
434
  hasErrorCode,
384
435
  hasRequiredProofs,
@@ -395,8 +446,10 @@ export {
395
446
  isStablecoin,
396
447
  isStablecoinOnChain,
397
448
  isValidAmount,
449
+ isValidAptosAddress,
398
450
  isValidChainId,
399
451
  isValidCompressedPublicKey,
452
+ isValidCosmosAddress,
400
453
  isValidEd25519PublicKey,
401
454
  isValidHex,
402
455
  isValidHexLength,
@@ -408,12 +461,17 @@ export {
408
461
  isValidSlippage,
409
462
  isValidSolanaAddress,
410
463
  isValidStealthMetaAddress,
464
+ isValidTaprootAddress,
411
465
  nearAddressToEd25519PublicKey,
412
466
  normalizeAddress,
413
467
  notConnectedError,
414
468
  publicKeyToEthAddress,
415
469
  registerWallet,
416
470
  removeOracle,
471
+ schnorrSign,
472
+ schnorrSignHex,
473
+ schnorrVerify,
474
+ schnorrVerifyHex,
417
475
  secureWipe,
418
476
  secureWipeAll,
419
477
  serializeAttestationMessage,
@@ -422,6 +480,7 @@ export {
422
480
  signAttestationMessage,
423
481
  solanaAddressToEd25519PublicKey,
424
482
  solanaPublicKeyToHex,
483
+ stealthKeyToCosmosAddress,
425
484
  subtractBlindings,
426
485
  subtractCommitments,
427
486
  supportsSharedArrayBuffer,
@@ -430,6 +489,7 @@ export {
430
489
  supportsWebHID,
431
490
  supportsWebUSB,
432
491
  supportsWebWorkers,
492
+ taprootAddress,
433
493
  toHex,
434
494
  toStablecoinUnits,
435
495
  trackIntent,
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  ProofError,
8
8
  ProofGenerationError
9
- } from "../chunk-UHZKNGIT.mjs";
9
+ } from "../chunk-HGU6HZRC.mjs";
10
10
 
11
11
  // src/proofs/noir.ts
12
12
  import { Noir } from "@noir-lang/noir_js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sip-protocol/sdk",
3
- "version": "0.3.2",
3
+ "version": "0.5.0",
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",
@@ -54,6 +54,7 @@
54
54
  "@noble/hashes": "^1.3.3",
55
55
  "@noir-lang/noir_js": "^1.0.0-beta.16",
56
56
  "@noir-lang/types": "1.0.0-beta.16",
57
+ "@scure/base": "^2.0.0",
57
58
  "@sip-protocol/types": "^0.1.1"
58
59
  },
59
60
  "devDependencies": {
@@ -200,6 +200,14 @@ const CHAIN_BLOCKCHAIN_MAP: Record<ChainId, string> = {
200
200
  optimism: 'evm',
201
201
  base: 'evm',
202
202
  bitcoin: 'bitcoin',
203
+ aptos: 'aptos',
204
+ sui: 'sui',
205
+ cosmos: 'cosmos',
206
+ osmosis: 'cosmos',
207
+ injective: 'cosmos',
208
+ celestia: 'cosmos',
209
+ sei: 'cosmos',
210
+ dydx: 'cosmos',
203
211
  }
204
212
 
205
213
  /**
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Bitcoin Module
3
+ *
4
+ * Provides Bitcoin privacy features including:
5
+ * - BIP-340 Schnorr signatures
6
+ * - BIP-341 Taproot outputs
7
+ * - BIP-352 Silent Payments
8
+ */
9
+
10
+ export {
11
+ // BIP-340 Schnorr signatures
12
+ schnorrSign,
13
+ schnorrVerify,
14
+ schnorrSignHex,
15
+ schnorrVerifyHex,
16
+ // BIP-341 Taproot
17
+ getXOnlyPublicKey,
18
+ computeTweakedKey,
19
+ createTaprootOutput,
20
+ createKeySpendOnlyOutput,
21
+ taprootAddress,
22
+ decodeTaprootAddress,
23
+ isValidTaprootAddress,
24
+ } from './taproot'
25
+
26
+ export type {
27
+ TaprootOutput,
28
+ TapScript,
29
+ BitcoinNetwork,
30
+ } from './taproot'
31
+
32
+ export {
33
+ // BIP-352 Silent Payments
34
+ generateSilentPaymentAddress,
35
+ parseSilentPaymentAddress,
36
+ createSilentPaymentOutput,
37
+ scanForPayments,
38
+ deriveSpendingKey,
39
+ isValidSilentPaymentAddress,
40
+ hexToPrivateKey,
41
+ hexToPublicKey,
42
+ } from './silent-payments'
43
+
44
+ export type {
45
+ SilentPaymentAddress,
46
+ ParsedSilentPaymentAddress,
47
+ SenderInput,
48
+ SilentPaymentOutput,
49
+ OutputToScan,
50
+ ReceivedPayment,
51
+ } from './silent-payments'