@notabene/javascript-sdk 2.8.0-next.1 → 2.8.0-next.3

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,393 @@
1
+ var c = Object.defineProperty;
2
+ var m = (e, t, r) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var o = (e, t, r) => m(e, typeof t != "symbol" ? t + "" : t, r);
4
+ var u = /* @__PURE__ */ ((e) => (e.PRIVATE = "WALLET", e.VASP = "VASP", e))(u || {}), E = /* @__PURE__ */ ((e) => (e.NATURAL = "natural", e.LEGAL = "legal", e.SELF = "self", e))(E || {}), p = /* @__PURE__ */ ((e) => (e.EMPTY = "empty", e.VERIFY = "verify", e.PENDING = "pending", e.VERIFIED = "verified", e.BANNED = "banned", e))(p || {}), f = /* @__PURE__ */ ((e) => (e.ALLOWED = "allowed", e.PENDING = "pending", e))(f || {}), v = /* @__PURE__ */ ((e) => (e.ASSET = "asset", e.DESTINATION = "destination", e.COUNTERPARTY = "counterparty", e.AGENT = "agent", e))(v || {}), h = /* @__PURE__ */ ((e) => (e.COMPLETE = "complete", e.RESIZE = "resize", e.RESULT = "result", e.READY = "ready", e.INVALID = "invalid", e.ERROR = "error", e.CANCEL = "cancel", e))(h || {}), I = /* @__PURE__ */ ((e) => (e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", e.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", e.TOKEN_INVALID = "TOKEN_INVALID", e))(I || {}), d = /* @__PURE__ */ ((e) => (e.UPDATE = "update", e.REQUEST_RESPONSE = "requestResponse", e))(d || {}), L = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.FAILED = "rejected", e.FLAGGED = "flagged", e.VERIFIED = "verified", e))(L || {}), g = /* @__PURE__ */ ((e) => (e.SelfDeclaration = "self-declaration", e.SIWE = "siwe", e.SIWX = "siwx", e.EIP191 = "eip-191", e.EIP712 = "eip-712", e.EIP1271 = "eip-1271", e.BIP137 = "bip-137", e.BIP322 = "bip-322", e.BIP137_XPUB = "xpub", e.TIP191 = "tip-191", e.ED25519 = "ed25519", e.XRP_ED25519 = "xrp-ed25519", e.CIP8 = "cip-8", e.MicroTransfer = "microtransfer", e.Screenshot = "screenshot", e.Connect = "connect", e))(g || {});
5
+ class A {
6
+ constructor() {
7
+ o(this, "listeners", /* @__PURE__ */ new Map());
8
+ o(this, "port");
9
+ this.handleMessage = this.handleMessage.bind(this);
10
+ }
11
+ /**
12
+ * Sets up the message port for communication.
13
+ *
14
+ * Initializes the MessagePort for receiving messages by setting up the message handler
15
+ * and starting the port.
16
+ *
17
+ * @param port - The MessagePort instance to use for communication
18
+ */
19
+ setPort(t) {
20
+ this.port = t, this.port.onmessage = this.handleMessage, this.port.start();
21
+ }
22
+ /**
23
+ * Registers a callback for a specific message type.
24
+ *
25
+ * When messages of the specified type are received, the callback will be executed
26
+ * with the message data.
27
+ *
28
+ * @param messageType - The type of message to listen for
29
+ * @param callback - The callback function to execute when matching messages are received
30
+
31
+ */
32
+ on(t, r) {
33
+ return this.listeners.has(t) || this.listeners.set(t, /* @__PURE__ */ new Set()), this.listeners.get(t).add(r), () => this.off(t, r);
34
+ }
35
+ /**
36
+ * Removes a callback for a specific message type.
37
+ *
38
+ * If the callback is the last one registered for the message type,
39
+ * the message type entry will be removed entirely.
40
+ *
41
+ * @param messageType - The type of message to remove listener from
42
+ * @param callback - The callback function to remove
43
+ */
44
+ off(t, r) {
45
+ const s = this.listeners.get(t);
46
+ s && (s.delete(r), s.size === 0 && this.listeners.delete(t));
47
+ }
48
+ /**
49
+ * Internal message handler for processing received messages.
50
+ *
51
+ * Validates incoming messages and dispatches them to registered callbacks
52
+ * based on the message type.
53
+ *
54
+ * @param event - The message event containing the component message
55
+ */
56
+ handleMessage(t) {
57
+ const r = t.data;
58
+ if (typeof r == "object" && r !== null && "type" in r) {
59
+ const s = r.type, i = this.listeners.get(s);
60
+ i && i.forEach((n) => n(r));
61
+ }
62
+ }
63
+ /**
64
+ * Sends a message through the message port
65
+ * @param message The host message to send
66
+ */
67
+ send(t) {
68
+ this.port && this.port.postMessage(t);
69
+ }
70
+ }
71
+ class N {
72
+ /**
73
+ * Creates an instance of EmbeddedComponent.
74
+ * @param url - The URL of the embedded component
75
+ * @param value - The initial transaction value
76
+ */
77
+ constructor(t, r, s) {
78
+ o(this, "_url");
79
+ o(this, "_value");
80
+ o(this, "_options");
81
+ o(this, "_errors", []);
82
+ o(this, "iframe");
83
+ o(this, "eventManager");
84
+ o(this, "modal");
85
+ this._url = t, this._value = r, this._options = s, this.eventManager = new A(), this.on(h.INVALID, (i) => {
86
+ i.type === h.INVALID && (this._errors = i.errors, this._value = i.value);
87
+ }), this.on(h.RESIZE, (i) => {
88
+ i.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${i.height}px`);
89
+ });
90
+ }
91
+ /**
92
+ * Gets the URL of the embedded component
93
+ * @returns The URL of the embedded component
94
+ */
95
+ get url() {
96
+ return this._url;
97
+ }
98
+ /**
99
+ * Gets the current transaction value
100
+ * @returns The current transaction value
101
+ */
102
+ get value() {
103
+ return this._value;
104
+ }
105
+ get options() {
106
+ return this._options;
107
+ }
108
+ get errors() {
109
+ return this._errors;
110
+ }
111
+ /**
112
+ * Opens the component URL in the current window
113
+ */
114
+ open() {
115
+ document.location.href = this.url;
116
+ }
117
+ /**
118
+ * Mounts the component to a parent element
119
+ * @param parentId - The ID of the parent element
120
+ * @throws Will throw an error if the parent element is not found
121
+ */
122
+ mount(t) {
123
+ const r = document.querySelector(t);
124
+ if (!r) throw new Error(`parentID ${t} not found`);
125
+ this.embed(r);
126
+ }
127
+ /**
128
+ * Embeds the component into a parent element
129
+ * @param parent - The parent element to embed the component into
130
+ */
131
+ embed(t, r = !1) {
132
+ var s, i;
133
+ this.removeEmbed(), this.iframe = document.createElement("iframe"), this.iframe.src = this.url + (r ? "" : "&embedded=true"), this.iframe.allow = "web-share; clipboard-write; hid; bluetooth;", this.iframe.style.width = "100%", this.iframe.style.height = "0px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", this.iframe.scrolling = "no", t.appendChild(this.iframe), window.addEventListener("message", (n) => {
134
+ var a, l;
135
+ n.source === ((a = this.iframe) == null ? void 0 : a.contentWindow) && ((l = this.eventManager) == null || l.setPort(n.ports[0]));
136
+ }), (i = (s = this.iframe) == null ? void 0 : s.contentWindow) == null || i.focus();
137
+ }
138
+ removeEmbed() {
139
+ this.iframe && this.iframe.remove();
140
+ }
141
+ /**
142
+ * Sends a message to the embedded component
143
+ * @param message - The message to send
144
+ */
145
+ send(t) {
146
+ this.eventManager.send(t);
147
+ }
148
+ /**
149
+ * Adds an event listener for a specific message type
150
+ * @param messageType - The type of message to listen for
151
+ * @param callback - The callback function to execute when the message is received
152
+ */
153
+ on(t, r) {
154
+ return this.eventManager.on(t, r);
155
+ }
156
+ /**
157
+ * Removes an event listener for a specific message type
158
+ * @param messageType - The type of message to stop listening for
159
+ * @param callback - The callback function to remove
160
+ */
161
+ off(t, r) {
162
+ this.eventManager.off(t, r);
163
+ }
164
+ /**
165
+ * Updates the transaction value and sends an update message to the component
166
+ * @param value - The new transaction value
167
+ */
168
+ update(t, r) {
169
+ this._value = t, r && (this._options = r), this.send({ type: d.UPDATE, value: t, options: this._options });
170
+ }
171
+ /**
172
+ * Waits for the component to complete and returns the transaction response
173
+ * @returns A promise that resolves with the transaction response
174
+ */
175
+ completion() {
176
+ return new Promise((t, r) => {
177
+ let s, i, n;
178
+ function a() {
179
+ s && s(), i && i(), n && n();
180
+ }
181
+ s = this.on(h.COMPLETE, (l) => {
182
+ t(l.response), a();
183
+ }), i = this.on(h.CANCEL, () => {
184
+ r(new Error("User cancelled")), a();
185
+ }), n = this.on("error", (l) => {
186
+ r(new Error(l.message)), a();
187
+ });
188
+ });
189
+ }
190
+ /**
191
+ * Opens the component in a modal dialog
192
+ */
193
+ async openModal() {
194
+ this.modal && this.closeModal(), this.modal = document.createElement("dialog"), this.modal.style.border = "none", this.modal.style.backgroundColor = "white", this.modal.style.maxWidth = "100vw", this.modal.style.maxHeight = "100vh", this.modal.style.width = "600px", this.modal.style.height = "600px", document.body.appendChild(this.modal), this.embed(this.modal, !0);
195
+ const t = this.on(h.CANCEL, () => {
196
+ this.closeModal();
197
+ }), r = this.on(h.COMPLETE, () => {
198
+ this.closeModal();
199
+ });
200
+ return this.modal.showModal(), this.modal.addEventListener("click", () => {
201
+ this.closeModal();
202
+ }), this.completion().finally(() => {
203
+ t(), r();
204
+ });
205
+ }
206
+ /**
207
+ * Closes the modal dialog
208
+ *
209
+ */
210
+ closeModal() {
211
+ var t;
212
+ this.modal && ((t = this.modal) == null || t.close(), this.modal.remove(), this.modal = void 0);
213
+ }
214
+ /**
215
+ * Opens the component in a popup window. This may be needed to support many self-hosted wallets
216
+ * @returns A promise that resolves with the transaction response
217
+ * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#restrictions)
218
+ * @see [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
219
+ */
220
+ async popup() {
221
+ const t = window.open(
222
+ this.url,
223
+ "_blank",
224
+ "popup=true,width=600,height=600"
225
+ );
226
+ window.addEventListener("message", (i) => {
227
+ var n;
228
+ i.source === t && (console.log("received message from popup", i.data), (n = this.eventManager) == null || n.setPort(i.ports[0]));
229
+ });
230
+ const r = this.on(h.CANCEL, () => {
231
+ t == null || t.close();
232
+ }), s = this.on(h.COMPLETE, () => {
233
+ t == null || t.close();
234
+ });
235
+ return this.completion().finally(() => {
236
+ r(), s();
237
+ });
238
+ }
239
+ }
240
+ function w(e) {
241
+ return Object.entries(e).map(([t, r]) => {
242
+ if (r == null) return;
243
+ const s = encodeURIComponent(t), i = encodeURIComponent(
244
+ typeof r == "object" ? JSON.stringify(r) : String(r)
245
+ // Use String() to handle all primitive types
246
+ );
247
+ return `${s}=${i}`;
248
+ }).filter((t) => t !== void 0).join("&");
249
+ }
250
+ function C(e) {
251
+ const t = e.slice(1);
252
+ return t ? t.split("&").filter(Boolean).reduce(
253
+ (s, i) => {
254
+ const [n, a] = i.split("=");
255
+ return n && (s[decodeURIComponent(n)] = a ? decodeURIComponent(a) : ""), s;
256
+ },
257
+ {}
258
+ ) : {};
259
+ }
260
+ class U {
261
+ /**
262
+ * Creates a new instance of the Notabene SDK
263
+ *
264
+ * @param config - Configuration options for the Notabene SDK
265
+ */
266
+ constructor(t) {
267
+ o(this, "nodeUrl");
268
+ o(this, "authToken");
269
+ o(this, "uxUrl");
270
+ o(this, "theme");
271
+ o(this, "locale");
272
+ this.uxUrl = t.uxUrl || "https://connect.notabene.id", this.nodeUrl = t.nodeUrl, this.authToken = t.authToken, this.theme = t.theme, this.locale = t.locale;
273
+ }
274
+ /**
275
+ * Generates a URL for a Notabene component
276
+ *
277
+ * @param path - The path of the component
278
+ * @param value - Transaction data
279
+ * @param configuration - Optional transaction configuration
280
+ * @param callbacks - Optional callback configuration
281
+ * @returns component URL
282
+ * @internal
283
+ */
284
+ componentUrl(t, r, s, i) {
285
+ const n = new URL(this.uxUrl);
286
+ n.pathname = t;
287
+ const a = w({
288
+ authToken: this.authToken,
289
+ value: r,
290
+ configuration: s
291
+ });
292
+ return n.hash = a, this.nodeUrl && n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.locale && n.searchParams.set("locale", this.locale), i && (i.callback && n.searchParams.set("callback_url", i.callback), i.redirectUri && n.searchParams.set("redirect_uri", i.redirectUri)), n.toString();
293
+ }
294
+ /**
295
+ * Creates a new embedded component
296
+ *
297
+ * @param path - The path of the component
298
+ * @param value - Transaction data
299
+ * @param options - Optional transaction options
300
+ * @param callbacks - Optional callback configuration
301
+ * @returns A new EmbeddedComponent instance
302
+ * @internal
303
+ */
304
+ createComponent(t, r, s, i) {
305
+ return new N(
306
+ this.componentUrl(t, r, s, i),
307
+ r,
308
+ s
309
+ );
310
+ }
311
+ /**
312
+ * Creates a withdrawal assist component
313
+ *
314
+ * @param value - Withdrawal transaction data
315
+ * @param options - Optional transaction options
316
+ * @param callbacks - Optional callback configuration
317
+ * @returns A new EmbeddedComponent instance for withdrawal assistance
318
+ */
319
+ createWithdrawalAssist(t, r, s) {
320
+ return this.createComponent(
321
+ "withdrawal-assist",
322
+ t,
323
+ r,
324
+ s
325
+ );
326
+ }
327
+ /**
328
+ * Creates a connect component
329
+ *
330
+ * @param value - Connection request data
331
+ * @param options - Optional transaction options
332
+ * @param callbacks - Optional callback configuration
333
+ * @returns A new EmbeddedComponent instance for connection
334
+ * @alpha
335
+ */
336
+ createConnectWallet(t, r, s) {
337
+ return this.createComponent(
338
+ "connect",
339
+ t,
340
+ r,
341
+ s
342
+ );
343
+ }
344
+ /**
345
+ * Creates a deposit request component
346
+ *
347
+ * @param value - Deposit request data
348
+ * @param options - Optional transaction options
349
+ * @param callbacks - Optional callback configuration
350
+ * @returns A new EmbeddedComponent instance for deposit requests
351
+ * @public
352
+ */
353
+ createDepositRequest(t, r, s) {
354
+ return this.createComponent(
355
+ "deposit-request",
356
+ t,
357
+ r,
358
+ s
359
+ );
360
+ }
361
+ /**
362
+ * Creates a deposit assist component
363
+ *
364
+ * @param value - Partial deposit transaction data
365
+ * @param options - Optional transaction options
366
+ * @param callbacks - Optional callback configuration
367
+ * @returns A new EmbeddedComponent instance for deposit assistance
368
+ * @public
369
+ */
370
+ createDepositAssist(t, r, s) {
371
+ return this.createComponent(
372
+ "deposit-assist",
373
+ t,
374
+ r,
375
+ s
376
+ );
377
+ }
378
+ }
379
+ export {
380
+ u as AgentType,
381
+ h as CMType,
382
+ N as EmbeddedComponent,
383
+ I as ErrorIdentifierCode,
384
+ d as HMType,
385
+ E as PersonType,
386
+ L as ProofStatus,
387
+ g as ProofTypes,
388
+ p as Status,
389
+ f as VASPSearchControl,
390
+ v as ValidationSections,
391
+ C as decodeFragmentToObject,
392
+ U as default
393
+ };
@@ -0,0 +1,107 @@
1
+ {
2
+ "name": "@notabene/javascript-sdk",
3
+ "type": "module",
4
+ "description": "JavaScript SDK for Notabene",
5
+ "homepage": "https://gitlab.com/notabene/open-source/javascript-sdk",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://gitlab.com/notabene/open-source/javascript-sdk"
9
+ },
10
+ "author": "Notabene <developers@notabene.id>",
11
+ "license": "MIT",
12
+ "packageManager": "yarn@4.5.1",
13
+ "version": "2.8.0-next.3",
14
+ "source": "src/notabene.ts",
15
+ "main": "dist/cjs/notabene.cjs",
16
+ "module": "dist/esm/notabene.js",
17
+ "types": "dist/notabene.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": {
21
+ "import": "./dist/esm/notabene.d.ts",
22
+ "require": "./dist/cjs/notabene.d.ts"
23
+ },
24
+ "import": "./dist/esm/notabene.js",
25
+ "require": "./dist/cjs/notabene.cjs"
26
+ },
27
+ "./src/types": {
28
+ "types": {
29
+ "import": "./dist/esm/notabene.d.ts",
30
+ "require": "./dist/cjs/notabene.d.ts"
31
+ },
32
+ "import": "./dist/esm/notabene.js",
33
+ "require": "./dist/cjs/notabene.cjs"
34
+ },
35
+ "./src/ivms/types": "./src/ivms/types.ts"
36
+ },
37
+ "browserslist": "> 0.5%, last 2 versions, not dead",
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "docs",
44
+ "src",
45
+ "package.json",
46
+ "README.md"
47
+ ],
48
+ "scripts": {
49
+ "docs": "typedoc --options typedoc.json",
50
+ "prepare": "husky",
51
+ "dev": "vite",
52
+ "preview": "vite preview",
53
+ "build:dev": "yarn build && yarn dev",
54
+ "build:clean": "rimraf dist ts-out coverage temp",
55
+ "build": "vite build && yarn typecheck && api-extractor run --local && node scripts/copy-types.mjs && yarn docs",
56
+ "lint": "eslint . --max-warnings 0",
57
+ "lint:fix": "yarn lint --fix --cache --no-warn-ignored",
58
+ "format": "prettier --write --cache .",
59
+ "format:check": "prettier --check .",
60
+ "test": "vitest",
61
+ "typecheck": "tsc --skipLibCheck",
62
+ "coverage": "vitest run --coverage --coverage.extension=.ts",
63
+ "release": "semantic-release"
64
+ },
65
+ "devDependencies": {
66
+ "@commitlint/cli": "^19.5.0",
67
+ "@commitlint/config-conventional": "^19.5.0",
68
+ "@eslint/js": "^9.13.0",
69
+ "@fast-check/vitest": "^0.1.4",
70
+ "@microsoft/api-extractor": "^7.48.1",
71
+ "@semantic-release/git": "^10.0.1",
72
+ "@semantic-release/gitlab": "^13.2.1",
73
+ "@semantic-release/npm": "^12.0.1",
74
+ "@vitest/coverage-v8": "^2.1.8",
75
+ "eslint": "^9.14.0",
76
+ "eslint-config-prettier": "^9.1.0",
77
+ "eslint-plugin-prettier": "^5.2.1",
78
+ "fast-check": "^3.23.1",
79
+ "globals": "^15.11.0",
80
+ "husky": "^9.1.6",
81
+ "jsdom": "^25.0.1",
82
+ "lint-staged": "^15.2.10",
83
+ "prettier": "^3.3.3",
84
+ "prettier-plugin-organize-imports": "^4.1.0",
85
+ "rimraf": "^6.0.1",
86
+ "semantic-release": "^24.2.0",
87
+ "typedoc": "^0.27.5",
88
+ "typedoc-plugin-markdown": "^4.2.10",
89
+ "typescript": "^5.7.2",
90
+ "typescript-eslint": "^8.12.2",
91
+ "vite": "^5.4.10",
92
+ "vitest": "^2.1.8"
93
+ },
94
+ "lint-staged": {
95
+ "*.ts": [
96
+ "yarn format:check",
97
+ "yarn lint:fix",
98
+ "yarn typecheck --noEmit",
99
+ "yarn test --run"
100
+ ]
101
+ },
102
+ "commitlint": {
103
+ "extends": [
104
+ "@commitlint/config-conventional"
105
+ ]
106
+ }
107
+ }
@@ -573,7 +573,7 @@ export declare enum ErrorIdentifierCode {
573
573
  * Field properties
574
574
  * @public
575
575
  */
576
- declare type FieldOptions = boolean | {
576
+ export declare type FieldOptions = boolean | {
577
577
  optional: boolean;
578
578
  transmit: boolean;
579
579
  };
@@ -725,13 +725,13 @@ declare type LegalPerson_2 = {
725
725
  countryOfRegistration?: ISOCountryCode;
726
726
  };
727
727
 
728
- declare type LegalPersonFieldName = 'name' | 'lei' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'countryOfRegistration';
728
+ export declare type LegalPersonFieldName = 'name' | 'lei' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'countryOfRegistration';
729
729
 
730
730
  /**
731
731
  * Field properties by field name
732
732
  * @public
733
733
  */
734
- declare type LegalPersonFields = {
734
+ export declare type LegalPersonFields = {
735
735
  [name in LegalPersonFieldName]?: FieldOptions;
736
736
  };
737
737
 
@@ -896,13 +896,13 @@ declare type NaturalPerson_2 = {
896
896
  * Field names for NaturalPerson
897
897
  * @public
898
898
  */
899
- declare type NaturalPersonFieldName = 'name' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'dateOfBirth' | 'placeOfBirth' | 'countryOfResidence';
899
+ export declare type NaturalPersonFieldName = 'name' | 'website' | 'email' | 'phone' | 'geographicAddress' | 'nationalIdentification' | 'dateOfBirth' | 'placeOfBirth' | 'countryOfResidence';
900
900
 
901
901
  /**
902
902
  * Field properties by field name for Natural persons
903
903
  * @public
904
904
  */
905
- declare type NaturalPersonFields = {
905
+ export declare type NaturalPersonFields = {
906
906
  [name in NaturalPersonFieldName]?: FieldOptions;
907
907
  };
908
908
 
@@ -1311,7 +1311,7 @@ export declare interface ScreenshotProof extends OwnershipProof {
1311
1311
  * @public
1312
1312
  */
1313
1313
  export declare interface SignatureProof extends OwnershipProof {
1314
- type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8;
1314
+ type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519;
1315
1315
  proof: string;
1316
1316
  attestation: string;
1317
1317
  wallet_provider: string;
package/package.json CHANGED
@@ -10,10 +10,30 @@
10
10
  "author": "Notabene <developers@notabene.id>",
11
11
  "license": "MIT",
12
12
  "packageManager": "yarn@4.5.1",
13
- "version": "2.8.0-next.1",
13
+ "version": "2.8.0-next.3",
14
14
  "source": "src/notabene.ts",
15
- "main": "dist/notabene.js",
15
+ "main": "dist/cjs/notabene.cjs",
16
+ "module": "dist/esm/notabene.js",
16
17
  "types": "dist/notabene.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": {
21
+ "import": "./dist/esm/notabene.d.ts",
22
+ "require": "./dist/cjs/notabene.d.ts"
23
+ },
24
+ "import": "./dist/esm/notabene.js",
25
+ "require": "./dist/cjs/notabene.cjs"
26
+ },
27
+ "./src/types": {
28
+ "types": {
29
+ "import": "./dist/esm/notabene.d.ts",
30
+ "require": "./dist/cjs/notabene.d.ts"
31
+ },
32
+ "import": "./dist/esm/notabene.js",
33
+ "require": "./dist/cjs/notabene.cjs"
34
+ },
35
+ "./src/ivms/types": "./src/ivms/types.ts"
36
+ },
17
37
  "browserslist": "> 0.5%, last 2 versions, not dead",
18
38
  "publishConfig": {
19
39
  "access": "public"
@@ -32,7 +52,7 @@
32
52
  "preview": "vite preview",
33
53
  "build:dev": "yarn build && yarn dev",
34
54
  "build:clean": "rimraf dist ts-out coverage temp",
35
- "build": "vite build && yarn typecheck && api-extractor run --local && yarn docs",
55
+ "build": "vite build && yarn typecheck && api-extractor run --local && node scripts/copy-types.mjs && yarn docs",
36
56
  "lint": "eslint . --max-warnings 0",
37
57
  "lint:fix": "yarn lint --fix --cache --no-warn-ignored",
38
58
  "format": "prettier --write --cache .",
package/src/notabene.ts CHANGED
@@ -22,15 +22,20 @@ import type {
22
22
  DID,
23
23
  DTI,
24
24
  Error,
25
+ FieldOptions,
25
26
  FieldTypes,
26
27
  HostMessage,
27
28
  InvalidValue,
28
29
  IVMS101,
29
30
  LegalPerson,
31
+ LegalPersonFieldName,
32
+ LegalPersonFields,
30
33
  LEI,
31
34
  MicroTransferProof,
32
35
  NationalIdentification,
33
36
  NaturalPerson,
37
+ NaturalPersonFieldName,
38
+ NaturalPersonFields,
34
39
  NotabeneAsset,
35
40
  OwnershipProof,
36
41
  Ready,
@@ -104,16 +109,21 @@ export type {
104
109
  DID,
105
110
  DTI,
106
111
  Error,
112
+ FieldOptions,
107
113
  FieldTypes,
108
114
  HostMessage,
109
115
  InvalidValue,
110
116
  IVMS101,
111
117
  LegalPerson,
118
+ LegalPersonFieldName,
119
+ LegalPersonFields,
112
120
  LEI,
113
121
  MessageCallback,
114
122
  MicroTransferProof,
115
123
  NationalIdentification,
116
124
  NaturalPerson,
125
+ NaturalPersonFieldName,
126
+ NaturalPersonFields,
117
127
  NotabeneAsset,
118
128
  OwnershipProof,
119
129
  Ready,
package/src/types.ts CHANGED
@@ -1113,7 +1113,8 @@ export interface SignatureProof extends OwnershipProof {
1113
1113
  | ProofTypes.TIP191
1114
1114
  | ProofTypes.SIWX
1115
1115
  | ProofTypes.SIWE
1116
- | ProofTypes.CIP8;
1116
+ | ProofTypes.CIP8
1117
+ | ProofTypes.XRP_ED25519;
1117
1118
 
1118
1119
  proof: string;
1119
1120
  attestation: string;
File without changes