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

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