@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.
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +2881 -295
- package/dist/browser.mjs +62 -2
- package/dist/chunk-AOZIY3GU.mjs +12995 -0
- package/dist/chunk-BCLIX5T2.mjs +12940 -0
- package/dist/chunk-DMHBKRWV.mjs +14712 -0
- package/dist/chunk-FKXPHKYD.mjs +12955 -0
- package/dist/chunk-HGU6HZRC.mjs +231 -0
- package/dist/chunk-J4Q4NJ2U.mjs +13544 -0
- package/dist/chunk-OPQ2GQIO.mjs +13013 -0
- package/dist/chunk-W2B7T6WU.mjs +14714 -0
- package/dist/index-5jAdWMA-.d.ts +8973 -0
- package/dist/index-B9Vkpaao.d.mts +8973 -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 +2852 -266
- package/dist/index.mjs +62 -2
- package/dist/proofs/noir.mjs +1 -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/compliance/compliance-manager.ts +87 -0
- package/src/compliance/conditional-threshold.ts +379 -0
- package/src/compliance/conditional.ts +382 -0
- package/src/compliance/derivation.ts +489 -0
- package/src/compliance/index.ts +50 -8
- package/src/compliance/pdf.ts +365 -0
- package/src/compliance/reports.ts +644 -0
- package/src/compliance/threshold.ts +529 -0
- package/src/compliance/types.ts +223 -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/errors.ts +8 -0
- package/src/index.ts +80 -1
- 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
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance reporting types
|
|
3
|
+
*
|
|
4
|
+
* Types for audit report generation and transaction disclosure.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { EncryptedTransaction, ViewingKey } from '@sip-protocol/types'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Decrypted transaction data for audit reports
|
|
11
|
+
*/
|
|
12
|
+
export interface DecryptedTransaction {
|
|
13
|
+
/** Transaction ID */
|
|
14
|
+
id: string
|
|
15
|
+
/** Sender address */
|
|
16
|
+
sender: string
|
|
17
|
+
/** Recipient address */
|
|
18
|
+
recipient: string
|
|
19
|
+
/** Amount (as string to avoid serialization issues) */
|
|
20
|
+
amount: string
|
|
21
|
+
/** Transaction timestamp */
|
|
22
|
+
timestamp: number
|
|
23
|
+
/** Transaction hash (if available) */
|
|
24
|
+
txHash?: string
|
|
25
|
+
/** Additional metadata */
|
|
26
|
+
metadata?: Record<string, unknown>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Audit report structure
|
|
31
|
+
*/
|
|
32
|
+
export interface AuditReport {
|
|
33
|
+
/** Report ID */
|
|
34
|
+
reportId: string
|
|
35
|
+
/** Generation timestamp */
|
|
36
|
+
generatedAt: Date
|
|
37
|
+
/** Report period */
|
|
38
|
+
period: {
|
|
39
|
+
start: Date
|
|
40
|
+
end: Date
|
|
41
|
+
}
|
|
42
|
+
/** Decrypted transactions */
|
|
43
|
+
transactions: DecryptedTransaction[]
|
|
44
|
+
/** Summary statistics */
|
|
45
|
+
summary: {
|
|
46
|
+
/** Total volume (sum of all amounts as bigint) */
|
|
47
|
+
totalVolume: bigint
|
|
48
|
+
/** Number of transactions */
|
|
49
|
+
transactionCount: number
|
|
50
|
+
/** Number of unique counterparties */
|
|
51
|
+
uniqueCounterparties: number
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Parameters for generating an audit report
|
|
57
|
+
*/
|
|
58
|
+
export interface GenerateAuditReportParams {
|
|
59
|
+
/** Viewing key for decryption */
|
|
60
|
+
viewingKey: ViewingKey | string
|
|
61
|
+
/** Encrypted transactions to include */
|
|
62
|
+
transactions: EncryptedTransaction[]
|
|
63
|
+
/** Start date (optional) */
|
|
64
|
+
startDate?: Date
|
|
65
|
+
/** End date (optional) */
|
|
66
|
+
endDate?: Date
|
|
67
|
+
/** Report format */
|
|
68
|
+
format: 'json' | 'pdf'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* PDF export options
|
|
73
|
+
*/
|
|
74
|
+
export interface PdfExportOptions {
|
|
75
|
+
/** Report title (default: "SIP Protocol Audit Report") */
|
|
76
|
+
title?: string
|
|
77
|
+
/** Organization name */
|
|
78
|
+
organization?: string
|
|
79
|
+
/** Include transaction details (default: true) */
|
|
80
|
+
includeTransactions?: boolean
|
|
81
|
+
/** Maximum transactions to include in detail section (default: 100) */
|
|
82
|
+
maxTransactions?: number
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Jurisdiction codes for regulatory compliance
|
|
87
|
+
*/
|
|
88
|
+
export type Jurisdiction = 'US' | 'EU' | 'UK' | 'SG'
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Regulatory export format types
|
|
92
|
+
*/
|
|
93
|
+
export type RegulatoryFormat = 'FATF' | 'FINCEN' | 'CSV'
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* FATF Travel Rule export format
|
|
97
|
+
* Simplified version of FATF Recommendation 16 (Travel Rule) for cross-border transfers
|
|
98
|
+
*/
|
|
99
|
+
export interface FATFExport {
|
|
100
|
+
/** Report metadata */
|
|
101
|
+
reportId: string
|
|
102
|
+
/** Generation timestamp */
|
|
103
|
+
generatedAt: string
|
|
104
|
+
/** Jurisdiction code */
|
|
105
|
+
jurisdiction: Jurisdiction
|
|
106
|
+
/** Transaction records */
|
|
107
|
+
transactions: FATFTransaction[]
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* FATF transaction record
|
|
112
|
+
*/
|
|
113
|
+
export interface FATFTransaction {
|
|
114
|
+
/** Originator name (optional for privacy) */
|
|
115
|
+
originatorName?: string
|
|
116
|
+
/** Originator account/address */
|
|
117
|
+
originatorAccount: string
|
|
118
|
+
/** Beneficiary name (optional for privacy) */
|
|
119
|
+
beneficiaryName?: string
|
|
120
|
+
/** Beneficiary account/address */
|
|
121
|
+
beneficiaryAccount: string
|
|
122
|
+
/** Transaction amount */
|
|
123
|
+
amount: string
|
|
124
|
+
/** Currency code (e.g., 'USD', 'ETH') */
|
|
125
|
+
currency: string
|
|
126
|
+
/** Transaction reference */
|
|
127
|
+
transactionRef: string
|
|
128
|
+
/** Transaction timestamp (ISO 8601) */
|
|
129
|
+
timestamp: string
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* FINCEN Suspicious Activity Report export format
|
|
134
|
+
* Simplified version of FinCEN SAR (Form 111) for suspicious activity reporting
|
|
135
|
+
*/
|
|
136
|
+
export interface FINCENExport {
|
|
137
|
+
/** Report metadata */
|
|
138
|
+
reportId: string
|
|
139
|
+
/** Filing type (always 'SAR' for Suspicious Activity Report) */
|
|
140
|
+
filingType: 'SAR'
|
|
141
|
+
/** Report generation date (ISO 8601) */
|
|
142
|
+
reportDate: string
|
|
143
|
+
/** Jurisdiction (must be 'US') */
|
|
144
|
+
jurisdiction: 'US'
|
|
145
|
+
/** Suspicious activity summary */
|
|
146
|
+
summary: {
|
|
147
|
+
/** Total transaction count */
|
|
148
|
+
transactionCount: number
|
|
149
|
+
/** Total volume */
|
|
150
|
+
totalAmount: string
|
|
151
|
+
/** Date range */
|
|
152
|
+
period: {
|
|
153
|
+
start: string
|
|
154
|
+
end: string
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Transaction records */
|
|
158
|
+
transactions: FINCENTransaction[]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* FINCEN transaction record
|
|
163
|
+
*/
|
|
164
|
+
export interface FINCENTransaction {
|
|
165
|
+
/** Transaction date (ISO 8601) */
|
|
166
|
+
transactionDate: string
|
|
167
|
+
/** Transaction amount */
|
|
168
|
+
amount: string
|
|
169
|
+
/** Currency code */
|
|
170
|
+
currency: string
|
|
171
|
+
/** Suspicious activity indicators (optional) */
|
|
172
|
+
suspiciousActivity?: string[]
|
|
173
|
+
/** Narrative summary of transaction */
|
|
174
|
+
narrativeSummary: string
|
|
175
|
+
/** Transaction reference */
|
|
176
|
+
transactionRef: string
|
|
177
|
+
/** Involved parties */
|
|
178
|
+
parties: {
|
|
179
|
+
sender: string
|
|
180
|
+
recipient: string
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* CSV export format (generic)
|
|
186
|
+
*/
|
|
187
|
+
export interface CSVExport {
|
|
188
|
+
/** Report metadata */
|
|
189
|
+
reportId: string
|
|
190
|
+
/** Generation timestamp */
|
|
191
|
+
generatedAt: string
|
|
192
|
+
/** Jurisdiction code */
|
|
193
|
+
jurisdiction: Jurisdiction
|
|
194
|
+
/** CSV headers */
|
|
195
|
+
headers: string[]
|
|
196
|
+
/** CSV rows (array of arrays) */
|
|
197
|
+
rows: string[][]
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Parameters for exporting to regulatory formats
|
|
202
|
+
*/
|
|
203
|
+
export interface ExportForRegulatorParams {
|
|
204
|
+
/** Viewing key for decryption */
|
|
205
|
+
viewingKey: ViewingKey | string
|
|
206
|
+
/** Encrypted transactions to include */
|
|
207
|
+
transactions: EncryptedTransaction[]
|
|
208
|
+
/** Target jurisdiction */
|
|
209
|
+
jurisdiction: Jurisdiction
|
|
210
|
+
/** Export format */
|
|
211
|
+
format: RegulatoryFormat
|
|
212
|
+
/** Start date (optional) */
|
|
213
|
+
startDate?: Date
|
|
214
|
+
/** End date (optional) */
|
|
215
|
+
endDate?: Date
|
|
216
|
+
/** Currency code (default: 'USD') */
|
|
217
|
+
currency?: string
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Union type for all regulatory export formats
|
|
222
|
+
*/
|
|
223
|
+
export type RegulatoryExport = FATFExport | FINCENExport | CSVExport
|