@sip-protocol/sdk 0.3.2 → 0.4.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.
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1019 -146
- package/dist/browser.mjs +49 -1
- package/dist/chunk-AOZIY3GU.mjs +12995 -0
- package/dist/chunk-BCLIX5T2.mjs +12940 -0
- package/dist/chunk-FKXPHKYD.mjs +12955 -0
- package/dist/chunk-OPQ2GQIO.mjs +13013 -0
- package/dist/index-BcWNakUD.d.ts +7990 -0
- package/dist/index-BsKY3Hr0.d.mts +7990 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +990 -117
- package/dist/index.mjs +49 -1
- package/package.json +2 -1
- package/src/adapters/near-intents.ts +8 -0
- package/src/bitcoin/index.ts +51 -0
- package/src/bitcoin/silent-payments.ts +865 -0
- package/src/bitcoin/taproot.ts +590 -0
- package/src/cosmos/ibc-stealth.ts +825 -0
- package/src/cosmos/index.ts +83 -0
- package/src/cosmos/stealth.ts +487 -0
- package/src/index.ts +51 -0
- package/src/move/aptos.ts +369 -0
- package/src/move/index.ts +35 -0
- package/src/move/sui.ts +367 -0
- package/src/oracle/types.ts +8 -0
- package/src/settlement/backends/direct-chain.ts +8 -0
- package/src/stealth.ts +3 -3
- package/src/validation.ts +42 -1
- package/src/wallet/aptos/adapter.ts +422 -0
- package/src/wallet/aptos/index.ts +10 -0
- package/src/wallet/aptos/mock.ts +410 -0
- package/src/wallet/aptos/types.ts +278 -0
- package/src/wallet/bitcoin/adapter.ts +470 -0
- package/src/wallet/bitcoin/index.ts +38 -0
- package/src/wallet/bitcoin/mock.ts +516 -0
- package/src/wallet/bitcoin/types.ts +274 -0
- package/src/wallet/cosmos/adapter.ts +484 -0
- package/src/wallet/cosmos/index.ts +63 -0
- package/src/wallet/cosmos/mock.ts +596 -0
- package/src/wallet/cosmos/types.ts +462 -0
- package/src/wallet/index.ts +127 -0
- package/src/wallet/sui/adapter.ts +471 -0
- package/src/wallet/sui/index.ts +10 -0
- package/src/wallet/sui/mock.ts +439 -0
- package/src/wallet/sui/types.ts +245 -0
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ATTESTATION_VERSION,
|
|
3
|
+
AptosStealthService,
|
|
3
4
|
BaseWalletAdapter,
|
|
4
5
|
CHAIN_NUMERIC_IDS,
|
|
6
|
+
CHAIN_PREFIXES,
|
|
5
7
|
ComplianceManager,
|
|
8
|
+
CosmosStealthService,
|
|
6
9
|
DEFAULT_THRESHOLD,
|
|
7
10
|
DEFAULT_TOTAL_ORACLES,
|
|
8
11
|
DerivationPath,
|
|
@@ -57,16 +60,20 @@ import {
|
|
|
57
60
|
addBlindings,
|
|
58
61
|
addCommitments,
|
|
59
62
|
addOracle,
|
|
63
|
+
aptosAddressToAuthKey,
|
|
60
64
|
attachProofs,
|
|
61
65
|
base58ToHex,
|
|
62
66
|
bytesToHex,
|
|
67
|
+
checkAptosStealthAddress,
|
|
63
68
|
checkEd25519StealthAddress,
|
|
64
69
|
checkStealthAddress,
|
|
65
70
|
commit,
|
|
66
71
|
commitZero,
|
|
67
72
|
computeAttestationHash,
|
|
73
|
+
computeTweakedKey,
|
|
68
74
|
createCommitment,
|
|
69
75
|
createEthereumAdapter,
|
|
76
|
+
createKeySpendOnlyOutput,
|
|
70
77
|
createLedgerAdapter,
|
|
71
78
|
createMockEthereumAdapter,
|
|
72
79
|
createMockEthereumProvider,
|
|
@@ -85,6 +92,7 @@ import {
|
|
|
85
92
|
createShieldedPayment,
|
|
86
93
|
createSmartRouter,
|
|
87
94
|
createSolanaAdapter,
|
|
95
|
+
createTaprootOutput,
|
|
88
96
|
createTrezorAdapter,
|
|
89
97
|
createWalletFactory,
|
|
90
98
|
createZcashClient,
|
|
@@ -92,8 +100,10 @@ import {
|
|
|
92
100
|
createZcashShieldedService,
|
|
93
101
|
createZcashSwapService,
|
|
94
102
|
decodeStealthMetaAddress,
|
|
103
|
+
decodeTaprootAddress,
|
|
95
104
|
decryptMemo,
|
|
96
105
|
decryptWithViewing,
|
|
106
|
+
deriveAptosStealthPrivateKey,
|
|
97
107
|
deriveEd25519StealthPrivateKey,
|
|
98
108
|
deriveOracleId,
|
|
99
109
|
deriveStealthPrivateKey,
|
|
@@ -103,6 +113,7 @@ import {
|
|
|
103
113
|
deserializePayment,
|
|
104
114
|
detectEthereumWallets,
|
|
105
115
|
detectSolanaWallets,
|
|
116
|
+
ed25519PublicKeyToAptosAddress,
|
|
106
117
|
ed25519PublicKeyToNearAddress,
|
|
107
118
|
ed25519PublicKeyToSolanaAddress,
|
|
108
119
|
encodeStealthMetaAddress,
|
|
@@ -111,7 +122,10 @@ import {
|
|
|
111
122
|
formatStablecoinAmount,
|
|
112
123
|
fromHex,
|
|
113
124
|
fromStablecoinUnits,
|
|
125
|
+
generateAptosStealthAddress,
|
|
114
126
|
generateBlinding,
|
|
127
|
+
generateCosmosStealthAddress,
|
|
128
|
+
generateCosmosStealthMetaAddress,
|
|
115
129
|
generateEd25519StealthAddress,
|
|
116
130
|
generateEd25519StealthMetaAddress,
|
|
117
131
|
generateIntentId,
|
|
@@ -140,6 +154,7 @@ import {
|
|
|
140
154
|
getStablecoinsForChain,
|
|
141
155
|
getSupportedStablecoins,
|
|
142
156
|
getTimeRemaining,
|
|
157
|
+
getXOnlyPublicKey,
|
|
143
158
|
hasEnoughOracles,
|
|
144
159
|
hasRequiredProofs,
|
|
145
160
|
hash,
|
|
@@ -155,8 +170,10 @@ import {
|
|
|
155
170
|
isStablecoin,
|
|
156
171
|
isStablecoinOnChain,
|
|
157
172
|
isValidAmount,
|
|
173
|
+
isValidAptosAddress,
|
|
158
174
|
isValidChainId,
|
|
159
175
|
isValidCompressedPublicKey,
|
|
176
|
+
isValidCosmosAddress,
|
|
160
177
|
isValidEd25519PublicKey,
|
|
161
178
|
isValidHex,
|
|
162
179
|
isValidHexLength,
|
|
@@ -168,12 +185,17 @@ import {
|
|
|
168
185
|
isValidSlippage,
|
|
169
186
|
isValidSolanaAddress,
|
|
170
187
|
isValidStealthMetaAddress,
|
|
188
|
+
isValidTaprootAddress,
|
|
171
189
|
nearAddressToEd25519PublicKey,
|
|
172
190
|
normalizeAddress,
|
|
173
191
|
notConnectedError,
|
|
174
192
|
publicKeyToEthAddress,
|
|
175
193
|
registerWallet,
|
|
176
194
|
removeOracle,
|
|
195
|
+
schnorrSign,
|
|
196
|
+
schnorrSignHex,
|
|
197
|
+
schnorrVerify,
|
|
198
|
+
schnorrVerifyHex,
|
|
177
199
|
secureWipe,
|
|
178
200
|
secureWipeAll,
|
|
179
201
|
serializeAttestationMessage,
|
|
@@ -182,6 +204,7 @@ import {
|
|
|
182
204
|
signAttestationMessage,
|
|
183
205
|
solanaAddressToEd25519PublicKey,
|
|
184
206
|
solanaPublicKeyToHex,
|
|
207
|
+
stealthKeyToCosmosAddress,
|
|
185
208
|
subtractBlindings,
|
|
186
209
|
subtractCommitments,
|
|
187
210
|
supportsSharedArrayBuffer,
|
|
@@ -190,6 +213,7 @@ import {
|
|
|
190
213
|
supportsWebHID,
|
|
191
214
|
supportsWebUSB,
|
|
192
215
|
supportsWebWorkers,
|
|
216
|
+
taprootAddress,
|
|
193
217
|
toHex,
|
|
194
218
|
toStablecoinUnits,
|
|
195
219
|
trackIntent,
|
|
@@ -208,7 +232,7 @@ import {
|
|
|
208
232
|
walletRegistry,
|
|
209
233
|
withSecureBuffer,
|
|
210
234
|
withSecureBufferSync
|
|
211
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-OPQ2GQIO.mjs";
|
|
212
236
|
import {
|
|
213
237
|
CryptoError,
|
|
214
238
|
EncryptionNotImplementedError,
|
|
@@ -227,9 +251,12 @@ import {
|
|
|
227
251
|
} from "./chunk-UHZKNGIT.mjs";
|
|
228
252
|
export {
|
|
229
253
|
ATTESTATION_VERSION,
|
|
254
|
+
AptosStealthService,
|
|
230
255
|
BaseWalletAdapter,
|
|
231
256
|
CHAIN_NUMERIC_IDS,
|
|
257
|
+
CHAIN_PREFIXES as COSMOS_CHAIN_PREFIXES,
|
|
232
258
|
ComplianceManager,
|
|
259
|
+
CosmosStealthService,
|
|
233
260
|
CryptoError,
|
|
234
261
|
DEFAULT_THRESHOLD,
|
|
235
262
|
DEFAULT_TOTAL_ORACLES,
|
|
@@ -294,17 +321,21 @@ export {
|
|
|
294
321
|
addBlindings,
|
|
295
322
|
addCommitments,
|
|
296
323
|
addOracle,
|
|
324
|
+
aptosAddressToAuthKey,
|
|
297
325
|
attachProofs,
|
|
298
326
|
base58ToHex,
|
|
299
327
|
bytesToHex as browserBytesToHex,
|
|
300
328
|
hexToBytes as browserHexToBytes,
|
|
329
|
+
checkAptosStealthAddress,
|
|
301
330
|
checkEd25519StealthAddress,
|
|
302
331
|
checkStealthAddress,
|
|
303
332
|
commit,
|
|
304
333
|
commitZero,
|
|
305
334
|
computeAttestationHash,
|
|
335
|
+
computeTweakedKey,
|
|
306
336
|
createCommitment,
|
|
307
337
|
createEthereumAdapter,
|
|
338
|
+
createKeySpendOnlyOutput,
|
|
308
339
|
createLedgerAdapter,
|
|
309
340
|
createMockEthereumAdapter,
|
|
310
341
|
createMockEthereumProvider,
|
|
@@ -323,6 +354,7 @@ export {
|
|
|
323
354
|
createShieldedPayment,
|
|
324
355
|
createSmartRouter,
|
|
325
356
|
createSolanaAdapter,
|
|
357
|
+
createTaprootOutput,
|
|
326
358
|
createTrezorAdapter,
|
|
327
359
|
createWalletFactory,
|
|
328
360
|
createZcashClient,
|
|
@@ -330,8 +362,10 @@ export {
|
|
|
330
362
|
createZcashShieldedService,
|
|
331
363
|
createZcashSwapService,
|
|
332
364
|
decodeStealthMetaAddress,
|
|
365
|
+
decodeTaprootAddress,
|
|
333
366
|
decryptMemo,
|
|
334
367
|
decryptWithViewing,
|
|
368
|
+
deriveAptosStealthPrivateKey,
|
|
335
369
|
deriveEd25519StealthPrivateKey,
|
|
336
370
|
deriveOracleId,
|
|
337
371
|
deriveStealthPrivateKey,
|
|
@@ -341,6 +375,7 @@ export {
|
|
|
341
375
|
deserializePayment,
|
|
342
376
|
detectEthereumWallets,
|
|
343
377
|
detectSolanaWallets,
|
|
378
|
+
ed25519PublicKeyToAptosAddress,
|
|
344
379
|
ed25519PublicKeyToNearAddress,
|
|
345
380
|
ed25519PublicKeyToSolanaAddress,
|
|
346
381
|
encodeStealthMetaAddress,
|
|
@@ -349,7 +384,10 @@ export {
|
|
|
349
384
|
formatStablecoinAmount,
|
|
350
385
|
fromHex,
|
|
351
386
|
fromStablecoinUnits,
|
|
387
|
+
generateAptosStealthAddress,
|
|
352
388
|
generateBlinding,
|
|
389
|
+
generateCosmosStealthAddress,
|
|
390
|
+
generateCosmosStealthMetaAddress,
|
|
353
391
|
generateEd25519StealthAddress,
|
|
354
392
|
generateEd25519StealthMetaAddress,
|
|
355
393
|
generateIntentId,
|
|
@@ -379,6 +417,7 @@ export {
|
|
|
379
417
|
getStablecoinsForChain,
|
|
380
418
|
getSupportedStablecoins,
|
|
381
419
|
getTimeRemaining,
|
|
420
|
+
getXOnlyPublicKey,
|
|
382
421
|
hasEnoughOracles,
|
|
383
422
|
hasErrorCode,
|
|
384
423
|
hasRequiredProofs,
|
|
@@ -395,8 +434,10 @@ export {
|
|
|
395
434
|
isStablecoin,
|
|
396
435
|
isStablecoinOnChain,
|
|
397
436
|
isValidAmount,
|
|
437
|
+
isValidAptosAddress,
|
|
398
438
|
isValidChainId,
|
|
399
439
|
isValidCompressedPublicKey,
|
|
440
|
+
isValidCosmosAddress,
|
|
400
441
|
isValidEd25519PublicKey,
|
|
401
442
|
isValidHex,
|
|
402
443
|
isValidHexLength,
|
|
@@ -408,12 +449,17 @@ export {
|
|
|
408
449
|
isValidSlippage,
|
|
409
450
|
isValidSolanaAddress,
|
|
410
451
|
isValidStealthMetaAddress,
|
|
452
|
+
isValidTaprootAddress,
|
|
411
453
|
nearAddressToEd25519PublicKey,
|
|
412
454
|
normalizeAddress,
|
|
413
455
|
notConnectedError,
|
|
414
456
|
publicKeyToEthAddress,
|
|
415
457
|
registerWallet,
|
|
416
458
|
removeOracle,
|
|
459
|
+
schnorrSign,
|
|
460
|
+
schnorrSignHex,
|
|
461
|
+
schnorrVerify,
|
|
462
|
+
schnorrVerifyHex,
|
|
417
463
|
secureWipe,
|
|
418
464
|
secureWipeAll,
|
|
419
465
|
serializeAttestationMessage,
|
|
@@ -422,6 +468,7 @@ export {
|
|
|
422
468
|
signAttestationMessage,
|
|
423
469
|
solanaAddressToEd25519PublicKey,
|
|
424
470
|
solanaPublicKeyToHex,
|
|
471
|
+
stealthKeyToCosmosAddress,
|
|
425
472
|
subtractBlindings,
|
|
426
473
|
subtractCommitments,
|
|
427
474
|
supportsSharedArrayBuffer,
|
|
@@ -430,6 +477,7 @@ export {
|
|
|
430
477
|
supportsWebHID,
|
|
431
478
|
supportsWebUSB,
|
|
432
479
|
supportsWebWorkers,
|
|
480
|
+
taprootAddress,
|
|
433
481
|
toHex,
|
|
434
482
|
toStablecoinUnits,
|
|
435
483
|
trackIntent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sip-protocol/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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'
|