@notabene/javascript-sdk 2.0.0-next.8 → 2.0.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/LICENSE.md +21 -0
- package/README.md +471 -111
- package/dist/js/notabene.js +1 -0
- package/dist/notabene.cjs +1 -1
- package/dist/notabene.d.ts +1012 -227
- package/dist/notabene.js +286 -110
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +31 -23
- package/src/__tests__/notabene.test.ts +113 -2
- package/src/arbitraries.ts +0 -13
- package/src/components/EmbeddedComponent.ts +125 -63
- package/src/components/__tests__/EmbeddedComponent.test.ts +402 -32
- package/src/ivms/types.ts +177 -140
- package/src/locales.ts +47 -0
- package/src/notabene.ts +199 -63
- package/src/types.ts +773 -150
- package/src/utils/MessageEventManager.ts +70 -9
- package/src/utils/__tests__/MessageEventManager.test.ts +29 -5
- package/src/utils/__tests__/urls.test.ts +112 -0
- package/src/utils/arbitraries.ts +219 -1
- package/src/utils/urls.ts +30 -5
package/dist/notabene.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 5.2.6
|
|
3
2
|
* Address
|
|
3
|
+
* Represents a physical address
|
|
4
|
+
* @public
|
|
4
5
|
*/
|
|
5
6
|
declare type Address = {
|
|
6
7
|
/** Identifies the nature of the address. */
|
|
@@ -34,16 +35,13 @@ declare type Address = {
|
|
|
34
35
|
/** Information that locates and identifies a specific address, presented in free format text. */
|
|
35
36
|
addressLine?: string[];
|
|
36
37
|
/** Nation with its own government. */
|
|
37
|
-
country:
|
|
38
|
+
country: ISOCountryCode;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* `HOME` Residential - Address is the home address.
|
|
45
|
-
* `BIZZ` Business - Address is the business address.
|
|
46
|
-
* `GEOG` Geographic - Address is the unspecified physical (geographical) address suitable for identification of the natural or legal person.
|
|
42
|
+
* Address Type Code
|
|
43
|
+
* Specifies the type of address
|
|
44
|
+
* @public
|
|
47
45
|
*/
|
|
48
46
|
declare type AddressTypeCode = 'HOME' | 'BIZZ' | 'GEOG';
|
|
49
47
|
|
|
@@ -54,8 +52,8 @@ declare type AddressTypeCode = 'HOME' | 'BIZZ' | 'GEOG';
|
|
|
54
52
|
export declare interface Agent {
|
|
55
53
|
did: DID;
|
|
56
54
|
type: AgentType;
|
|
57
|
-
logo?:
|
|
58
|
-
url?:
|
|
55
|
+
logo?: URI;
|
|
56
|
+
url?: URI;
|
|
59
57
|
name?: string;
|
|
60
58
|
verified?: boolean;
|
|
61
59
|
}
|
|
@@ -70,51 +68,136 @@ export declare enum AgentType {
|
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
71
|
+
* Beneficiary
|
|
72
|
+
* Represents the receiver of the requested VA transfer
|
|
73
|
+
* @public
|
|
75
74
|
*/
|
|
76
75
|
declare type Beneficiary = {
|
|
76
|
+
/** Array of persons associated with the beneficiary */
|
|
77
77
|
beneficiaryPersons?: Person[];
|
|
78
|
+
/** Array of account numbers, maximum 100 characters each */
|
|
78
79
|
accountNumber?: string[];
|
|
79
80
|
};
|
|
80
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Fields specific to the beneficiary of a transaction
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
81
86
|
declare type BeneficiaryFields = {
|
|
82
|
-
destination?:
|
|
87
|
+
destination?: Destination;
|
|
83
88
|
};
|
|
84
89
|
|
|
85
90
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
91
|
+
* Beneficiary VASP
|
|
92
|
+
* Represents the VASP which receives the VA transfer
|
|
93
|
+
* @public
|
|
88
94
|
*/
|
|
89
95
|
declare type BeneficiaryVASP = {
|
|
96
|
+
/** The beneficiary VASP information */
|
|
90
97
|
beneficiaryVASP?: Person;
|
|
91
98
|
};
|
|
92
99
|
|
|
93
|
-
|
|
100
|
+
/**
|
|
101
|
+
* A blockchain address
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
/**
|
|
105
|
+
* A native blockchain address string
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* Represents a blockchain address in the native format specific to a particular chain.
|
|
109
|
+
* This could be an Ethereum address, Bitcoin address, or other chain-specific format.
|
|
110
|
+
* The address format and validation rules depend on the underlying blockchain.
|
|
111
|
+
*
|
|
112
|
+
* @example "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Ethereum address
|
|
113
|
+
* @example "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" // Bitcoin address
|
|
114
|
+
* @example "cosmos1t2uflqwqe0fsj0shcfkrvpukewcw40yjj6hdc0" // Cosmos address
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
export declare type BlockchainAddress = string;
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Chain Agnostic Account Identifier (CAIP-10)
|
|
121
|
+
* Represents an account/address on a specific blockchain following the CAIP-10 specification.
|
|
122
|
+
* Extends CAIP-2 by adding the account address specific to that chain.
|
|
123
|
+
*
|
|
124
|
+
* Format: `{caip2}:{address}`
|
|
125
|
+
* - caip2: The CAIP-2 chain identifier (e.g. 'eip155:1')
|
|
126
|
+
* - address: Chain-specific account address format
|
|
127
|
+
*
|
|
128
|
+
* @example "eip155:1:0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Ethereum account on mainnet
|
|
129
|
+
* @example "bip122:000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" // Bitcoin account on mainnet
|
|
130
|
+
* @example "cosmos:cosmoshub-3:cosmos1t2uflqwqe0fsj0shcfkrvpukewcw40yjj6hdc0" // Cosmos account
|
|
131
|
+
* @see {@link https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md | CAIP-10 Specification}
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
export declare type CAIP10 = `${CAIP2}:${string}`;
|
|
96
135
|
|
|
97
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Chain Agnostic Asset Identifier (CAIP-19)
|
|
138
|
+
* Represents an asset/token on a specific blockchain following the CAIP-19 specification.
|
|
139
|
+
* Extends CAIP-2 by adding asset type and identifier information.
|
|
140
|
+
*
|
|
141
|
+
* Format: `{caip2}/{asset_namespace}:{asset_reference}`
|
|
142
|
+
* - caip2: The CAIP-2 chain identifier (e.g. 'eip155:1')
|
|
143
|
+
* - asset_namespace: The asset standard (e.g. 'erc20', 'erc721', 'slip44')
|
|
144
|
+
* - asset_reference: Chain/standard-specific asset identifier
|
|
145
|
+
*
|
|
146
|
+
* @example "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f" // DAI token on Ethereum mainnet
|
|
147
|
+
* @example "eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d" // CryptoKitties NFT contract
|
|
148
|
+
* @example "cosmos:cosmoshub-3/slip44:118" // ATOM token on Cosmos Hub
|
|
149
|
+
* @see {@link https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-19.md | CAIP-19 Specification}
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
export declare type CAIP19 = `${CAIP2}/${string}:${string}`;
|
|
98
153
|
|
|
99
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Chain Agnostic Blockchain Identifier (CAIP-2)
|
|
156
|
+
* Represents a blockchain in a chain-agnostic way following the CAIP-2 specification.
|
|
157
|
+
* The identifier consists of a namespace and reference separated by a colon.
|
|
158
|
+
*
|
|
159
|
+
* Format: `namespace:reference`
|
|
160
|
+
* - namespace: Represents the blockchain namespace (e.g. 'eip155', 'bip122', 'cosmos')
|
|
161
|
+
* - reference: Chain-specific identifier within that namespace
|
|
162
|
+
*
|
|
163
|
+
* @example "eip155:1" // Ethereum Mainnet
|
|
164
|
+
* @example "bip122:000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" // Bitcoin Mainnet
|
|
165
|
+
* @example "cosmos:cosmoshub-3" // Cosmos Hub Mainnet
|
|
166
|
+
* @see {@link https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md | CAIP-2 Specification}
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
export declare type CAIP2 = `${string}:${string}`;
|
|
100
170
|
|
|
101
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Options for callback and redirect URIs
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
export declare interface CallbackOptions {
|
|
102
176
|
callback?: URI;
|
|
103
177
|
redirectUri?: URI;
|
|
104
178
|
}
|
|
105
179
|
|
|
106
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Represents a cancel component message
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
export declare type Cancel = {
|
|
107
185
|
type: CMType.CANCEL;
|
|
108
186
|
};
|
|
109
187
|
|
|
110
|
-
declare type CloseModal = {
|
|
111
|
-
type: CMType.CLOSE;
|
|
112
|
-
reqid: RequestID;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
188
|
/**
|
|
116
|
-
* Component Message
|
|
117
|
-
*
|
|
189
|
+
* Component Message Type enum representing different message types that can be sent
|
|
190
|
+
* between the host and component.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* - COMPLETE: Indicates a completed operation with response data
|
|
194
|
+
* - RESIZE: Request to adjust component size/dimensions
|
|
195
|
+
* - RESULT: Operation result notification
|
|
196
|
+
* - READY: Component is initialized and ready
|
|
197
|
+
* - INVALID: Validation failed with errors
|
|
198
|
+
* - ERROR: Operation encountered an error
|
|
199
|
+
* - CANCEL: Operation was cancelled
|
|
200
|
+
* @public
|
|
118
201
|
*/
|
|
119
202
|
export declare const enum CMType {
|
|
120
203
|
COMPLETE = "complete",
|
|
@@ -122,44 +205,160 @@ export declare const enum CMType {
|
|
|
122
205
|
RESULT = "result",
|
|
123
206
|
READY = "ready",
|
|
124
207
|
INVALID = "invalid",
|
|
125
|
-
MODAL = "openModal",
|
|
126
208
|
ERROR = "error",
|
|
127
|
-
CLOSE = "closeModal",
|
|
128
209
|
CANCEL = "cancel"
|
|
129
210
|
}
|
|
130
211
|
|
|
131
|
-
|
|
212
|
+
/**
|
|
213
|
+
* Represents a completed component message
|
|
214
|
+
* @typeParam T - The overall Value type being returned
|
|
215
|
+
* @param response - The Response object which wraps T
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
export declare type Completed<T> = {
|
|
132
219
|
type: CMType.COMPLETE;
|
|
133
|
-
response: TransactionResponse
|
|
220
|
+
response: TransactionResponse<T>;
|
|
134
221
|
};
|
|
135
222
|
|
|
136
223
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
224
|
+
* Union type representing all possible messages that can be sent from a component
|
|
225
|
+
*
|
|
226
|
+
* @remarks
|
|
227
|
+
* Components communicate their state and results back to the host application
|
|
228
|
+
* through these message types:
|
|
229
|
+
* - Completed: Operation finished successfully with response data
|
|
230
|
+
* - Cancel: User cancelled the operation
|
|
231
|
+
* - Error: Operation failed with error message
|
|
232
|
+
* - Ready: Component initialized and ready for use
|
|
233
|
+
* - ResizeRequest: Component needs to adjust its dimensions
|
|
234
|
+
* - InvalidValue: Validation failed with current partial value
|
|
235
|
+
*
|
|
236
|
+
* @typeParam T - The value type that will be returned in Completed messages
|
|
237
|
+
*
|
|
238
|
+
* @see {@link Completed} For successful completion message format
|
|
239
|
+
* @see {@link Cancel} For cancellation message format
|
|
240
|
+
* @see {@link Error} For error message format
|
|
241
|
+
* @see {@link Ready} For ready message format
|
|
242
|
+
* @see {@link ResizeRequest} For resize message format
|
|
243
|
+
* @see {@link InvalidValue} For validation failure message format
|
|
244
|
+
* @public
|
|
245
|
+
*/
|
|
246
|
+
export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Base interface for requests sent to SDK components
|
|
250
|
+
*
|
|
251
|
+
* @remarks
|
|
252
|
+
* Defines core properties that all component requests share:
|
|
253
|
+
* - Optional unique request ID for tracking/correlating requests and responses
|
|
254
|
+
* - Optional customer detailsfor pre-filling component data
|
|
255
|
+
*
|
|
256
|
+
* This interface is extended by specific request types like:
|
|
257
|
+
* - Transaction requests for sending/receiving assets
|
|
258
|
+
* - Connection requests for establishing VASP to VASP communication
|
|
259
|
+
*
|
|
260
|
+
* @see {@link Transaction} For transaction-specific request properties
|
|
261
|
+
* @see {@link ConnectionRequest} For connection-specific request properties
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
declare interface ComponentRequest {
|
|
265
|
+
requestId?: RequestID;
|
|
266
|
+
customer?: Counterparty;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Base response interface for all SDK component operations
|
|
271
|
+
*
|
|
272
|
+
* @remarks
|
|
273
|
+
* Provides standardized response propertiesfor component interactions:
|
|
274
|
+
* - requestID: Links response back to the originating request
|
|
275
|
+
* - valid: Boolean indicating if the operation was valid/successful
|
|
276
|
+
* - status: Current verification status of the operation
|
|
277
|
+
* - errors: Array of validation errors if any occurred
|
|
278
|
+
*
|
|
279
|
+
* This interface is extended by specific response types like:
|
|
280
|
+
* - TransResponse for transaction operations
|
|
281
|
+
* - ConnectionResponse for VASP connection operations
|
|
282
|
+
*
|
|
283
|
+
* @see {@link Status} For possible status values
|
|
284
|
+
* @see {@link ValidationError} For error structure
|
|
285
|
+
* @see {@link TransactionResponse} For transaction-specific responses
|
|
286
|
+
* @public
|
|
287
|
+
*/
|
|
288
|
+
export declare interface ComponentResponse {
|
|
289
|
+
requestID: RequestID;
|
|
290
|
+
valid: boolean;
|
|
291
|
+
status: Status;
|
|
292
|
+
errors: ValidationError[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* An object representing options for a Connection Request
|
|
297
|
+
* @public
|
|
298
|
+
*/
|
|
299
|
+
declare type ConnectionOptions = Omit<TransactionOptions, 'allowedAgentTypes' | 'allowedCounterpartyTypes' | 'vasps' | 'fields' | 'hide'>;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* An object representing a connection request
|
|
303
|
+
* @public
|
|
139
304
|
*/
|
|
140
|
-
export declare
|
|
305
|
+
export declare interface ConnectionRequest extends ComponentRequest {
|
|
306
|
+
asset: TransactionAsset;
|
|
307
|
+
}
|
|
141
308
|
|
|
142
309
|
/**
|
|
143
310
|
* The counterparty of a transaction.
|
|
144
311
|
* @public
|
|
145
312
|
*/
|
|
313
|
+
/**
|
|
314
|
+
* Interface representing a party involved in a transaction other than the initiator
|
|
315
|
+
*
|
|
316
|
+
* @remarks
|
|
317
|
+
fines the core properties that identify and describe a counterparty:
|
|
318
|
+
* - name: The display or legal name of the counterparty
|
|
319
|
+
* - accountNumber: An account identifier/reference number
|
|
320
|
+
* - did: Decentralized identifier for the counterparty
|
|
321
|
+
* - type: Classification as natural person, legal entity, or self
|
|
322
|
+
* - verified: Whether the counterparty's identity has been verified
|
|
323
|
+
* - geographicAddress: Physical/mailing address information
|
|
324
|
+
* - nationalIdentification: Government-issued ID details
|
|
325
|
+
* - website: Official web presence
|
|
326
|
+
* - phone: Contact phone number
|
|
327
|
+
* - email: Contact email address
|
|
328
|
+
*
|
|
329
|
+
* This interface serves as the base for more specific counterparty types:
|
|
330
|
+
* @see {@link NaturalPerson} For individual person properties
|
|
331
|
+
* @see {@link LegalPerson} For organization/entity properties
|
|
332
|
+
*
|
|
333
|
+
* @public
|
|
334
|
+
*/
|
|
146
335
|
export declare interface Counterparty {
|
|
147
336
|
name?: string;
|
|
148
337
|
accountNumber?: string;
|
|
149
|
-
did?:
|
|
150
|
-
geographicAddress?: string;
|
|
338
|
+
did?: DID;
|
|
151
339
|
type?: PersonType;
|
|
152
340
|
verified?: boolean;
|
|
341
|
+
geographicAddress?: Address;
|
|
342
|
+
nationalIdentification?: NationalIdentification;
|
|
343
|
+
website?: URI;
|
|
344
|
+
phone?: string;
|
|
345
|
+
email?: string;
|
|
153
346
|
}
|
|
154
347
|
|
|
155
|
-
|
|
348
|
+
/**
|
|
349
|
+
* A crypto credential
|
|
350
|
+
* @public
|
|
351
|
+
*/ export declare type CryptoCredential = `${string}.${string}.mastercard`;
|
|
156
352
|
|
|
157
353
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
354
|
+
* Date and Place of Birth
|
|
355
|
+
* Represents the date and place of birth for a natural person
|
|
356
|
+
* @public
|
|
160
357
|
*/
|
|
161
358
|
declare type DateAndPlaceOfBirth = {
|
|
162
|
-
|
|
359
|
+
/** Date of birth in ISO 8601 format (YYYY-MM-DD) */
|
|
360
|
+
dateOfBirth?: ISODate;
|
|
361
|
+
/** Place of birth (max 70 characters) */
|
|
163
362
|
placeOfBirth?: string;
|
|
164
363
|
};
|
|
165
364
|
|
|
@@ -173,6 +372,15 @@ export declare interface DeclarationProof extends OwnershipProof {
|
|
|
173
372
|
confirmed: boolean;
|
|
174
373
|
}
|
|
175
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Decodes a URL fragment into an object
|
|
377
|
+
*
|
|
378
|
+
* @param fragment - The URL fragment to decode
|
|
379
|
+
* @returns An object containing the decoded key-value pairs
|
|
380
|
+
* @public
|
|
381
|
+
*/
|
|
382
|
+
export declare function decodeFragmentToObject(fragment: string): Record<string, string>;
|
|
383
|
+
|
|
176
384
|
/**
|
|
177
385
|
* An object representing a deposit transaction
|
|
178
386
|
* @public
|
|
@@ -184,86 +392,251 @@ export declare interface Deposit extends OriginatorFields, Transaction {
|
|
|
184
392
|
* An object representing a request for a deposit
|
|
185
393
|
* @public
|
|
186
394
|
*/
|
|
187
|
-
export declare interface DepositRequest extends DepositRequestFields,
|
|
395
|
+
export declare interface DepositRequest extends DepositRequestFields, ComponentRequest {
|
|
188
396
|
}
|
|
189
397
|
|
|
398
|
+
/**
|
|
399
|
+
* Fields specific to a deposit request
|
|
400
|
+
* @public
|
|
401
|
+
*/
|
|
190
402
|
declare type DepositRequestFields = {
|
|
191
|
-
|
|
403
|
+
destination: BlockchainAddress | CAIP10;
|
|
404
|
+
asset: TransactionAsset;
|
|
405
|
+
amountDecimal?: number;
|
|
406
|
+
travelAddress?: TravelAddress;
|
|
407
|
+
cryptoCredential?: CryptoCredential;
|
|
192
408
|
};
|
|
193
409
|
|
|
410
|
+
/**
|
|
411
|
+
* An object representing options for a Deposit Request
|
|
412
|
+
* @public
|
|
413
|
+
*/
|
|
414
|
+
declare interface DepositRequestOptions {
|
|
415
|
+
showQrCode?: boolean;
|
|
416
|
+
}
|
|
417
|
+
|
|
194
418
|
/**
|
|
195
419
|
* The destination of a transaction either a blockchain address, a CAIP-19 address, or a travel address.
|
|
196
420
|
* @public
|
|
197
421
|
*/
|
|
198
|
-
export declare type
|
|
422
|
+
export declare type Destination = BlockchainAddress | CAIP10 | CryptoCredential | TravelAddress;
|
|
199
423
|
|
|
200
|
-
|
|
424
|
+
/**
|
|
425
|
+
* A Decentralized Identifier
|
|
426
|
+
* @public
|
|
427
|
+
*/
|
|
428
|
+
export declare type DID = `did:${string}:${string}`;
|
|
201
429
|
|
|
202
|
-
|
|
430
|
+
/**
|
|
431
|
+
* Digital Token Identifier (DTI) following ISO 24165 standard
|
|
432
|
+
*
|
|
433
|
+
* @remarks
|
|
434
|
+
* A standardized identifier for digital assets and cryptocurrencies. The DTI system
|
|
435
|
+
* provides unique and unambiguous identification of digital tokens, supporting interoperability
|
|
436
|
+
* and clarity in financial markets.
|
|
437
|
+
*
|
|
438
|
+
* Format: `DTI[NNNNN]` where N is a digit
|
|
439
|
+
*
|
|
440
|
+
* @example "DTI00001" // Example DTI for Bitcoin
|
|
441
|
+
* @example "DTI00002" // Example DTI for Ethereum
|
|
442
|
+
*
|
|
443
|
+
* @see {@link https://dtif.org/ | Digital Token Identifier Foundation}
|
|
444
|
+
* @see {@link https://www.iso.org/standard/77895.html | ISO 24165}
|
|
445
|
+
* @public
|
|
446
|
+
*/
|
|
447
|
+
export declare type DTI = string;
|
|
203
448
|
|
|
204
449
|
/**
|
|
205
450
|
* An embedded Notabene component
|
|
206
451
|
* @public
|
|
207
452
|
*/
|
|
208
|
-
export declare class EmbeddedComponent {
|
|
453
|
+
export declare class EmbeddedComponent<V, O> {
|
|
209
454
|
private _url;
|
|
210
455
|
private _value;
|
|
456
|
+
private _options?;
|
|
211
457
|
private _errors;
|
|
212
458
|
private iframe?;
|
|
213
459
|
private eventManager;
|
|
214
|
-
private ready;
|
|
215
460
|
private modal?;
|
|
216
|
-
|
|
461
|
+
/**
|
|
462
|
+
* Creates an instance of EmbeddedComponent.
|
|
463
|
+
* @param url - The URL of the embedded component
|
|
464
|
+
* @param value - The initial transaction value
|
|
465
|
+
*/
|
|
466
|
+
constructor(url: string, value: Partial<V>, options?: O);
|
|
467
|
+
/**
|
|
468
|
+
* Gets the URL of the embedded component
|
|
469
|
+
* @returns The URL of the embedded component
|
|
470
|
+
*/
|
|
217
471
|
get url(): string;
|
|
218
|
-
|
|
472
|
+
/**
|
|
473
|
+
* Gets the current transaction value
|
|
474
|
+
* @returns The current transaction value
|
|
475
|
+
*/
|
|
476
|
+
get value(): Partial<V>;
|
|
477
|
+
get options(): O | undefined;
|
|
219
478
|
get errors(): ValidationError[];
|
|
479
|
+
/**
|
|
480
|
+
* Opens the component URL in the current window
|
|
481
|
+
*/
|
|
220
482
|
open(): void;
|
|
483
|
+
/**
|
|
484
|
+
* Mounts the component to a parent element
|
|
485
|
+
* @param parentId - The ID of the parent element
|
|
486
|
+
* @throws Will throw an error if the parent element is not found
|
|
487
|
+
*/
|
|
221
488
|
mount(parentId: string): void;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
489
|
+
/**
|
|
490
|
+
* Embeds the component into a parent element
|
|
491
|
+
* @param parent - The parent element to embed the component into
|
|
492
|
+
*/
|
|
493
|
+
embed(parent: Element, modal?: boolean): void;
|
|
494
|
+
removeEmbed(): void;
|
|
495
|
+
/**
|
|
496
|
+
* Sends a message to the embedded component
|
|
497
|
+
* @param message - The message to send
|
|
498
|
+
*/
|
|
499
|
+
send(message: HostMessage<V, O>): void;
|
|
500
|
+
/**
|
|
501
|
+
* Adds an event listener for a specific message type
|
|
502
|
+
* @param messageType - The type of message to listen for
|
|
503
|
+
* @param callback - The callback function to execute when the message is received
|
|
504
|
+
*/
|
|
505
|
+
on(messageType: string, callback: MessageCallback<V>): () => void;
|
|
506
|
+
/**
|
|
507
|
+
* Removes an event listener for a specific message type
|
|
508
|
+
* @param messageType - The type of message to stop listening for
|
|
509
|
+
* @param callback - The callback function to remove
|
|
510
|
+
*/
|
|
511
|
+
off(messageType: string, callback: MessageCallback<V>): void;
|
|
512
|
+
/**
|
|
513
|
+
* Updates the transaction value and sends an update message to the component
|
|
514
|
+
* @param value - The new transaction value
|
|
515
|
+
*/
|
|
516
|
+
update(value: Partial<V>, options?: O): void;
|
|
517
|
+
/**
|
|
518
|
+
* Waits for the component to complete and returns the transaction response
|
|
519
|
+
* @returns A promise that resolves with the transaction response
|
|
520
|
+
*/
|
|
521
|
+
completion(): Promise<TransactionResponse<V>>;
|
|
522
|
+
/**
|
|
523
|
+
* Opens the component in a modal dialog
|
|
524
|
+
*/
|
|
525
|
+
openModal(): Promise<TransactionResponse<V>>;
|
|
526
|
+
/**
|
|
527
|
+
* Closes the modal dialog
|
|
528
|
+
*
|
|
529
|
+
*/
|
|
530
|
+
closeModal(): void;
|
|
230
531
|
}
|
|
231
532
|
|
|
533
|
+
/**
|
|
534
|
+
* Represents an error component message
|
|
535
|
+
* @param message - Error message
|
|
536
|
+
* @public
|
|
537
|
+
*/
|
|
232
538
|
declare type Error_2 = {
|
|
233
539
|
type: CMType.ERROR;
|
|
234
540
|
message: string;
|
|
235
541
|
};
|
|
542
|
+
export { Error_2 as Error }
|
|
236
543
|
|
|
237
544
|
/**
|
|
238
|
-
*
|
|
239
|
-
* @
|
|
545
|
+
* Field properties
|
|
546
|
+
* @public
|
|
240
547
|
*/
|
|
241
|
-
declare
|
|
548
|
+
declare type FieldOptions = boolean | {
|
|
549
|
+
optional: boolean;
|
|
550
|
+
transmit: boolean;
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Field type configuration
|
|
555
|
+
* @public
|
|
556
|
+
*/
|
|
557
|
+
export declare type FieldTypes = {
|
|
558
|
+
naturalPerson?: NaturalPersonFields;
|
|
559
|
+
legalPerson?: LegalPersonFields;
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Host Message Type enum representing different message types that can be sent
|
|
564
|
+
* from the host application.
|
|
565
|
+
*
|
|
566
|
+
* @remarks
|
|
567
|
+
* - UPDATE: Message to update component value/state
|
|
568
|
+
* - REQUEST_RESPONSE: Message requesting a response from component
|
|
569
|
+
* @public
|
|
570
|
+
*/
|
|
571
|
+
export declare const enum HMType {
|
|
242
572
|
UPDATE = "update",
|
|
243
573
|
REQUEST_RESPONSE = "requestResponse"
|
|
244
574
|
}
|
|
245
575
|
|
|
246
576
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
577
|
+
* Union type representing all possible messages that can be sent from the host application
|
|
578
|
+
* to a component
|
|
579
|
+
*
|
|
580
|
+
* @remarks
|
|
581
|
+
* Currently only supports update messages which allow the host to modify component
|
|
582
|
+
* and configuration. The host uses these messages to communicate changes to the component
|
|
583
|
+
* without requiring full reinitialization.
|
|
584
|
+
*
|
|
585
|
+
* @typeParam T - The value type that components operate on
|
|
586
|
+
* @typeParam O - The options type used to configure component behavior
|
|
587
|
+
*
|
|
588
|
+
* @see {@link UpdateValue} For the structure of update messages
|
|
589
|
+
* @see {@link HMType} For message type constants
|
|
590
|
+
* @public
|
|
249
591
|
*/
|
|
250
|
-
export declare type HostMessage = UpdateValue
|
|
592
|
+
export declare type HostMessage<T, O> = UpdateValue<T, O>;
|
|
251
593
|
|
|
252
594
|
/**
|
|
253
|
-
*
|
|
254
|
-
*
|
|
595
|
+
* Intermediary VASP
|
|
596
|
+
* Represents an intermediary Virtual Asset Service Provider
|
|
597
|
+
* @public
|
|
255
598
|
*/
|
|
256
599
|
declare type IntermediaryVASP = {
|
|
600
|
+
/** The intermediary VASP information */
|
|
257
601
|
intermediaryVASP?: Person;
|
|
602
|
+
/** The sequence number of this VASP in the transfer path */
|
|
258
603
|
sequence?: number;
|
|
259
604
|
};
|
|
260
605
|
|
|
261
|
-
|
|
606
|
+
/**
|
|
607
|
+
* Represents an invalid value component message
|
|
608
|
+
* @typeParam T - The overall Value type being returned
|
|
609
|
+
* @param value - The current Partial value
|
|
610
|
+
* @param errors - Array of validation errors
|
|
611
|
+
* @internal
|
|
612
|
+
*/
|
|
613
|
+
export declare type InvalidValue<T> = {
|
|
262
614
|
type: CMType.INVALID;
|
|
263
|
-
value:
|
|
615
|
+
value: Partial<T>;
|
|
264
616
|
errors: ValidationError[];
|
|
265
617
|
};
|
|
266
618
|
|
|
619
|
+
/**
|
|
620
|
+
* ISO-3166 Alpha-2 country code
|
|
621
|
+
* @example "US" for United States, "GB" for United Kingdom
|
|
622
|
+
* @public
|
|
623
|
+
*/
|
|
624
|
+
declare type ISOCountryCode = string;
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* 3 letter ISO currency code
|
|
628
|
+
* @public
|
|
629
|
+
*/
|
|
630
|
+
declare type ISOCurrency = string;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* A point in time, represented as a day within the calendar year. Compliant with ISO 8601.
|
|
634
|
+
* Format: YYYY-MM-DD
|
|
635
|
+
* @example "2023-05-15" for May 15, 2023
|
|
636
|
+
* @public
|
|
637
|
+
*/
|
|
638
|
+
declare type ISODate = `${number}-${number}-${number}`;
|
|
639
|
+
|
|
267
640
|
/**
|
|
268
641
|
* IVMS101 definition
|
|
269
642
|
*
|
|
@@ -279,73 +652,134 @@ export declare type IVMS101 = {
|
|
|
279
652
|
};
|
|
280
653
|
|
|
281
654
|
/**
|
|
282
|
-
*
|
|
283
|
-
*
|
|
655
|
+
* Interface representing a legal entity (organization/company) involved in a transaction
|
|
656
|
+
*
|
|
657
|
+
* @remarks
|
|
658
|
+
* Extends the baseface to add properties specific to legal entities:
|
|
659
|
+
* - type: MustPersonType.LEGAL to identify as an organization
|
|
660
|
+
* - name: Required registered legal name of the entity
|
|
661
|
+
* - lei: Optional Legal Entity Identifier for regulated entities
|
|
662
|
+
* - logo: Optional URI to the organization's logo image
|
|
663
|
+
* - countryOfRegistration: Optional ISO country code where entity is registered
|
|
664
|
+
*
|
|
665
|
+
* This interface captures the additional identifying information required for
|
|
666
|
+
* legal persons under FATF Travel Rule requirements. The properties align with
|
|
667
|
+
* standard business KYC (Know Your Businessta collection practices.
|
|
668
|
+
*
|
|
669
|
+
* @see {@link Counterparty} For base properties common to all counterparties
|
|
670
|
+
* @see {@link PersonType} For person type classification
|
|
671
|
+
* @see {@link LEI} For Legal Entity Identifier format
|
|
672
|
+
* @public
|
|
673
|
+
*/
|
|
674
|
+
export declare interface LegalPerson extends Counterparty {
|
|
675
|
+
type: PersonType.LEGAL;
|
|
676
|
+
name: string;
|
|
677
|
+
lei?: LEI;
|
|
678
|
+
logo?: URI;
|
|
679
|
+
countryOfRegistration?: ISOCountryCode;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Legal Person
|
|
684
|
+
* Represents a legal person with all associated information
|
|
685
|
+
* @public
|
|
284
686
|
*/
|
|
285
|
-
declare type
|
|
286
|
-
/** The name of the legal person
|
|
687
|
+
declare type LegalPerson_2 = {
|
|
688
|
+
/** The name of the legal person */
|
|
287
689
|
name: LegalPersonName;
|
|
288
|
-
/** The address of the legal person
|
|
690
|
+
/** The address of the legal person */
|
|
289
691
|
geographicAddress?: Address[];
|
|
290
|
-
/** A distinct identifier that uniquely identifies the person to the institution in context
|
|
692
|
+
/** A distinct identifier that uniquely identifies the person to the institution in context */
|
|
291
693
|
customerNumber?: string;
|
|
292
|
-
/** A distinct identifier used by governments to uniquely identify a legal person
|
|
694
|
+
/** A distinct identifier used by governments to uniquely identify a legal person */
|
|
293
695
|
nationalIdentification?: NationalIdentification;
|
|
294
|
-
/** The country in which the legal person is registered
|
|
295
|
-
countryOfRegistration?:
|
|
696
|
+
/** The country in which the legal person is registered */
|
|
697
|
+
countryOfRegistration?: ISOCountryCode;
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
declare type LegalPersonFieldName = 'name' | 'lei' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'countryOfRegistration';
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Field properties by field name
|
|
704
|
+
* @public
|
|
705
|
+
*/
|
|
706
|
+
declare type LegalPersonFields = {
|
|
707
|
+
[name in LegalPersonFieldName]?: FieldOptions;
|
|
296
708
|
};
|
|
297
709
|
|
|
298
710
|
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
711
|
+
* Legal Person Name
|
|
712
|
+
* Represents the full name structure for a legal person
|
|
713
|
+
* @public
|
|
301
714
|
*/
|
|
302
715
|
declare type LegalPersonName = {
|
|
716
|
+
/** Array of name identifiers */
|
|
303
717
|
nameIdentifier: LegalPersonNameID[];
|
|
718
|
+
/** Array of local name identifiers */
|
|
304
719
|
localNameIdentifier?: LocalLegalPersonNameID[];
|
|
720
|
+
/** Array of phonetic name identifiers */
|
|
305
721
|
phoneticNameIdentifier?: LocalLegalPersonNameID[];
|
|
306
722
|
};
|
|
307
723
|
|
|
308
724
|
/**
|
|
309
|
-
*
|
|
310
|
-
*
|
|
725
|
+
* Legal Person Name ID
|
|
726
|
+
* Represents a name identifier for a legal person
|
|
727
|
+
* @public
|
|
311
728
|
*/
|
|
312
729
|
declare type LegalPersonNameID = {
|
|
313
|
-
/** Name by which the legal person is known
|
|
730
|
+
/** Name by which the legal person is known */
|
|
314
731
|
legalPersonName: string;
|
|
315
|
-
/** The nature of the name specified
|
|
732
|
+
/** The nature of the name specified */
|
|
316
733
|
legalPersonNameIdentifierType: LegalPersonNameTypeCode;
|
|
317
734
|
};
|
|
318
735
|
|
|
319
736
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* `LEGL` Legal name - Official name under which an organisation is registered.
|
|
324
|
-
* `SHRT` Short name - Specifies the short name of the organisation.
|
|
325
|
-
* `TRAD` Trading name - Name used by a business for commercial purposes, although its registered legal name, used for contracts and other formal situations, may be another.
|
|
737
|
+
* Legal Person Name Type Code
|
|
738
|
+
* Specifies the type of name for a legal person
|
|
739
|
+
* @public
|
|
326
740
|
*/
|
|
327
741
|
declare type LegalPersonNameTypeCode = 'LEGL' | 'SHRT' | 'TRAD';
|
|
328
742
|
|
|
329
743
|
/**
|
|
330
|
-
*
|
|
331
|
-
*
|
|
744
|
+
* A LEI Legal Entity Identifier
|
|
745
|
+
* @public
|
|
746
|
+
*/
|
|
747
|
+
export declare type LEI = string;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Local Legal Person Name ID
|
|
751
|
+
* Represents a local name identifier for a legal person
|
|
752
|
+
* @public
|
|
332
753
|
*/
|
|
333
754
|
declare type LocalLegalPersonNameID = {
|
|
755
|
+
/** Name of the legal person, maximum 100 characters in local format */
|
|
334
756
|
legalPersonName?: string;
|
|
757
|
+
/** Type of legal person name identifier */
|
|
335
758
|
legalPersonNameIdentifierType?: LegalPersonNameTypeCode;
|
|
336
759
|
};
|
|
337
760
|
|
|
338
761
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
762
|
+
* Local Natural Person Name ID
|
|
763
|
+
* Represents a local name identifier for a natural person
|
|
764
|
+
* @public
|
|
341
765
|
*/
|
|
342
766
|
declare type LocalNaturalPersonNameID = {
|
|
767
|
+
/** Primary identifier, maximum 100 characters in local format */
|
|
343
768
|
primaryIdentifier?: string;
|
|
769
|
+
/** Secondary identifier, maximum 100 characters in local format */
|
|
344
770
|
secondaryIdentifier?: string;
|
|
771
|
+
/** Type of name identifier */
|
|
345
772
|
nameIdentifierType?: NaturalPersonNameTypeCode;
|
|
346
773
|
};
|
|
347
774
|
|
|
348
|
-
|
|
775
|
+
/**
|
|
776
|
+
* Callback function for handling component messages.
|
|
777
|
+
*
|
|
778
|
+
* @typeParam T - The type of data contained in the component message
|
|
779
|
+
* @param message - The message object containing the component data and type
|
|
780
|
+
* @public
|
|
781
|
+
*/
|
|
782
|
+
export declare type MessageCallback<T> = (message: ComponentMessage<T>) => void;
|
|
349
783
|
|
|
350
784
|
/**
|
|
351
785
|
* Ownership Proof using Micro Transfer
|
|
@@ -353,99 +787,140 @@ declare type MessageCallback = (message: ComponentMessage) => void;
|
|
|
353
787
|
*/
|
|
354
788
|
export declare interface MicroTransferProof extends OwnershipProof {
|
|
355
789
|
type: ProofTypes.MicroTransfer;
|
|
356
|
-
|
|
790
|
+
proof: string;
|
|
357
791
|
chain: CAIP2;
|
|
358
|
-
|
|
792
|
+
asset: CAIP19;
|
|
793
|
+
destination: BlockchainAddress;
|
|
794
|
+
amountSubunits: string;
|
|
359
795
|
}
|
|
360
796
|
|
|
361
|
-
declare type ModalRequest = {
|
|
362
|
-
type: CMType.MODAL;
|
|
363
|
-
url: string;
|
|
364
|
-
reqid: RequestID;
|
|
365
|
-
};
|
|
366
|
-
|
|
367
797
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
798
|
+
* National Identification
|
|
799
|
+
* Represents a national identifier for a person or entity
|
|
800
|
+
* @public
|
|
370
801
|
*/
|
|
371
|
-
declare type NationalIdentification = {
|
|
802
|
+
export declare type NationalIdentification = {
|
|
803
|
+
/** National identifier (max 35 characters) */
|
|
372
804
|
nationalIdentifier?: string;
|
|
805
|
+
/** Type of national identifier */
|
|
373
806
|
nationalIdentifierType?: NationalIdentifierTypeCode;
|
|
374
|
-
|
|
807
|
+
/** Country that issued the national identifier */
|
|
808
|
+
countryOfIssue?: ISOCountryCode;
|
|
809
|
+
/** Registration authority (format: RA followed by 6 digits) */
|
|
375
810
|
registrationAuthority?: string;
|
|
376
811
|
};
|
|
377
812
|
|
|
378
813
|
/**
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* `ARNU` Alien registration number - Number assigned by a government agency to identify foreign nationals.
|
|
383
|
-
* `CCPT` Passport number - Number assigned by a passport authority.
|
|
384
|
-
* `RAID` Registration authority identifier - Identifier of a legal entity as maintained by a registration authority.
|
|
385
|
-
* `DRLC` Driver license number - Number assigned to a driver's license.
|
|
386
|
-
* `FIIN` Foreign investment identity number - Number assigned to a foreign investor (other than the alien number).
|
|
387
|
-
* `TXID` Tax identification number - Number assigned by a tax authority to an entity.
|
|
388
|
-
* `SOCS` Social security number - Number assigned by a social security agency.
|
|
389
|
-
* `IDCD` Identity card number - Number assigned by a national authority to an identity card.
|
|
390
|
-
* `LEIX` Legal Entity Identifier - Legal Entity Identifier (LEI) assigned in accordance with ISO 17442 11 .
|
|
391
|
-
* `MISC` Unspecified - A national identifier which may be known but which cannot otherwise be categorized or the category of which the sender is unable to determine.
|
|
814
|
+
* National Identifier Type Code
|
|
815
|
+
* Specifies the type of national identifier
|
|
816
|
+
* @public
|
|
392
817
|
*/
|
|
393
818
|
declare type NationalIdentifierTypeCode = 'ARNU' | 'CCPT' | 'RAID' | 'DRLC' | 'FIIN' | 'TXID' | 'SOCS' | 'IDCD' | 'LEIX' | 'MISC';
|
|
394
819
|
|
|
395
820
|
/**
|
|
396
|
-
*
|
|
397
|
-
*
|
|
821
|
+
* Interface representing a natural person (individual) involved in a transaction
|
|
822
|
+
*
|
|
823
|
+
* @remarks
|
|
824
|
+
* Extends the baseinterface to add properties specific to individual persons:
|
|
825
|
+
* - type: Must be PersonType.NATURAL to identify as an individual
|
|
826
|
+
* - dateOfBirth: Optional ISO format birth date for identity verification
|
|
827
|
+
* - placeOfBirth: Optional birth place for identity verification
|
|
828
|
+
* - countryOfResidence: Optional ISO country code of current residence
|
|
829
|
+
* - name: Required full legal name of the individual
|
|
830
|
+
*
|
|
831
|
+
* This interface captures the additional identifying information required for
|
|
832
|
+
* natural persons under FATF Travel Rule requirements. The properties align
|
|
833
|
+
* with standard KYC (Know Your Customer) data collection practices.
|
|
834
|
+
*
|
|
835
|
+
* @see {@link Counterparty} For base properties common to all counterparties
|
|
836
|
+
* @see {@link PersonType} For person type classification
|
|
837
|
+
* @public
|
|
838
|
+
*/
|
|
839
|
+
export declare interface NaturalPerson extends Counterparty {
|
|
840
|
+
type: PersonType.NATURAL;
|
|
841
|
+
dateOfBirth?: ISODate;
|
|
842
|
+
placeOfBirth?: string;
|
|
843
|
+
countryOfResidence?: ISOCountryCode;
|
|
844
|
+
name: string;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Natural Person
|
|
849
|
+
* Represents a natural person with all associated information
|
|
850
|
+
* @public
|
|
398
851
|
*/
|
|
399
|
-
declare type
|
|
400
|
-
/** The distinct words used as identification for an individual
|
|
852
|
+
declare type NaturalPerson_2 = {
|
|
853
|
+
/** The distinct words used as identification for an individual */
|
|
401
854
|
name: NaturalPersonName;
|
|
402
|
-
/** The particulars of a location at which a person may be communicated with
|
|
855
|
+
/** The particulars of a location at which a person may be communicated with */
|
|
403
856
|
geographicAddress?: Address[];
|
|
404
|
-
/** A distinct identifier used by governments to uniquely identify a natural person
|
|
857
|
+
/** A distinct identifier used by governments to uniquely identify a natural person */
|
|
405
858
|
nationalIdentification?: NationalIdentification;
|
|
406
|
-
/** A distinct identifier that uniquely identifies the person to the institution in context
|
|
859
|
+
/** A distinct identifier that uniquely identifies the person to the institution in context */
|
|
407
860
|
customerIdentification?: string;
|
|
408
|
-
/** Date and place of birth of a person
|
|
861
|
+
/** Date and place of birth of a person */
|
|
409
862
|
dateAndPlaceOfBirth?: DateAndPlaceOfBirth;
|
|
410
|
-
/** Country in which a person resides (the place of a person's home)
|
|
411
|
-
countryOfResidence?:
|
|
863
|
+
/** Country in which a person resides (the place of a person's home) */
|
|
864
|
+
countryOfResidence?: ISOCountryCode;
|
|
412
865
|
};
|
|
413
866
|
|
|
414
867
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
868
|
+
* Field names for NaturalPerson
|
|
869
|
+
* @public
|
|
870
|
+
*/
|
|
871
|
+
declare type NaturalPersonFieldName = 'name' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'dateOfBirth' | 'placeOfBirth' | 'countryOfResidence';
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Field properties by field name for Natural persons
|
|
875
|
+
* @public
|
|
876
|
+
*/
|
|
877
|
+
declare type NaturalPersonFields = {
|
|
878
|
+
[name in NaturalPersonFieldName]?: FieldOptions;
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Natural Person Name
|
|
883
|
+
* Represents the full name structure for a natural person
|
|
884
|
+
* @public
|
|
417
885
|
*/
|
|
418
886
|
declare type NaturalPersonName = {
|
|
887
|
+
/** Array of name identifiers */
|
|
419
888
|
nameIdentifier?: NaturalPersonNameID[];
|
|
889
|
+
/** Array of local name identifiers */
|
|
420
890
|
localNameIdentifier?: LocalNaturalPersonNameID[];
|
|
891
|
+
/** Array of phonetic name identifiers */
|
|
421
892
|
phoneticNameIdentifier?: LocalNaturalPersonNameID[];
|
|
422
893
|
};
|
|
423
894
|
|
|
424
895
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
896
|
+
* Natural Person Name ID
|
|
897
|
+
* Represents a name identifier for a natural person
|
|
898
|
+
* @public
|
|
427
899
|
*/
|
|
428
900
|
declare type NaturalPersonNameID = {
|
|
901
|
+
/** Primary identifier, maximum 100 characters */
|
|
429
902
|
primaryIdentifier?: string;
|
|
903
|
+
/** Secondary identifier, maximum 100 characters */
|
|
430
904
|
secondaryIdentifier?: string;
|
|
905
|
+
/** Type of name identifier */
|
|
431
906
|
nameIdentifierType?: NaturalPersonNameTypeCode;
|
|
432
907
|
};
|
|
433
908
|
|
|
434
909
|
/**
|
|
435
|
-
*
|
|
436
|
-
*
|
|
910
|
+
* Natural Person Name Type Code
|
|
911
|
+
* Specifies the type of name for a natural person
|
|
437
912
|
*
|
|
438
|
-
*
|
|
439
|
-
* `BIRT` Name at birth - The name given to a natural person at birth.
|
|
440
|
-
* `MAID` Maiden name - The original name of a natural person who has changed their name after marriage.
|
|
441
|
-
* `LEGL` Legal name - The name that identifies a natural person for legal, official or administrative purposes.
|
|
442
|
-
* `MISC` Unspecified - A name by which a natural person may be known but which cannot otherwise be categorized or the category of which the sender is unable to determine.
|
|
913
|
+
* @public
|
|
443
914
|
*/
|
|
444
915
|
declare type NaturalPersonNameTypeCode = 'ALIA' | 'BIRT' | 'MAID' | 'LEGL' | 'MISC';
|
|
445
916
|
|
|
446
917
|
/**
|
|
447
918
|
* Primary constructor for Notabene UX elements
|
|
448
919
|
*
|
|
920
|
+
* This class provides methods to create and manage various Notabene components
|
|
921
|
+
* such as withdrawal assist, deposit assist, connect, and deposit request.
|
|
922
|
+
* It also handles URL generation and fragment decoding for these components.
|
|
923
|
+
*
|
|
449
924
|
* @public
|
|
450
925
|
*/
|
|
451
926
|
declare class Notabene {
|
|
@@ -454,19 +929,85 @@ declare class Notabene {
|
|
|
454
929
|
private uxUrl;
|
|
455
930
|
private theme?;
|
|
456
931
|
private locale?;
|
|
932
|
+
/**
|
|
933
|
+
* Creates a new instance of the Notabene SDK
|
|
934
|
+
*
|
|
935
|
+
* @param config - Configuration options for the Notabene SDK
|
|
936
|
+
*/
|
|
457
937
|
constructor(config: NotabeneConfig);
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
938
|
+
/**
|
|
939
|
+
* Generates a URL for a Notabene component
|
|
940
|
+
*
|
|
941
|
+
* @param path - The path of the component
|
|
942
|
+
* @param value - Transaction data
|
|
943
|
+
* @param configuration - Optional transaction configuration
|
|
944
|
+
* @param callbacks - Optional callback configuration
|
|
945
|
+
* @returns component URL
|
|
946
|
+
* @internal
|
|
947
|
+
*/
|
|
948
|
+
componentUrl<V, O>(path: string, value: V, configuration?: O, callbacks?: CallbackOptions): string;
|
|
949
|
+
/**
|
|
950
|
+
* Creates a new embedded component
|
|
951
|
+
*
|
|
952
|
+
* @param path - The path of the component
|
|
953
|
+
* @param value - Transaction data
|
|
954
|
+
* @param options - Optional transaction options
|
|
955
|
+
* @param callbacks - Optional callback configuration
|
|
956
|
+
* @returns A new EmbeddedComponent instance
|
|
957
|
+
* @internal
|
|
958
|
+
*/
|
|
959
|
+
createComponent<V, O>(path: string, value: Partial<V>, options?: O, callbacks?: CallbackOptions): EmbeddedComponent<V, O>;
|
|
960
|
+
/**
|
|
961
|
+
* Creates a withdrawal assist component
|
|
962
|
+
*
|
|
963
|
+
* @param value - Withdrawal transaction data
|
|
964
|
+
* @param options - Optional transaction options
|
|
965
|
+
* @param callbacks - Optional callback configuration
|
|
966
|
+
* @returns A new EmbeddedComponent instance for withdrawal assistance
|
|
967
|
+
*/
|
|
968
|
+
createWithdrawalAssist(value: Partial<Withdrawal>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent<Withdrawal, TransactionOptions>;
|
|
969
|
+
/**
|
|
970
|
+
* Creates a connect component
|
|
971
|
+
*
|
|
972
|
+
* @param value - Connection request data
|
|
973
|
+
* @param options - Optional transaction options
|
|
974
|
+
* @param callbacks - Optional callback configuration
|
|
975
|
+
* @returns A new EmbeddedComponent instance for connection
|
|
976
|
+
* @alpha
|
|
977
|
+
*/
|
|
978
|
+
createConnectWallet(value: ConnectionRequest, options?: ConnectionOptions, callbacks?: CallbackOptions): EmbeddedComponent<ConnectionRequest, ConnectionOptions>;
|
|
979
|
+
/**
|
|
980
|
+
* Creates a deposit request component
|
|
981
|
+
*
|
|
982
|
+
* @param value - Deposit request data
|
|
983
|
+
* @param options - Optional transaction options
|
|
984
|
+
* @param callbacks - Optional callback configuration
|
|
985
|
+
* @returns A new EmbeddedComponent instance for deposit requests
|
|
986
|
+
* @public
|
|
987
|
+
*/
|
|
988
|
+
createDepositRequest(value: DepositRequest, options?: DepositRequestOptions, callbacks?: CallbackOptions): EmbeddedComponent<DepositRequest, DepositRequestOptions>;
|
|
989
|
+
}
|
|
467
990
|
export default Notabene;
|
|
468
991
|
|
|
469
|
-
|
|
992
|
+
/**
|
|
993
|
+
* Notabene Asset Identifier
|
|
994
|
+
* @public
|
|
995
|
+
*/
|
|
996
|
+
/**
|
|
997
|
+
* Internal identifier for assets in the Notabene system
|
|
998
|
+
*
|
|
999
|
+
* @remarks
|
|
1000
|
+
* A standardized string format used within Notabene to identify cryptocurrencies,
|
|
1001
|
+
* tokens, and other digital assets. This is Notabene's legacy asset identification
|
|
1002
|
+
* system that may be used alongside CAIP-19 and DTI identifiers.
|
|
1003
|
+
*
|
|
1004
|
+
* @example "ETH_USDT" // USDT token on Ethereum
|
|
1005
|
+
* @example "BTC" // Bitcoin
|
|
1006
|
+
* @see {@link CAIP19} For chain-agnostic asset identifiers
|
|
1007
|
+
* @see {@link DTI} For ISO standardized identifiers
|
|
1008
|
+
* @public
|
|
1009
|
+
*/
|
|
1010
|
+
export declare type NotabeneAsset = string;
|
|
470
1011
|
|
|
471
1012
|
/**
|
|
472
1013
|
* Configuration for the Notabene SDK
|
|
@@ -474,36 +1015,77 @@ declare type NotabeneAsset = string;
|
|
|
474
1015
|
* @public
|
|
475
1016
|
*/
|
|
476
1017
|
export declare interface NotabeneConfig {
|
|
1018
|
+
/**
|
|
1019
|
+
* The URL of the Notabene API node
|
|
1020
|
+
*/
|
|
477
1021
|
nodeUrl?: string;
|
|
1022
|
+
/**
|
|
1023
|
+
* The authentication token for the Notabene API
|
|
1024
|
+
*/
|
|
478
1025
|
authToken?: string;
|
|
1026
|
+
/**
|
|
1027
|
+
* The URL of the Notabene UX components
|
|
1028
|
+
*/
|
|
479
1029
|
uxUrl?: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* Custom theme configuration for the UX components
|
|
1032
|
+
*/
|
|
480
1033
|
theme?: Theme;
|
|
1034
|
+
/**
|
|
1035
|
+
* The locale to use for the UX components
|
|
1036
|
+
*/
|
|
481
1037
|
locale?: string;
|
|
482
1038
|
}
|
|
483
1039
|
|
|
484
1040
|
/**
|
|
485
|
-
*
|
|
486
|
-
*
|
|
1041
|
+
* Originating VASP
|
|
1042
|
+
* Represents the VASP which initiates the VA transfer
|
|
1043
|
+
* @public
|
|
487
1044
|
*/
|
|
488
1045
|
declare type OriginatingVASP = {
|
|
1046
|
+
/** The originating VASP information */
|
|
489
1047
|
originatingVASP?: Person;
|
|
490
1048
|
};
|
|
491
1049
|
|
|
492
1050
|
/**
|
|
493
|
-
*
|
|
494
|
-
*
|
|
1051
|
+
* Originator
|
|
1052
|
+
* Represents the account holder who initiates the VA transfer
|
|
1053
|
+
* @public
|
|
495
1054
|
*/
|
|
496
1055
|
declare type Originator = {
|
|
1056
|
+
/** Array of persons associated with the originator */
|
|
497
1057
|
originatorPersons?: Person[];
|
|
1058
|
+
/** Array of account numbers, maximum 100 characters each */
|
|
498
1059
|
accountNumber?: string[];
|
|
499
1060
|
};
|
|
500
1061
|
|
|
1062
|
+
/**
|
|
1063
|
+
* Fields specific to the originator of a transaction
|
|
1064
|
+
* @public
|
|
1065
|
+
*/
|
|
501
1066
|
declare type OriginatorFields = {
|
|
502
1067
|
source?: Source;
|
|
503
1068
|
};
|
|
504
1069
|
|
|
505
1070
|
/**
|
|
506
|
-
*
|
|
1071
|
+
* Base interface for proving ownership of an account or address
|
|
1072
|
+
*
|
|
1073
|
+
* @remarks
|
|
1074
|
+
* TheOwnershipProof interface provides a common structure for different types of ownership verification:
|
|
1075
|
+
* - All proofs must specify their type from the supported ProofTypes enum
|
|
1076
|
+
* - Current verification status is tracked via ProofStatus
|
|
1077
|
+
* - Links the proof to a decentralized identifier (DID)
|
|
1078
|
+
* - Specifies the blockchain account/address being proven using CAIP-10 format
|
|
1079
|
+
*
|
|
1080
|
+
* This interface is extended by specific proof types like:
|
|
1081
|
+
* - SignatureProof for cryptographic signatures
|
|
1082
|
+
* - DeclarationProof for self-declarations
|
|
1083
|
+
* - MicroTransferProof for transaction-based proof
|
|
1084
|
+
* - ScreenshotProof for image-based verification
|
|
1085
|
+
*
|
|
1086
|
+
* @see {@link ProofTypes} For supported proof methods
|
|
1087
|
+
* @see {@link ProofStatus} For possible verification states
|
|
1088
|
+
* @see {@link CAIP10} For address format specification
|
|
507
1089
|
* @public
|
|
508
1090
|
*/
|
|
509
1091
|
export declare interface OwnershipProof {
|
|
@@ -535,18 +1117,38 @@ declare enum PayloadVersionCode {
|
|
|
535
1117
|
}
|
|
536
1118
|
|
|
537
1119
|
/**
|
|
538
|
-
* 5.2.1
|
|
539
1120
|
* Person
|
|
1121
|
+
* Represents either a natural person or a legal person
|
|
1122
|
+
* @public
|
|
540
1123
|
*/
|
|
541
1124
|
declare type Person = {
|
|
542
|
-
|
|
543
|
-
|
|
1125
|
+
/** Natural person information */
|
|
1126
|
+
naturalPerson?: NaturalPerson_2;
|
|
1127
|
+
/** Legal person information */
|
|
1128
|
+
legalPerson?: LegalPerson_2;
|
|
544
1129
|
};
|
|
545
1130
|
|
|
546
1131
|
/**
|
|
547
1132
|
* The type of counterparty. Either a natural person or a legal person. If the customer is the same as the counterparty then the counterparty is a self.
|
|
548
1133
|
* @public
|
|
549
1134
|
*/
|
|
1135
|
+
/**
|
|
1136
|
+
* Enum defining the types of persons/entities in a transaction
|
|
1137
|
+
*
|
|
1138
|
+
* @remarks
|
|
1139
|
+
* This classification system aligns with FATF travel rule requirements and defines:
|
|
1140
|
+
* - NATURAL: Individual human persons acting in their own capacity
|
|
1141
|
+
* - LEGAL: Registered organizations, companies, or other legal entities
|
|
1142
|
+
* - SELF: When the counterparty is the same as the customer (first party transaction)
|
|
1143
|
+
*
|
|
1144
|
+
* The type affects what information must be collected and transmitted as part of
|
|
1145
|
+
* travel rule compliance. Different verification and due diligence requirements
|
|
1146
|
+
* apply to each type.
|
|
1147
|
+
*
|
|
1148
|
+
* @see {@link NaturalPerson} For natural person data requirements
|
|
1149
|
+
* @see {@link LegalPerson} For legal person data requirements
|
|
1150
|
+
* @public
|
|
1151
|
+
*/
|
|
550
1152
|
export declare enum PersonType {
|
|
551
1153
|
NATURAL = "natural",
|
|
552
1154
|
LEGAL = "legal",
|
|
@@ -554,7 +1156,15 @@ export declare enum PersonType {
|
|
|
554
1156
|
}
|
|
555
1157
|
|
|
556
1158
|
/**
|
|
557
|
-
* Status of the proof
|
|
1159
|
+
* Status of the ownership proof verification process
|
|
1160
|
+
*
|
|
1161
|
+
* @remarks
|
|
1162
|
+
* Represents the different states that an ownership proof can be in during and after verification:
|
|
1163
|
+
* - PENDING: Initial state where verification is in progress or awaiting processing
|
|
1164
|
+
* - FAILED: The proof was rejected due to failing verification checks
|
|
1165
|
+
* - FLAGGED: The proof requires manual review due to suspicious or unclear verification results
|
|
1166
|
+
* - VERIFIED: The proof has passed all verification checks successfully
|
|
1167
|
+
*
|
|
558
1168
|
* @public
|
|
559
1169
|
*/
|
|
560
1170
|
export declare enum ProofStatus {
|
|
@@ -565,41 +1175,59 @@ export declare enum ProofStatus {
|
|
|
565
1175
|
}
|
|
566
1176
|
|
|
567
1177
|
/**
|
|
568
|
-
*
|
|
1178
|
+
* Types of ownership proofs supported by the system
|
|
1179
|
+
*
|
|
1180
|
+
* @remarks
|
|
1181
|
+
* Supported proof types:
|
|
1182
|
+
* - SelfDeclaration: User self-declares ownership without cryptographic proof
|
|
1183
|
+
* - EIP191: Ethereum personal signature following EIP-191 standard
|
|
1184
|
+
* - SIWE: Sign-In with Ethereum message signature (EIP-4361)
|
|
1185
|
+
* - EIP712: Ethereum typed data signature following EIP-712 standard
|
|
1186
|
+
* - BIP137: Bitcoin message signature following BIP-137
|
|
1187
|
+
* - XPUB: Extended public key signature for HD wallets
|
|
1188
|
+
* - MicroTransfer: Proof via small blockchain transaction
|
|
1189
|
+
* - Screenshot: Image proof of ownership/access
|
|
1190
|
+
*
|
|
1191
|
+
* @see {@link SignatureProof} For signature-based proofs
|
|
1192
|
+
* @see {@link DeclarationProof} For self-declaration proofs
|
|
1193
|
+
* @see {@link MicroTransferProof} For transaction-based proofs
|
|
1194
|
+
* @see {@link ScreenshotProof} For screenshot proofs
|
|
569
1195
|
* @public
|
|
570
|
-
|
|
1196
|
+
*/
|
|
571
1197
|
export declare enum ProofTypes {
|
|
572
1198
|
SelfDeclaration = "self-declaration",
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
1199
|
+
SIWE = "siwe",
|
|
1200
|
+
SIWX = "siwx",
|
|
1201
|
+
EIP191 = "eip-191",
|
|
1202
|
+
EIP712 = "eip-712",
|
|
1203
|
+
EIP1271 = "eip-1271",
|
|
1204
|
+
BIP137 = "bip-137",
|
|
1205
|
+
BIP137_XPUB = "xpub",
|
|
1206
|
+
ED25519 = "ed25519",
|
|
577
1207
|
MicroTransfer = "microtransfer",
|
|
578
|
-
Screenshot = "screenshot"
|
|
1208
|
+
Screenshot = "screenshot",
|
|
1209
|
+
Connect = "connect"
|
|
579
1210
|
}
|
|
580
1211
|
|
|
581
|
-
|
|
1212
|
+
/**
|
|
1213
|
+
* Represents a ready component message
|
|
1214
|
+
* @public
|
|
1215
|
+
*/
|
|
1216
|
+
export declare type Ready = {
|
|
582
1217
|
type: CMType.READY;
|
|
583
1218
|
};
|
|
584
1219
|
|
|
585
|
-
declare type RequestID =
|
|
586
|
-
|
|
587
|
-
declare type RequestResponse = {
|
|
588
|
-
type: HMType.REQUEST_RESPONSE;
|
|
589
|
-
reqid: RequestID;
|
|
590
|
-
};
|
|
1220
|
+
declare type RequestID = UUID;
|
|
591
1221
|
|
|
592
|
-
|
|
1222
|
+
/**
|
|
1223
|
+
* Represents a resize request component message. This is handled by the library.
|
|
1224
|
+
* @internal
|
|
1225
|
+
*/
|
|
1226
|
+
export declare type ResizeRequest = {
|
|
593
1227
|
type: CMType.RESIZE;
|
|
594
1228
|
height: number;
|
|
595
1229
|
};
|
|
596
1230
|
|
|
597
|
-
declare type Result = {
|
|
598
|
-
type: CMType.RESULT;
|
|
599
|
-
reqid: RequestID;
|
|
600
|
-
response: TransactionResponse;
|
|
601
|
-
};
|
|
602
|
-
|
|
603
1231
|
/**
|
|
604
1232
|
* Ownership Proof using Screenshot
|
|
605
1233
|
* @public
|
|
@@ -610,16 +1238,33 @@ export declare interface ScreenshotProof extends OwnershipProof {
|
|
|
610
1238
|
}
|
|
611
1239
|
|
|
612
1240
|
/**
|
|
613
|
-
*
|
|
1241
|
+
* Interface for signature-based ownership proofs that use cryptographic message signing
|
|
1242
|
+
*
|
|
1243
|
+
* @remarks
|
|
1244
|
+
* Extends the base OwnershipProface to add signature-specific properties:
|
|
1245
|
+
* - Supports multiple signature standards like EIP-191, EIP-712, BIP-137, SIWE
|
|
1246
|
+
* - Includes the cryptographic proof signature string
|
|
1247
|
+
* - Contains an attestation message that was signed
|
|
1248
|
+
* - Records which wallet provider was used for signing
|
|
1249
|
+
*
|
|
1250
|
+
* The signature proves ownership by demonstrating control of the private keys
|
|
1251
|
+
* associated with the claimed address.
|
|
1252
|
+
*
|
|
1253
|
+
* @see {@link ProofTypes} For supported signature types
|
|
1254
|
+
* @see {@link OwnershipProof} For base proof properties
|
|
614
1255
|
* @public
|
|
615
1256
|
*/
|
|
616
1257
|
export declare interface SignatureProof extends OwnershipProof {
|
|
617
|
-
type: ProofTypes.
|
|
1258
|
+
type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.SIWX | ProofTypes.SIWE;
|
|
618
1259
|
proof: string;
|
|
619
1260
|
attestation: string;
|
|
620
1261
|
wallet_provider: string;
|
|
621
1262
|
}
|
|
622
1263
|
|
|
1264
|
+
/**
|
|
1265
|
+
* The source of a transaction
|
|
1266
|
+
* @public
|
|
1267
|
+
*/
|
|
623
1268
|
declare type Source = BlockchainAddress | CAIP10;
|
|
624
1269
|
|
|
625
1270
|
/**
|
|
@@ -646,24 +1291,59 @@ export declare type Theme = {
|
|
|
646
1291
|
};
|
|
647
1292
|
|
|
648
1293
|
/**
|
|
649
|
-
*
|
|
1294
|
+
* Specify what to do under the provided threshold.
|
|
1295
|
+
*
|
|
1296
|
+
* Eg. to allow self-declaration for all transactions under 1000 EUR
|
|
1297
|
+
*
|
|
1298
|
+
* Note to support threshold you MUST include the Asset Price in the Transaction
|
|
1299
|
+
*
|
|
1300
|
+
* @see {@link Transaction} Transaction object
|
|
1301
|
+
*
|
|
650
1302
|
* @public
|
|
651
1303
|
*/
|
|
652
|
-
export declare interface
|
|
1304
|
+
export declare interface ThresholdOptions {
|
|
1305
|
+
threshold: number;
|
|
1306
|
+
currency: ISOCurrency;
|
|
1307
|
+
proofTypes?: ProofTypes[];
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Core transaction interface representing a crypto asset transfer between parties
|
|
1312
|
+
*
|
|
1313
|
+
* @remarks
|
|
1314
|
+
* Extends ComponentRequest to add transaction-specific properties:
|
|
1315
|
+
* - agent: The entity facilitating/executing the transaction
|
|
1316
|
+
* - counterparty: The other party involved in the transaction
|
|
1317
|
+
* - asset: The cryptocurrency or token being transferred
|
|
1318
|
+
* - amountDecimal: The amount to transfer in decimal format
|
|
1319
|
+
* - proof: Optional ownership proof verifying control of involved addresses
|
|
1320
|
+
* - assetPrice: Optional price information in a fiat currency
|
|
1321
|
+
*
|
|
1322
|
+
* This interface serves as the base for specific transaction types like:
|
|
1323
|
+
* - Withdrawals for sending assets out
|
|
1324
|
+
* - Deposits for receiving assets
|
|
1325
|
+
* - Deposit requests for requesting asset transfers
|
|
1326
|
+
*
|
|
1327
|
+
* @see {@link Withdrawal} For withdrawal-specific transaction properties
|
|
1328
|
+
* @see {@link Deposit} For deposit-specific transaction properties
|
|
1329
|
+
* @see {@link Agent} For agent details
|
|
1330
|
+
* @see {@link Counterparty} For counterparty information
|
|
1331
|
+
* @public
|
|
1332
|
+
*/
|
|
1333
|
+
export declare interface Transaction extends ComponentRequest {
|
|
653
1334
|
agent: Agent;
|
|
654
|
-
customer?: Counterparty;
|
|
655
1335
|
counterparty: Counterparty;
|
|
656
1336
|
asset: TransactionAsset;
|
|
657
1337
|
amountDecimal: number;
|
|
658
|
-
|
|
1338
|
+
proof?: OwnershipProof;
|
|
1339
|
+
assetPrice?: {
|
|
659
1340
|
price: number;
|
|
660
|
-
currency:
|
|
1341
|
+
currency: ISOCurrency;
|
|
661
1342
|
};
|
|
662
1343
|
}
|
|
663
1344
|
|
|
664
1345
|
/**
|
|
665
1346
|
* The asset of a transaction either a Notabene asset, a CAIP-19 asset, or a DTI.
|
|
666
|
-
*
|
|
667
1347
|
* @public
|
|
668
1348
|
*/
|
|
669
1349
|
export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
|
|
@@ -673,94 +1353,199 @@ export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
|
|
|
673
1353
|
* @public
|
|
674
1354
|
*/
|
|
675
1355
|
export declare interface TransactionOptions {
|
|
676
|
-
|
|
677
|
-
|
|
1356
|
+
proofs?: {
|
|
1357
|
+
microTransfer?: {
|
|
1358
|
+
destination: BlockchainAddress;
|
|
1359
|
+
amountSubunits: string;
|
|
1360
|
+
timeout?: number;
|
|
1361
|
+
};
|
|
1362
|
+
fallbacks?: ProofTypes[];
|
|
1363
|
+
deminimis?: ThresholdOptions;
|
|
1364
|
+
};
|
|
1365
|
+
allowedAgentTypes?: AgentType[];
|
|
1366
|
+
allowedCounterpartyTypes?: PersonType[];
|
|
1367
|
+
fields?: FieldTypes;
|
|
1368
|
+
vasps?: VASPOptions;
|
|
1369
|
+
hide?: ValidationSections[];
|
|
678
1370
|
}
|
|
679
1371
|
|
|
680
1372
|
/**
|
|
681
|
-
*
|
|
1373
|
+
* Response interface for transaction-related operations
|
|
1374
|
+
*
|
|
1375
|
+
* @remarks
|
|
1376
|
+
* Extends ComponentResponse to add transaction-specific response data:
|
|
1377
|
+
* - value: The resulting transaction value of generic type V
|
|
1378
|
+
* - ivms101: IVMS 101 travel rule data for the transaction
|
|
1379
|
+
* - proof: Optional ownership proof details if required
|
|
1380
|
+
* - txCreate: Optional V1 transaction payload for legacy API compatibility
|
|
1381
|
+
*
|
|
1382
|
+
* @typeParam V - Type of the transaction value being returned
|
|
1383
|
+
*
|
|
1384
|
+
* @see {@link ComponentResponse} For base response properties
|
|
1385
|
+
* @see {@link IVMS101} For travel rule data structure
|
|
1386
|
+
* @see {@link OwnershipProof} For proof details
|
|
1387
|
+
* @see {@link V1Transaction} For legacy transaction format
|
|
682
1388
|
* @public
|
|
683
1389
|
*/
|
|
684
|
-
export declare
|
|
685
|
-
value:
|
|
686
|
-
|
|
1390
|
+
export declare interface TransactionResponse<V> extends ComponentResponse {
|
|
1391
|
+
value: V;
|
|
1392
|
+
ivms101: IVMS101;
|
|
687
1393
|
proof?: OwnershipProof;
|
|
688
|
-
valid: boolean;
|
|
689
|
-
status: Status;
|
|
690
|
-
errors: ValidationError[];
|
|
691
1394
|
txCreate?: V1Transaction;
|
|
692
|
-
}
|
|
1395
|
+
}
|
|
693
1396
|
|
|
694
1397
|
/**
|
|
695
|
-
*
|
|
696
|
-
*
|
|
1398
|
+
* Transfer Path
|
|
1399
|
+
* Represents the path of intermediary VASPs in a transfer
|
|
1400
|
+
* @public
|
|
697
1401
|
*/
|
|
698
1402
|
declare type TransferPath = {
|
|
1403
|
+
/** Array of intermediary VASPs involved in the transfer */
|
|
699
1404
|
transferPath?: IntermediaryVASP[];
|
|
700
1405
|
};
|
|
701
1406
|
|
|
702
1407
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
* `arab` Arabic (Arabic language) - ISO 233-2:1993
|
|
707
|
-
* `aran` Arabic (Persian language) - ISO 233-3:1999
|
|
708
|
-
* `armn` Armenian - ISO 9985:1996
|
|
709
|
-
* `cyrl` Cyrillic - ISO 9:1995
|
|
710
|
-
* `deva` Devanagari & related Indic - ISO 15919:2001
|
|
711
|
-
* `geor` Georgian - ISO 9984:1996
|
|
712
|
-
* `grek` Greek - ISO 843:1997
|
|
713
|
-
* `hani` Han (Hanzi, Kanji, Hanja) - ISO 7098:2015
|
|
714
|
-
* `hebr` Hebrew - ISO 259-2:1994
|
|
715
|
-
* `kana` Kana - ISO 3602:1989
|
|
716
|
-
* `kore` Korean - Revised Romanization of Korean
|
|
717
|
-
* `thai` Thai - ISO 11940-2:2007
|
|
718
|
-
* `othr` Script other than those listed above - Unspecified
|
|
1408
|
+
* Transliteration Method Code
|
|
1409
|
+
* Specifies the method used to transliterate text
|
|
1410
|
+
* @public
|
|
719
1411
|
*/
|
|
720
1412
|
declare type TransliterationMethodCode = 'arab' | 'aran' | 'armn' | 'cyrl' | 'deva' | 'geor' | 'grek' | 'hani' | 'hebr' | 'kana' | 'kore' | 'thai' | 'othr';
|
|
721
1413
|
|
|
722
|
-
|
|
1414
|
+
/**
|
|
1415
|
+
* A travel address
|
|
1416
|
+
* @public
|
|
723
1417
|
|
|
724
|
-
|
|
1418
|
+
* A standardized travel rule address format
|
|
1419
|
+
*
|
|
1420
|
+
* @remarks
|
|
1421
|
+
* Represents a special address format used for travel rule compliance. Travel addresses
|
|
1422
|
+
* are prefixed with 'ta' and contain encoded information about the transaction
|
|
1423
|
+
* and counterparty details required for travel rule reporting.
|
|
1424
|
+
*
|
|
1425
|
+
* The format ensures consistent handling of travel rule data across different
|
|
1426
|
+
* VASPs and blockchain networks while maintaining privacy.
|
|
1427
|
+
*
|
|
1428
|
+
* @example "ta1234abcd..." // Example travel rule address
|
|
1429
|
+
* @see {@link BlockchainAddress} For native chain addresses
|
|
1430
|
+
* @see {@link CAIP10} For chain-agnostic addresses
|
|
1431
|
+
|
|
1432
|
+
*/ export declare type TravelAddress = `ta${string}`;
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* Message type for updating component state and configuration from host application
|
|
1436
|
+
*
|
|
1437
|
+
* @remarks
|
|
1438
|
+
* Defines the structure of update messages sent from host to component:
|
|
1439
|
+
* - type: Identifies this as an update message
|
|
1440
|
+
* - value: New partial state/data to update the component with
|
|
1441
|
+
* - options: Optional configuration parameters to modify component behavior
|
|
1442
|
+
*
|
|
1443
|
+
* The host can use this to dynamically update both the component's data
|
|
1444
|
+
* and its configuration without requiring a full reload/reinitialize.
|
|
1445
|
+
*
|
|
1446
|
+
* @typeParam T - The type of the value being updated
|
|
1447
|
+
* @typeParam O - The type of the optional configuration parameters
|
|
1448
|
+
*
|
|
1449
|
+
* @see {@link HMType} For message type constants
|
|
1450
|
+
* @see {@link HostMessage} For full host message type union
|
|
1451
|
+
* @public
|
|
1452
|
+
*/
|
|
1453
|
+
export declare type UpdateValue<T, O> = {
|
|
725
1454
|
type: HMType.UPDATE;
|
|
726
|
-
value: Partial<
|
|
1455
|
+
value: Partial<T>;
|
|
1456
|
+
options?: O;
|
|
727
1457
|
};
|
|
728
1458
|
|
|
1459
|
+
/**
|
|
1460
|
+
* A Uniform Resource Identifier
|
|
1461
|
+
* @public
|
|
1462
|
+
*/
|
|
729
1463
|
declare type URI = string;
|
|
730
1464
|
|
|
731
|
-
|
|
1465
|
+
/**
|
|
1466
|
+
* UUID v4 string identifier
|
|
1467
|
+
* A universally unique identifier that follows RFC 4122 format
|
|
1468
|
+
* Format: 8-4-4-4-12 hexadecimal digits
|
|
1469
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
1470
|
+
* @see {@link https://tools.ietf.org/html/rfc4122 | RFC4122}
|
|
1471
|
+
* @public
|
|
1472
|
+
*/
|
|
1473
|
+
declare type UUID = string;
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Represents a legacy V1 API asset format supporting both Notabene and CAIP-19 identifiers
|
|
1477
|
+
*
|
|
1478
|
+
* @remarks
|
|
1479
|
+
* Used for backwards compatibility with V1 API transaction payloads:
|
|
1480
|
+
* - Can be either a simple Notabene asset string
|
|
1481
|
+
* - Or an object containing a CAIP-19 identifier
|
|
1482
|
+
*
|
|
1483
|
+
* @example "ETH_USDT" // Notabene asset format
|
|
1484
|
+
* @example \{ caip19: "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f" \} // CAIP-19 format
|
|
1485
|
+
* @see {@link NotabeneAsset} For Notabene asset format
|
|
1486
|
+
* @see {@link CAIP19} For CAIP-19 asset format
|
|
1487
|
+
* @public
|
|
1488
|
+
*/
|
|
1489
|
+
declare type V1Asset = NotabeneAsset | {
|
|
732
1490
|
caip19: CAIP19;
|
|
733
|
-
}
|
|
1491
|
+
};
|
|
734
1492
|
|
|
735
1493
|
/**
|
|
736
1494
|
* Transaction payload suitable for calling Notabene v1 tx/create
|
|
737
1495
|
* @public
|
|
738
1496
|
*/
|
|
739
|
-
declare type V1Transaction = {
|
|
1497
|
+
export declare type V1Transaction = {
|
|
740
1498
|
transactionAsset: V1Asset;
|
|
741
1499
|
transactionAmount: string;
|
|
742
1500
|
originatorEqualsBeneficiary?: boolean;
|
|
743
1501
|
originatorVASPdid: DID;
|
|
744
1502
|
beneficiaryVASPdid: DID;
|
|
745
|
-
beneficiaryProof
|
|
746
|
-
originator
|
|
1503
|
+
beneficiaryProof?: OwnershipProof;
|
|
1504
|
+
originator?: Originator;
|
|
747
1505
|
beneficiary: Beneficiary;
|
|
748
1506
|
};
|
|
749
1507
|
|
|
750
|
-
|
|
1508
|
+
/**
|
|
1509
|
+
* Validation error
|
|
1510
|
+
* @public
|
|
1511
|
+
*/
|
|
1512
|
+
export declare type ValidationError = {
|
|
751
1513
|
attribute: string;
|
|
752
1514
|
message: string;
|
|
753
1515
|
};
|
|
754
1516
|
|
|
1517
|
+
/**
|
|
1518
|
+
* Sections in a WithdrawalAssist screen
|
|
1519
|
+
*
|
|
1520
|
+
* @alpha
|
|
1521
|
+
*/
|
|
1522
|
+
export declare enum ValidationSections {
|
|
1523
|
+
ASSET = "asset",
|
|
1524
|
+
DESTINATION = "destination",
|
|
1525
|
+
COUNTERPARTY = "counterparty",
|
|
1526
|
+
AGENT = "agent"
|
|
1527
|
+
}
|
|
1528
|
+
|
|
755
1529
|
/**
|
|
756
1530
|
* A VASP agent acting on behalf of the counterparty
|
|
757
1531
|
* @public
|
|
758
1532
|
*/
|
|
759
1533
|
export declare interface VASP extends Agent {
|
|
760
|
-
|
|
761
|
-
|
|
1534
|
+
lei?: LEI;
|
|
1535
|
+
logo?: URI;
|
|
1536
|
+
website?: URI;
|
|
1537
|
+
countryOfRegistration?: ISOCountryCode;
|
|
762
1538
|
}
|
|
763
1539
|
|
|
1540
|
+
/**
|
|
1541
|
+
* Options for which VASPs to be searchable
|
|
1542
|
+
* @public
|
|
1543
|
+
*/
|
|
1544
|
+
export declare type VASPOptions = {
|
|
1545
|
+
addUnknown?: boolean;
|
|
1546
|
+
onlyActive?: boolean;
|
|
1547
|
+
};
|
|
1548
|
+
|
|
764
1549
|
/**
|
|
765
1550
|
* A wallet agent acting on behalf of the counterparty
|
|
766
1551
|
* @public
|