@notabene/javascript-sdk 2.0.0-next.6 → 2.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -178
- package/dist/notabene.cjs +1 -1
- package/dist/notabene.d.ts +123 -21
- package/dist/notabene.js +87 -107
- package/package.json +1 -1
- package/src/__tests__/notabene.test.ts +28 -0
- package/src/components/EmbeddedComponent.ts +69 -4
- package/src/ivms/types.ts +69 -28
- package/src/notabene.ts +38 -54
- package/src/types.ts +54 -18
- package/src/utils/MessageEventManager.ts +2 -3
- package/src/utils/arbitraries.ts +5 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
This library is the JavaScript SDK for loading the Notabene UX components in the front-end.
|
|
12
12
|
|
|
13
|
-
[Documentation](https://devx.notabene.id/docs/
|
|
13
|
+
[Documentation](https://devx.notabene.id/docs/embedded=ux)
|
|
14
14
|
[Installation](#installation)
|
|
15
15
|
|
|
16
16
|
</div>
|
|
@@ -31,12 +31,7 @@ This library is the JavaScript SDK for loading the Notabene UX components in the
|
|
|
31
31
|
- [Customization](#customization)
|
|
32
32
|
- [Functionality](#functionality)
|
|
33
33
|
- [Pass the variables in the configuration](#pass-the-variables-in-the-configuration)
|
|
34
|
-
- [Theme](#theme)
|
|
35
|
-
- [Dictionary](#dictionary)
|
|
36
|
-
- [The property name must be the same as the text in the widget, for it to be replaced](#the-property-name-must-be-the-same-as-the-text-in-the-widget-for-it-to-be-replaced)
|
|
37
34
|
- [Fields Properties](#fields-properties)
|
|
38
|
-
- [Fallbacks](#fallbacks)
|
|
39
|
-
- [Opt-In Features](#opt-in-features)
|
|
40
35
|
- [Transaction Custom Asset Price](#transaction-custom-asset-price)
|
|
41
36
|
- [License](#license)
|
|
42
37
|
|
|
@@ -70,7 +65,8 @@ Create a new Notabene instance:
|
|
|
70
65
|
|
|
71
66
|
const notabene = new Notabene({
|
|
72
67
|
nodeUrl: 'https://api.notabene.id',
|
|
73
|
-
authToken: '{CUSTOMER_TOKEN}'
|
|
68
|
+
authToken: '{CUSTOMER_TOKEN}',
|
|
69
|
+
locale: 'de' // default locale
|
|
74
70
|
});
|
|
75
71
|
```
|
|
76
72
|
|
|
@@ -223,18 +219,6 @@ Type | Code | Title | Detail
|
|
|
223
219
|
|
|
224
220
|
## Customization
|
|
225
221
|
|
|
226
|
-
### Functionality
|
|
227
|
-
|
|
228
|
-
`transactionTypeAllowed`: `ALL` | `VASP_2_VASP_ONLY` | `FIRST_PARTY_ONLY`
|
|
229
|
-
|
|
230
|
-
For limiting the type of transaction destinations you can pass.
|
|
231
|
-
|
|
232
|
-
`ALL`: All transaction destinations are allowed. (DEFAULT)
|
|
233
|
-
`VASP_2_VASP_ONLY`: Only transaction destinations that are VASPs are allowed.
|
|
234
|
-
`FIRST_PARTY_ONLY`: Only transaction destinations that the originator owns are allowed.
|
|
235
|
-
|
|
236
|
-
---
|
|
237
|
-
|
|
238
222
|
`nonCustodialDeclarationType`: `SIGNATURE` | `DECLARATION`
|
|
239
223
|
|
|
240
224
|
For deciding which ownership proof type you want to use.
|
|
@@ -248,83 +232,6 @@ For deciding which ownership proof type you want to use.
|
|
|
248
232
|
|
|
249
233
|
For deciding if you would like to allow your customer to provide a manual counterparty vasp name in the counterparty field.
|
|
250
234
|
|
|
251
|
-
### Pass the variables in the configuration
|
|
252
|
-
|
|
253
|
-
```js
|
|
254
|
-
const notabene = new Notabene({
|
|
255
|
-
vaspDID: 'did:ethr:0x94c38fd29ef36f5cb2f7bc771f9d5bd9f7d05f27',
|
|
256
|
-
widget: 'https://beta-widget.notabene.id',
|
|
257
|
-
container: '#container',
|
|
258
|
-
authToken: '{CUSTOMER_TOKEN}'
|
|
259
|
-
allowedTransactionTypes: 'VASP_2_VASP_ONLY',
|
|
260
|
-
nonCustodialDeclarationType: 'DECLARATION',
|
|
261
|
-
});
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
### Theme
|
|
267
|
-
|
|
268
|
-
Pass a `theme` object when creating an instance
|
|
269
|
-
|
|
270
|
-
Here you can pass configuration which will customize the styles of the widget to meet your brand needs, all values are optional.
|
|
271
|
-
|
|
272
|
-
```js
|
|
273
|
-
{
|
|
274
|
-
primaryColor: '#fff',
|
|
275
|
-
secondaryColor: '#fff',
|
|
276
|
-
primaryFontColor: '#fff',
|
|
277
|
-
secondaryFontColor: '#fff',
|
|
278
|
-
backgroundColor: '#fff',
|
|
279
|
-
fontFamily: Arial,
|
|
280
|
-
logo: {LOGO_URL},
|
|
281
|
-
mode: 'dark', // default: 'light'
|
|
282
|
-
|
|
283
|
-
// If you are using the Signature flow, here is the full list of custom theme that can be applied to the WalletConnect Modal.
|
|
284
|
-
'--w3m-font-family',
|
|
285
|
-
'--w3m-font-feature-settings',
|
|
286
|
-
'--w3m-overlay-background-color',
|
|
287
|
-
'--w3m-overlay-backdrop-filter',
|
|
288
|
-
'--w3m-z-index',
|
|
289
|
-
'--w3m-accent-color',
|
|
290
|
-
'--w3m-accent-fill-color',
|
|
291
|
-
'--w3m-background-color',
|
|
292
|
-
'--w3m-background-image-url',
|
|
293
|
-
'--w3m-logo-image-url',
|
|
294
|
-
'--w3m-background-border-radius',
|
|
295
|
-
'--w3m-container-border-radius',
|
|
296
|
-
'--w3m-wallet-icon-border-radius',
|
|
297
|
-
'--w3m-wallet-icon-large-border-radius',
|
|
298
|
-
'--w3m-wallet-icon-small-border-radius',
|
|
299
|
-
'--w3m-input-border-radius',
|
|
300
|
-
'--w3m-notification-border-radius',
|
|
301
|
-
'--w3m-button-border-radius',
|
|
302
|
-
'--w3m-secondary-button-border-radius',
|
|
303
|
-
'--w3m-icon-button-border-radius',
|
|
304
|
-
'--w3m-button-hover-highlight-border-radius',
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
To get a list of supported fonts, visit [https://fonts.google.com/](https://fonts.google.com/)
|
|
309
|
-
|
|
310
|
-
To get more details about the WalletConnect theme variables, visit [General style variables](https://docs.walletconnect.com/2.0/web/web3modal/react/wagmi/theming#general-style-variables).
|
|
311
|
-
|
|
312
|
-
---
|
|
313
|
-
|
|
314
|
-
### Dictionary
|
|
315
|
-
|
|
316
|
-
Pass a `dictionary` object mapping in text in the widget to your own language, for example:
|
|
317
|
-
|
|
318
|
-
To replace `Loading...` with `Cargando...`
|
|
319
|
-
|
|
320
|
-
```js
|
|
321
|
-
{
|
|
322
|
-
'Loading...': 'Cargando...',
|
|
323
|
-
}
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
###### The property name must be the same as the text in the widget, for it to be replaced
|
|
327
|
-
|
|
328
235
|
---
|
|
329
236
|
|
|
330
237
|
### Fields Properties
|
|
@@ -333,10 +240,8 @@ Possible fields customization support:
|
|
|
333
240
|
|
|
334
241
|
| field name | `forceDisplay` | `optional` | description |
|
|
335
242
|
| ------------------------ | -------------- | ---------- | ------------------------------------------------------- |
|
|
336
|
-
| `counterparty` | -- | ☑️ | Counterparty VASP or Wallet (destination or originator) |
|
|
337
243
|
| `dateAndPlaceOfBirth` | ☑️ | -- | Recipient (or Sender) Date and Place of Birth |
|
|
338
244
|
| `geographicAddress` | ☑️ | ☑️ | Recipient (or Sender) Address |
|
|
339
|
-
| `firstName` | ☑️ | -- | Recipient (or Sender) First name |
|
|
340
245
|
| `name` | ☑️ | -- | Recipient (or Sender) Last Name / Company Name |
|
|
341
246
|
| `nationalIdentification` | ☑️ | --️ | Recipient (or Sender) National Identification |
|
|
342
247
|
| `country` | ☑️ | ☑️ | Recipient (or Sender) Country of Residence (for natural person) / Country of Registration (for legal person) |
|
|
@@ -358,87 +263,7 @@ Possible fields customization support:
|
|
|
358
263
|
}
|
|
359
264
|
```
|
|
360
265
|
|
|
361
|
-
---
|
|
362
|
-
|
|
363
|
-
**_Beneficiary Details_ [DEPRECATED]**
|
|
364
|
-
|
|
365
|
-
You can require specific beneficiary fields that are not required by your jurisdiction.
|
|
366
|
-
|
|
367
|
-
Possible fields:
|
|
368
|
-
|
|
369
|
-
- `beneficiaryName` - Recipient Name
|
|
370
|
-
- `beneficiaryGeographicAddress` - Recipient Address
|
|
371
|
-
- `beneficiaryNationalIdentification` - Recipient National Identification
|
|
372
|
-
- `beneficiaryDateAndPlaceOfBirth` - Recipient Date and Place of Birth
|
|
373
|
-
|
|
374
|
-
```js
|
|
375
|
-
beneficiaryDetails: [
|
|
376
|
-
'benficiaryName',
|
|
377
|
-
'beneficiaryGeographicAddress',
|
|
378
|
-
'beneficiaryNationalIdentification',
|
|
379
|
-
'beneficiaryDateAndPlaceOfBirth',
|
|
380
|
-
];
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
---
|
|
384
|
-
|
|
385
|
-
### Fallbacks
|
|
386
|
-
|
|
387
|
-
Fallbacks are custom options provided when desired outcome is not achieved
|
|
388
|
-
|
|
389
|
-
Possible options and actions:
|
|
390
|
-
|
|
391
|
-
- `WALLET_NOT_SUPPORTED` - Performs one of the following options when wallet is not supported
|
|
392
|
-
- `DECLARATION` - Falls back to the self declaration flow
|
|
393
|
-
- `REJECT` - Rejects the transaction and throws an error
|
|
394
|
-
- The error that will be thrown here will have the following structure
|
|
395
|
-
|
|
396
|
-
```js
|
|
397
|
-
{
|
|
398
|
-
"type": "WALLET_NOT_SUPPORTED",
|
|
399
|
-
"title": "Wallet Not Supported",
|
|
400
|
-
"status": 501,
|
|
401
|
-
"detail": "We don't support the wallet for the provided asset"
|
|
402
|
-
}
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
```js
|
|
406
|
-
fallbacks: [{flow: "WALLET_NOT_SUPPORTED", action: "DECLARATION"}]
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
---
|
|
410
|
-
|
|
411
|
-
Finally you pass the configuration to a Notabene instance:
|
|
412
|
-
|
|
413
|
-
```js
|
|
414
|
-
const notabene = new Notabene({
|
|
415
|
-
widget: 'https://beta-widget.notabene.id',
|
|
416
|
-
container: '#container',
|
|
417
|
-
authToken: '{CUSTOMER_TOKEN}'
|
|
418
|
-
theme: {THEME},
|
|
419
|
-
dictionary: {DICTIONARY},
|
|
420
|
-
fallbacks: [{flow: "WALLET_NOT_SUPPORTED", action: "DECLARATION"}]
|
|
421
|
-
});
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
---
|
|
425
|
-
|
|
426
|
-
### Opt-In Features
|
|
427
|
-
|
|
428
|
-
```js
|
|
429
|
-
const notabene = new Notabene({
|
|
430
|
-
widget: 'https://beta-widget.notabene.id',
|
|
431
|
-
container: '#container',
|
|
432
|
-
authToken: '{CUSTOMER_TOKEN}'
|
|
433
|
-
theme: {THEME},
|
|
434
|
-
dictionary: {DICTIONARY},
|
|
435
|
-
optInFeatures: ['REUSE_ADDRESS_OWNERSHIP_PROOF']
|
|
436
|
-
});
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
**Available Opt-In Features**
|
|
440
266
|
|
|
441
|
-
- `REUSE_ADDRESS_OWNERSHIP_PROOF`: For a given unique customer (identified by the `customerRef` from the customer token used) + unique wallet address, the widget would not ask for data collection if the customer previously verified the address ownership in a previous first party self-hosted transfer.
|
|
442
267
|
|
|
443
268
|
### Transaction Custom Asset Price
|
|
444
269
|
|
package/dist/notabene.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var c=(r,e,t)=>e in r?d(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>c(r,typeof e!="symbol"?e+"":e,t);var h=(r=>(r.COMPLETE="complete",r.RESIZE="resize",r.RESULT="result",r.READY="ready",r.INVALID="invalid",r.MODAL="openModal",r.ERROR="error",r.CLOSE="closeModal",r.CANCEL="cancel",r))(h||{}),l=(r=>(r.UPDATE="update",r.REQUEST_RESPONSE="requestResponse",r))(l||{});class m{constructor(){n(this,"listeners",new Map);n(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(e){this.port=e,this.port.onmessage=this.handleMessage,this.port.start()}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const s=this.listeners.get(e);s&&(s.delete(t),s.size===0&&this.listeners.delete(e))}handleMessage(e){console.log("received message",e.data);const t=e.data;if(typeof t=="object"&&t!==null&&"type"in t){const s=t.type,o=this.listeners.get(s);o&&o.forEach(i=>i(t))}}send(e){this.port&&this.port.postMessage(e)}}class u{constructor(e,t){n(this,"_url");n(this,"_value");n(this,"_errors",[]);n(this,"iframe");n(this,"eventManager");n(this,"ready",!1);n(this,"modal");this._url=e,this._value=t,this.eventManager=new m,this.on(h.INVALID,s=>{s.type===h.INVALID&&(this._errors=s.errors,this._value=s.value)}),this.on(h.RESIZE,s=>{s.type===h.RESIZE&&this.iframe&&(this.iframe.style.height=`${s.height}px`)})}get url(){return this._url}get value(){return this._value}get errors(){return this._errors}open(){document.location.href=this.url}mount(e){const t=document.querySelector(e);if(!t)throw new Error(`parentID ${e} not found`);this.embed(t)}embed(e){var t,s;this.iframe=document.createElement("iframe"),this.iframe.src=this.url,this.iframe.style.width="100%",this.iframe.style.height="100px",this.iframe.style.border="none",this.iframe.style.overflow="hidden",this.iframe.setAttribute("allowtransparency","true"),this.iframe.style.backgroundColor="transparent",e.appendChild(this.iframe),window.addEventListener("message",o=>{var i,a;o.source===((i=this.iframe)==null?void 0:i.contentWindow)&&(console.log("received message from iframe",o.data),(a=this.eventManager)==null||a.setPort(o.ports[0]),this.ready=!0)}),(s=(t=this.iframe)==null?void 0:t.contentWindow)==null||s.focus()}send(e){this.eventManager.send(e)}on(e,t){this.eventManager.on(e,t)}off(e,t){this.eventManager.off(e,t)}update(e){this._value=e,this.send({type:l.UPDATE,value:e})}completion(){return new Promise((e,t)=>{this.closeModal(),this.on(h.COMPLETE,s=>{e(s.response)}),this.on("error",s=>{t(new Error(s.message))})})}openModal(){this.modal&&this.closeModal(),this.modal=document.createElement("dialog"),document.body.appendChild(this.modal),this.embed(this.modal),this.modal.show(),this.modal.addEventListener("click",()=>{this.closeModal()})}closeModal(){var e;this.modal&&(console.log("closeModal"),(e=this.modal)==null||e.close(),this.modal.remove(),this.modal=void 0)}}function f(r){return Object.entries(r).map(([e,t])=>{if(!(e&&t))return;const s=encodeURIComponent(e),o=encodeURIComponent(typeof t=="object"?JSON.stringify(t):t);return`${s}=${o}`}).filter(e=>!!e).join("&")}class p{constructor(e){n(this,"nodeUrl");n(this,"authToken");n(this,"uxUrl");n(this,"theme");n(this,"locale");this.uxUrl=e.uxUrl||"https://connect.notabene.id",this.nodeUrl=e.nodeUrl,this.authToken=e.authToken,this.theme=e.theme,this.locale=e.locale}componentUrl(e,t,s,o){const i=new URL(this.uxUrl);i.pathname=e;const a=f({authToken:this.authToken,value:t,configuration:s});return i.hash=a,this.nodeUrl&&i.searchParams.set("nodeUrl",this.nodeUrl),this.theme&&i.searchParams.set("theme",JSON.stringify(this.theme)),this.locale&&i.searchParams.set("locale",this.locale),o&&(o.callback&&i.searchParams.set("callback_url",o.callback),o.redirectUri&&i.searchParams.set("redirect_uri",o.redirectUri)),i.toString()}createComponent(e,t,s,o){return new u(this.componentUrl(e,t,s,o),t)}createWithdrawalAssist(e,t,s){return this.createComponent("withdrawal-assist",e,t,s)}createDepositAssist(e,t,s){return this.createComponent("deposit-assist",e,t,s)}createConnect(e,t,s){return this.createComponent("connect",e,t,s)}createDepositRequest(e,t,s){return this.createComponent("deposit-request",e,t,s)}decodeFragmentToObject(e){return e.slice(1).split("&").reduce((s,o)=>{const[i,a]=o.split("=");return s[decodeURIComponent(i)]=decodeURIComponent(a),s},{})}}module.exports=p;
|
package/dist/notabene.d.ts
CHANGED
|
@@ -3,22 +3,38 @@
|
|
|
3
3
|
* Address
|
|
4
4
|
*/
|
|
5
5
|
declare type Address = {
|
|
6
|
-
|
|
6
|
+
/** Identifies the nature of the address. */
|
|
7
|
+
addressType: AddressTypeCode;
|
|
8
|
+
/** Identification of a division of a large organisation or building. */
|
|
7
9
|
department?: string;
|
|
10
|
+
/** Identification of a sub-division of a large organisation or building. */
|
|
8
11
|
subDepartment?: string;
|
|
12
|
+
/** Name of a street or thoroughfare. */
|
|
9
13
|
streetName?: string;
|
|
14
|
+
/** Number that identifies the position of a building on a street. */
|
|
10
15
|
buildingNumber?: string;
|
|
16
|
+
/** Name of the building or house. */
|
|
11
17
|
buildingName?: string;
|
|
18
|
+
/** Floor or storey within a building. */
|
|
12
19
|
floor?: string;
|
|
20
|
+
/** Numbered box in a post office. */
|
|
13
21
|
postBox?: string;
|
|
22
|
+
/** Building room number. */
|
|
14
23
|
room?: string;
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
/** Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail. */
|
|
25
|
+
postcode?: string;
|
|
26
|
+
/** Name of a built-up area, with defined boundaries, and a local government. */
|
|
27
|
+
townName: string;
|
|
28
|
+
/** Specific location name within the town. */
|
|
17
29
|
townLocationName?: string;
|
|
30
|
+
/** Identifies a subdivision within a country subdivision. */
|
|
18
31
|
districtName?: string;
|
|
32
|
+
/** Identifies a subdivision of a country such as state, region, province. */
|
|
19
33
|
countrySubDivision?: string;
|
|
34
|
+
/** Information that locates and identifies a specific address, presented in free format text. */
|
|
20
35
|
addressLine?: string[];
|
|
21
|
-
|
|
36
|
+
/** Nation with its own government. */
|
|
37
|
+
country: string;
|
|
22
38
|
};
|
|
23
39
|
|
|
24
40
|
/**
|
|
@@ -136,6 +152,8 @@ export declare interface Counterparty {
|
|
|
136
152
|
verified?: boolean;
|
|
137
153
|
}
|
|
138
154
|
|
|
155
|
+
declare type CryptoCredential = `${string}.${string}.mastercard`;
|
|
156
|
+
|
|
139
157
|
/**
|
|
140
158
|
* 5.2.7
|
|
141
159
|
* DateAndPlaceOfBirth
|
|
@@ -155,11 +173,29 @@ export declare interface DeclarationProof extends OwnershipProof {
|
|
|
155
173
|
confirmed: boolean;
|
|
156
174
|
}
|
|
157
175
|
|
|
176
|
+
/**
|
|
177
|
+
* An object representing a deposit transaction
|
|
178
|
+
* @public
|
|
179
|
+
*/
|
|
180
|
+
export declare interface Deposit extends OriginatorFields, Transaction {
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* An object representing a request for a deposit
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
export declare interface DepositRequest extends DepositRequestFields, Transaction {
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
declare type DepositRequestFields = {
|
|
191
|
+
destinations: destination[];
|
|
192
|
+
};
|
|
193
|
+
|
|
158
194
|
/**
|
|
159
195
|
* The destination of a transaction either a blockchain address, a CAIP-19 address, or a travel address.
|
|
160
196
|
* @public
|
|
161
197
|
*/
|
|
162
|
-
export declare type destination = BlockchainAddress | CAIP10 | TravelAddress;
|
|
198
|
+
export declare type destination = BlockchainAddress | CAIP10 | CryptoCredential | TravelAddress;
|
|
163
199
|
|
|
164
200
|
declare type DID = `did:${string}:${string}`;
|
|
165
201
|
|
|
@@ -176,17 +212,21 @@ export declare class EmbeddedComponent {
|
|
|
176
212
|
private iframe?;
|
|
177
213
|
private eventManager;
|
|
178
214
|
private ready;
|
|
215
|
+
private modal?;
|
|
179
216
|
constructor(url: string, value: Partial<Transaction>);
|
|
180
217
|
get url(): string;
|
|
181
218
|
get value(): Partial<Transaction>;
|
|
182
219
|
get errors(): ValidationError[];
|
|
183
220
|
open(): void;
|
|
184
221
|
mount(parentId: string): void;
|
|
222
|
+
embed(parent: Element): void;
|
|
185
223
|
send(message: HostMessage): void;
|
|
186
224
|
on(messageType: string, callback: MessageCallback): void;
|
|
187
225
|
off(messageType: string, callback: MessageCallback): void;
|
|
188
226
|
update(value: Partial<Transaction>): void;
|
|
189
227
|
completion(): Promise<TransactionResponse>;
|
|
228
|
+
openModal(): void;
|
|
229
|
+
private closeModal;
|
|
190
230
|
}
|
|
191
231
|
|
|
192
232
|
declare type Error_2 = {
|
|
@@ -243,10 +283,15 @@ export declare type IVMS101 = {
|
|
|
243
283
|
* LegalPerson
|
|
244
284
|
*/
|
|
245
285
|
declare type LegalPerson = {
|
|
246
|
-
name
|
|
286
|
+
/** The name of the legal person. */
|
|
287
|
+
name: LegalPersonName;
|
|
288
|
+
/** The address of the legal person. */
|
|
247
289
|
geographicAddress?: Address[];
|
|
290
|
+
/** A distinct identifier that uniquely identifies the person to the institution in context. */
|
|
248
291
|
customerNumber?: string;
|
|
292
|
+
/** A distinct identifier used by governments to uniquely identify a legal person. */
|
|
249
293
|
nationalIdentification?: NationalIdentification;
|
|
294
|
+
/** The country in which the legal person is registered. */
|
|
250
295
|
countryOfRegistration?: string;
|
|
251
296
|
};
|
|
252
297
|
|
|
@@ -255,7 +300,7 @@ declare type LegalPerson = {
|
|
|
255
300
|
* LegalPersonName
|
|
256
301
|
*/
|
|
257
302
|
declare type LegalPersonName = {
|
|
258
|
-
nameIdentifier
|
|
303
|
+
nameIdentifier: LegalPersonNameID[];
|
|
259
304
|
localNameIdentifier?: LocalLegalPersonNameID[];
|
|
260
305
|
phoneticNameIdentifier?: LocalLegalPersonNameID[];
|
|
261
306
|
};
|
|
@@ -265,8 +310,10 @@ declare type LegalPersonName = {
|
|
|
265
310
|
* LegalPersonNameID
|
|
266
311
|
*/
|
|
267
312
|
declare type LegalPersonNameID = {
|
|
268
|
-
|
|
269
|
-
|
|
313
|
+
/** Name by which the legal person is known. */
|
|
314
|
+
legalPersonName: string;
|
|
315
|
+
/** The nature of the name specified. */
|
|
316
|
+
legalPersonNameIdentifierType: LegalPersonNameTypeCode;
|
|
270
317
|
};
|
|
271
318
|
|
|
272
319
|
/**
|
|
@@ -350,11 +397,17 @@ declare type NationalIdentifierTypeCode = 'ARNU' | 'CCPT' | 'RAID' | 'DRLC' | 'F
|
|
|
350
397
|
* NaturalPerson
|
|
351
398
|
*/
|
|
352
399
|
declare type NaturalPerson = {
|
|
353
|
-
|
|
400
|
+
/** The distinct words used as identification for an individual. */
|
|
401
|
+
name: NaturalPersonName;
|
|
402
|
+
/** The particulars of a location at which a person may be communicated with. */
|
|
354
403
|
geographicAddress?: Address[];
|
|
404
|
+
/** A distinct identifier used by governments to uniquely identify a natural person. */
|
|
355
405
|
nationalIdentification?: NationalIdentification;
|
|
406
|
+
/** A distinct identifier that uniquely identifies the person to the institution in context. */
|
|
356
407
|
customerIdentification?: string;
|
|
408
|
+
/** Date and place of birth of a person. */
|
|
357
409
|
dateAndPlaceOfBirth?: DateAndPlaceOfBirth;
|
|
410
|
+
/** Country in which a person resides (the place of a person's home). */
|
|
358
411
|
countryOfResidence?: string;
|
|
359
412
|
};
|
|
360
413
|
|
|
@@ -400,11 +453,14 @@ declare class Notabene {
|
|
|
400
453
|
private authToken?;
|
|
401
454
|
private uxUrl;
|
|
402
455
|
private theme?;
|
|
403
|
-
private
|
|
456
|
+
private locale?;
|
|
404
457
|
constructor(config: NotabeneConfig);
|
|
405
|
-
componentUrl(path: string, value: Partial<Transaction>, configuration?:
|
|
406
|
-
createComponent(path: string, value: Partial<Transaction>, options?:
|
|
407
|
-
createWithdrawalAssist(value: Partial<Withdrawal>, options?:
|
|
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;
|
|
408
464
|
decodeFragmentToObject(fragment: string): Record<string, string>;
|
|
409
465
|
}
|
|
410
466
|
export { Notabene }
|
|
@@ -422,9 +478,7 @@ export declare interface NotabeneConfig {
|
|
|
422
478
|
authToken?: string;
|
|
423
479
|
uxUrl?: string;
|
|
424
480
|
theme?: Theme;
|
|
425
|
-
|
|
426
|
-
[key: string]: string;
|
|
427
|
-
};
|
|
481
|
+
locale?: string;
|
|
428
482
|
}
|
|
429
483
|
|
|
430
484
|
/**
|
|
@@ -444,6 +498,10 @@ declare type Originator = {
|
|
|
444
498
|
accountNumber?: string[];
|
|
445
499
|
};
|
|
446
500
|
|
|
501
|
+
declare type OriginatorFields = {
|
|
502
|
+
source?: Source;
|
|
503
|
+
};
|
|
504
|
+
|
|
447
505
|
/**
|
|
448
506
|
* Ownership Proof
|
|
449
507
|
* @public
|
|
@@ -459,9 +517,22 @@ export declare interface OwnershipProof {
|
|
|
459
517
|
* 6.7
|
|
460
518
|
* Data describing the contents of the payload.
|
|
461
519
|
*/
|
|
462
|
-
declare
|
|
463
|
-
|
|
464
|
-
|
|
520
|
+
declare interface PayloadMetadata {
|
|
521
|
+
/** The method used to map from a national system of writing to Latin script. */
|
|
522
|
+
transliterationMethod?: TransliterationMethodCode[];
|
|
523
|
+
/** The version of IVMS 101 to which the payload complies. */
|
|
524
|
+
payloadVersion: PayloadVersionCode;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* The version of IVMS 101 to which the payload complies.
|
|
529
|
+
*/
|
|
530
|
+
declare enum PayloadVersionCode {
|
|
531
|
+
/** Published May 2020 */
|
|
532
|
+
V101 = "101",
|
|
533
|
+
/** Published August 2023 */
|
|
534
|
+
V101_2023 = "101.2023"
|
|
535
|
+
}
|
|
465
536
|
|
|
466
537
|
/**
|
|
467
538
|
* 5.2.1
|
|
@@ -549,6 +620,8 @@ export declare interface SignatureProof extends OwnershipProof {
|
|
|
549
620
|
wallet_provider: string;
|
|
550
621
|
}
|
|
551
622
|
|
|
623
|
+
declare type Source = BlockchainAddress | CAIP10;
|
|
624
|
+
|
|
552
625
|
/**
|
|
553
626
|
* The verification status of a transaction
|
|
554
627
|
* @public
|
|
@@ -595,6 +668,15 @@ export declare interface Transaction {
|
|
|
595
668
|
*/
|
|
596
669
|
export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
|
|
597
670
|
|
|
671
|
+
/**
|
|
672
|
+
* Configuration options for Transaction components
|
|
673
|
+
* @public
|
|
674
|
+
*/
|
|
675
|
+
export declare interface TransactionOptions {
|
|
676
|
+
microTransactionAddress?: BlockchainAddress;
|
|
677
|
+
proofFallbacks?: ProofTypes[];
|
|
678
|
+
}
|
|
679
|
+
|
|
598
680
|
/**
|
|
599
681
|
* The response of a transaction
|
|
600
682
|
* @public
|
|
@@ -606,6 +688,7 @@ export declare type TransactionResponse = {
|
|
|
606
688
|
valid: boolean;
|
|
607
689
|
status: Status;
|
|
608
690
|
errors: ValidationError[];
|
|
691
|
+
txCreate?: V1Transaction;
|
|
609
692
|
};
|
|
610
693
|
|
|
611
694
|
/**
|
|
@@ -636,7 +719,7 @@ declare type TransferPath = {
|
|
|
636
719
|
*/
|
|
637
720
|
declare type TransliterationMethodCode = 'arab' | 'aran' | 'armn' | 'cyrl' | 'deva' | 'geor' | 'grek' | 'hani' | 'hebr' | 'kana' | 'kore' | 'thai' | 'othr';
|
|
638
721
|
|
|
639
|
-
declare type TravelAddress = string
|
|
722
|
+
declare type TravelAddress = `ta${string}`;
|
|
640
723
|
|
|
641
724
|
declare type UpdateValue = {
|
|
642
725
|
type: HMType.UPDATE;
|
|
@@ -645,6 +728,25 @@ declare type UpdateValue = {
|
|
|
645
728
|
|
|
646
729
|
declare type URI = string;
|
|
647
730
|
|
|
731
|
+
declare type V1Asset = {
|
|
732
|
+
caip19: CAIP19;
|
|
733
|
+
} | string;
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Transaction payload suitable for calling Notabene v1 tx/create
|
|
737
|
+
* @public
|
|
738
|
+
*/
|
|
739
|
+
declare type V1Transaction = {
|
|
740
|
+
transactionAsset: V1Asset;
|
|
741
|
+
transactionAmount: string;
|
|
742
|
+
originatorEqualsBeneficiary?: boolean;
|
|
743
|
+
originatorVASPdid: DID;
|
|
744
|
+
beneficiaryVASPdid: DID;
|
|
745
|
+
beneficiaryProof: OwnershipProof;
|
|
746
|
+
originator: Originator;
|
|
747
|
+
beneficiary: Beneficiary;
|
|
748
|
+
};
|
|
749
|
+
|
|
648
750
|
declare type ValidationError = {
|
|
649
751
|
attribute: string;
|
|
650
752
|
message: string;
|