@notabene/javascript-sdk 2.9.0-next.1 → 2.9.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.
package/dist/notabene.js CHANGED
@@ -1,8 +1,8 @@
1
- var w = Object.defineProperty;
2
- var v = (t, e, n) => e in t ? w(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var a = (t, e, n) => v(t, typeof e != "symbol" ? e + "" : e, n);
4
- var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), g = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(g || {}), y = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(I || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t))(l || {}), C = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(C || {}), u = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(u || {}), b = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(b || {}), N = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t))(N || {});
5
- class U {
1
+ var v = Object.defineProperty;
2
+ var g = (t, e, n) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var a = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
4
+ var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}), L = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(L || {}), b = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(b || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t))(l || {}), C = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(C || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), N = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(N || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t))(U || {});
5
+ class _ {
6
6
  constructor() {
7
7
  a(this, "listeners", /* @__PURE__ */ new Map());
8
8
  a(this, "port");
@@ -42,8 +42,8 @@ class U {
42
42
  * @param callback - The callback function to remove
43
43
  */
44
44
  off(e, n) {
45
- const r = this.listeners.get(e);
46
- r && (r.delete(n), r.size === 0 && this.listeners.delete(e));
45
+ const s = this.listeners.get(e);
46
+ s && (s.delete(n), s.size === 0 && this.listeners.delete(e));
47
47
  }
48
48
  /**
49
49
  * Internal message handler for processing received messages.
@@ -56,8 +56,8 @@ class U {
56
56
  handleMessage(e) {
57
57
  const n = e.data;
58
58
  if (typeof n == "object" && n !== null && "type" in n) {
59
- const r = n.type, i = this.listeners.get(r);
60
- i && i.forEach((s) => s(n));
59
+ const s = n.type, r = this.listeners.get(s);
60
+ r && r.forEach((i) => i(n));
61
61
  }
62
62
  }
63
63
  /**
@@ -68,13 +68,13 @@ class U {
68
68
  this.port && this.port.postMessage(e);
69
69
  }
70
70
  }
71
- class _ {
71
+ class x {
72
72
  /**
73
73
  * Creates an instance of EmbeddedComponent.
74
74
  * @param url - The URL of the embedded component
75
75
  * @param value - The initial transaction value
76
76
  */
77
- constructor(e, n, r) {
77
+ constructor(e, n, s) {
78
78
  a(this, "_url");
79
79
  a(this, "_value");
80
80
  a(this, "_options");
@@ -82,10 +82,10 @@ class _ {
82
82
  a(this, "iframe");
83
83
  a(this, "eventManager");
84
84
  a(this, "modal");
85
- this._url = e, this._value = n, this._options = r, this.eventManager = new U(), this.on(l.INVALID, (i) => {
86
- i.type === l.INVALID && (this._errors = i.errors, this._value = i.value);
87
- }), this.on(l.RESIZE, (i) => {
88
- i.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${i.height}px`);
85
+ this._url = e, this._value = n, this._options = s, this.eventManager = new _(), this.on(l.INVALID, (r) => {
86
+ r.type === l.INVALID && (this._errors = r.errors, this._value = r.value);
87
+ }), this.on(l.RESIZE, (r) => {
88
+ r.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
89
89
  });
90
90
  }
91
91
  /**
@@ -129,11 +129,11 @@ class _ {
129
129
  * @param parent - The parent element to embed the component into
130
130
  */
131
131
  embed(e, n = !1) {
132
- var r, i;
133
- this.removeEmbed(), this.iframe = document.createElement("iframe"), this.iframe.src = this.url + (n ? "" : "&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", e.appendChild(this.iframe), window.addEventListener("message", (s) => {
132
+ var s, r;
133
+ this.removeEmbed(), this.iframe = document.createElement("iframe"), this.iframe.src = this.url + (n ? "" : "&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", e.appendChild(this.iframe), window.addEventListener("message", (i) => {
134
134
  var o, c;
135
- s.source === ((o = this.iframe) == null ? void 0 : o.contentWindow) && ((c = this.eventManager) == null || c.setPort(s.ports[0]));
136
- }), (i = (r = this.iframe) == null ? void 0 : r.contentWindow) == null || i.focus();
135
+ i.source === ((o = this.iframe) == null ? void 0 : o.contentWindow) && ((c = this.eventManager) == null || c.setPort(i.ports[0]));
136
+ }), (r = (s = this.iframe) == null ? void 0 : s.contentWindow) == null || r.focus();
137
137
  }
138
138
  removeEmbed() {
139
139
  this.iframe && this.iframe.remove();
@@ -166,7 +166,7 @@ class _ {
166
166
  * @param value - The new transaction value
167
167
  */
168
168
  update(e, n) {
169
- this._value = e, n && (this._options = n), this.send({ type: u.UPDATE, value: e, options: this._options });
169
+ this._value = e, n && (this._options = n), this.send({ type: E.UPDATE, value: e, options: this._options });
170
170
  }
171
171
  /**
172
172
  * Waits for the component to complete and returns the transaction response
@@ -174,15 +174,15 @@ class _ {
174
174
  */
175
175
  completion() {
176
176
  return new Promise((e, n) => {
177
- let r, i, s;
177
+ let s, r, i;
178
178
  function o() {
179
- r && r(), i && i(), s && s();
179
+ s && s(), r && r(), i && i();
180
180
  }
181
- r = this.on(l.COMPLETE, (c) => {
181
+ s = this.on(l.COMPLETE, (c) => {
182
182
  e(c.response), o();
183
- }), i = this.on(l.CANCEL, () => {
183
+ }), r = this.on(l.CANCEL, () => {
184
184
  n(new Error("User cancelled")), o();
185
- }), s = this.on("error", (c) => {
185
+ }), i = this.on("error", (c) => {
186
186
  n(new Error(c.message)), o();
187
187
  });
188
188
  });
@@ -223,87 +223,115 @@ class _ {
223
223
  "_blank",
224
224
  "popup=true,width=600,height=600"
225
225
  );
226
- window.addEventListener("message", (i) => {
227
- var s;
228
- i.source === e && (console.log("received message from popup", i.data), (s = this.eventManager) == null || s.setPort(i.ports[0]));
226
+ window.addEventListener("message", (r) => {
227
+ var i;
228
+ r.source === e && (console.log("received message from popup", r.data), (i = this.eventManager) == null || i.setPort(r.ports[0]));
229
229
  });
230
230
  const n = this.on(l.CANCEL, () => {
231
231
  e == null || e.close();
232
- }), r = this.on(l.COMPLETE, () => {
232
+ }), s = this.on(l.COMPLETE, () => {
233
233
  e == null || e.close();
234
234
  });
235
235
  return this.completion().finally(() => {
236
- n(), r();
236
+ n(), s();
237
237
  });
238
238
  }
239
239
  }
240
- function x(t) {
240
+ function D(t) {
241
241
  return Object.entries(t).map(([e, n]) => {
242
242
  if (n == null) return;
243
- const r = encodeURIComponent(e), i = encodeURIComponent(
243
+ const s = encodeURIComponent(e), r = encodeURIComponent(
244
244
  typeof n == "object" ? JSON.stringify(n) : String(n)
245
245
  // Use String() to handle all primitive types
246
246
  );
247
- return `${r}=${i}`;
247
+ return `${s}=${r}`;
248
248
  }).filter((e) => e !== void 0).join("&");
249
249
  }
250
250
  function O(t) {
251
251
  const e = t.slice(1);
252
252
  return e ? e.split("&").filter(Boolean).reduce(
253
- (r, i) => {
254
- const [s, o] = i.split("=");
255
- return s && (r[decodeURIComponent(s)] = o ? decodeURIComponent(o) : ""), r;
253
+ (s, r) => {
254
+ const [i, o] = r.split("=");
255
+ return i && (s[decodeURIComponent(i)] = o ? decodeURIComponent(o) : ""), s;
256
256
  },
257
257
  {}
258
258
  ) : {};
259
259
  }
260
- async function d(t) {
261
- const e = JSON.stringify(t), n = new TextEncoder(), r = crypto.getRandomValues(new Uint8Array(32)), i = await crypto.subtle.importKey(
260
+ async function p(t, e) {
261
+ const n = JSON.stringify(t), s = new TextEncoder(), r = e ? m(e) : crypto.getRandomValues(new Uint8Array(32)), i = await crypto.subtle.importKey(
262
262
  "raw",
263
263
  r,
264
264
  { name: "AES-GCM" },
265
265
  !1,
266
266
  ["encrypt"]
267
- ), s = crypto.getRandomValues(new Uint8Array(12)), o = await crypto.subtle.encrypt(
268
- { name: "AES-GCM", iv: s },
267
+ ), o = crypto.getRandomValues(new Uint8Array(12)), c = await crypto.subtle.encrypt(
268
+ { name: "AES-GCM", iv: o },
269
269
  i,
270
- n.encode(e)
270
+ s.encode(n)
271
271
  );
272
272
  return {
273
- ciphertext: `${h(s)}-${h(o)}`,
274
- key: h(r)
273
+ ciphertext: `${u(o)}-${u(c)}`,
274
+ key: u(r)
275
275
  };
276
276
  }
277
- async function D({ ciphertext: t, key: e }) {
278
- const [n, r] = t.split("-"), i = new Uint8Array(
279
- atob(e).split("").map((f) => f.charCodeAt(0))
280
- ), s = m(n), o = m(r), c = await crypto.subtle.importKey(
277
+ async function f({ ciphertext: t, key: e }) {
278
+ const [n, s] = t.split("-"), r = new Uint8Array(
279
+ atob(e).split("").map((w) => w.charCodeAt(0))
280
+ ), i = m(n), o = m(s), c = await crypto.subtle.importKey(
281
281
  "raw",
282
- i,
282
+ r,
283
283
  { name: "AES-GCM" },
284
284
  !1,
285
285
  ["decrypt"]
286
- ), p = new TextDecoder(), E = await crypto.subtle.decrypt(
287
- { name: "AES-GCM", iv: new Uint8Array(s) },
286
+ ), h = new TextDecoder(), d = await crypto.subtle.decrypt(
287
+ { name: "AES-GCM", iv: new Uint8Array(i) },
288
288
  c,
289
289
  o
290
290
  );
291
- return JSON.parse(p.decode(E));
291
+ return JSON.parse(h.decode(d));
292
292
  }
293
- function h(t) {
293
+ function u(t) {
294
294
  const e = new Uint8Array(t);
295
295
  let n = "";
296
- for (let r = 0; r < e.length; r++)
297
- n += String.fromCharCode(e[r]);
296
+ for (let s = 0; s < e.length; s++)
297
+ n += String.fromCharCode(e[s]);
298
298
  return btoa(n);
299
299
  }
300
300
  function m(t) {
301
301
  const e = atob(t), n = new Uint8Array(e.length);
302
- for (let r = 0; r < e.length; r++)
303
- n[r] = e.charCodeAt(r);
302
+ for (let s = 0; s < e.length; s++)
303
+ n[s] = e.charCodeAt(s);
304
304
  return n;
305
305
  }
306
- class M {
306
+ async function M(t) {
307
+ const e = await fetch(t.url, {
308
+ method: "GET"
309
+ });
310
+ if (!e.ok)
311
+ throw new Error(`Failed to get connection: ${await e.text()}`);
312
+ const n = await e.json();
313
+ if (!n.id || !n.metadata || !n.status || !n.sealed)
314
+ throw new Error("Data missing from server response");
315
+ const s = {
316
+ id: n.id,
317
+ metadata: n.metadata,
318
+ status: n.status
319
+ };
320
+ if (n.status === "closed")
321
+ return s;
322
+ const r = n.sealed[n.sealed.length - 1], i = await f({
323
+ ciphertext: r,
324
+ key: t.key
325
+ });
326
+ return n.status === "completed" ? {
327
+ ...s,
328
+ result: i.result
329
+ } : {
330
+ ...s,
331
+ tx: i.tx
332
+ };
333
+ }
334
+ class S {
307
335
  constructor(e) {
308
336
  a(this, "endpoint");
309
337
  this.endpoint = e;
@@ -315,25 +343,26 @@ class M {
315
343
  * @returns Promise resolving to connection details including ID, version, and encryption key
316
344
  */
317
345
  async create(e, n) {
318
- const r = await d(e), i = {
346
+ const s = await p(e), r = {
319
347
  metadata: n,
320
- sealed: r.ciphertext
321
- }, s = await fetch(this.endpoint, {
348
+ sealed: s.ciphertext
349
+ }, i = await fetch(this.endpoint, {
322
350
  method: "POST",
323
351
  headers: {
324
352
  "Content-Type": "application/json"
325
353
  },
326
- body: JSON.stringify(i)
354
+ body: JSON.stringify(r)
327
355
  });
328
- if (!s.ok)
329
- throw new Error(`Failed to create connection: ${await s.text()}`);
330
- const o = await s.json();
356
+ if (!i.ok)
357
+ throw new Error(`Failed to create connection: ${await i.text()}`);
358
+ const o = await i.json();
331
359
  return {
332
360
  id: o.id,
333
361
  version: o.version,
362
+ status: o.status,
334
363
  metadata: n,
335
364
  data: e,
336
- key: r.key
365
+ key: s.key
337
366
  };
338
367
  }
339
368
  /**
@@ -343,26 +372,28 @@ class M {
343
372
  * @param version Current version number
344
373
  * @returns Promise resolving to updated connection details including new encryption key
345
374
  */
346
- async update(e, n, r) {
347
- const i = await d(n), s = {
348
- sealed: i.ciphertext,
349
- version: r
350
- }, o = await fetch(`${this.endpoint}/${e}`, {
375
+ async update(e, n, s, r, i) {
376
+ const o = await p(n, i), c = {
377
+ sealed: o.ciphertext,
378
+ version: s,
379
+ status: r
380
+ }, h = await fetch(`${this.endpoint}/${e}`, {
351
381
  method: "PATCH",
352
382
  headers: {
353
383
  "Content-Type": "application/json"
354
384
  },
355
- body: JSON.stringify(s)
385
+ body: JSON.stringify(c)
356
386
  });
357
- if (!o.ok)
358
- throw new Error(`Failed to update connection: ${await o.text()}`);
359
- const c = await o.json();
387
+ if (!h.ok)
388
+ throw new Error(`Failed to update connection: ${await h.text()}`);
389
+ const d = await h.json();
360
390
  return {
361
- id: c.id,
362
- metadata: c.metadata,
363
- version: c.version,
391
+ id: d.id,
392
+ metadata: d.metadata,
393
+ version: d.version,
394
+ status: d.status,
364
395
  data: n,
365
- key: i.key
396
+ key: o.key
366
397
  };
367
398
  }
368
399
  /**
@@ -372,19 +403,20 @@ class M {
372
403
  * @returns Promise resolving to connection details including decrypted data
373
404
  */
374
405
  async get(e, n) {
375
- const r = await fetch(`${this.endpoint}/${e}`, {
406
+ const s = await fetch(`${this.endpoint}/${e}`, {
376
407
  method: "GET"
377
408
  });
378
- if (!r.ok)
379
- throw new Error(`Failed to get connection: ${await r.text()}`);
380
- const i = await r.json(), s = i.sealed[i.sealed.length - 1], o = await D({
381
- ciphertext: s,
409
+ if (!s.ok)
410
+ throw new Error(`Failed to get connection: ${await s.text()}`);
411
+ const r = await s.json(), i = r.sealed[r.sealed.length - 1], o = await f({
412
+ ciphertext: i,
382
413
  key: n
383
414
  });
384
415
  return {
385
- id: i.id,
386
- version: i.version,
387
- metadata: i.metadata,
416
+ id: r.id,
417
+ status: r.status,
418
+ version: r.version,
419
+ metadata: r.metadata,
388
420
  data: o,
389
421
  key: n
390
422
  };
@@ -401,7 +433,7 @@ class M {
401
433
  throw new Error(`Failed to close connection: ${await n.text()}`);
402
434
  }
403
435
  }
404
- class S {
436
+ class k {
405
437
  /**
406
438
  * Creates a new instance of the Notabene SDK
407
439
  *
@@ -425,15 +457,15 @@ class S {
425
457
  * @returns component URL
426
458
  * @internal
427
459
  */
428
- componentUrl(e, n, r, i) {
429
- const s = new URL(this.uxUrl);
430
- s.pathname = e;
431
- const o = x({
460
+ componentUrl(e, n, s, r) {
461
+ const i = new URL(this.uxUrl);
462
+ i.pathname = e;
463
+ const o = D({
432
464
  authToken: this.authToken,
433
465
  value: n,
434
- configuration: r
466
+ configuration: s
435
467
  });
436
- return s.hash = o, this.nodeUrl && s.searchParams.set("nodeUrl", this.nodeUrl), this.theme && s.searchParams.set("theme", JSON.stringify(this.theme)), this.locale && s.searchParams.set("locale", this.locale), i && (i.callback && s.searchParams.set("callback_url", i.callback), i.redirectUri && s.searchParams.set("redirect_uri", i.redirectUri)), s.toString();
468
+ return i.hash = o, 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), r && (r.callback && i.searchParams.set("callback_url", r.callback), r.redirectUri && i.searchParams.set("redirect_uri", r.redirectUri)), i.toString();
437
469
  }
438
470
  /**
439
471
  * Creates a new embedded component
@@ -445,11 +477,11 @@ class S {
445
477
  * @returns A new EmbeddedComponent instance
446
478
  * @internal
447
479
  */
448
- createComponent(e, n, r, i) {
449
- return new _(
450
- this.componentUrl(e, n, r, i),
480
+ createComponent(e, n, s, r) {
481
+ return new x(
482
+ this.componentUrl(e, n, s, r),
451
483
  n,
452
- r
484
+ s
453
485
  );
454
486
  }
455
487
  /**
@@ -460,12 +492,12 @@ class S {
460
492
  * @param callbacks - Optional callback configuration
461
493
  * @returns A new EmbeddedComponent instance for withdrawal assistance
462
494
  */
463
- createWithdrawalAssist(e, n, r) {
495
+ createWithdrawalAssist(e, n, s) {
464
496
  return this.createComponent(
465
497
  "withdrawal-assist",
466
498
  e,
467
499
  n,
468
- r
500
+ s
469
501
  );
470
502
  }
471
503
  /**
@@ -477,12 +509,12 @@ class S {
477
509
  * @returns A new EmbeddedComponent instance for connection
478
510
  * @alpha
479
511
  */
480
- createConnectWallet(e, n, r) {
512
+ createConnectWallet(e, n, s) {
481
513
  return this.createComponent(
482
514
  "connect",
483
515
  e,
484
516
  n,
485
- r
517
+ s
486
518
  );
487
519
  }
488
520
  /**
@@ -494,12 +526,12 @@ class S {
494
526
  * @returns A new EmbeddedComponent instance for deposit requests
495
527
  * @public
496
528
  */
497
- createDepositRequest(e, n, r) {
529
+ createDepositRequest(e, n, s) {
498
530
  return this.createComponent(
499
531
  "deposit-request",
500
532
  e,
501
533
  n,
502
- r
534
+ s
503
535
  );
504
536
  }
505
537
  /**
@@ -511,28 +543,29 @@ class S {
511
543
  * @returns A new EmbeddedComponent instance for deposit assistance
512
544
  * @public
513
545
  */
514
- createDepositAssist(e, n, r) {
546
+ createDepositAssist(e, n, s) {
515
547
  return this.createComponent(
516
548
  "deposit-assist",
517
549
  e,
518
550
  n,
519
- r
551
+ s
520
552
  );
521
553
  }
522
554
  }
523
555
  export {
524
556
  A as AgentType,
525
557
  l as CMType,
526
- M as ConnectionManager,
527
- _ as EmbeddedComponent,
558
+ S as ConnectionManager,
559
+ x as EmbeddedComponent,
528
560
  C as ErrorIdentifierCode,
529
- u as HMType,
530
- g as PersonType,
531
- b as ProofStatus,
532
- N as ProofTypes,
533
- y as Status,
534
- I as VASPSearchControl,
535
- L as ValidationSections,
561
+ E as HMType,
562
+ y as PersonType,
563
+ N as ProofStatus,
564
+ U as ProofTypes,
565
+ I as Status,
566
+ L as VASPSearchControl,
567
+ b as ValidationSections,
536
568
  O as decodeFragmentToObject,
537
- S as default
569
+ k as default,
570
+ M as getRefreshResult
538
571
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "author": "Notabene <developers@notabene.id>",
11
11
  "license": "MIT",
12
12
  "packageManager": "yarn@4.5.1",
13
- "version": "2.9.0-next.1",
13
+ "version": "2.9.0-next.3",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/cjs/notabene.cjs",
16
16
  "module": "dist/esm/notabene.js",
package/src/notabene.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import EmbeddedComponent from './components/EmbeddedComponent';
2
2
  import type {
3
+ Account,
3
4
  Agent,
4
5
  BlockchainAddress,
5
6
  CAIP10,
@@ -39,6 +40,7 @@ import type {
39
40
  NotabeneAsset,
40
41
  OwnershipProof,
41
42
  Ready,
43
+ RefreshSource,
42
44
  ResizeRequest,
43
45
  ScreenshotProof,
44
46
  SignatureProof,
@@ -75,9 +77,12 @@ import { decodeFragmentToObject, encodeObjectToFragment } from './utils/urls';
75
77
  export { default as EmbeddedComponent } from './components/EmbeddedComponent';
76
78
  export {
77
79
  ConnectionManager,
80
+ getRefreshResult,
78
81
  type ConnectionData,
79
82
  type ConnectionMetadata,
80
83
  type ConnectionResponse,
84
+ type ConnectionResult,
85
+ type ConnectionStatus,
81
86
  type TransactionType,
82
87
  } from './utils/connections';
83
88
  export {
@@ -94,6 +99,7 @@ export {
94
99
  VASPSearchControl,
95
100
  };
96
101
  export type {
102
+ Account,
97
103
  Agent,
98
104
  BlockchainAddress,
99
105
  CAIP10,
@@ -134,6 +140,7 @@ export type {
134
140
  NotabeneAsset,
135
141
  OwnershipProof,
136
142
  Ready,
143
+ RefreshSource,
137
144
  ResizeRequest,
138
145
  ScreenshotProof,
139
146
  SignatureProof,
package/src/types.ts CHANGED
@@ -312,6 +312,18 @@ export interface Wallet extends Agent {
312
312
  wallet_connect_id?: string;
313
313
  }
314
314
 
315
+ /**
316
+ * A blockchain account
317
+ * @public
318
+ */
319
+ export interface Account {
320
+ did?: DID;
321
+ blockchainAddress?: BlockchainAddress;
322
+ chain?: CAIP2;
323
+ caip10?: CAIP10;
324
+ identifier?: string;
325
+ }
326
+
315
327
  /**
316
328
  * The counterparty of a transaction.
317
329
  * @public
@@ -557,6 +569,7 @@ export interface Transaction extends ComponentRequest {
557
569
  price: number;
558
570
  currency: ISOCurrency;
559
571
  };
572
+ account?: Account;
560
573
  }
561
574
 
562
575
  export interface RefreshSource {