@trusset/sdk 0.1.0 → 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/README.md +175 -171
- package/dist/base-BYEauvBZ.d.mts +111 -0
- package/dist/base-zODt0Kf5.d.ts +111 -0
- package/dist/chunk-2KHUPARH.js +2260 -0
- package/dist/chunk-3YF42MHV.mjs +678 -0
- package/dist/chunk-4MNJZAXE.mjs +2260 -0
- package/dist/chunk-7HFMHYRA.js +107 -0
- package/dist/chunk-ACXAKW5E.js +916 -0
- package/dist/chunk-AI4ZNJLR.js +678 -0
- package/dist/chunk-C7CANC53.mjs +208 -0
- package/dist/chunk-DQCX2GYT.mjs +107 -0
- package/dist/chunk-GWMT6UU7.js +208 -0
- package/dist/chunk-OQG3PEF3.mjs +916 -0
- package/dist/flow-Cz8A09rn.d.mts +171 -0
- package/dist/flow-Cz8A09rn.d.ts +171 -0
- package/dist/index-DKUSzkBN.d.ts +956 -0
- package/dist/index-Dl4U8vUM.d.mts +956 -0
- package/dist/index.d.mts +39 -448
- package/dist/index.d.ts +39 -448
- package/dist/index.js +264 -534
- package/dist/index.mjs +249 -483
- package/dist/modules/customers/index.d.mts +2 -0
- package/dist/modules/customers/index.d.ts +2 -0
- package/dist/modules/customers/index.js +17 -0
- package/dist/modules/customers/index.mjs +17 -0
- package/dist/modules/lending/index.d.mts +6768 -0
- package/dist/modules/lending/index.d.ts +6768 -0
- package/dist/modules/lending/index.js +44 -0
- package/dist/modules/lending/index.mjs +44 -0
- package/dist/modules/tokens/index.d.mts +476 -0
- package/dist/modules/tokens/index.d.ts +476 -0
- package/dist/modules/tokens/index.js +8 -0
- package/dist/modules/tokens/index.mjs +8 -0
- package/package.json +71 -35
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
import { S as SignedStep, P as PaginationOptions, d as TransactionSigner, H as HttpClient, e as ChainSource, b as SignOptions, C as ConfirmOptions } from './flow-Cz8A09rn.mjs';
|
|
2
|
+
|
|
3
|
+
type InvestorType = 'RETAIL' | 'PROFESSIONAL' | 'ELIGIBLE_COUNTERPARTY';
|
|
4
|
+
/**
|
|
5
|
+
* Investor type input. Either one of the three presets or the key of a
|
|
6
|
+
* custom verification profile configured on the instance.
|
|
7
|
+
*/
|
|
8
|
+
type InvestorTypeInput = InvestorType | (string & {});
|
|
9
|
+
type KYCStatus = 'active' | 'soft_expired' | 'hard_expired' | 'revoked' | 'none' | 'unknown';
|
|
10
|
+
type CustomerStatus = 'pending' | 'verified' | 'revoked';
|
|
11
|
+
type CustomerType = 'INDIVIDUAL' | 'COMPANY';
|
|
12
|
+
type IdLinkStatus = 'PENDING' | 'COMPLETED' | 'EXPIRED';
|
|
13
|
+
/**
|
|
14
|
+
* On-chain claim types in the identity registry.
|
|
15
|
+
* KYC, ACCREDITATION, RESIDENCY, and CITIZENSHIP are derived from a KYC
|
|
16
|
+
* proof manifest (see `addClaimsFromProof`). AML, TAX_RESIDENCY,
|
|
17
|
+
* SANCTIONS_CHECK, and PEP_CHECK are added manually via `addClaim`.
|
|
18
|
+
*/
|
|
19
|
+
type ClaimType = 'KYC' | 'AML' | 'ACCREDITATION' | 'RESIDENCY' | 'CITIZENSHIP' | 'TAX_RESIDENCY' | 'SANCTIONS_CHECK' | 'PEP_CHECK';
|
|
20
|
+
interface Customer {
|
|
21
|
+
id: string;
|
|
22
|
+
instanceId: string;
|
|
23
|
+
issuerId: string;
|
|
24
|
+
walletAddress: string | null;
|
|
25
|
+
name: string | null;
|
|
26
|
+
country: string | null;
|
|
27
|
+
investorType: string;
|
|
28
|
+
customerType: CustomerType;
|
|
29
|
+
companyUrl: string | null;
|
|
30
|
+
companyId: string | null;
|
|
31
|
+
externalId: string | null;
|
|
32
|
+
referenceKey: string | null;
|
|
33
|
+
status: CustomerStatus;
|
|
34
|
+
frozen: boolean;
|
|
35
|
+
kycHash: string | null;
|
|
36
|
+
onChainTxHash: string | null;
|
|
37
|
+
contactChannels: string[];
|
|
38
|
+
metadata: Record<string, unknown> | null;
|
|
39
|
+
archived: boolean;
|
|
40
|
+
archivedAt: string | null;
|
|
41
|
+
verifiedAt: string | null;
|
|
42
|
+
revokedAt: string | null;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
/** Present on single-customer fetches: the linked company record. */
|
|
46
|
+
company?: {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string | null;
|
|
49
|
+
companyUrl: string | null;
|
|
50
|
+
} | null;
|
|
51
|
+
/** Present on single-customer fetches of COMPANY customers. */
|
|
52
|
+
members?: Array<{
|
|
53
|
+
id: string;
|
|
54
|
+
name: string | null;
|
|
55
|
+
walletAddress: string | null;
|
|
56
|
+
status: string;
|
|
57
|
+
country: string | null;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
}>;
|
|
60
|
+
/** Present on single-customer fetches. */
|
|
61
|
+
linkedWallets?: Array<{
|
|
62
|
+
id: string;
|
|
63
|
+
walletAddress: string;
|
|
64
|
+
label: string | null;
|
|
65
|
+
addedAt: string;
|
|
66
|
+
addedBy: string;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
interface CreateCustomerInput {
|
|
70
|
+
walletAddress?: string;
|
|
71
|
+
name?: string;
|
|
72
|
+
country?: string;
|
|
73
|
+
investorType?: InvestorTypeInput;
|
|
74
|
+
/** INDIVIDUAL (default) or COMPANY. Immutable after creation. */
|
|
75
|
+
customerType?: CustomerType;
|
|
76
|
+
/** Company customers only. */
|
|
77
|
+
companyUrl?: string;
|
|
78
|
+
/** Individual customers only: id of a COMPANY customer to link to. */
|
|
79
|
+
companyId?: string;
|
|
80
|
+
externalId?: string;
|
|
81
|
+
/** Up to 20 contact strings (email, phone, ...), 200 chars each. */
|
|
82
|
+
contactChannels?: string[];
|
|
83
|
+
metadata?: Record<string, unknown>;
|
|
84
|
+
}
|
|
85
|
+
interface UpdateCustomerInput {
|
|
86
|
+
name?: string;
|
|
87
|
+
country?: string;
|
|
88
|
+
investorType?: InvestorTypeInput;
|
|
89
|
+
walletAddress?: string;
|
|
90
|
+
status?: CustomerStatus;
|
|
91
|
+
companyUrl?: string | null;
|
|
92
|
+
companyId?: string | null;
|
|
93
|
+
contactChannels?: string[];
|
|
94
|
+
metadata?: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
interface ListCustomersOptions extends PaginationOptions {
|
|
97
|
+
includeArchived?: boolean;
|
|
98
|
+
search?: string;
|
|
99
|
+
customerType?: CustomerType;
|
|
100
|
+
}
|
|
101
|
+
interface LinkWalletInput {
|
|
102
|
+
referenceKey: string;
|
|
103
|
+
walletAddress: string;
|
|
104
|
+
}
|
|
105
|
+
interface LinkedWallet {
|
|
106
|
+
/** Only set for non-primary wallets. */
|
|
107
|
+
id?: string;
|
|
108
|
+
address: string;
|
|
109
|
+
label: string | null;
|
|
110
|
+
isPrimary: boolean;
|
|
111
|
+
addedAt: string;
|
|
112
|
+
addedBy?: string;
|
|
113
|
+
}
|
|
114
|
+
interface LinkedWalletsResult {
|
|
115
|
+
primary: string | null;
|
|
116
|
+
total: number;
|
|
117
|
+
wallets: LinkedWallet[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* An unsigned transaction for the wallet holder to sign and broadcast.
|
|
121
|
+
* Trusset holds no keys: every on-chain write is prepared as calldata here,
|
|
122
|
+
* signed by your wallet, and then confirmed back to the backend, which reads
|
|
123
|
+
* the mined receipt before recording anything.
|
|
124
|
+
*/
|
|
125
|
+
interface PreparedTransaction {
|
|
126
|
+
action: 'SIGN_TRANSACTION';
|
|
127
|
+
registerKind?: RegisterKind;
|
|
128
|
+
chainId?: number;
|
|
129
|
+
transaction: {
|
|
130
|
+
to: string;
|
|
131
|
+
data: string;
|
|
132
|
+
};
|
|
133
|
+
functionName: string;
|
|
134
|
+
description: string;
|
|
135
|
+
}
|
|
136
|
+
type RegisterKind = 'TRUSSET' | 'TREX';
|
|
137
|
+
type RegisterPhase = 'DEPLOY_IDENTITY' | 'SIGN_CLAIMS' | 'REGISTER';
|
|
138
|
+
interface ClaimSignature {
|
|
139
|
+
walletAddress: string;
|
|
140
|
+
signature: string;
|
|
141
|
+
claimType?: ClaimType;
|
|
142
|
+
}
|
|
143
|
+
interface RegisterPlanInput {
|
|
144
|
+
signerAddress?: string;
|
|
145
|
+
claimSignatures?: ClaimSignature[];
|
|
146
|
+
identities?: Record<string, string>;
|
|
147
|
+
}
|
|
148
|
+
interface RegisterPlanStep {
|
|
149
|
+
action: 'SIGN_TRANSACTION';
|
|
150
|
+
stepType: string;
|
|
151
|
+
walletAddress?: string;
|
|
152
|
+
walletAddresses?: string[];
|
|
153
|
+
identity?: string;
|
|
154
|
+
managementKey?: string;
|
|
155
|
+
implementationAuthority?: string;
|
|
156
|
+
transaction: {
|
|
157
|
+
to: string | null;
|
|
158
|
+
data: string;
|
|
159
|
+
create?: true;
|
|
160
|
+
};
|
|
161
|
+
functionName: string;
|
|
162
|
+
description: string;
|
|
163
|
+
claimType?: ClaimType;
|
|
164
|
+
dataHash?: string;
|
|
165
|
+
expiry?: number;
|
|
166
|
+
}
|
|
167
|
+
interface ClaimSigningRequest {
|
|
168
|
+
walletAddress: string;
|
|
169
|
+
identity: string;
|
|
170
|
+
topic: string;
|
|
171
|
+
claimIssuer: string;
|
|
172
|
+
data: string;
|
|
173
|
+
messageHash: string;
|
|
174
|
+
scheme: 'eip191';
|
|
175
|
+
description: string;
|
|
176
|
+
claimType: ClaimType;
|
|
177
|
+
}
|
|
178
|
+
interface RegisterPlan {
|
|
179
|
+
registerKind: 'TREX';
|
|
180
|
+
register: string;
|
|
181
|
+
signerAddress: string | null;
|
|
182
|
+
claimSigners?: string[];
|
|
183
|
+
action: 'SIGN_TRANSACTIONS' | 'SIGN_MESSAGES';
|
|
184
|
+
phase: RegisterPhase;
|
|
185
|
+
steps?: RegisterPlanStep[];
|
|
186
|
+
messages?: ClaimSigningRequest[];
|
|
187
|
+
confirmStepIndex?: number;
|
|
188
|
+
registerStep?: string | null;
|
|
189
|
+
identities: Record<string, string>;
|
|
190
|
+
claimIssuer: string;
|
|
191
|
+
claimTopic: string;
|
|
192
|
+
next?: string;
|
|
193
|
+
warnings?: string[];
|
|
194
|
+
description?: string;
|
|
195
|
+
}
|
|
196
|
+
interface PreparedOnchainId {
|
|
197
|
+
registerKind: 'TREX';
|
|
198
|
+
walletAddress: string;
|
|
199
|
+
exists: boolean;
|
|
200
|
+
identity?: string;
|
|
201
|
+
registered?: boolean;
|
|
202
|
+
action?: 'SIGN_TRANSACTION';
|
|
203
|
+
stepType?: 'deployIdentity';
|
|
204
|
+
managementKey?: string;
|
|
205
|
+
implementationAuthority?: string;
|
|
206
|
+
transaction?: {
|
|
207
|
+
to: null;
|
|
208
|
+
data: string;
|
|
209
|
+
create: true;
|
|
210
|
+
};
|
|
211
|
+
functionName?: string;
|
|
212
|
+
description?: string;
|
|
213
|
+
confirmWith: {
|
|
214
|
+
endpoint: string;
|
|
215
|
+
fields: string[];
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
interface OnchainIdResult {
|
|
219
|
+
registerKind: 'TREX';
|
|
220
|
+
walletAddress: string;
|
|
221
|
+
identity: string;
|
|
222
|
+
txHash: string;
|
|
223
|
+
blockNumber: number;
|
|
224
|
+
from: string;
|
|
225
|
+
implementationAuthority: string | null;
|
|
226
|
+
managementKey: string | null;
|
|
227
|
+
managementKeyHeld: boolean | null;
|
|
228
|
+
alreadyRecorded: boolean;
|
|
229
|
+
transactions?: SignedStep[];
|
|
230
|
+
}
|
|
231
|
+
/** Where a signed transaction is confirmed, echoed by every write endpoint. */
|
|
232
|
+
interface ConfirmWith {
|
|
233
|
+
endpoint: string;
|
|
234
|
+
field: string;
|
|
235
|
+
shape?: string;
|
|
236
|
+
}
|
|
237
|
+
interface VerifyIdentityInput extends RegisterPlanInput {
|
|
238
|
+
walletAddress: string;
|
|
239
|
+
country: string;
|
|
240
|
+
investorType?: InvestorTypeInput;
|
|
241
|
+
softExpiryDays?: number;
|
|
242
|
+
hardExpiryDays?: number;
|
|
243
|
+
/**
|
|
244
|
+
* The KYC root hash produced by the Trusset KYC zk-proof tool
|
|
245
|
+
* (`kycHash` in the bundle's manifest.json / kycHash.hex).
|
|
246
|
+
* This exact hash is stored on-chain and later checked against the
|
|
247
|
+
* manifest when adding claims via `addClaimsFromProof`.
|
|
248
|
+
*/
|
|
249
|
+
kycHash?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Legacy fallback: arbitrary data the backend hashes with
|
|
252
|
+
* keccak256(JSON.stringify(kycData)). Ignored when `kycHash` is set.
|
|
253
|
+
* Prefer `kycHash` - claims from a proof manifest only work with it.
|
|
254
|
+
*/
|
|
255
|
+
kycData?: Record<string, unknown>;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* The unsigned identity write, returned when no signer and no txHash is given.
|
|
259
|
+
* `kycHash` is the hash that was encoded into the calldata - confirm with it,
|
|
260
|
+
* not with a freshly derived one, or the record and the chain disagree.
|
|
261
|
+
*/
|
|
262
|
+
interface PreparedVerifyIdentity extends PreparedTransaction {
|
|
263
|
+
walletAddress: string;
|
|
264
|
+
kycHash: string;
|
|
265
|
+
investorType: number;
|
|
266
|
+
softExpiry: number;
|
|
267
|
+
hardExpiry: number;
|
|
268
|
+
/** 'verify' for a new on-chain identity, 'update' when one already existed. */
|
|
269
|
+
operation: 'verify' | 'update';
|
|
270
|
+
confirmWith: ConfirmWith;
|
|
271
|
+
warnings?: string[];
|
|
272
|
+
}
|
|
273
|
+
type PreparedVerifyPlan = RegisterPlan & Omit<PreparedVerifyIdentity, keyof PreparedTransaction>;
|
|
274
|
+
interface VerifyIdentityResult {
|
|
275
|
+
walletAddress: string;
|
|
276
|
+
status: string;
|
|
277
|
+
/** 'verify' for a new on-chain identity, 'update' when one already existed. */
|
|
278
|
+
operation?: string;
|
|
279
|
+
txHash: string;
|
|
280
|
+
gasUsed: string;
|
|
281
|
+
kycHash: string;
|
|
282
|
+
alreadyRecorded?: boolean;
|
|
283
|
+
transactions?: SignedStep[];
|
|
284
|
+
}
|
|
285
|
+
interface BatchVerifyEntry {
|
|
286
|
+
walletAddress: string;
|
|
287
|
+
country: string;
|
|
288
|
+
investorType?: InvestorTypeInput;
|
|
289
|
+
softExpiryDays?: number;
|
|
290
|
+
hardExpiryDays?: number;
|
|
291
|
+
/** KYC root hash from the zk-proof tool for this subject. */
|
|
292
|
+
kycHash?: string;
|
|
293
|
+
}
|
|
294
|
+
/** An entry the backend refused, with its position in the submitted array. */
|
|
295
|
+
interface BatchVerifyRejection {
|
|
296
|
+
index: number;
|
|
297
|
+
walletAddress: string | null;
|
|
298
|
+
code: string;
|
|
299
|
+
message: string;
|
|
300
|
+
}
|
|
301
|
+
/** An accepted entry, carrying the root hash that went into the calldata. */
|
|
302
|
+
interface PreparedBatchEntry {
|
|
303
|
+
walletAddress: string;
|
|
304
|
+
country: string;
|
|
305
|
+
investorType?: string;
|
|
306
|
+
kycHash: string;
|
|
307
|
+
}
|
|
308
|
+
interface PreparedBatchVerify extends PreparedTransaction {
|
|
309
|
+
submitted: number;
|
|
310
|
+
accepted: number;
|
|
311
|
+
totalEntries: number;
|
|
312
|
+
rejectedCount: number;
|
|
313
|
+
rejected: BatchVerifyRejection[];
|
|
314
|
+
entries: PreparedBatchEntry[];
|
|
315
|
+
confirmWith: ConfirmWith;
|
|
316
|
+
warnings?: string[];
|
|
317
|
+
}
|
|
318
|
+
type PreparedBatchVerifyPlan = RegisterPlan & Omit<PreparedBatchVerify, keyof PreparedTransaction>;
|
|
319
|
+
interface BatchVerifyResult {
|
|
320
|
+
submitted: number;
|
|
321
|
+
accepted: number;
|
|
322
|
+
totalEntries: number;
|
|
323
|
+
rejectedCount: number;
|
|
324
|
+
rejected: BatchVerifyRejection[];
|
|
325
|
+
onChainSkipped?: string[];
|
|
326
|
+
txHash: string;
|
|
327
|
+
gasUsed: string;
|
|
328
|
+
transactions?: SignedStep[];
|
|
329
|
+
}
|
|
330
|
+
interface PreparedRevokeIdentity extends PreparedTransaction {
|
|
331
|
+
walletAddress: string;
|
|
332
|
+
confirmWith: ConfirmWith;
|
|
333
|
+
}
|
|
334
|
+
interface RevokeIdentityResult {
|
|
335
|
+
walletAddress: string;
|
|
336
|
+
status: string;
|
|
337
|
+
txHash: string;
|
|
338
|
+
gasUsed: string;
|
|
339
|
+
transactions?: SignedStep[];
|
|
340
|
+
}
|
|
341
|
+
interface OnChainIdentity {
|
|
342
|
+
kycHash: string;
|
|
343
|
+
investorType: number;
|
|
344
|
+
kycProvider: string;
|
|
345
|
+
timestamp: number;
|
|
346
|
+
softExpiry: number;
|
|
347
|
+
hardExpiry: number;
|
|
348
|
+
status: KYCStatus;
|
|
349
|
+
statusCode: number;
|
|
350
|
+
frozen: boolean;
|
|
351
|
+
isVerified: boolean;
|
|
352
|
+
}
|
|
353
|
+
interface IdentityStatusResult {
|
|
354
|
+
walletAddress: string;
|
|
355
|
+
onChain: OnChainIdentity | null;
|
|
356
|
+
offChain: {
|
|
357
|
+
status: CustomerStatus;
|
|
358
|
+
country: string | null;
|
|
359
|
+
investorType: string;
|
|
360
|
+
verifiedAt: string | null;
|
|
361
|
+
} | null;
|
|
362
|
+
}
|
|
363
|
+
interface TransferCheckInput {
|
|
364
|
+
from: string;
|
|
365
|
+
to: string;
|
|
366
|
+
amount?: string;
|
|
367
|
+
fromBalance?: string;
|
|
368
|
+
toBalance?: string;
|
|
369
|
+
}
|
|
370
|
+
interface TransferCheckResult {
|
|
371
|
+
allowed: boolean;
|
|
372
|
+
reason: number;
|
|
373
|
+
senderStatus: KYCStatus;
|
|
374
|
+
receiverStatus: KYCStatus;
|
|
375
|
+
}
|
|
376
|
+
interface Claim {
|
|
377
|
+
claimType: number;
|
|
378
|
+
claimTypeLabel: ClaimType | 'UNKNOWN';
|
|
379
|
+
dataHash: string;
|
|
380
|
+
issuer: string;
|
|
381
|
+
issuedAt: number;
|
|
382
|
+
expiry: number;
|
|
383
|
+
active: boolean;
|
|
384
|
+
}
|
|
385
|
+
interface ClaimsResult {
|
|
386
|
+
walletAddress: string;
|
|
387
|
+
claims: Claim[];
|
|
388
|
+
}
|
|
389
|
+
interface AddClaimInput extends RegisterPlanInput {
|
|
390
|
+
walletAddress: string;
|
|
391
|
+
/** Manual claim types only: AML, TAX_RESIDENCY, SANCTIONS_CHECK, PEP_CHECK (or their numeric ids). */
|
|
392
|
+
claimType: ClaimType | number;
|
|
393
|
+
/** Pre-computed 32-byte hash of the claim evidence. */
|
|
394
|
+
dataHash?: string;
|
|
395
|
+
/** Alternative to dataHash: a string the backend hashes for you. */
|
|
396
|
+
dataInput?: string;
|
|
397
|
+
expiryDays?: number;
|
|
398
|
+
}
|
|
399
|
+
interface PreparedAddClaim extends PreparedTransaction {
|
|
400
|
+
walletAddress: string;
|
|
401
|
+
claimType: ClaimType;
|
|
402
|
+
dataHash: string;
|
|
403
|
+
expiry: number;
|
|
404
|
+
confirmWith: ConfirmWith;
|
|
405
|
+
warnings?: string[];
|
|
406
|
+
}
|
|
407
|
+
type PreparedAddClaimPlan = RegisterPlan & Omit<PreparedAddClaim, keyof PreparedTransaction>;
|
|
408
|
+
interface AddClaimResult {
|
|
409
|
+
walletAddress: string;
|
|
410
|
+
claimType: ClaimType;
|
|
411
|
+
dataHash: string;
|
|
412
|
+
expiry: number;
|
|
413
|
+
txHash: string;
|
|
414
|
+
gasUsed: string;
|
|
415
|
+
transactions?: SignedStep[];
|
|
416
|
+
}
|
|
417
|
+
interface PreparedRevokeClaim extends PreparedTransaction {
|
|
418
|
+
walletAddress: string;
|
|
419
|
+
claimType: ClaimType;
|
|
420
|
+
confirmWith: ConfirmWith;
|
|
421
|
+
}
|
|
422
|
+
interface RevokeClaimResult {
|
|
423
|
+
walletAddress: string;
|
|
424
|
+
claimType: ClaimType;
|
|
425
|
+
txHash: string;
|
|
426
|
+
gasUsed: string;
|
|
427
|
+
transactions?: SignedStep[];
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* One proof leaf inside a KYC bundle manifest. The tool writes more fields
|
|
431
|
+
* than listed here; extras are passed through untouched.
|
|
432
|
+
*/
|
|
433
|
+
interface KycProofLeaf {
|
|
434
|
+
fieldName: string;
|
|
435
|
+
circuit: string;
|
|
436
|
+
leafHash: string;
|
|
437
|
+
commitment: string;
|
|
438
|
+
[key: string]: unknown;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* The `manifest.json` produced per subject by the Trusset KYC zk-proof tool
|
|
442
|
+
* (github.com/Trusset/trusset-kyc-zk-proofs). `kycHash` is the Merkle root
|
|
443
|
+
* hash - the value verified on-chain. `mode: 'stub'` manifests are only
|
|
444
|
+
* accepted by development instances.
|
|
445
|
+
*/
|
|
446
|
+
interface KycProofManifest {
|
|
447
|
+
version: string;
|
|
448
|
+
mode: 'stub' | 'production';
|
|
449
|
+
walletAddress: string;
|
|
450
|
+
kycHash: string;
|
|
451
|
+
leaves: KycProofLeaf[];
|
|
452
|
+
/** Verification parameters echoed from the tool's input row. */
|
|
453
|
+
passthrough?: {
|
|
454
|
+
country?: string;
|
|
455
|
+
investorType?: string;
|
|
456
|
+
softExpiryDays?: number;
|
|
457
|
+
hardExpiryDays?: number;
|
|
458
|
+
[key: string]: unknown;
|
|
459
|
+
};
|
|
460
|
+
[key: string]: unknown;
|
|
461
|
+
}
|
|
462
|
+
interface ProofClaimsInput extends RegisterPlanInput {
|
|
463
|
+
walletAddress: string;
|
|
464
|
+
/** The full manifest.json object from the proof bundle. */
|
|
465
|
+
manifest: KycProofManifest;
|
|
466
|
+
/** The bundle's manifest.sig as its 64 raw bytes or their base64, never the file read as text. */
|
|
467
|
+
manifestSig?: string | Uint8Array;
|
|
468
|
+
/**
|
|
469
|
+
* The bundle's proofs, as fieldName -> base64 of the matching proofs/*.bin.
|
|
470
|
+
* Required on instances with proof verification enabled; stub manifests on
|
|
471
|
+
* development instances are accepted without them.
|
|
472
|
+
*/
|
|
473
|
+
proofs?: Record<string, string>;
|
|
474
|
+
/** Limit which proof-backed claim types to add. Default: all derivable. */
|
|
475
|
+
selected?: ClaimType[];
|
|
476
|
+
/** Claim expiry. Default: the identity's on-chain hardExpiry, if set. */
|
|
477
|
+
expiryDays?: number;
|
|
478
|
+
}
|
|
479
|
+
/** The outcome of verifying the proof bundle, echoed on both phases. */
|
|
480
|
+
interface ProofVerificationInfo {
|
|
481
|
+
verified: boolean;
|
|
482
|
+
mode: string;
|
|
483
|
+
reportId: string | null;
|
|
484
|
+
verifierVersion: string | null;
|
|
485
|
+
cached: boolean;
|
|
486
|
+
}
|
|
487
|
+
/** One claim to sign, in the order the steps are returned. */
|
|
488
|
+
interface PreparedProofClaimStep extends PreparedTransaction {
|
|
489
|
+
claimType: ClaimType;
|
|
490
|
+
dataHash: string;
|
|
491
|
+
expiry: number;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* A multi-step write: one transaction per derived claim. Sign and broadcast
|
|
495
|
+
* the steps in order, then confirm them together.
|
|
496
|
+
*/
|
|
497
|
+
interface PreparedProofClaims {
|
|
498
|
+
action: 'SIGN_TRANSACTIONS';
|
|
499
|
+
steps: PreparedProofClaimStep[];
|
|
500
|
+
walletAddress: string;
|
|
501
|
+
kycHash: string;
|
|
502
|
+
total: number;
|
|
503
|
+
verification: ProofVerificationInfo;
|
|
504
|
+
confirmWith: ConfirmWith;
|
|
505
|
+
}
|
|
506
|
+
type PreparedProofClaimsPlan = RegisterPlan & {
|
|
507
|
+
walletAddress: string;
|
|
508
|
+
kycHash: string;
|
|
509
|
+
};
|
|
510
|
+
/** One signed step, paired back to the claim it belongs to. */
|
|
511
|
+
interface ProofClaimTxResult {
|
|
512
|
+
claimType: ClaimType;
|
|
513
|
+
txHash: string;
|
|
514
|
+
}
|
|
515
|
+
/** Confirm proof claims you signed and broadcast yourself, in step order. */
|
|
516
|
+
interface ProofConfirmOptions {
|
|
517
|
+
txResults: ProofClaimTxResult[];
|
|
518
|
+
}
|
|
519
|
+
interface ProofClaimOutcome {
|
|
520
|
+
claimType: ClaimType;
|
|
521
|
+
dataHash: string;
|
|
522
|
+
/** 'skipped' when no transaction was submitted for this claim. */
|
|
523
|
+
status: 'confirmed' | 'failed' | 'skipped';
|
|
524
|
+
txHash?: string;
|
|
525
|
+
gasUsed?: string;
|
|
526
|
+
error?: string;
|
|
527
|
+
}
|
|
528
|
+
interface ProofClaimsResult {
|
|
529
|
+
walletAddress: string;
|
|
530
|
+
kycHash: string;
|
|
531
|
+
added: number;
|
|
532
|
+
total: number;
|
|
533
|
+
claims: ProofClaimOutcome[];
|
|
534
|
+
verification: ProofVerificationInfo;
|
|
535
|
+
transactions?: SignedStep[];
|
|
536
|
+
}
|
|
537
|
+
interface CreateIdLinkInput {
|
|
538
|
+
recipientEmail?: string;
|
|
539
|
+
recipientWallet?: string;
|
|
540
|
+
recipientPhone?: string;
|
|
541
|
+
note?: string;
|
|
542
|
+
expiryDays?: number;
|
|
543
|
+
sendVia?: ('email' | 'sms')[];
|
|
544
|
+
customRedirectUrl?: string;
|
|
545
|
+
customMessage?: string;
|
|
546
|
+
investorType?: InvestorTypeInput;
|
|
547
|
+
country?: string;
|
|
548
|
+
/** Charge the recipient before verification. Integer cents, 50 - 1,000,000. */
|
|
549
|
+
feeCents?: number;
|
|
550
|
+
/** Required when feeCents is set: 'eur' or 'usd'. */
|
|
551
|
+
currency?: 'eur' | 'usd';
|
|
552
|
+
}
|
|
553
|
+
interface IdLink {
|
|
554
|
+
id: string;
|
|
555
|
+
token: string;
|
|
556
|
+
verificationUrl: string;
|
|
557
|
+
status: IdLinkStatus;
|
|
558
|
+
recipientEmail: string | null;
|
|
559
|
+
recipientWallet: string | null;
|
|
560
|
+
recipientPhone: string | null;
|
|
561
|
+
expiresAt: string;
|
|
562
|
+
sumsubApplicantId: string | null;
|
|
563
|
+
feeCents: number | null;
|
|
564
|
+
currency: string | null;
|
|
565
|
+
delivery: Record<string, {
|
|
566
|
+
sent: boolean;
|
|
567
|
+
error?: string;
|
|
568
|
+
}>;
|
|
569
|
+
}
|
|
570
|
+
interface IdLinkListItem {
|
|
571
|
+
id: string;
|
|
572
|
+
token: string;
|
|
573
|
+
recipientEmail: string | null;
|
|
574
|
+
recipientWallet: string | null;
|
|
575
|
+
recipientPhone: string | null;
|
|
576
|
+
status: IdLinkStatus;
|
|
577
|
+
note: string | null;
|
|
578
|
+
investorType: string;
|
|
579
|
+
country: string | null;
|
|
580
|
+
expiresAt: string;
|
|
581
|
+
used: boolean;
|
|
582
|
+
usedAt: string | null;
|
|
583
|
+
createdAt: string;
|
|
584
|
+
feeCents: number | null;
|
|
585
|
+
currency: string | null;
|
|
586
|
+
paidAt: string | null;
|
|
587
|
+
verificationUrl: string;
|
|
588
|
+
}
|
|
589
|
+
interface ListIdLinksOptions extends PaginationOptions {
|
|
590
|
+
status?: IdLinkStatus;
|
|
591
|
+
}
|
|
592
|
+
interface ProfileRequiredField {
|
|
593
|
+
id: string;
|
|
594
|
+
idDocSetType: string;
|
|
595
|
+
types?: string[];
|
|
596
|
+
required: boolean;
|
|
597
|
+
label: string;
|
|
598
|
+
}
|
|
599
|
+
interface VerificationProfile {
|
|
600
|
+
id: string;
|
|
601
|
+
key: string;
|
|
602
|
+
name: string;
|
|
603
|
+
description: string | null;
|
|
604
|
+
onChainInvestorType: number;
|
|
605
|
+
sumsubLevelName: string;
|
|
606
|
+
requiredFields: ProfileRequiredField[];
|
|
607
|
+
isPreset: boolean;
|
|
608
|
+
enabled: boolean;
|
|
609
|
+
createdAt: string;
|
|
610
|
+
updatedAt: string;
|
|
611
|
+
}
|
|
612
|
+
interface SyncRecord {
|
|
613
|
+
/** Unique ID in the institution's system. Maps to externalId. */
|
|
614
|
+
externalId: string;
|
|
615
|
+
walletAddress?: string;
|
|
616
|
+
name?: string;
|
|
617
|
+
country?: string;
|
|
618
|
+
investorType?: InvestorTypeInput;
|
|
619
|
+
/** KYC root hash from the zk-proof tool, used when verifyOnChain is set. */
|
|
620
|
+
kycHash?: string;
|
|
621
|
+
metadata?: Record<string, unknown>;
|
|
622
|
+
}
|
|
623
|
+
interface SyncResult {
|
|
624
|
+
total: number;
|
|
625
|
+
created: number;
|
|
626
|
+
updated: number;
|
|
627
|
+
skipped: number;
|
|
628
|
+
errors: SyncError[];
|
|
629
|
+
}
|
|
630
|
+
interface SyncError {
|
|
631
|
+
externalId: string;
|
|
632
|
+
code: string;
|
|
633
|
+
message: string;
|
|
634
|
+
}
|
|
635
|
+
interface SyncOptions {
|
|
636
|
+
/** Batch size per API call. Default: 50, max: 200. */
|
|
637
|
+
batchSize?: number;
|
|
638
|
+
/**
|
|
639
|
+
* Conflict strategy when a customer with the same externalId already exists.
|
|
640
|
+
* 'skip' = do nothing, 'update' = overwrite fields. Default: 'update'.
|
|
641
|
+
*/
|
|
642
|
+
onConflict?: 'skip' | 'update';
|
|
643
|
+
/**
|
|
644
|
+
* If true, also verifies entries with a walletAddress on-chain, in batches
|
|
645
|
+
* of 500. Requires `signer`, since every transaction is signed by the wallet
|
|
646
|
+
* holder. Default: false.
|
|
647
|
+
*/
|
|
648
|
+
verifyOnChain?: boolean;
|
|
649
|
+
/** Signs the batch verification transactions. Required by `verifyOnChain`. */
|
|
650
|
+
signer?: TransactionSigner;
|
|
651
|
+
/** Confirmations to wait for per batch. Default: 1. */
|
|
652
|
+
confirmations?: number;
|
|
653
|
+
/** Country and expiry defaults for on-chain verification. */
|
|
654
|
+
verificationDefaults?: {
|
|
655
|
+
softExpiryDays?: number;
|
|
656
|
+
hardExpiryDays?: number;
|
|
657
|
+
};
|
|
658
|
+
/** Called after each batch completes. */
|
|
659
|
+
onProgress?: (processed: number, total: number) => void;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
declare class CustomerManagement {
|
|
663
|
+
private readonly http;
|
|
664
|
+
constructor(http: HttpClient);
|
|
665
|
+
/**
|
|
666
|
+
* List customers for the current instance.
|
|
667
|
+
*/
|
|
668
|
+
list(options?: ListCustomersOptions): Promise<{
|
|
669
|
+
customers: Customer[];
|
|
670
|
+
total: number;
|
|
671
|
+
}>;
|
|
672
|
+
/**
|
|
673
|
+
* Get a customer by wallet address, ID, externalId, or referenceKey.
|
|
674
|
+
*
|
|
675
|
+
* Note: the backend routes 20-30 character identifiers to the internal-ID
|
|
676
|
+
* lookup, so an externalId in that length range will not resolve here -
|
|
677
|
+
* use `searchByExternalId`, which handles the ambiguity.
|
|
678
|
+
*/
|
|
679
|
+
get(identifier: string): Promise<Customer>;
|
|
680
|
+
/**
|
|
681
|
+
* Create a new customer record.
|
|
682
|
+
*/
|
|
683
|
+
create(input: CreateCustomerInput): Promise<Customer>;
|
|
684
|
+
/**
|
|
685
|
+
* Update an existing customer.
|
|
686
|
+
*/
|
|
687
|
+
update(customerId: string, input: UpdateCustomerInput): Promise<Customer>;
|
|
688
|
+
/**
|
|
689
|
+
* Archive (soft-delete) a customer.
|
|
690
|
+
*/
|
|
691
|
+
archive(customerId: string): Promise<{
|
|
692
|
+
archived: boolean;
|
|
693
|
+
}>;
|
|
694
|
+
/**
|
|
695
|
+
* Link a wallet address to a customer created via referenceKey.
|
|
696
|
+
*/
|
|
697
|
+
linkWallet(input: LinkWalletInput): Promise<Customer>;
|
|
698
|
+
/**
|
|
699
|
+
* Batch-fetch country codes for a list of wallet addresses.
|
|
700
|
+
*/
|
|
701
|
+
batchGetCountries(addresses: string[]): Promise<Record<string, string>>;
|
|
702
|
+
/**
|
|
703
|
+
* List all wallets of a customer: the primary plus any linked wallets.
|
|
704
|
+
*/
|
|
705
|
+
listWallets(customerId: string): Promise<LinkedWalletsResult>;
|
|
706
|
+
/**
|
|
707
|
+
* Link an additional wallet to a customer. The wallet must not be in use
|
|
708
|
+
* by any other customer in the instance.
|
|
709
|
+
*/
|
|
710
|
+
addWallet(customerId: string, walletAddress: string, label?: string): Promise<LinkedWallet>;
|
|
711
|
+
/**
|
|
712
|
+
* Remove a linked (non-primary) wallet from a customer.
|
|
713
|
+
*/
|
|
714
|
+
removeWallet(customerId: string, walletAddress: string): Promise<{
|
|
715
|
+
removed: boolean;
|
|
716
|
+
address: string;
|
|
717
|
+
}>;
|
|
718
|
+
/**
|
|
719
|
+
* Promote a linked wallet to primary. The previous primary becomes a
|
|
720
|
+
* linked wallet labeled "Previously primary".
|
|
721
|
+
*/
|
|
722
|
+
promoteWallet(customerId: string, walletAddress: string): Promise<Customer>;
|
|
723
|
+
/**
|
|
724
|
+
* Search customers by name substring.
|
|
725
|
+
*/
|
|
726
|
+
searchByName(name: string, options?: ListCustomersOptions): Promise<{
|
|
727
|
+
customers: Customer[];
|
|
728
|
+
total: number;
|
|
729
|
+
}>;
|
|
730
|
+
/**
|
|
731
|
+
* Find a customer by wallet address.
|
|
732
|
+
*/
|
|
733
|
+
searchByWallet(walletAddress: string): Promise<Customer>;
|
|
734
|
+
/**
|
|
735
|
+
* Find a customer by external ID (your system's unique identifier).
|
|
736
|
+
*/
|
|
737
|
+
searchByExternalId(externalId: string): Promise<Customer>;
|
|
738
|
+
/**
|
|
739
|
+
* Find a customer by reference key (for pre-wallet customers).
|
|
740
|
+
*/
|
|
741
|
+
searchByReference(referenceKey: string): Promise<Customer>;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
declare class CustomerIdentity {
|
|
745
|
+
private readonly http;
|
|
746
|
+
private readonly chain;
|
|
747
|
+
constructor(http: HttpClient, chain?: ChainSource);
|
|
748
|
+
/**
|
|
749
|
+
* Verify a customer's identity on-chain via the IdentityRegistry contract.
|
|
750
|
+
*
|
|
751
|
+
* Called with input alone this returns an unsigned transaction for your
|
|
752
|
+
* wallet to sign - Trusset never holds a key. Pass `{ signer }` to sign,
|
|
753
|
+
* broadcast, and confirm in one call, or `{ txHash }` to confirm a
|
|
754
|
+
* transaction you broadcast yourself. Only a confirmed transaction updates
|
|
755
|
+
* the customer record, and only after the backend has read its receipt.
|
|
756
|
+
*
|
|
757
|
+
* Pass `kycHash` with the root hash from the KYC zk-proof tool - that hash
|
|
758
|
+
* is stored on-chain and is later required to add claims from the proof
|
|
759
|
+
* manifest. When you confirm yourself, send back the `kycHash` from the
|
|
760
|
+
* prepared transaction, otherwise the record and the chain disagree.
|
|
761
|
+
* If the identity already exists on-chain it is updated instead (the
|
|
762
|
+
* `operation` field tells you which happened).
|
|
763
|
+
*/
|
|
764
|
+
verify(input: VerifyIdentityInput, options: SignOptions | ConfirmOptions): Promise<VerifyIdentityResult>;
|
|
765
|
+
verify(input: VerifyIdentityInput): Promise<PreparedVerifyIdentity | PreparedVerifyPlan>;
|
|
766
|
+
/**
|
|
767
|
+
* Verify a customer on-chain straight from a KYC proof bundle manifest.
|
|
768
|
+
* Wallet, root hash, and the passthrough parameters (country, investorType,
|
|
769
|
+
* expiry days) are read from the manifest; `overrides` win where given.
|
|
770
|
+
*/
|
|
771
|
+
verifyFromManifest(manifest: KycProofManifest, overrides: Omit<Partial<VerifyIdentityInput>, 'kycHash' | 'kycData'> | undefined, options: SignOptions | ConfirmOptions): Promise<VerifyIdentityResult>;
|
|
772
|
+
verifyFromManifest(manifest: KycProofManifest, overrides?: Omit<Partial<VerifyIdentityInput>, 'kycHash' | 'kycData'>): Promise<PreparedVerifyIdentity | PreparedVerifyPlan>;
|
|
773
|
+
/**
|
|
774
|
+
* Batch-verify up to 500 identities in a single transaction. Include each
|
|
775
|
+
* subject's `kycHash` from the zk-proof tool so proof-backed claims can be
|
|
776
|
+
* added later.
|
|
777
|
+
*
|
|
778
|
+
* Entries that fail validation are reported in `rejected` and left out of
|
|
779
|
+
* the transaction; the rest are accepted. Confirmation is checked against
|
|
780
|
+
* the accepted entries, so confirm with the `entries` from the prepared
|
|
781
|
+
* transaction rather than the ones you submitted.
|
|
782
|
+
*/
|
|
783
|
+
batchVerify(entries: BatchVerifyEntry[], options: SignOptions | ConfirmOptions): Promise<BatchVerifyResult>;
|
|
784
|
+
batchVerify(entries: BatchVerifyEntry[], plan?: RegisterPlanInput): Promise<PreparedBatchVerify | PreparedBatchVerifyPlan>;
|
|
785
|
+
/**
|
|
786
|
+
* Revoke an identity on-chain.
|
|
787
|
+
*/
|
|
788
|
+
revoke(walletAddress: string, options: SignOptions | ConfirmOptions): Promise<RevokeIdentityResult>;
|
|
789
|
+
revoke(walletAddress: string): Promise<PreparedRevokeIdentity>;
|
|
790
|
+
/**
|
|
791
|
+
* Get combined on-chain and off-chain identity status.
|
|
792
|
+
*/
|
|
793
|
+
getStatus(walletAddress: string): Promise<IdentityStatusResult>;
|
|
794
|
+
/**
|
|
795
|
+
* Check whether a token transfer between two addresses is compliant.
|
|
796
|
+
* Runs identity checks + all registered compliance modules.
|
|
797
|
+
*/
|
|
798
|
+
canTransfer(input: TransferCheckInput): Promise<TransferCheckResult>;
|
|
799
|
+
deployOnchainId(walletAddress: string, options: SignOptions | ConfirmOptions): Promise<OnchainIdResult | PreparedOnchainId>;
|
|
800
|
+
deployOnchainId(walletAddress: string, plan?: {
|
|
801
|
+
signerAddress?: string;
|
|
802
|
+
}): Promise<PreparedOnchainId>;
|
|
803
|
+
/**
|
|
804
|
+
* List the active on-chain claims of a wallet.
|
|
805
|
+
*/
|
|
806
|
+
getClaims(walletAddress: string): Promise<ClaimsResult>;
|
|
807
|
+
/**
|
|
808
|
+
* Add claims backed by a KYC proof bundle. The wallet must already be
|
|
809
|
+
* verified on-chain with the manifest's root hash (see `verify` /
|
|
810
|
+
* `verifyFromManifest`), otherwise the backend rejects with HASH_MISMATCH.
|
|
811
|
+
*
|
|
812
|
+
* Derivable claims: KYC (always), RESIDENCY (country leaf), CITIZENSHIP
|
|
813
|
+
* (nationality leaf), ACCREDITATION (investorType leaf). Use `selected`
|
|
814
|
+
* to add a subset. One transaction is prepared per claim, to be signed and
|
|
815
|
+
* broadcast in the order returned; `{ signer }` does that for you, and
|
|
816
|
+
* `{ txResults }` confirms steps you broadcast yourself.
|
|
817
|
+
*
|
|
818
|
+
* Instances with proof verification enabled also require the bundle's
|
|
819
|
+
* `proofs` and `manifestSig`.
|
|
820
|
+
*/
|
|
821
|
+
addClaimsFromProof(input: ProofClaimsInput, options: SignOptions | ProofConfirmOptions): Promise<ProofClaimsResult>;
|
|
822
|
+
addClaimsFromProof(input: ProofClaimsInput): Promise<PreparedProofClaims | PreparedProofClaimsPlan>;
|
|
823
|
+
/**
|
|
824
|
+
* Add a manual claim (AML, TAX_RESIDENCY, SANCTIONS_CHECK, PEP_CHECK).
|
|
825
|
+
* Provide either a pre-computed 32-byte `dataHash` or a `dataInput` string
|
|
826
|
+
* for the backend to hash. Proof-backed claim types must go through
|
|
827
|
+
* `addClaimsFromProof` instead.
|
|
828
|
+
*/
|
|
829
|
+
addClaim(input: AddClaimInput, options: SignOptions | ConfirmOptions): Promise<AddClaimResult>;
|
|
830
|
+
addClaim(input: AddClaimInput): Promise<PreparedAddClaim | PreparedAddClaimPlan>;
|
|
831
|
+
/**
|
|
832
|
+
* Revoke an on-chain claim.
|
|
833
|
+
*/
|
|
834
|
+
revokeClaim(walletAddress: string, claimType: ClaimType | number, options: SignOptions | ConfirmOptions): Promise<RevokeClaimResult>;
|
|
835
|
+
revokeClaim(walletAddress: string, claimType: ClaimType | number): Promise<PreparedRevokeClaim>;
|
|
836
|
+
private confirmVerify;
|
|
837
|
+
private confirmBatchVerify;
|
|
838
|
+
private confirmRevoke;
|
|
839
|
+
private confirmAddClaim;
|
|
840
|
+
private confirmRevokeClaim;
|
|
841
|
+
private confirmProofClaims;
|
|
842
|
+
private confirmOnchainId;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
declare class CustomerIdLinks {
|
|
846
|
+
private readonly http;
|
|
847
|
+
constructor(http: HttpClient);
|
|
848
|
+
/**
|
|
849
|
+
* Create a KYC verification link to send to an investor.
|
|
850
|
+
*/
|
|
851
|
+
create(input: CreateIdLinkInput): Promise<IdLink>;
|
|
852
|
+
/**
|
|
853
|
+
* List all verification links for the current instance.
|
|
854
|
+
*/
|
|
855
|
+
list(options?: ListIdLinksOptions): Promise<{
|
|
856
|
+
links: IdLinkListItem[];
|
|
857
|
+
total: number;
|
|
858
|
+
}>;
|
|
859
|
+
/**
|
|
860
|
+
* Revoke (expire) a verification link so it can no longer be used.
|
|
861
|
+
*/
|
|
862
|
+
revoke(linkId: string): Promise<void>;
|
|
863
|
+
/**
|
|
864
|
+
* Resend a verification link via the specified channels.
|
|
865
|
+
*/
|
|
866
|
+
resend(linkId: string, channels: ('email' | 'sms')[]): Promise<{
|
|
867
|
+
verificationUrl: string;
|
|
868
|
+
delivery: Record<string, {
|
|
869
|
+
sent: boolean;
|
|
870
|
+
error?: string;
|
|
871
|
+
}>;
|
|
872
|
+
}>;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Synchronize an existing customer database with Trusset in bulk.
|
|
877
|
+
*
|
|
878
|
+
* This module handles:
|
|
879
|
+
* - Batched upsert of customer records mapped by externalId
|
|
880
|
+
* - Conflict resolution (skip or update)
|
|
881
|
+
* - Optional on-chain identity verification for entries that include a wallet
|
|
882
|
+
* - Progress callbacks for long-running imports
|
|
883
|
+
*
|
|
884
|
+
* Usage:
|
|
885
|
+
* ```ts
|
|
886
|
+
* const result = await trusset.customers.sync.importRecords(records, {
|
|
887
|
+
* onConflict: 'update',
|
|
888
|
+
* verifyOnChain: true,
|
|
889
|
+
* signer: issuerWallet,
|
|
890
|
+
* onProgress: (done, total) => console.log(`${done}/${total}`),
|
|
891
|
+
* })
|
|
892
|
+
* ```
|
|
893
|
+
*/
|
|
894
|
+
declare class CustomerSync {
|
|
895
|
+
private readonly http;
|
|
896
|
+
private readonly manage;
|
|
897
|
+
private readonly identity;
|
|
898
|
+
constructor(http: HttpClient, identity?: CustomerIdentity);
|
|
899
|
+
/**
|
|
900
|
+
* Import customer records from an external system.
|
|
901
|
+
*
|
|
902
|
+
* Each record is mapped by `externalId`. If a customer with that externalId
|
|
903
|
+
* already exists, the `onConflict` strategy determines whether to skip or
|
|
904
|
+
* update.
|
|
905
|
+
*
|
|
906
|
+
* When `verifyOnChain` is true, records that include a `walletAddress` and
|
|
907
|
+
* `country` are batch-verified on-chain after the database import. That
|
|
908
|
+
* needs `signer`: verification transactions are signed by your wallet, not
|
|
909
|
+
* by Trusset.
|
|
910
|
+
*/
|
|
911
|
+
importRecords(records: SyncRecord[], options?: SyncOptions): Promise<SyncResult>;
|
|
912
|
+
/**
|
|
913
|
+
* Export all customers from Trusset as flat records.
|
|
914
|
+
* Useful for syncing data back into your system.
|
|
915
|
+
*/
|
|
916
|
+
exportRecords(options?: {
|
|
917
|
+
includeArchived?: boolean;
|
|
918
|
+
}): Promise<SyncRecord[]>;
|
|
919
|
+
private processRecord;
|
|
920
|
+
private runBatchVerification;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Verification profiles (beta): the reusable KYC requirement sets of the
|
|
925
|
+
* instance. Profile keys are valid `investorType` values for customers
|
|
926
|
+
* and ID links. Read-only on the API surface.
|
|
927
|
+
*/
|
|
928
|
+
declare class CustomerVerificationProfiles {
|
|
929
|
+
private readonly http;
|
|
930
|
+
constructor(http: HttpClient);
|
|
931
|
+
/**
|
|
932
|
+
* List all verification profiles of the current instance,
|
|
933
|
+
* presets (RETAIL, PROFESSIONAL, ELIGIBLE_COUNTERPARTY) first.
|
|
934
|
+
*/
|
|
935
|
+
list(): Promise<VerificationProfile[]>;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Customer module providing full lifecycle management:
|
|
940
|
+
*
|
|
941
|
+
* - `manage` - CRUD operations, search, wallet linking
|
|
942
|
+
* - `identity` - On-chain KYC verification + claims via IdentityRegistry
|
|
943
|
+
* - `idLinks` - Send and manage KYC verification links
|
|
944
|
+
* - `profiles` - Verification profiles of the instance (beta, read-only)
|
|
945
|
+
* - `sync` - Bulk import/export for existing database integration
|
|
946
|
+
*/
|
|
947
|
+
declare class Customers {
|
|
948
|
+
readonly manage: CustomerManagement;
|
|
949
|
+
readonly identity: CustomerIdentity;
|
|
950
|
+
readonly idLinks: CustomerIdLinks;
|
|
951
|
+
readonly profiles: CustomerVerificationProfiles;
|
|
952
|
+
readonly sync: CustomerSync;
|
|
953
|
+
constructor(http: HttpClient, chain?: ChainSource);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export { type ProfileRequiredField as $, type AddClaimInput as A, type BatchVerifyEntry as B, Customers as C, type LinkedWallet as D, type LinkedWalletsResult as E, type ListCustomersOptions as F, type ListIdLinksOptions as G, type OnchainIdResult as H, type IdLink as I, type PreparedAddClaimPlan as J, type KycProofManifest as K, type LinkWalletInput as L, type PreparedBatchEntry as M, type PreparedBatchVerify as N, type OnChainIdentity as O, type PreparedAddClaim as P, type PreparedBatchVerifyPlan as Q, type PreparedOnchainId as R, type PreparedProofClaimStep as S, type PreparedProofClaims as T, type PreparedProofClaimsPlan as U, type VerifyIdentityInput as V, type PreparedRevokeClaim as W, type PreparedRevokeIdentity as X, type PreparedTransaction as Y, type PreparedVerifyIdentity as Z, type PreparedVerifyPlan as _, type AddClaimResult as a, type ProofClaimOutcome as a0, type ProofClaimTxResult as a1, type ProofClaimsInput as a2, type ProofClaimsResult as a3, type ProofConfirmOptions as a4, type ProofVerificationInfo as a5, type RegisterKind as a6, type RegisterPhase as a7, type RegisterPlan as a8, type RegisterPlanInput as a9, type RegisterPlanStep as aa, type RevokeClaimResult as ab, type RevokeIdentityResult as ac, type SyncError as ad, type SyncOptions as ae, type SyncRecord as af, type SyncResult as ag, type TransferCheckInput as ah, type TransferCheckResult as ai, type UpdateCustomerInput as aj, type VerificationProfile as ak, type VerifyIdentityResult as al, type BatchVerifyRejection as b, type BatchVerifyResult as c, type Claim as d, type ClaimSignature as e, type ClaimSigningRequest as f, type ClaimType as g, type ClaimsResult as h, type ConfirmWith as i, type CreateCustomerInput as j, type CreateIdLinkInput as k, type Customer as l, CustomerIdLinks as m, CustomerIdentity as n, CustomerManagement as o, type CustomerStatus as p, CustomerSync as q, type CustomerType as r, CustomerVerificationProfiles as s, type IdLinkListItem as t, type IdLinkStatus as u, type IdentityStatusResult as v, type InvestorType as w, type InvestorTypeInput as x, type KYCStatus as y, type KycProofLeaf as z };
|