@notabene/javascript-sdk 1.34.0 → 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.
@@ -0,0 +1,1136 @@
1
+ /**
2
+ * Address
3
+ * Represents a physical address
4
+ * @public
5
+ */
6
+ declare type Address = {
7
+ /** Identifies the nature of the address. */
8
+ addressType: AddressTypeCode;
9
+ /** Identification of a division of a large organisation or building. */
10
+ department?: string;
11
+ /** Identification of a sub-division of a large organisation or building. */
12
+ subDepartment?: string;
13
+ /** Name of a street or thoroughfare. */
14
+ streetName?: string;
15
+ /** Number that identifies the position of a building on a street. */
16
+ buildingNumber?: string;
17
+ /** Name of the building or house. */
18
+ buildingName?: string;
19
+ /** Floor or storey within a building. */
20
+ floor?: string;
21
+ /** Numbered box in a post office. */
22
+ postBox?: string;
23
+ /** Building room number. */
24
+ room?: string;
25
+ /** Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail. */
26
+ postcode?: string;
27
+ /** Name of a built-up area, with defined boundaries, and a local government. */
28
+ townName: string;
29
+ /** Specific location name within the town. */
30
+ townLocationName?: string;
31
+ /** Identifies a subdivision within a country subdivision. */
32
+ districtName?: string;
33
+ /** Identifies a subdivision of a country such as state, region, province. */
34
+ countrySubDivision?: string;
35
+ /** Information that locates and identifies a specific address, presented in free format text. */
36
+ addressLine?: string[];
37
+ /** Nation with its own government. */
38
+ country: ISOCountryCode;
39
+ };
40
+
41
+ /**
42
+ * Address Type Code
43
+ * Specifies the type of address
44
+ * @public
45
+ */
46
+ declare type AddressTypeCode = 'HOME' | 'BIZZ' | 'GEOG';
47
+
48
+ /**
49
+ * Who is the agent acting on behalf of the counterparty
50
+ * @public
51
+ */
52
+ export declare interface Agent {
53
+ did: DID;
54
+ type: AgentType;
55
+ logo?: URI;
56
+ url?: URI;
57
+ name?: string;
58
+ verified?: boolean;
59
+ }
60
+
61
+ /**
62
+ * The type of Agent. Either a wallet or a VASP
63
+ * @public
64
+ */
65
+ export declare enum AgentType {
66
+ PRIVATE = "WALLET",
67
+ VASP = "VASP"
68
+ }
69
+
70
+ /**
71
+ * Beneficiary
72
+ * Represents the receiver of the requested VA transfer
73
+ * @public
74
+ */
75
+ declare type Beneficiary = {
76
+ /** Array of persons associated with the beneficiary */
77
+ beneficiaryPersons?: Person[];
78
+ /** Array of account numbers, maximum 100 characters each */
79
+ accountNumber?: string[];
80
+ };
81
+
82
+ /**
83
+ * Fields specific to the beneficiary of a transaction
84
+ * @public
85
+ */
86
+ declare type BeneficiaryFields = {
87
+ destination?: destination;
88
+ };
89
+
90
+ /**
91
+ * Beneficiary VASP
92
+ * Represents the VASP which receives the VA transfer
93
+ * @public
94
+ */
95
+ declare type BeneficiaryVASP = {
96
+ /** The beneficiary VASP information */
97
+ beneficiaryVASP?: Person;
98
+ };
99
+
100
+ /**
101
+ * A blockchain address
102
+ * @public
103
+ */
104
+ declare type BlockchainAddress = string;
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
+ */
113
+ declare type CAIP10 = `${CAIP2}:${string}`;
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
+ */
122
+ declare type CAIP19 = `${CAIP2}/${string}:${string}`;
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
+ */
131
+ declare type CAIP2 = `${string}:${string}`;
132
+
133
+ /**
134
+ * Options for callback and redirect URIs
135
+ * @public
136
+ */
137
+ export declare interface CallbackOptions {
138
+ callback?: URI;
139
+ redirectUri?: URI;
140
+ }
141
+
142
+ /**
143
+ * Represents a cancel component message
144
+ * @public
145
+ */
146
+ declare type Cancel = {
147
+ type: CMType.CANCEL;
148
+ };
149
+
150
+ /**
151
+ * Component Message Types
152
+ * @public
153
+ */
154
+ export declare const enum CMType {
155
+ COMPLETE = "complete",
156
+ RESIZE = "resize",
157
+ RESULT = "result",
158
+ READY = "ready",
159
+ INVALID = "invalid",
160
+ MODAL = "openModal",
161
+ ERROR = "error",
162
+ CLOSE = "closeModal",
163
+ CANCEL = "cancel"
164
+ }
165
+
166
+ /**
167
+ * Represents a completed component message
168
+ * @public
169
+ */
170
+ declare type Completed = {
171
+ type: CMType.COMPLETE;
172
+ response: ComponentResponse;
173
+ };
174
+
175
+ /**
176
+ * Component Message
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
184
+ */
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
+ }
215
+
216
+ /**
217
+ * The counterparty of a transaction.
218
+ * @public
219
+ */
220
+ export declare interface Counterparty {
221
+ name?: string;
222
+ accountNumber?: string;
223
+ did?: DID;
224
+ type?: PersonType;
225
+ verified?: boolean;
226
+ geographicAddress?: Address;
227
+ nationalIdentification?: NationalIdentification;
228
+ website?: URI;
229
+ phone?: string;
230
+ }
231
+
232
+ /**
233
+ * A crypto credential
234
+ * @public
235
+ */
236
+ declare type CryptoCredential = `${string}.${string}.mastercard`;
237
+
238
+ /**
239
+ * Date and Place of Birth
240
+ * Represents the date and place of birth for a natural person
241
+ * @public
242
+ */
243
+ declare type DateAndPlaceOfBirth = {
244
+ /** Date of birth in ISO 8601 format (YYYY-MM-DD) */
245
+ dateOfBirth?: ISODate;
246
+ /** Place of birth (max 70 characters) */
247
+ placeOfBirth?: string;
248
+ };
249
+
250
+ /**
251
+ * Ownership Proof using Self Declaration
252
+ * @public
253
+ */
254
+ export declare interface DeclarationProof extends OwnershipProof {
255
+ type: ProofTypes.SelfDeclaration;
256
+ attestation: string;
257
+ confirmed: boolean;
258
+ }
259
+
260
+ /**
261
+ * An object representing a deposit transaction
262
+ * @public
263
+ */
264
+ export declare interface Deposit extends OriginatorFields, Transaction {
265
+ }
266
+
267
+ /**
268
+ * An object representing a request for a deposit
269
+ * @public
270
+ */
271
+ export declare interface DepositRequest extends DepositRequestFields, Transaction {
272
+ }
273
+
274
+ /**
275
+ * Fields specific to a deposit request
276
+ * @public
277
+ */
278
+ declare type DepositRequestFields = {
279
+ destinations: destination[];
280
+ };
281
+
282
+ /**
283
+ * The destination of a transaction either a blockchain address, a CAIP-19 address, or a travel address.
284
+ * @public
285
+ */
286
+ export declare type destination = BlockchainAddress | CAIP10 | CryptoCredential | TravelAddress;
287
+
288
+ /**
289
+ * A Decentralized Identifier
290
+ * @public
291
+ */
292
+ declare type DID = `did:${string}:${string}`;
293
+
294
+ /**
295
+ * Digital Token Identifier
296
+ * @public
297
+ */
298
+ declare type DTI = string;
299
+
300
+ /**
301
+ * An embedded Notabene component
302
+ * @public
303
+ */
304
+ export declare class EmbeddedComponent<V, R> {
305
+ private _url;
306
+ private _value;
307
+ private _errors;
308
+ private iframe?;
309
+ private eventManager;
310
+ private modal?;
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
+ */
321
+ get url(): string;
322
+ /**
323
+ * Gets the current transaction value
324
+ * @returns The current transaction value
325
+ */
326
+ get value(): V;
327
+ get errors(): ValidationError[];
328
+ /**
329
+ * Opens the component URL in the current window
330
+ */
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
+ */
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
+ */
342
+ embed(parent: Element): void;
343
+ /**
344
+ * Sends a message to the embedded component
345
+ * @param message - The message to send
346
+ */
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
+ */
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
+ */
359
+ off(messageType: string, callback: MessageCallback): void;
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;
379
+ }
380
+
381
+ /**
382
+ * Represents an error component message
383
+ * @public
384
+ */
385
+ declare type Error_2 = {
386
+ type: CMType.ERROR;
387
+ message: string;
388
+ };
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
+
404
+ /**
405
+ * Host Message Types
406
+ * @public
407
+ */
408
+ declare const enum HMType {
409
+ UPDATE = "update",
410
+ REQUEST_RESPONSE = "requestResponse"
411
+ }
412
+
413
+ /**
414
+ * Host Messages
415
+ * @public
416
+ */
417
+ export declare type HostMessage = UpdateValue;
418
+
419
+ /**
420
+ * Intermediary VASP
421
+ * Represents an intermediary Virtual Asset Service Provider
422
+ * @public
423
+ */
424
+ declare type IntermediaryVASP = {
425
+ /** The intermediary VASP information */
426
+ intermediaryVASP?: Person;
427
+ /** The sequence number of this VASP in the transfer path */
428
+ sequence?: number;
429
+ };
430
+
431
+ /**
432
+ * Represents an invalid value component message
433
+ * @public
434
+ */
435
+ declare type InvalidValue = {
436
+ type: CMType.INVALID;
437
+ value: any;
438
+ errors: ValidationError[];
439
+ };
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
+
462
+ /**
463
+ * IVMS101 definition
464
+ *
465
+ * @public
466
+ */
467
+ export declare type IVMS101 = {
468
+ originator?: Originator;
469
+ beneficiary?: Beneficiary;
470
+ originatingVASP?: OriginatingVASP;
471
+ beneficiaryVASP?: BeneficiaryVASP;
472
+ transferPath?: TransferPath;
473
+ payloadMetadata?: PayloadMetadata;
474
+ };
475
+
476
+ /**
477
+ * Legal Person
478
+ * Represents a legal person with all associated information
479
+ * @public
480
+ */
481
+ declare type LegalPerson = {
482
+ /** The name of the legal person */
483
+ name: LegalPersonName;
484
+ /** The address of the legal person */
485
+ geographicAddress?: Address[];
486
+ /** A distinct identifier that uniquely identifies the person to the institution in context */
487
+ customerNumber?: string;
488
+ /** A distinct identifier used by governments to uniquely identify a legal person */
489
+ nationalIdentification?: NationalIdentification;
490
+ /** The country in which the legal person is registered */
491
+ countryOfRegistration?: ISOCountryCode;
492
+ };
493
+
494
+ /**
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
512
+ */
513
+ declare type LegalPersonName = {
514
+ /** Array of name identifiers */
515
+ nameIdentifier: LegalPersonNameID[];
516
+ /** Array of local name identifiers */
517
+ localNameIdentifier?: LocalLegalPersonNameID[];
518
+ /** Array of phonetic name identifiers */
519
+ phoneticNameIdentifier?: LocalLegalPersonNameID[];
520
+ };
521
+
522
+ /**
523
+ * Legal Person Name ID
524
+ * Represents a name identifier for a legal person
525
+ * @public
526
+ */
527
+ declare type LegalPersonNameID = {
528
+ /** Name by which the legal person is known */
529
+ legalPersonName: string;
530
+ /** The nature of the name specified */
531
+ legalPersonNameIdentifierType: LegalPersonNameTypeCode;
532
+ };
533
+
534
+ /**
535
+ * Legal Person Name Type Code
536
+ * Specifies the type of name for a legal person
537
+ * @public
538
+ */
539
+ declare type LegalPersonNameTypeCode = 'LEGL' | 'SHRT' | 'TRAD';
540
+
541
+ /**
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
551
+ */
552
+ declare type LocalLegalPersonNameID = {
553
+ /** Name of the legal person, maximum 100 characters in local format */
554
+ legalPersonName?: string;
555
+ /** Type of legal person name identifier */
556
+ legalPersonNameIdentifierType?: LegalPersonNameTypeCode;
557
+ };
558
+
559
+ /**
560
+ * Local Natural Person Name ID
561
+ * Represents a local name identifier for a natural person
562
+ * @public
563
+ */
564
+ declare type LocalNaturalPersonNameID = {
565
+ /** Primary identifier, maximum 100 characters in local format */
566
+ primaryIdentifier?: string;
567
+ /** Secondary identifier, maximum 100 characters in local format */
568
+ secondaryIdentifier?: string;
569
+ /** Type of name identifier */
570
+ nameIdentifierType?: NaturalPersonNameTypeCode;
571
+ };
572
+
573
+ declare type MessageCallback = (message: ComponentMessage) => void;
574
+
575
+ /**
576
+ * Ownership Proof using Micro Transfer
577
+ * @public
578
+ */
579
+ export declare interface MicroTransferProof extends OwnershipProof {
580
+ type: ProofTypes.MicroTransfer;
581
+ txhash: string;
582
+ chain: CAIP2;
583
+ amountSubunits: string;
584
+ }
585
+
586
+ /**
587
+ * National Identification
588
+ * Represents a national identifier for a person or entity
589
+ * @public
590
+ */
591
+ declare type NationalIdentification = {
592
+ /** National identifier (max 35 characters) */
593
+ nationalIdentifier?: string;
594
+ /** Type of national identifier */
595
+ nationalIdentifierType?: NationalIdentifierTypeCode;
596
+ /** Country that issued the national identifier */
597
+ countryOfIssue?: ISOCountryCode;
598
+ /** Registration authority (format: RA followed by 6 digits) */
599
+ registrationAuthority?: string;
600
+ };
601
+
602
+ /**
603
+ * National Identifier Type Code
604
+ * Specifies the type of national identifier
605
+ * @public
606
+ */
607
+ declare type NationalIdentifierTypeCode = 'ARNU' | 'CCPT' | 'RAID' | 'DRLC' | 'FIIN' | 'TXID' | 'SOCS' | 'IDCD' | 'LEIX' | 'MISC';
608
+
609
+ /**
610
+ * Natural Person
611
+ * Represents a natural person with all associated information
612
+ * @public
613
+ */
614
+ declare type NaturalPerson = {
615
+ /** The distinct words used as identification for an individual */
616
+ name: NaturalPersonName;
617
+ /** The particulars of a location at which a person may be communicated with */
618
+ geographicAddress?: Address[];
619
+ /** A distinct identifier used by governments to uniquely identify a natural person */
620
+ nationalIdentification?: NationalIdentification;
621
+ /** A distinct identifier that uniquely identifies the person to the institution in context */
622
+ customerIdentification?: string;
623
+ /** Date and place of birth of a person */
624
+ dateAndPlaceOfBirth?: DateAndPlaceOfBirth;
625
+ /** Country in which a person resides (the place of a person's home) */
626
+ countryOfResidence?: ISOCountryCode;
627
+ };
628
+
629
+ /**
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
647
+ */
648
+ declare type NaturalPersonName = {
649
+ /** Array of name identifiers */
650
+ nameIdentifier?: NaturalPersonNameID[];
651
+ /** Array of local name identifiers */
652
+ localNameIdentifier?: LocalNaturalPersonNameID[];
653
+ /** Array of phonetic name identifiers */
654
+ phoneticNameIdentifier?: LocalNaturalPersonNameID[];
655
+ };
656
+
657
+ /**
658
+ * Natural Person Name ID
659
+ * Represents a name identifier for a natural person
660
+ * @public
661
+ */
662
+ declare type NaturalPersonNameID = {
663
+ /** Primary identifier, maximum 100 characters */
664
+ primaryIdentifier?: string;
665
+ /** Secondary identifier, maximum 100 characters */
666
+ secondaryIdentifier?: string;
667
+ /** Type of name identifier */
668
+ nameIdentifierType?: NaturalPersonNameTypeCode;
669
+ };
670
+
671
+ /**
672
+ * Natural Person Name Type Code
673
+ * Specifies the type of name for a natural person
674
+ *
675
+ * @public
676
+ */
677
+ declare type NaturalPersonNameTypeCode = 'ALIA' | 'BIRT' | 'MAID' | 'LEGL' | 'MISC';
678
+
679
+ /**
680
+ * Primary constructor for Notabene UX elements
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
+ *
686
+ * @public
687
+ */
688
+ declare class Notabene {
689
+ private nodeUrl?;
690
+ private authToken?;
691
+ private uxUrl;
692
+ private theme?;
693
+ private locale?;
694
+ /**
695
+ * Creates a new instance of the Notabene SDK
696
+ *
697
+ * @param config - Configuration options for the Notabene SDK
698
+ */
699
+ constructor(config: NotabeneConfig);
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
+ */
766
+ decodeFragmentToObject(fragment: string): Record<string, string>;
767
+ }
768
+ export { Notabene }
769
+ export default Notabene;
770
+
771
+ /**
772
+ * Notabene Asset Identifier
773
+ * @public
774
+ */
775
+ declare type NotabeneAsset = string;
776
+
777
+ /**
778
+ * Configuration for the Notabene SDK
779
+ *
780
+ * @public
781
+ */
782
+ /**
783
+ * Configuration for the Notabene SDK
784
+ *
785
+ * @public
786
+ */
787
+ export declare interface NotabeneConfig {
788
+ /**
789
+ * The URL of the Notabene API node
790
+ */
791
+ nodeUrl?: string;
792
+ /**
793
+ * The authentication token for the Notabene API
794
+ */
795
+ authToken?: string;
796
+ /**
797
+ * The URL of the Notabene UX components
798
+ */
799
+ uxUrl?: string;
800
+ /**
801
+ * Custom theme configuration for the UX components
802
+ */
803
+ theme?: Theme;
804
+ /**
805
+ * The locale to use for the UX components
806
+ */
807
+ locale?: string;
808
+ }
809
+
810
+ /**
811
+ * Originating VASP
812
+ * Represents the VASP which initiates the VA transfer
813
+ * @public
814
+ */
815
+ declare type OriginatingVASP = {
816
+ /** The originating VASP information */
817
+ originatingVASP?: Person;
818
+ };
819
+
820
+ /**
821
+ * Originator
822
+ * Represents the account holder who initiates the VA transfer
823
+ * @public
824
+ */
825
+ declare type Originator = {
826
+ /** Array of persons associated with the originator */
827
+ originatorPersons?: Person[];
828
+ /** Array of account numbers, maximum 100 characters each */
829
+ accountNumber?: string[];
830
+ };
831
+
832
+ /**
833
+ * Fields specific to the originator of a transaction
834
+ * @public
835
+ */
836
+ declare type OriginatorFields = {
837
+ source?: Source;
838
+ };
839
+
840
+ /**
841
+ * Ownership Proof
842
+ * @public
843
+ */
844
+ export declare interface OwnershipProof {
845
+ type: ProofTypes;
846
+ status: ProofStatus;
847
+ did: DID;
848
+ address: CAIP10;
849
+ }
850
+
851
+ /**
852
+ * 6.7
853
+ * Data describing the contents of the payload.
854
+ */
855
+ declare interface PayloadMetadata {
856
+ /** The method used to map from a national system of writing to Latin script. */
857
+ transliterationMethod?: TransliterationMethodCode[];
858
+ /** The version of IVMS 101 to which the payload complies. */
859
+ payloadVersion: PayloadVersionCode;
860
+ }
861
+
862
+ /**
863
+ * The version of IVMS 101 to which the payload complies.
864
+ */
865
+ declare enum PayloadVersionCode {
866
+ /** Published May 2020 */
867
+ V101 = "101",
868
+ /** Published August 2023 */
869
+ V101_2023 = "101.2023"
870
+ }
871
+
872
+ /**
873
+ * Person
874
+ * Represents either a natural person or a legal person
875
+ * @public
876
+ */
877
+ declare type Person = {
878
+ /** Natural person information */
879
+ naturalPerson?: NaturalPerson;
880
+ /** Legal person information */
881
+ legalPerson?: LegalPerson;
882
+ };
883
+
884
+ /**
885
+ * 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.
886
+ * @public
887
+ */
888
+ export declare enum PersonType {
889
+ NATURAL = "natural",
890
+ LEGAL = "legal",
891
+ SELF = "self"
892
+ }
893
+
894
+ /**
895
+ * Status of the proof
896
+ * @public
897
+ */
898
+ export declare enum ProofStatus {
899
+ PENDING = "pending",// Verification is pending
900
+ FAILED = "rejected",// Rejected
901
+ FLAGGED = "flagged",// Flagged for manual review
902
+ VERIFIED = "verified"
903
+ }
904
+
905
+ /**
906
+ * The type of Proofs supported
907
+ * @public
908
+ */
909
+ export declare enum ProofTypes {
910
+ SelfDeclaration = "self-declaration",
911
+ PersonalSignEIP191 = "eip-191",
912
+ PersonalSignEIP712 = "eip-712",
913
+ PersonalSignBIP137 = "bip-137",
914
+ PersonalSignXPUB = "xpub",
915
+ MicroTransfer = "microtransfer",
916
+ Screenshot = "screenshot"
917
+ }
918
+
919
+ /**
920
+ * Represents a ready component message
921
+ * @public
922
+ */
923
+ declare type Ready = {
924
+ type: CMType.READY;
925
+ };
926
+
927
+ declare type RequestID = UUID;
928
+
929
+ /**
930
+ * Represents a resize request component message
931
+ * @public
932
+ */
933
+ declare type ResizeRequest = {
934
+ type: CMType.RESIZE;
935
+ height: number;
936
+ };
937
+
938
+ /**
939
+ * Ownership Proof using Screenshot
940
+ * @public
941
+ */
942
+ export declare interface ScreenshotProof extends OwnershipProof {
943
+ type: ProofTypes.Screenshot;
944
+ url: string;
945
+ }
946
+
947
+ /**
948
+ * Ownership Proof using Message Signature
949
+ * @public
950
+ */
951
+ export declare interface SignatureProof extends OwnershipProof {
952
+ type: ProofTypes.PersonalSignEIP191 | ProofTypes.PersonalSignEIP712 | ProofTypes.PersonalSignBIP137 | ProofTypes.PersonalSignXPUB;
953
+ proof: string;
954
+ attestation: string;
955
+ wallet_provider: string;
956
+ }
957
+
958
+ /**
959
+ * The source of a transaction
960
+ * @public
961
+ */
962
+ declare type Source = BlockchainAddress | CAIP10;
963
+
964
+ /**
965
+ * The verification status of a transaction
966
+ * @public
967
+ */
968
+ export declare enum Status {
969
+ EMPTY = "empty",
970
+ VERIFY = "verify",
971
+ PENDING = "pending",
972
+ VERIFIED = "verified",
973
+ BANNED = "banned"
974
+ }
975
+
976
+ /**
977
+ * The theme of the Notabene SDK
978
+ * @public
979
+ */
980
+ export declare type Theme = {
981
+ primaryColor: string;
982
+ secondaryColor: string;
983
+ fontFamily: string;
984
+ logo: string;
985
+ };
986
+
987
+ /**
988
+ * An abstract transaction object
989
+ * @public
990
+ */
991
+ export declare interface Transaction extends ComponentRequest {
992
+ agent: Agent;
993
+ counterparty: Counterparty;
994
+ asset: TransactionAsset;
995
+ amountDecimal: number;
996
+ proof?: OwnershipProof;
997
+ assetPrice?: {
998
+ price: number;
999
+ currency: ISOCurrency;
1000
+ };
1001
+ }
1002
+
1003
+ /**
1004
+ * The asset of a transaction either a Notabene asset, a CAIP-19 asset, or a DTI.
1005
+ * @public
1006
+ */
1007
+ export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
1008
+
1009
+ /**
1010
+ * Configuration options for Transaction components
1011
+ * @public
1012
+ */
1013
+ export declare interface TransactionOptions {
1014
+ proofs?: {
1015
+ microTransfer?: {
1016
+ destination: BlockchainAddress;
1017
+ timeout?: number;
1018
+ };
1019
+ fallbacks?: ProofTypes[];
1020
+ };
1021
+ allowedAgentTypes?: AgentType[];
1022
+ allowedCounterpartyTypes?: PersonType[];
1023
+ fields?: FieldTypes;
1024
+ }
1025
+
1026
+ /**
1027
+ * The response of a transaction
1028
+ * @public
1029
+ */
1030
+ export declare interface TransactionResponse<V> extends ComponentResponse {
1031
+ value: V;
1032
+ ivms: IVMS101;
1033
+ proof?: OwnershipProof;
1034
+ txCreate?: V1Transaction;
1035
+ }
1036
+
1037
+ /**
1038
+ * Transfer Path
1039
+ * Represents the path of intermediary VASPs in a transfer
1040
+ * @public
1041
+ */
1042
+ declare type TransferPath = {
1043
+ /** Array of intermediary VASPs involved in the transfer */
1044
+ transferPath?: IntermediaryVASP[];
1045
+ };
1046
+
1047
+ /**
1048
+ * Transliteration Method Code
1049
+ * Specifies the method used to transliterate text
1050
+ * @public
1051
+ */
1052
+ declare type TransliterationMethodCode = 'arab' | 'aran' | 'armn' | 'cyrl' | 'deva' | 'geor' | 'grek' | 'hani' | 'hebr' | 'kana' | 'kore' | 'thai' | 'othr';
1053
+
1054
+ /**
1055
+ * A travel address
1056
+ * @public
1057
+ */
1058
+ declare type TravelAddress = `ta${string}`;
1059
+
1060
+ /**
1061
+ * Represents an update value host message
1062
+ * @public
1063
+ */
1064
+ declare type UpdateValue = {
1065
+ type: HMType.UPDATE;
1066
+ value: ComponentRequest;
1067
+ };
1068
+
1069
+ /**
1070
+ * A Uniform Resource Identifier
1071
+ * @public
1072
+ */
1073
+ declare type URI = string;
1074
+
1075
+ /**
1076
+ * UUID v4
1077
+ * @public
1078
+ */
1079
+ declare type UUID = string;
1080
+
1081
+ declare type V1Asset = NotabeneAsset | {
1082
+ caip19: CAIP19;
1083
+ };
1084
+
1085
+ /**
1086
+ * Transaction payload suitable for calling Notabene v1 tx/create
1087
+ * @public
1088
+ */
1089
+ declare type V1Transaction = {
1090
+ transactionAsset: V1Asset;
1091
+ transactionAmount: string;
1092
+ originatorEqualsBeneficiary?: boolean;
1093
+ originatorVASPdid: DID;
1094
+ beneficiaryVASPdid: DID;
1095
+ beneficiaryProof: OwnershipProof;
1096
+ originator: Originator;
1097
+ beneficiary: Beneficiary;
1098
+ };
1099
+
1100
+ /**
1101
+ * Validation error
1102
+ * @public
1103
+ */
1104
+ declare type ValidationError = {
1105
+ attribute: string;
1106
+ message: string;
1107
+ };
1108
+
1109
+ /**
1110
+ * A VASP agent acting on behalf of the counterparty
1111
+ * @public
1112
+ */
1113
+ export declare interface VASP extends Agent {
1114
+ lei?: LEI;
1115
+ logo?: URI;
1116
+ website?: URI;
1117
+ countryOfRegistration?: ISOCountryCode;
1118
+ }
1119
+
1120
+ /**
1121
+ * A wallet agent acting on behalf of the counterparty
1122
+ * @public
1123
+ */
1124
+ export declare interface Wallet extends Agent {
1125
+ proof: OwnershipProof;
1126
+ wallet_connect_id?: string;
1127
+ }
1128
+
1129
+ /**
1130
+ * An object representing a withdrawal transaction
1131
+ * @public
1132
+ */
1133
+ export declare interface Withdrawal extends BeneficiaryFields, Transaction {
1134
+ }
1135
+
1136
+ export { }