@notabene/javascript-sdk 2.11.0 → 2.13.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
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 || {}), I = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(I || {}), y = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(y || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), 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.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__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))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.SOL_SIWX = "sol-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.CONCORDIUM = "concordium", t))(U || {});
5
- class _ {
1
+ var f = Object.defineProperty;
2
+ var L = (e, t, n) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var o = (e, t, n) => L(e, typeof t != "symbol" ? t + "" : t, n);
4
+ var N = /* @__PURE__ */ ((e) => (e.PRIVATE = "WALLET", e.VASP = "VASP", e))(N || {}), v = /* @__PURE__ */ ((e) => (e.NATURAL = "natural", e.LEGAL = "legal", e.SELF = "self", e))(v || {}), I = /* @__PURE__ */ ((e) => (e.EMPTY = "empty", e.VERIFY = "verify", e.PENDING = "pending", e.VERIFIED = "verified", e.BANNED = "banned", e))(I || {}), _ = /* @__PURE__ */ ((e) => (e.ALLOWED = "allowed", e.PENDING = "pending", e))(_ || {}), g = /* @__PURE__ */ ((e) => (e.SMS = "sms", e.EMAIL = "email", e))(g || {}), D = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.APPROVED = "approved", e.FAILED = "failed", e.EXPIRED = "expired", e.MAX_ATTEMPTS_REACHED = "max_attempts_reached", e.UNREACHABLE = "unreachable", e))(D || {}), U = /* @__PURE__ */ ((e) => (e.COINBASE = "coinbase", e))(U || {}), R = /* @__PURE__ */ ((e) => (e.ASSET = "asset", e.DESTINATION = "destination", e.COUNTERPARTY = "counterparty", e.AGENT = "agent", e))(R || {}), l = /* @__PURE__ */ ((e) => (e.COMPLETE = "complete", e.RESIZE = "resize", e.RESULT = "result", e.READY = "ready", e.INVALID = "invalid", e.ERROR = "error", e.CANCEL = "cancel", e.WARNING = "warning", e.INFO = "info", e))(l || {}), C = /* @__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))(C || {}), O = /* @__PURE__ */ ((e) => (e.WALLET_ADDRESS_NOT_CONNECTED = "WALLET_ADDRESS_NOT_CONNECTED", e.WALLET_LOCKED = "WALLET_LOCKED", e.WALLET_UNREACHABLE = "WALLET_UNREACHABLE", e.JURISDICTIONAL_REQUIREMENTS_UNAVAILABLE = "JURISDICTIONAL_REQUIREMENTS_UNAVAILABLE", e.IDV_UNAVAILABLE = "IDV_UNAVAILABLE", e))(O || {}), p = /* @__PURE__ */ ((e) => (e.UPDATE = "update", e.REQUEST_RESPONSE = "requestResponse", e))(p || {}), b = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.FAILED = "rejected", e.FLAGGED = "flagged", e.VERIFIED = "verified", e))(b || {}), y = /* @__PURE__ */ ((e) => (e.SelfDeclaration = "self-declaration", e.SIWE = "siwe", e.SIWX = "siwx", e.SOL_SIWX = "sol-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.XLM_ED25519 = "xlm-ed25519", e.CIP8 = "cip-8", e.COSMOS = "cosmos-ecdsa", e.MicroTransfer = "microtransfer", e.Screenshot = "screenshot", e.Connect = "connect", e.CONCORDIUM = "concordium", e))(y || {});
5
+ class x {
6
6
  constructor() {
7
- a(this, "listeners", /* @__PURE__ */ new Map());
8
- a(this, "port");
7
+ o(this, "listeners", /* @__PURE__ */ new Map());
8
+ o(this, "port");
9
9
  this.handleMessage = this.handleMessage.bind(this);
10
10
  }
11
11
  /**
@@ -16,8 +16,8 @@ class _ {
16
16
  *
17
17
  * @param port - The MessagePort instance to use for communication
18
18
  */
19
- setPort(e) {
20
- this.port = e, this.port.onmessage = this.handleMessage, this.port.start();
19
+ setPort(t) {
20
+ this.port = t, this.port.onmessage = this.handleMessage, this.port.start();
21
21
  }
22
22
  /**
23
23
  * Registers a callback for a specific message type.
@@ -29,8 +29,8 @@ class _ {
29
29
  * @param callback - The callback function to execute when matching messages are received
30
30
 
31
31
  */
32
- on(e, n) {
33
- return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(n), () => this.off(e, n);
32
+ on(t, n) {
33
+ return this.listeners.has(t) || this.listeners.set(t, /* @__PURE__ */ new Set()), this.listeners.get(t).add(n), () => this.off(t, n);
34
34
  }
35
35
  /**
36
36
  * Removes a callback for a specific message type.
@@ -41,9 +41,9 @@ class _ {
41
41
  * @param messageType - The type of message to remove listener from
42
42
  * @param callback - The callback function to remove
43
43
  */
44
- off(e, n) {
45
- const s = this.listeners.get(e);
46
- s && (s.delete(n), s.size === 0 && this.listeners.delete(e));
44
+ off(t, n) {
45
+ const s = this.listeners.get(t);
46
+ s && (s.delete(n), s.size === 0 && this.listeners.delete(t));
47
47
  }
48
48
  /**
49
49
  * Internal message handler for processing received messages.
@@ -53,8 +53,8 @@ class _ {
53
53
  *
54
54
  * @param event - The message event containing the component message
55
55
  */
56
- handleMessage(e) {
57
- const n = e.data;
56
+ handleMessage(t) {
57
+ const n = t.data;
58
58
  if (typeof n == "object" && n !== null && "type" in n) {
59
59
  const s = n.type, r = this.listeners.get(s);
60
60
  r && r.forEach((i) => i(n));
@@ -64,25 +64,25 @@ class _ {
64
64
  * Sends a message through the message port
65
65
  * @param message The host message to send
66
66
  */
67
- send(e) {
68
- this.port && this.port.postMessage(e);
67
+ send(t) {
68
+ this.port && this.port.postMessage(t);
69
69
  }
70
70
  }
71
- class x {
71
+ class S {
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, s) {
78
- a(this, "_url");
79
- a(this, "_value");
80
- a(this, "_options");
81
- a(this, "_errors", []);
82
- a(this, "iframe");
83
- a(this, "eventManager");
84
- a(this, "modal");
85
- this._url = e, this._value = n, this._options = s, this.eventManager = new _(), this.on(l.INVALID, (r) => {
77
+ constructor(t, n, 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 = n, this._options = s, this.eventManager = new x(), this.on(l.INVALID, (r) => {
86
86
  r.type === l.INVALID && (this._errors = r.errors, this._value = r.value);
87
87
  }), this.on(l.RESIZE, (r) => {
88
88
  r.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
@@ -119,20 +119,20 @@ class x {
119
119
  * @param parentId - The ID of the parent element
120
120
  * @throws Will throw an error if the parent element is not found
121
121
  */
122
- mount(e) {
123
- const n = document.querySelector(e);
124
- if (!n) throw new Error(`parentID ${e} not found`);
122
+ mount(t) {
123
+ const n = document.querySelector(t);
124
+ if (!n) throw new Error(`parentID ${t} not found`);
125
125
  this.embed(n);
126
126
  }
127
127
  /**
128
128
  * Embeds the component into a parent element
129
129
  * @param parent - The parent element to embed the component into
130
130
  */
131
- embed(e, n = !1) {
131
+ embed(t, n = !1) {
132
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
- var o, c;
135
- i.source === ((o = this.iframe) == null ? void 0 : o.contentWindow) && ((c = this.eventManager) == null || c.setPort(i.ports[0]));
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", t.appendChild(this.iframe), window.addEventListener("message", (i) => {
134
+ var a, c;
135
+ i.source === ((a = this.iframe) == null ? void 0 : a.contentWindow) && ((c = this.eventManager) == null || c.setPort(i.ports[0]));
136
136
  }), (r = (s = this.iframe) == null ? void 0 : s.contentWindow) == null || r.focus();
137
137
  }
138
138
  removeEmbed() {
@@ -142,48 +142,48 @@ class x {
142
142
  * Sends a message to the embedded component
143
143
  * @param message - The message to send
144
144
  */
145
- send(e) {
146
- this.eventManager.send(e);
145
+ send(t) {
146
+ this.eventManager.send(t);
147
147
  }
148
148
  /**
149
149
  * Adds an event listener for a specific message type
150
150
  * @param messageType - The type of message to listen for
151
151
  * @param callback - The callback function to execute when the message is received
152
152
  */
153
- on(e, n) {
154
- return this.eventManager.on(e, n);
153
+ on(t, n) {
154
+ return this.eventManager.on(t, n);
155
155
  }
156
156
  /**
157
157
  * Removes an event listener for a specific message type
158
158
  * @param messageType - The type of message to stop listening for
159
159
  * @param callback - The callback function to remove
160
160
  */
161
- off(e, n) {
162
- this.eventManager.off(e, n);
161
+ off(t, n) {
162
+ this.eventManager.off(t, n);
163
163
  }
164
164
  /**
165
165
  * Updates the transaction value and sends an update message to the component
166
166
  * @param value - The new transaction value
167
167
  */
168
- update(e, n) {
169
- this._value = e, n && (this._options = n), this.send({ type: E.UPDATE, value: e, options: this._options });
168
+ update(t, n) {
169
+ this._value = t, n && (this._options = n), this.send({ type: p.UPDATE, value: t, options: this._options });
170
170
  }
171
171
  /**
172
172
  * Waits for the component to complete and returns the transaction response
173
173
  * @returns A promise that resolves with the transaction response
174
174
  */
175
175
  completion() {
176
- return new Promise((e, n) => {
176
+ return new Promise((t, n) => {
177
177
  let s, r, i;
178
- function o() {
178
+ function a() {
179
179
  s && s(), r && r(), i && i();
180
180
  }
181
181
  s = this.on(l.COMPLETE, (c) => {
182
- e(c.response), o();
182
+ t(c.response), a();
183
183
  }), r = this.on(l.CANCEL, () => {
184
- n(new Error("User cancelled")), o();
184
+ n(new Error("User cancelled")), a();
185
185
  }), i = this.on("error", (c) => {
186
- n(new Error(c.message)), o();
186
+ n(new Error(c.message)), a();
187
187
  });
188
188
  });
189
189
  }
@@ -192,7 +192,7 @@ class x {
192
192
  */
193
193
  async openModal() {
194
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 e = this.on(l.CANCEL, () => {
195
+ const t = this.on(l.CANCEL, () => {
196
196
  this.closeModal();
197
197
  }), n = this.on(l.COMPLETE, () => {
198
198
  this.closeModal();
@@ -200,7 +200,7 @@ class x {
200
200
  return this.modal.showModal(), this.modal.addEventListener("click", () => {
201
201
  this.closeModal();
202
202
  }), this.completion().finally(() => {
203
- e(), n();
203
+ t(), n();
204
204
  });
205
205
  }
206
206
  /**
@@ -208,8 +208,8 @@ class x {
208
208
  *
209
209
  */
210
210
  closeModal() {
211
- var e;
212
- this.modal && ((e = this.modal) == null || e.close(), this.modal.remove(), this.modal = void 0);
211
+ var t;
212
+ this.modal && ((t = this.modal) == null || t.close(), this.modal.remove(), this.modal = void 0);
213
213
  }
214
214
  /**
215
215
  * Opens the component in a popup window. This may be needed to support many self-hosted wallets
@@ -218,66 +218,66 @@ class x {
218
218
  * @see [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
219
219
  */
220
220
  async popup() {
221
- const e = window.open(
221
+ const t = window.open(
222
222
  this.url,
223
223
  "_blank",
224
224
  "popup=true,width=600,height=600"
225
225
  );
226
226
  window.addEventListener("message", (r) => {
227
227
  var i;
228
- r.source === e && (console.log("received message from popup", r.data), (i = this.eventManager) == null || i.setPort(r.ports[0]));
228
+ r.source === t && (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
- e == null || e.close();
231
+ t == null || t.close();
232
232
  }), s = this.on(l.COMPLETE, () => {
233
- e == null || e.close();
233
+ t == null || t.close();
234
234
  });
235
235
  return this.completion().finally(() => {
236
236
  n(), s();
237
237
  });
238
238
  }
239
239
  }
240
- function R(t) {
241
- return Object.entries(t).map(([e, n]) => {
240
+ function T(e) {
241
+ return Object.entries(e).map(([t, n]) => {
242
242
  if (n == null) return;
243
- const s = encodeURIComponent(e), r = encodeURIComponent(
243
+ const s = encodeURIComponent(t), r = encodeURIComponent(
244
244
  typeof n == "object" ? JSON.stringify(n) : String(n)
245
245
  // Use String() to handle all primitive types
246
246
  );
247
247
  return `${s}=${r}`;
248
- }).filter((e) => e !== void 0).join("&");
248
+ }).filter((t) => t !== void 0).join("&");
249
249
  }
250
- function O(t) {
251
- const e = t.slice(1);
252
- return e ? e.split("&").filter(Boolean).reduce(
250
+ function B(e) {
251
+ const t = e.slice(1);
252
+ return t ? t.split("&").filter(Boolean).reduce(
253
253
  (s, r) => {
254
- const [i, o] = r.split("=");
255
- return i && (s[decodeURIComponent(i)] = o ? decodeURIComponent(o) : ""), s;
254
+ const [i, a] = r.split("=");
255
+ return i && (s[decodeURIComponent(i)] = a ? decodeURIComponent(a) : ""), s;
256
256
  },
257
257
  {}
258
258
  ) : {};
259
259
  }
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(
260
+ async function m(e, t) {
261
+ const n = JSON.stringify(e), s = new TextEncoder(), r = t ? u(t) : 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
- ), o = crypto.getRandomValues(new Uint8Array(12)), c = await crypto.subtle.encrypt(
268
- { name: "AES-GCM", iv: o },
267
+ ), a = crypto.getRandomValues(new Uint8Array(12)), c = await crypto.subtle.encrypt(
268
+ { name: "AES-GCM", iv: a },
269
269
  i,
270
270
  s.encode(n)
271
271
  );
272
272
  return {
273
- ciphertext: `${u(o)}-${u(c)}`,
274
- key: u(r)
273
+ ciphertext: `${E(a)}-${E(c)}`,
274
+ key: E(r)
275
275
  };
276
276
  }
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(
277
+ async function A({ ciphertext: e, key: t }) {
278
+ const [n, s] = e.split("-"), r = new Uint8Array(
279
+ atob(t).split("").map((w) => w.charCodeAt(0))
280
+ ), i = u(n), a = u(s), c = await crypto.subtle.importKey(
281
281
  "raw",
282
282
  r,
283
283
  { name: "AES-GCM" },
@@ -286,30 +286,30 @@ async function f({ ciphertext: t, key: e }) {
286
286
  ), h = new TextDecoder(), d = await crypto.subtle.decrypt(
287
287
  { name: "AES-GCM", iv: new Uint8Array(i) },
288
288
  c,
289
- o
289
+ a
290
290
  );
291
291
  return JSON.parse(h.decode(d));
292
292
  }
293
- function u(t) {
294
- const e = new Uint8Array(t);
293
+ function E(e) {
294
+ const t = new Uint8Array(e);
295
295
  let n = "";
296
- for (let s = 0; s < e.length; s++)
297
- n += String.fromCharCode(e[s]);
296
+ for (let s = 0; s < t.length; s++)
297
+ n += String.fromCharCode(t[s]);
298
298
  return btoa(n);
299
299
  }
300
- function m(t) {
301
- const e = atob(t), n = new Uint8Array(e.length);
302
- for (let s = 0; s < e.length; s++)
303
- n[s] = e.charCodeAt(s);
300
+ function u(e) {
301
+ const t = atob(e), n = new Uint8Array(t.length);
302
+ for (let s = 0; s < t.length; s++)
303
+ n[s] = t.charCodeAt(s);
304
304
  return n;
305
305
  }
306
- async function S(t) {
307
- const e = await fetch(t.url, {
306
+ async function k(e) {
307
+ const t = await fetch(e.url, {
308
308
  method: "GET"
309
309
  });
310
- if (!e.ok)
311
- throw new Error(`Failed to get connection: ${await e.text()}`);
312
- const n = await e.json();
310
+ if (!t.ok)
311
+ throw new Error(`Failed to get connection: ${await t.text()}`);
312
+ const n = await t.json();
313
313
  if (!n.id || !n.metadata || !n.status || !n.sealed)
314
314
  throw new Error("Data missing from server response");
315
315
  const s = {
@@ -319,9 +319,9 @@ async function S(t) {
319
319
  };
320
320
  if (n.status === "closed")
321
321
  return s;
322
- const r = n.sealed[n.sealed.length - 1], i = await f({
322
+ const r = n.sealed[n.sealed.length - 1], i = await A({
323
323
  ciphertext: r,
324
- key: t.key
324
+ key: e.key
325
325
  });
326
326
  return n.status === "completed" ? {
327
327
  ...s,
@@ -331,10 +331,10 @@ async function S(t) {
331
331
  tx: i.tx
332
332
  };
333
333
  }
334
- class M {
335
- constructor(e) {
336
- a(this, "endpoint");
337
- this.endpoint = e;
334
+ class P {
335
+ constructor(t) {
336
+ o(this, "endpoint");
337
+ this.endpoint = t;
338
338
  }
339
339
  /**
340
340
  * Creates a new encrypted connection
@@ -343,8 +343,8 @@ class M {
343
343
  * @param metadata Connection metadata including participants and transaction type
344
344
  * @returns Promise resolving to connection details including ID, version, and encryption key
345
345
  */
346
- async create(e, n) {
347
- const s = await p(e), r = {
346
+ async create(t, n) {
347
+ const s = await m(t), r = {
348
348
  metadata: n,
349
349
  sealed: s.ciphertext
350
350
  }, i = await fetch(this.endpoint, {
@@ -356,13 +356,13 @@ class M {
356
356
  });
357
357
  if (!i.ok)
358
358
  throw new Error(`Failed to create connection: ${await i.text()}`);
359
- const o = await i.json();
359
+ const a = await i.json();
360
360
  return {
361
- id: o.id,
362
- version: o.version,
363
- status: o.status,
361
+ id: a.id,
362
+ version: a.version,
363
+ status: a.status,
364
364
  metadata: n,
365
- data: e,
365
+ data: t,
366
366
  key: s.key
367
367
  };
368
368
  }
@@ -376,12 +376,12 @@ class M {
376
376
  * @param key Current encryption key
377
377
  * @returns Promise resolving to updated connection details including new encryption key
378
378
  */
379
- async update(e, n, s, r, i) {
380
- const o = await p(n, i), c = {
381
- sealed: o.ciphertext,
379
+ async update(t, n, s, r, i) {
380
+ const a = await m(n, i), c = {
381
+ sealed: a.ciphertext,
382
382
  version: s,
383
383
  status: r
384
- }, h = await fetch(`${this.endpoint}/${e}`, {
384
+ }, h = await fetch(`${this.endpoint}/${t}`, {
385
385
  method: "PATCH",
386
386
  headers: {
387
387
  "Content-Type": "application/json"
@@ -397,7 +397,7 @@ class M {
397
397
  version: d.version,
398
398
  status: d.status,
399
399
  data: n,
400
- key: o.key
400
+ key: a.key
401
401
  };
402
402
  }
403
403
  /**
@@ -407,13 +407,13 @@ class M {
407
407
  * @param key Encryption key from previous create/update operation
408
408
  * @returns Promise resolving to connection details including decrypted data
409
409
  */
410
- async get(e, n) {
411
- const s = await fetch(`${this.endpoint}/${e}`, {
410
+ async get(t, n) {
411
+ const s = await fetch(`${this.endpoint}/${t}`, {
412
412
  method: "GET"
413
413
  });
414
414
  if (!s.ok)
415
415
  throw new Error(`Failed to get connection: ${await s.text()}`);
416
- const r = await s.json(), i = r.sealed[r.sealed.length - 1], o = await f({
416
+ const r = await s.json(), i = r.sealed[r.sealed.length - 1], a = await A({
417
417
  ciphertext: i,
418
418
  key: n
419
419
  });
@@ -422,7 +422,7 @@ class M {
422
422
  status: r.status,
423
423
  version: r.version,
424
424
  metadata: r.metadata,
425
- data: o,
425
+ data: a,
426
426
  key: n
427
427
  };
428
428
  }
@@ -431,27 +431,27 @@ class M {
431
431
  * @param id Connection ID
432
432
  * @returns Promise resolving when the connection is closed
433
433
  */
434
- async close(e) {
435
- const n = await fetch(`${this.endpoint}/${e}`, {
434
+ async close(t) {
435
+ const n = await fetch(`${this.endpoint}/${t}`, {
436
436
  method: "DELETE"
437
437
  });
438
438
  if (!n.ok)
439
439
  throw new Error(`Failed to close connection: ${await n.text()}`);
440
440
  }
441
441
  }
442
- class k {
442
+ class F {
443
443
  /**
444
444
  * Creates a new instance of the Notabene SDK
445
445
  *
446
446
  * @param config - Configuration options for the Notabene SDK
447
447
  */
448
- constructor(e) {
449
- a(this, "nodeUrl");
450
- a(this, "authToken");
451
- a(this, "uxUrl");
452
- a(this, "theme");
453
- a(this, "locale");
454
- this.uxUrl = e.uxUrl || "https://connect.notabene.id", this.nodeUrl = e.nodeUrl, this.authToken = e.authToken, this.theme = e.theme, this.locale = e.locale;
448
+ constructor(t) {
449
+ o(this, "nodeUrl");
450
+ o(this, "authToken");
451
+ o(this, "uxUrl");
452
+ o(this, "theme");
453
+ o(this, "locale");
454
+ this.uxUrl = t.uxUrl || "https://connect.notabene.id", this.nodeUrl = t.nodeUrl, this.authToken = t.authToken, this.theme = t.theme, this.locale = t.locale;
455
455
  }
456
456
  /**
457
457
  * Generates a URL for a Notabene component
@@ -463,15 +463,15 @@ class k {
463
463
  * @returns component URL
464
464
  * @internal
465
465
  */
466
- componentUrl(e, n, s, r) {
466
+ componentUrl(t, n, s, r) {
467
467
  const i = new URL(this.uxUrl);
468
- i.pathname = e;
469
- const o = R({
468
+ i.pathname = t;
469
+ const a = T({
470
470
  authToken: this.authToken,
471
471
  value: n,
472
472
  configuration: s
473
473
  });
474
- 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();
474
+ 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), r && (r.callback && i.searchParams.set("callback_url", r.callback), r.redirectUri && i.searchParams.set("redirect_uri", r.redirectUri)), i.toString();
475
475
  }
476
476
  /**
477
477
  * Creates a new embedded component
@@ -483,9 +483,9 @@ class k {
483
483
  * @returns A new EmbeddedComponent instance
484
484
  * @internal
485
485
  */
486
- createComponent(e, n, s, r) {
487
- return new x(
488
- this.componentUrl(e, n, s, r),
486
+ createComponent(t, n, s, r) {
487
+ return new S(
488
+ this.componentUrl(t, n, s, r),
489
489
  n,
490
490
  s
491
491
  );
@@ -498,10 +498,10 @@ class k {
498
498
  * @param callbacks - Optional callback configuration
499
499
  * @returns A new EmbeddedComponent instance for withdrawal assistance
500
500
  */
501
- createWithdrawalAssist(e, n, s) {
501
+ createWithdrawalAssist(t, n, s) {
502
502
  return this.createComponent(
503
503
  "withdrawal-assist",
504
- e,
504
+ t,
505
505
  n,
506
506
  s
507
507
  );
@@ -515,10 +515,10 @@ class k {
515
515
  * @returns A new EmbeddedComponent instance for connection
516
516
  * @alpha
517
517
  */
518
- createConnectWallet(e, n, s) {
518
+ createConnectWallet(t, n, s) {
519
519
  return this.createComponent(
520
520
  "connect",
521
- e,
521
+ t,
522
522
  n,
523
523
  s
524
524
  );
@@ -532,10 +532,10 @@ class k {
532
532
  * @returns A new EmbeddedComponent instance for deposit requests
533
533
  * @public
534
534
  */
535
- createDepositRequest(e, n, s) {
535
+ createDepositRequest(t, n, s) {
536
536
  return this.createComponent(
537
537
  "deposit-request",
538
- e,
538
+ t,
539
539
  n,
540
540
  s
541
541
  );
@@ -549,29 +549,33 @@ class k {
549
549
  * @returns A new EmbeddedComponent instance for deposit assistance
550
550
  * @public
551
551
  */
552
- createDepositAssist(e, n, s) {
552
+ createDepositAssist(t, n, s) {
553
553
  return this.createComponent(
554
554
  "deposit-assist",
555
- e,
555
+ t,
556
556
  n,
557
557
  s
558
558
  );
559
559
  }
560
560
  }
561
561
  export {
562
- A as AgentType,
562
+ N as AgentType,
563
563
  l as CMType,
564
- M as ConnectionManager,
565
- x as EmbeddedComponent,
566
- b as ErrorIdentifierCode,
567
- E as HMType,
568
- I as PersonType,
569
- C as ProofStatus,
570
- U as ProofTypes,
571
- y as Status,
572
- N as VASPSearchControl,
573
- L as ValidationSections,
574
- O as decodeFragmentToObject,
575
- k as default,
576
- S as getRefreshResult
564
+ D as CodeVerificationStatus,
565
+ P as ConnectionManager,
566
+ S as EmbeddedComponent,
567
+ C as ErrorIdentifierCode,
568
+ p as HMType,
569
+ g as IdentityVerificationMethod,
570
+ U as OAuthProvider,
571
+ v as PersonType,
572
+ b as ProofStatus,
573
+ y as ProofTypes,
574
+ I as Status,
575
+ _ as VASPSearchControl,
576
+ R as ValidationSections,
577
+ O as WarningIdentifierCode,
578
+ B as decodeFragmentToObject,
579
+ F as default,
580
+ k as getRefreshResult
577
581
  };
@@ -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.11.0",
13
+ "version": "2.13.0-next.1",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/cjs/notabene.cjs",
16
16
  "module": "dist/esm/notabene.js",