@sip-protocol/sdk 0.6.0 → 0.6.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/README.md +58 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +2752 -448
- package/dist/browser.mjs +31 -1
- package/dist/chunk-7QZPORY5.mjs +15604 -0
- package/dist/chunk-C2NPCUAJ.mjs +17010 -0
- package/dist/chunk-FCVLFUIC.mjs +16699 -0
- package/dist/chunk-G5UHXECN.mjs +16340 -0
- package/dist/chunk-GEDEIZHJ.mjs +16798 -0
- package/dist/chunk-GOOEOAMV.mjs +17026 -0
- package/dist/chunk-MTNYSNR7.mjs +16269 -0
- package/dist/chunk-O5PIB2EA.mjs +16698 -0
- package/dist/chunk-PCFM7FQO.mjs +17010 -0
- package/dist/chunk-QK464ARC.mjs +16946 -0
- package/dist/chunk-VNBMNGC3.mjs +16698 -0
- package/dist/chunk-W5TUELDQ.mjs +16947 -0
- package/dist/index-CD_zShu-.d.ts +10870 -0
- package/dist/index-CQBYdLYy.d.mts +10976 -0
- package/dist/index-Cg9TYEPv.d.mts +11321 -0
- package/dist/index-CqZJOO8C.d.mts +11323 -0
- package/dist/index-CywN9Bnp.d.ts +11321 -0
- package/dist/index-DHy5ZjCD.d.ts +10976 -0
- package/dist/index-DfsVsmxu.d.ts +11323 -0
- package/dist/index-ObjwyVDX.d.mts +10870 -0
- package/dist/index-m0xbSfmT.d.mts +11318 -0
- package/dist/index-rWLEgvhN.d.ts +11318 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2737 -427
- package/dist/index.mjs +31 -1
- package/dist/noir-DKfEzWy9.d.mts +482 -0
- package/dist/noir-DKfEzWy9.d.ts +482 -0
- package/dist/proofs/noir.d.mts +1 -1
- package/dist/proofs/noir.d.ts +1 -1
- package/dist/proofs/noir.js +12 -3
- package/dist/proofs/noir.mjs +12 -3
- package/package.json +16 -14
- package/src/adapters/near-intents.ts +13 -3
- package/src/auction/index.ts +20 -0
- package/src/auction/sealed-bid.ts +1037 -0
- package/src/compliance/derivation.ts +13 -3
- package/src/compliance/reports.ts +5 -4
- package/src/cosmos/ibc-stealth.ts +2 -2
- package/src/cosmos/stealth.ts +2 -2
- package/src/governance/index.ts +19 -0
- package/src/governance/private-vote.ts +1116 -0
- package/src/index.ts +50 -2
- package/src/intent.ts +145 -8
- package/src/nft/index.ts +27 -0
- package/src/nft/private-nft.ts +811 -0
- package/src/proofs/browser-utils.ts +1 -7
- package/src/proofs/noir.ts +34 -7
- package/src/settlement/backends/direct-chain.ts +14 -3
- package/src/stealth.ts +31 -13
- package/src/types/browser.d.ts +67 -0
- package/src/validation.ts +4 -2
- package/src/wallet/bitcoin/adapter.ts +159 -15
- package/src/wallet/bitcoin/types.ts +340 -15
- package/src/wallet/cosmos/mock.ts +16 -12
- package/src/wallet/hardware/ledger.ts +82 -12
- package/src/wallet/hardware/types.ts +2 -0
- package/LICENSE +0 -21
|
@@ -122,10 +122,20 @@ export interface DeriveMultipleParams {
|
|
|
122
122
|
*/
|
|
123
123
|
export class AuditorKeyDerivation {
|
|
124
124
|
/**
|
|
125
|
-
* SIP Protocol coin type
|
|
125
|
+
* SIP Protocol coin type for BIP-44 derivation
|
|
126
126
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
127
|
+
* This uses 1234 as SIP Protocol's internal coin type identifier.
|
|
128
|
+
*
|
|
129
|
+
* **Registration Status**: Not registered with SLIP-44
|
|
130
|
+
*
|
|
131
|
+
* **Why this is acceptable**:
|
|
132
|
+
* - SIP viewing keys are protocol-specific, not wallet-portable
|
|
133
|
+
* - Keys derived here are for auditor access, not user funds
|
|
134
|
+
* - SLIP-44 registration is for coin types that need hardware wallet support
|
|
135
|
+
*
|
|
136
|
+
* **Future consideration**: If hardware wallet integration for SIP auditor keys
|
|
137
|
+
* is desired, submit a PR to https://github.com/satoshilabs/slips to register
|
|
138
|
+
* an official coin type. Current value (1234) is in the unregistered range.
|
|
129
139
|
*/
|
|
130
140
|
static readonly COIN_TYPE = 1234
|
|
131
141
|
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
FINCENExport,
|
|
25
25
|
FINCENTransaction,
|
|
26
26
|
CSVExport,
|
|
27
|
+
Jurisdiction,
|
|
27
28
|
} from './types'
|
|
28
29
|
import { generatePdfReport } from './pdf'
|
|
29
30
|
|
|
@@ -533,7 +534,7 @@ export class ComplianceReporter {
|
|
|
533
534
|
private exportToFATF(
|
|
534
535
|
reportId: string,
|
|
535
536
|
transactions: DecryptedTransaction[],
|
|
536
|
-
jurisdiction:
|
|
537
|
+
jurisdiction: Jurisdiction,
|
|
537
538
|
currency: string
|
|
538
539
|
): FATFExport {
|
|
539
540
|
const fatfTransactions: FATFTransaction[] = transactions.map((tx) => ({
|
|
@@ -548,7 +549,7 @@ export class ComplianceReporter {
|
|
|
548
549
|
return {
|
|
549
550
|
reportId,
|
|
550
551
|
generatedAt: new Date().toISOString(),
|
|
551
|
-
jurisdiction
|
|
552
|
+
jurisdiction,
|
|
552
553
|
transactions: fatfTransactions,
|
|
553
554
|
}
|
|
554
555
|
}
|
|
@@ -612,7 +613,7 @@ export class ComplianceReporter {
|
|
|
612
613
|
private exportToCSV(
|
|
613
614
|
reportId: string,
|
|
614
615
|
transactions: DecryptedTransaction[],
|
|
615
|
-
jurisdiction:
|
|
616
|
+
jurisdiction: Jurisdiction,
|
|
616
617
|
currency: string
|
|
617
618
|
): CSVExport {
|
|
618
619
|
const headers = [
|
|
@@ -636,7 +637,7 @@ export class ComplianceReporter {
|
|
|
636
637
|
return {
|
|
637
638
|
reportId,
|
|
638
639
|
generatedAt: new Date().toISOString(),
|
|
639
|
-
jurisdiction
|
|
640
|
+
jurisdiction,
|
|
640
641
|
headers,
|
|
641
642
|
rows,
|
|
642
643
|
}
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
type CosmosStealthResult,
|
|
35
35
|
CHAIN_PREFIXES,
|
|
36
36
|
} from './stealth'
|
|
37
|
-
import type { HexString, StealthMetaAddress } from '@sip-protocol/types'
|
|
37
|
+
import type { HexString, StealthMetaAddress, ChainId } from '@sip-protocol/types'
|
|
38
38
|
import { ValidationError } from '../errors'
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -679,7 +679,7 @@ export class CosmosIBCStealthService {
|
|
|
679
679
|
|
|
680
680
|
const [, chain, spendingKey, viewingKey] = parts
|
|
681
681
|
return {
|
|
682
|
-
chain: chain as
|
|
682
|
+
chain: chain as ChainId,
|
|
683
683
|
spendingKey: spendingKey as HexString,
|
|
684
684
|
viewingKey: viewingKey as HexString,
|
|
685
685
|
}
|
package/src/cosmos/stealth.ts
CHANGED
|
@@ -32,6 +32,7 @@ import type {
|
|
|
32
32
|
StealthAddress,
|
|
33
33
|
StealthAddressRecovery,
|
|
34
34
|
HexString,
|
|
35
|
+
ChainId,
|
|
35
36
|
} from '@sip-protocol/types'
|
|
36
37
|
import { ValidationError } from '../errors'
|
|
37
38
|
|
|
@@ -118,12 +119,11 @@ export class CosmosStealthService {
|
|
|
118
119
|
const result = generateStealthMetaAddress('ethereum', label)
|
|
119
120
|
|
|
120
121
|
// Override chain with actual Cosmos chain ID
|
|
121
|
-
// Note: This is a workaround since the core types don't include Cosmos chains yet
|
|
122
122
|
return {
|
|
123
123
|
...result,
|
|
124
124
|
metaAddress: {
|
|
125
125
|
...result.metaAddress,
|
|
126
|
-
chain: chain as
|
|
126
|
+
chain: chain as ChainId,
|
|
127
127
|
},
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Governance module for SIP Protocol
|
|
3
|
+
*
|
|
4
|
+
* Provides private voting functionality for DAO governance
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
PrivateVoting,
|
|
9
|
+
createPrivateVoting,
|
|
10
|
+
} from './private-vote'
|
|
11
|
+
|
|
12
|
+
export type {
|
|
13
|
+
EncryptedVote,
|
|
14
|
+
RevealedVote,
|
|
15
|
+
CastVoteParams,
|
|
16
|
+
EncryptedTally,
|
|
17
|
+
TallyResult,
|
|
18
|
+
DecryptionShare,
|
|
19
|
+
} from './private-vote'
|