@notabene/javascript-sdk 2.0.0-next.10 → 2.0.0-next.11

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.
@@ -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: string;
38
+ country: ISOCountryCode;
38
39
  };
39
40
 
40
41
  /**
41
- * 5.3.11
42
- * AddressTypeCode
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?: string;
58
- url?: string;
55
+ logo?: URI;
56
+ url?: URI;
59
57
  name?: string;
60
58
  verified?: boolean;
61
59
  }
@@ -70,51 +68,88 @@ export declare enum AgentType {
70
68
  }
71
69
 
72
70
  /**
73
- * 6.3
74
- * The beneficiary is defined in Section 1.1 as the natural or legal person or legal arrangement who is identified by the originator as the receiver of the requested VA transfer.
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
87
  destination?: destination;
83
88
  };
84
89
 
85
90
  /**
86
- * 6.5
87
- * The originating VASP is defined in Section 1.1 as the VASP which initiates the VA transfer, and transfers the VA upon receiving the request for a VA transfer on behalf of the originator.
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
 
100
+ /**
101
+ * A blockchain address
102
+ * @public
103
+ */
93
104
  declare type BlockchainAddress = string;
94
105
 
106
+ /**
107
+ * Chain Agnostic Account Identifier
108
+ * Represents an account on a specific blockchain
109
+ * Format: `{caip2}:{address}`
110
+ * @example "eip155:1:0x742d35Cc6634C0532925a3b844Bc454e4438f44e" for an Ethereum account
111
+ * @public
112
+ */
95
113
  declare type CAIP10 = `${CAIP2}:${string}`;
96
114
 
115
+ /**
116
+ * Chain Agnostic Asset Identifier
117
+ * Represents an asset on a specific blockchain
118
+ * Format: `{caip2}/{asset_namespace}:{asset_reference}`
119
+ * @example "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f" for DAI on Ethereum
120
+ * @public
121
+ */
97
122
  declare type CAIP19 = `${CAIP2}/${string}:${string}`;
98
123
 
124
+ /**
125
+ * Chain Agnostic Blockchain Identifier
126
+ * Represents a blockchain in a chain-agnostic way
127
+ * Format: `namespace:reference`
128
+ * @example "eip155:1" for Ethereum Mainnet
129
+ * @public
130
+ */
99
131
  declare type CAIP2 = `${string}:${string}`;
100
132
 
101
- declare interface CallbackOptions {
133
+ /**
134
+ * Options for callback and redirect URIs
135
+ * @public
136
+ */
137
+ export declare interface CallbackOptions {
102
138
  callback?: URI;
103
139
  redirectUri?: URI;
104
140
  }
105
141
 
142
+ /**
143
+ * Represents a cancel component message
144
+ * @public
145
+ */
106
146
  declare type Cancel = {
107
147
  type: CMType.CANCEL;
108
148
  };
109
149
 
110
- declare type CloseModal = {
111
- type: CMType.CLOSE;
112
- reqid: RequestID;
113
- };
114
-
115
150
  /**
116
151
  * Component Message Types
117
- * @internal
152
+ * @public
118
153
  */
119
154
  export declare const enum CMType {
120
155
  COMPLETE = "complete",
@@ -128,16 +163,55 @@ export declare const enum CMType {
128
163
  CANCEL = "cancel"
129
164
  }
130
165
 
166
+ /**
167
+ * Represents a completed component message
168
+ * @public
169
+ */
131
170
  declare type Completed = {
132
171
  type: CMType.COMPLETE;
133
- response: TransactionResponse;
172
+ response: ComponentResponse;
134
173
  };
135
174
 
136
175
  /**
137
176
  * Component Message
138
- * @internal
177
+ * @public
178
+ */
179
+ export declare type ComponentMessage = Completed | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue;
180
+
181
+ /**
182
+ * An abstract request for communicating with a component
183
+ * @public
139
184
  */
140
- export declare type ComponentMessage = Completed | Cancel | Error_2 | Result | Ready | ResizeRequest | ModalRequest | InvalidValue | CloseModal;
185
+ declare interface ComponentRequest {
186
+ requestId?: RequestID;
187
+ customer?: Counterparty;
188
+ }
189
+
190
+ declare interface ComponentResponse {
191
+ requestID: RequestID;
192
+ valid: boolean;
193
+ status: Status;
194
+ errors: ValidationError[];
195
+ }
196
+
197
+ /**
198
+ * An object representing a connection request
199
+ * @public
200
+ */
201
+ export declare interface ConnectionRequest extends ComponentRequest {
202
+ asset: TransactionAsset;
203
+ }
204
+
205
+ /**
206
+ * An object representing a connection response
207
+ * @public
208
+ */
209
+ export declare interface ConnectionResponse extends ComponentResponse {
210
+ value: ConnectionRequest;
211
+ ivms: IVMS101;
212
+ proof?: OwnershipProof;
213
+ txCreate?: V1Transaction;
214
+ }
141
215
 
142
216
  /**
143
217
  * The counterparty of a transaction.
@@ -146,20 +220,30 @@ export declare type ComponentMessage = Completed | Cancel | Error_2 | Result | R
146
220
  export declare interface Counterparty {
147
221
  name?: string;
148
222
  accountNumber?: string;
149
- did?: string;
150
- geographicAddress?: string;
223
+ did?: DID;
151
224
  type?: PersonType;
152
225
  verified?: boolean;
226
+ geographicAddress?: Address;
227
+ nationalIdentification?: NationalIdentification;
228
+ website?: URI;
229
+ phone?: string;
153
230
  }
154
231
 
232
+ /**
233
+ * A crypto credential
234
+ * @public
235
+ */
155
236
  declare type CryptoCredential = `${string}.${string}.mastercard`;
156
237
 
157
238
  /**
158
- * 5.2.7
159
- * DateAndPlaceOfBirth
239
+ * Date and Place of Birth
240
+ * Represents the date and place of birth for a natural person
241
+ * @public
160
242
  */
161
243
  declare type DateAndPlaceOfBirth = {
162
- dateOfBirth?: string;
244
+ /** Date of birth in ISO 8601 format (YYYY-MM-DD) */
245
+ dateOfBirth?: ISODate;
246
+ /** Place of birth (max 70 characters) */
163
247
  placeOfBirth?: string;
164
248
  };
165
249
 
@@ -187,6 +271,10 @@ export declare interface Deposit extends OriginatorFields, Transaction {
187
271
  export declare interface DepositRequest extends DepositRequestFields, Transaction {
188
272
  }
189
273
 
274
+ /**
275
+ * Fields specific to a deposit request
276
+ * @public
277
+ */
190
278
  declare type DepositRequestFields = {
191
279
  destinations: destination[];
192
280
  };
@@ -197,46 +285,125 @@ declare type DepositRequestFields = {
197
285
  */
198
286
  export declare type destination = BlockchainAddress | CAIP10 | CryptoCredential | TravelAddress;
199
287
 
288
+ /**
289
+ * A Decentralized Identifier
290
+ * @public
291
+ */
200
292
  declare type DID = `did:${string}:${string}`;
201
293
 
294
+ /**
295
+ * Digital Token Identifier
296
+ * @public
297
+ */
202
298
  declare type DTI = string;
203
299
 
204
300
  /**
205
301
  * An embedded Notabene component
206
302
  * @public
207
303
  */
208
- export declare class EmbeddedComponent {
304
+ export declare class EmbeddedComponent<V, R> {
209
305
  private _url;
210
306
  private _value;
211
307
  private _errors;
212
308
  private iframe?;
213
309
  private eventManager;
214
- private ready;
215
310
  private modal?;
216
- constructor(url: string, value: Partial<Transaction>);
311
+ /**
312
+ * Creates an instance of EmbeddedComponent.
313
+ * @param url - The URL of the embedded component
314
+ * @param value - The initial transaction value
315
+ */
316
+ constructor(url: string, value: V);
317
+ /**
318
+ * Gets the URL of the embedded component
319
+ * @returns The URL of the embedded component
320
+ */
217
321
  get url(): string;
218
- get value(): Partial<Transaction>;
322
+ /**
323
+ * Gets the current transaction value
324
+ * @returns The current transaction value
325
+ */
326
+ get value(): V;
219
327
  get errors(): ValidationError[];
328
+ /**
329
+ * Opens the component URL in the current window
330
+ */
220
331
  open(): void;
332
+ /**
333
+ * Mounts the component to a parent element
334
+ * @param parentId - The ID of the parent element
335
+ * @throws Will throw an error if the parent element is not found
336
+ */
221
337
  mount(parentId: string): void;
338
+ /**
339
+ * Embeds the component into a parent element
340
+ * @param parent - The parent element to embed the component into
341
+ */
222
342
  embed(parent: Element): void;
343
+ /**
344
+ * Sends a message to the embedded component
345
+ * @param message - The message to send
346
+ */
223
347
  send(message: HostMessage): void;
348
+ /**
349
+ * Adds an event listener for a specific message type
350
+ * @param messageType - The type of message to listen for
351
+ * @param callback - The callback function to execute when the message is received
352
+ */
224
353
  on(messageType: string, callback: MessageCallback): void;
354
+ /**
355
+ * Removes an event listener for a specific message type
356
+ * @param messageType - The type of message to stop listening for
357
+ * @param callback - The callback function to remove
358
+ */
225
359
  off(messageType: string, callback: MessageCallback): void;
226
- update(value: Partial<Transaction>): void;
227
- completion(): Promise<TransactionResponse>;
228
- openModal(): void;
229
- private closeModal;
360
+ /**
361
+ * Updates the transaction value and sends an update message to the component
362
+ * @param value - The new transaction value
363
+ */
364
+ update(value: V): void;
365
+ /**
366
+ * Waits for the component to complete and returns the transaction response
367
+ * @returns A promise that resolves with the transaction response
368
+ */
369
+ completion(): Promise<R>;
370
+ /**
371
+ * Opens the component in a modal dialog
372
+ */
373
+ openModal(): Promise<R>;
374
+ /**
375
+ * Closes the modal dialog
376
+ *
377
+ */
378
+ closeModal(): void;
230
379
  }
231
380
 
381
+ /**
382
+ * Represents an error component message
383
+ * @public
384
+ */
232
385
  declare type Error_2 = {
233
386
  type: CMType.ERROR;
234
387
  message: string;
235
388
  };
236
389
 
390
+ /**
391
+ * Field properties
392
+ * @public
393
+ */
394
+ declare type FieldOptions = boolean | {
395
+ optional: boolean;
396
+ transmit: boolean;
397
+ };
398
+
399
+ declare type FieldTypes = {
400
+ naturalPerson?: NaturalPersonFields;
401
+ legalPerson?: LegalPersonFields;
402
+ };
403
+
237
404
  /**
238
405
  * Host Message Types
239
- * @internal
406
+ * @public
240
407
  */
241
408
  declare const enum HMType {
242
409
  UPDATE = "update",
@@ -245,25 +412,53 @@ declare const enum HMType {
245
412
 
246
413
  /**
247
414
  * Host Messages
248
- * @internal
415
+ * @public
249
416
  */
250
- export declare type HostMessage = UpdateValue | RequestResponse;
417
+ export declare type HostMessage = UpdateValue;
251
418
 
252
419
  /**
253
- * 5.2.13
254
- * IntermediaryVASP
420
+ * Intermediary VASP
421
+ * Represents an intermediary Virtual Asset Service Provider
422
+ * @public
255
423
  */
256
424
  declare type IntermediaryVASP = {
425
+ /** The intermediary VASP information */
257
426
  intermediaryVASP?: Person;
427
+ /** The sequence number of this VASP in the transfer path */
258
428
  sequence?: number;
259
429
  };
260
430
 
431
+ /**
432
+ * Represents an invalid value component message
433
+ * @public
434
+ */
261
435
  declare type InvalidValue = {
262
436
  type: CMType.INVALID;
263
437
  value: any;
264
438
  errors: ValidationError[];
265
439
  };
266
440
 
441
+ /**
442
+ * ISO-3166 Alpha-2 country code
443
+ * @example "US" for United States, "GB" for United Kingdom
444
+ * @public
445
+ */
446
+ declare type ISOCountryCode = string;
447
+
448
+ /**
449
+ * 3 letter ISO currency code
450
+ * @public
451
+ */
452
+ declare type ISOCurrency = string;
453
+
454
+ /**
455
+ * A point in time, represented as a day within the calendar year. Compliant with ISO 8601.
456
+ * Format: YYYY-MM-DD
457
+ * @example "2023-05-15" for May 15, 2023
458
+ * @public
459
+ */
460
+ declare type ISODate = `${number}-${number}-${number}`;
461
+
267
462
  /**
268
463
  * IVMS101 definition
269
464
  *
@@ -279,69 +474,99 @@ export declare type IVMS101 = {
279
474
  };
280
475
 
281
476
  /**
282
- * 5.2.9
283
- * LegalPerson
477
+ * Legal Person
478
+ * Represents a legal person with all associated information
479
+ * @public
284
480
  */
285
481
  declare type LegalPerson = {
286
- /** The name of the legal person. */
482
+ /** The name of the legal person */
287
483
  name: LegalPersonName;
288
- /** The address of the legal person. */
484
+ /** The address of the legal person */
289
485
  geographicAddress?: Address[];
290
- /** A distinct identifier that uniquely identifies the person to the institution in context. */
486
+ /** A distinct identifier that uniquely identifies the person to the institution in context */
291
487
  customerNumber?: string;
292
- /** A distinct identifier used by governments to uniquely identify a legal person. */
488
+ /** A distinct identifier used by governments to uniquely identify a legal person */
293
489
  nationalIdentification?: NationalIdentification;
294
- /** The country in which the legal person is registered. */
295
- countryOfRegistration?: string;
490
+ /** The country in which the legal person is registered */
491
+ countryOfRegistration?: ISOCountryCode;
296
492
  };
297
493
 
298
494
  /**
299
- * 5.2.10
300
- * LegalPersonName
495
+ * Field names for LegalPerson
496
+ * @public
497
+ */
498
+ declare type LegalPersonFieldName = 'name' | 'lei' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'countryOfRegistration';
499
+
500
+ /**
501
+ * Field properties by field name
502
+ * @public
503
+ */
504
+ declare type LegalPersonFields = {
505
+ [name in LegalPersonFieldName]?: FieldOptions;
506
+ };
507
+
508
+ /**
509
+ * Legal Person Name
510
+ * Represents the full name structure for a legal person
511
+ * @public
301
512
  */
302
513
  declare type LegalPersonName = {
514
+ /** Array of name identifiers */
303
515
  nameIdentifier: LegalPersonNameID[];
516
+ /** Array of local name identifiers */
304
517
  localNameIdentifier?: LocalLegalPersonNameID[];
518
+ /** Array of phonetic name identifiers */
305
519
  phoneticNameIdentifier?: LocalLegalPersonNameID[];
306
520
  };
307
521
 
308
522
  /**
309
- * 5.2.11
310
- * LegalPersonNameID
523
+ * Legal Person Name ID
524
+ * Represents a name identifier for a legal person
525
+ * @public
311
526
  */
312
527
  declare type LegalPersonNameID = {
313
- /** Name by which the legal person is known. */
528
+ /** Name by which the legal person is known */
314
529
  legalPersonName: string;
315
- /** The nature of the name specified. */
530
+ /** The nature of the name specified */
316
531
  legalPersonNameIdentifierType: LegalPersonNameTypeCode;
317
532
  };
318
533
 
319
534
  /**
320
- * 5.3.9
321
- * LegalPersonNameTypeCode
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.
535
+ * Legal Person Name Type Code
536
+ * Specifies the type of name for a legal person
537
+ * @public
326
538
  */
327
539
  declare type LegalPersonNameTypeCode = 'LEGL' | 'SHRT' | 'TRAD';
328
540
 
329
541
  /**
330
- * 5.2.12
331
- * LocalLegalPersonNameID
542
+ * A LEI Legal Entity Identifier
543
+ * @public
544
+ */
545
+ declare type LEI = string;
546
+
547
+ /**
548
+ * Local Legal Person Name ID
549
+ * Represents a local name identifier for a legal person
550
+ * @public
332
551
  */
333
552
  declare type LocalLegalPersonNameID = {
553
+ /** Name of the legal person, maximum 100 characters in local format */
334
554
  legalPersonName?: string;
555
+ /** Type of legal person name identifier */
335
556
  legalPersonNameIdentifierType?: LegalPersonNameTypeCode;
336
557
  };
337
558
 
338
559
  /**
339
- * 5.2.5
340
- * LocalNaturalPersonNameID
560
+ * Local Natural Person Name ID
561
+ * Represents a local name identifier for a natural person
562
+ * @public
341
563
  */
342
564
  declare type LocalNaturalPersonNameID = {
565
+ /** Primary identifier, maximum 100 characters in local format */
343
566
  primaryIdentifier?: string;
567
+ /** Secondary identifier, maximum 100 characters in local format */
344
568
  secondaryIdentifier?: string;
569
+ /** Type of name identifier */
345
570
  nameIdentifierType?: NaturalPersonNameTypeCode;
346
571
  };
347
572
 
@@ -355,97 +580,109 @@ export declare interface MicroTransferProof extends OwnershipProof {
355
580
  type: ProofTypes.MicroTransfer;
356
581
  txhash: string;
357
582
  chain: CAIP2;
358
- amount: number;
583
+ amountSubunits: string;
359
584
  }
360
585
 
361
- declare type ModalRequest = {
362
- type: CMType.MODAL;
363
- url: string;
364
- reqid: RequestID;
365
- };
366
-
367
586
  /**
368
- * 5.2.8
369
- * NationalIdentification
587
+ * National Identification
588
+ * Represents a national identifier for a person or entity
589
+ * @public
370
590
  */
371
591
  declare type NationalIdentification = {
592
+ /** National identifier (max 35 characters) */
372
593
  nationalIdentifier?: string;
594
+ /** Type of national identifier */
373
595
  nationalIdentifierType?: NationalIdentifierTypeCode;
374
- countryOfIssue?: string;
596
+ /** Country that issued the national identifier */
597
+ countryOfIssue?: ISOCountryCode;
598
+ /** Registration authority (format: RA followed by 6 digits) */
375
599
  registrationAuthority?: string;
376
600
  };
377
601
 
378
602
  /**
379
- * 5.3.14
380
- * NationalIdentifierTypeCode
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.
603
+ * National Identifier Type Code
604
+ * Specifies the type of national identifier
605
+ * @public
392
606
  */
393
607
  declare type NationalIdentifierTypeCode = 'ARNU' | 'CCPT' | 'RAID' | 'DRLC' | 'FIIN' | 'TXID' | 'SOCS' | 'IDCD' | 'LEIX' | 'MISC';
394
608
 
395
609
  /**
396
- * 5.2.2
397
- * NaturalPerson
610
+ * Natural Person
611
+ * Represents a natural person with all associated information
612
+ * @public
398
613
  */
399
614
  declare type NaturalPerson = {
400
- /** The distinct words used as identification for an individual. */
615
+ /** The distinct words used as identification for an individual */
401
616
  name: NaturalPersonName;
402
- /** The particulars of a location at which a person may be communicated with. */
617
+ /** The particulars of a location at which a person may be communicated with */
403
618
  geographicAddress?: Address[];
404
- /** A distinct identifier used by governments to uniquely identify a natural person. */
619
+ /** A distinct identifier used by governments to uniquely identify a natural person */
405
620
  nationalIdentification?: NationalIdentification;
406
- /** A distinct identifier that uniquely identifies the person to the institution in context. */
621
+ /** A distinct identifier that uniquely identifies the person to the institution in context */
407
622
  customerIdentification?: string;
408
- /** Date and place of birth of a person. */
623
+ /** Date and place of birth of a person */
409
624
  dateAndPlaceOfBirth?: DateAndPlaceOfBirth;
410
- /** Country in which a person resides (the place of a person's home). */
411
- countryOfResidence?: string;
625
+ /** Country in which a person resides (the place of a person's home) */
626
+ countryOfResidence?: ISOCountryCode;
412
627
  };
413
628
 
414
629
  /**
415
- * 5.2.3
416
- * NaturalPersonName
630
+ * Field names for NaturalPerson
631
+ * @public
632
+ */
633
+ declare type NaturalPersonFieldName = 'name' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'dateOfBirth' | 'placeOfBirth' | 'countryOfResidence';
634
+
635
+ /**
636
+ * Field properties by field name
637
+ * @public
638
+ */
639
+ declare type NaturalPersonFields = {
640
+ [name in NaturalPersonFieldName]?: FieldOptions;
641
+ };
642
+
643
+ /**
644
+ * Natural Person Name
645
+ * Represents the full name structure for a natural person
646
+ * @public
417
647
  */
418
648
  declare type NaturalPersonName = {
649
+ /** Array of name identifiers */
419
650
  nameIdentifier?: NaturalPersonNameID[];
651
+ /** Array of local name identifiers */
420
652
  localNameIdentifier?: LocalNaturalPersonNameID[];
653
+ /** Array of phonetic name identifiers */
421
654
  phoneticNameIdentifier?: LocalNaturalPersonNameID[];
422
655
  };
423
656
 
424
657
  /**
425
- * 5.2.4
426
- * NaturalPersonNameID
658
+ * Natural Person Name ID
659
+ * Represents a name identifier for a natural person
660
+ * @public
427
661
  */
428
662
  declare type NaturalPersonNameID = {
663
+ /** Primary identifier, maximum 100 characters */
429
664
  primaryIdentifier?: string;
665
+ /** Secondary identifier, maximum 100 characters */
430
666
  secondaryIdentifier?: string;
667
+ /** Type of name identifier */
431
668
  nameIdentifierType?: NaturalPersonNameTypeCode;
432
669
  };
433
670
 
434
671
  /**
435
- * 5.3.8
436
- * NaturalPersonNameTypeCode
672
+ * Natural Person Name Type Code
673
+ * Specifies the type of name for a natural person
437
674
  *
438
- * `ALIA` Alias name - A name other than the legal name by which a natural person is also known.
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.
675
+ * @public
443
676
  */
444
677
  declare type NaturalPersonNameTypeCode = 'ALIA' | 'BIRT' | 'MAID' | 'LEGL' | 'MISC';
445
678
 
446
679
  /**
447
680
  * Primary constructor for Notabene UX elements
448
681
  *
682
+ * This class provides methods to create and manage various Notabene components
683
+ * such as withdrawal assist, deposit assist, connect, and deposit request.
684
+ * It also handles URL generation and fragment decoding for these components.
685
+ *
449
686
  * @public
450
687
  */
451
688
  declare class Notabene {
@@ -454,50 +691,148 @@ declare class Notabene {
454
691
  private uxUrl;
455
692
  private theme?;
456
693
  private locale?;
694
+ /**
695
+ * Creates a new instance of the Notabene SDK
696
+ *
697
+ * @param config - Configuration options for the Notabene SDK
698
+ */
457
699
  constructor(config: NotabeneConfig);
458
- componentUrl(path: string, value: Partial<Transaction>, configuration?: TransactionOptions, callbacks?: CallbackOptions): string;
459
- createComponent(path: string, value: Partial<Transaction>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent;
460
- createWithdrawalAssist(value: Partial<Withdrawal>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent;
461
- createDepositAssist(value: Partial<Deposit>, options?: any, callbacks?: CallbackOptions): EmbeddedComponent;
462
- createConnect(value: Partial<Withdrawal>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent;
463
- createDepositRequest(value: Partial<DepositRequest>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent;
700
+ /**
701
+ * Generates a URL for a Notabene component
702
+ *
703
+ * @param path - The path of the component
704
+ * @param value - Transaction data
705
+ * @param configuration - Optional transaction configuration
706
+ * @param callbacks - Optional callback configuration
707
+ * @returns component URL
708
+ * @internal
709
+ */
710
+ componentUrl<V>(path: string, value: V, configuration?: TransactionOptions, callbacks?: CallbackOptions): string;
711
+ /**
712
+ * Creates a new embedded component
713
+ *
714
+ * @param path - The path of the component
715
+ * @param value - Transaction data
716
+ * @param options - Optional transaction options
717
+ * @param callbacks - Optional callback configuration
718
+ * @returns A new EmbeddedComponent instance
719
+ * @internal
720
+ */
721
+ createComponent<V, R>(path: string, value: V, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent<V, R>;
722
+ /**
723
+ * Creates a withdrawal assist component
724
+ *
725
+ * @param value - Withdrawal transaction data
726
+ * @param options - Optional transaction options
727
+ * @param callbacks - Optional callback configuration
728
+ * @returns A new EmbeddedComponent instance for withdrawal assistance
729
+ */
730
+ createWithdrawalAssist(value: Partial<Withdrawal>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent<Partial<Withdrawal>, TransactionResponse<Withdrawal>>;
731
+ /**
732
+ * Creates a deposit assist component
733
+ *
734
+ * @param value - Deposit transaction data
735
+ * @param options - Optional transaction options
736
+ * @param callbacks - Optional callback configuration
737
+ * @returns A new EmbeddedComponent instance for deposit assistance
738
+ * @alpha
739
+ */
740
+ createDepositAssist(value: Partial<Deposit>, options?: any, callbacks?: CallbackOptions): EmbeddedComponent<Partial<Deposit>, TransactionResponse<Deposit>>;
741
+ /**
742
+ * Creates a connect component
743
+ *
744
+ * @param value - Connection request data
745
+ * @param options - Optional transaction options
746
+ * @param callbacks - Optional callback configuration
747
+ * @returns A new EmbeddedComponent instance for connection
748
+ */
749
+ createConnectWallet(value: ConnectionRequest, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent<ConnectionRequest, ConnectionResponse>;
750
+ /**
751
+ * Creates a deposit request component
752
+ *
753
+ * @param value - Deposit request data
754
+ * @param options - Optional transaction options
755
+ * @param callbacks - Optional callback configuration
756
+ * @returns A new EmbeddedComponent instance for deposit requests
757
+ * @alpha
758
+ */
759
+ createDepositRequest(value: DepositRequest, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent<DepositRequest, TransactionResponse<DepositRequest>>;
760
+ /**
761
+ * Decodes a URL fragment into an object
762
+ *
763
+ * @param fragment - The URL fragment to decode
764
+ * @returns An object containing the decoded key-value pairs
765
+ */
464
766
  decodeFragmentToObject(fragment: string): Record<string, string>;
465
767
  }
466
768
  export { Notabene }
467
769
  export default Notabene;
468
770
 
771
+ /**
772
+ * Notabene Asset Identifier
773
+ * @public
774
+ */
469
775
  declare type NotabeneAsset = string;
470
776
 
777
+ /**
778
+ * Configuration for the Notabene SDK
779
+ *
780
+ * @public
781
+ */
471
782
  /**
472
783
  * Configuration for the Notabene SDK
473
784
  *
474
785
  * @public
475
786
  */
476
787
  export declare interface NotabeneConfig {
788
+ /**
789
+ * The URL of the Notabene API node
790
+ */
477
791
  nodeUrl?: string;
792
+ /**
793
+ * The authentication token for the Notabene API
794
+ */
478
795
  authToken?: string;
796
+ /**
797
+ * The URL of the Notabene UX components
798
+ */
479
799
  uxUrl?: string;
800
+ /**
801
+ * Custom theme configuration for the UX components
802
+ */
480
803
  theme?: Theme;
804
+ /**
805
+ * The locale to use for the UX components
806
+ */
481
807
  locale?: string;
482
808
  }
483
809
 
484
810
  /**
485
- * 6.4
486
- * The originating VASP is defined in Section 1.1 as the VASP which initiates the VA transfer, and transfers the VA upon receiving the request for a VA transfer on behalf of the originator.
811
+ * Originating VASP
812
+ * Represents the VASP which initiates the VA transfer
813
+ * @public
487
814
  */
488
815
  declare type OriginatingVASP = {
816
+ /** The originating VASP information */
489
817
  originatingVASP?: Person;
490
818
  };
491
819
 
492
820
  /**
493
- * 6.2
494
- * The originator is defined in Section 1.1 as the account holder who allows the VA transfer from that account or, where there is no account, the natural or legal person that places the order with the originating VASP to perform the VA transfer.
821
+ * Originator
822
+ * Represents the account holder who initiates the VA transfer
823
+ * @public
495
824
  */
496
825
  declare type Originator = {
826
+ /** Array of persons associated with the originator */
497
827
  originatorPersons?: Person[];
828
+ /** Array of account numbers, maximum 100 characters each */
498
829
  accountNumber?: string[];
499
830
  };
500
831
 
832
+ /**
833
+ * Fields specific to the originator of a transaction
834
+ * @public
835
+ */
501
836
  declare type OriginatorFields = {
502
837
  source?: Source;
503
838
  };
@@ -535,11 +870,14 @@ declare enum PayloadVersionCode {
535
870
  }
536
871
 
537
872
  /**
538
- * 5.2.1
539
873
  * Person
874
+ * Represents either a natural person or a legal person
875
+ * @public
540
876
  */
541
877
  declare type Person = {
878
+ /** Natural person information */
542
879
  naturalPerson?: NaturalPerson;
880
+ /** Legal person information */
543
881
  legalPerson?: LegalPerson;
544
882
  };
545
883
 
@@ -567,7 +905,7 @@ export declare enum ProofStatus {
567
905
  /**
568
906
  * The type of Proofs supported
569
907
  * @public
570
- **/
908
+ */
571
909
  export declare enum ProofTypes {
572
910
  SelfDeclaration = "self-declaration",
573
911
  PersonalSignEIP191 = "eip-191",
@@ -578,28 +916,25 @@ export declare enum ProofTypes {
578
916
  Screenshot = "screenshot"
579
917
  }
580
918
 
919
+ /**
920
+ * Represents a ready component message
921
+ * @public
922
+ */
581
923
  declare type Ready = {
582
924
  type: CMType.READY;
583
925
  };
584
926
 
585
- declare type RequestID = string;
586
-
587
- declare type RequestResponse = {
588
- type: HMType.REQUEST_RESPONSE;
589
- reqid: RequestID;
590
- };
927
+ declare type RequestID = UUID;
591
928
 
929
+ /**
930
+ * Represents a resize request component message
931
+ * @public
932
+ */
592
933
  declare type ResizeRequest = {
593
934
  type: CMType.RESIZE;
594
935
  height: number;
595
936
  };
596
937
 
597
- declare type Result = {
598
- type: CMType.RESULT;
599
- reqid: RequestID;
600
- response: TransactionResponse;
601
- };
602
-
603
938
  /**
604
939
  * Ownership Proof using Screenshot
605
940
  * @public
@@ -620,6 +955,10 @@ export declare interface SignatureProof extends OwnershipProof {
620
955
  wallet_provider: string;
621
956
  }
622
957
 
958
+ /**
959
+ * The source of a transaction
960
+ * @public
961
+ */
623
962
  declare type Source = BlockchainAddress | CAIP10;
624
963
 
625
964
  /**
@@ -649,21 +988,20 @@ export declare type Theme = {
649
988
  * An abstract transaction object
650
989
  * @public
651
990
  */
652
- export declare interface Transaction {
991
+ export declare interface Transaction extends ComponentRequest {
653
992
  agent: Agent;
654
- customer?: Counterparty;
655
993
  counterparty: Counterparty;
656
994
  asset: TransactionAsset;
657
995
  amountDecimal: number;
658
- customAssetPrice?: {
996
+ proof?: OwnershipProof;
997
+ assetPrice?: {
659
998
  price: number;
660
- currency: string;
999
+ currency: ISOCurrency;
661
1000
  };
662
1001
  }
663
1002
 
664
1003
  /**
665
1004
  * The asset of a transaction either a Notabene asset, a CAIP-19 asset, or a DTI.
666
- *
667
1005
  * @public
668
1006
  */
669
1007
  export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
@@ -673,64 +1011,76 @@ export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
673
1011
  * @public
674
1012
  */
675
1013
  export declare interface TransactionOptions {
676
- microTransactionAddress?: BlockchainAddress;
677
- proofFallbacks?: ProofTypes[];
1014
+ proofs?: {
1015
+ microTransfer?: {
1016
+ destination: BlockchainAddress;
1017
+ timeout?: number;
1018
+ };
1019
+ fallbacks?: ProofTypes[];
1020
+ };
1021
+ allowedAgentTypes?: AgentType[];
1022
+ allowedCounterpartyTypes?: PersonType[];
1023
+ fields?: FieldTypes;
678
1024
  }
679
1025
 
680
1026
  /**
681
1027
  * The response of a transaction
682
1028
  * @public
683
1029
  */
684
- export declare type TransactionResponse = {
685
- value: Transaction;
1030
+ export declare interface TransactionResponse<V> extends ComponentResponse {
1031
+ value: V;
686
1032
  ivms: IVMS101;
687
1033
  proof?: OwnershipProof;
688
- valid: boolean;
689
- status: Status;
690
- errors: ValidationError[];
691
1034
  txCreate?: V1Transaction;
692
- };
1035
+ }
693
1036
 
694
1037
  /**
695
- * 6.6
696
- * The transfer path refers to the intermediary VASP(s) participating in a serial chain that receive(s) and retransmit(s) a VA transfer on behalf of the originating VASP and the beneficiary VASP, or another intermediary VASP, together with their corresponding sequence number.
1038
+ * Transfer Path
1039
+ * Represents the path of intermediary VASPs in a transfer
1040
+ * @public
697
1041
  */
698
1042
  declare type TransferPath = {
1043
+ /** Array of intermediary VASPs involved in the transfer */
699
1044
  transferPath?: IntermediaryVASP[];
700
1045
  };
701
1046
 
702
1047
  /**
703
- * 5.3.16
704
- * TransliterationMethodCode
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
1048
+ * Transliteration Method Code
1049
+ * Specifies the method used to transliterate text
1050
+ * @public
719
1051
  */
720
1052
  declare type TransliterationMethodCode = 'arab' | 'aran' | 'armn' | 'cyrl' | 'deva' | 'geor' | 'grek' | 'hani' | 'hebr' | 'kana' | 'kore' | 'thai' | 'othr';
721
1053
 
1054
+ /**
1055
+ * A travel address
1056
+ * @public
1057
+ */
722
1058
  declare type TravelAddress = `ta${string}`;
723
1059
 
1060
+ /**
1061
+ * Represents an update value host message
1062
+ * @public
1063
+ */
724
1064
  declare type UpdateValue = {
725
1065
  type: HMType.UPDATE;
726
- value: Partial<Transaction>;
1066
+ value: ComponentRequest;
727
1067
  };
728
1068
 
1069
+ /**
1070
+ * A Uniform Resource Identifier
1071
+ * @public
1072
+ */
729
1073
  declare type URI = string;
730
1074
 
731
- declare type V1Asset = {
1075
+ /**
1076
+ * UUID v4
1077
+ * @public
1078
+ */
1079
+ declare type UUID = string;
1080
+
1081
+ declare type V1Asset = NotabeneAsset | {
732
1082
  caip19: CAIP19;
733
- } | string;
1083
+ };
734
1084
 
735
1085
  /**
736
1086
  * Transaction payload suitable for calling Notabene v1 tx/create
@@ -747,6 +1097,10 @@ declare type V1Transaction = {
747
1097
  beneficiary: Beneficiary;
748
1098
  };
749
1099
 
1100
+ /**
1101
+ * Validation error
1102
+ * @public
1103
+ */
750
1104
  declare type ValidationError = {
751
1105
  attribute: string;
752
1106
  message: string;
@@ -757,8 +1111,10 @@ declare type ValidationError = {
757
1111
  * @public
758
1112
  */
759
1113
  export declare interface VASP extends Agent {
760
- url?: string;
761
- name?: string;
1114
+ lei?: LEI;
1115
+ logo?: URI;
1116
+ website?: URI;
1117
+ countryOfRegistration?: ISOCountryCode;
762
1118
  }
763
1119
 
764
1120
  /**