@notabene/javascript-sdk 2.12.0 → 2.13.0
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 +45 -4
- package/dist/cjs/notabene.cjs +1 -1
- package/dist/cjs/notabene.d.ts +15 -2
- package/dist/cjs/package.json +1 -1
- package/dist/esm/notabene.d.ts +15 -2
- package/dist/esm/notabene.js +106 -105
- package/dist/esm/package.json +1 -1
- package/dist/notabene.d.ts +15 -2
- package/dist/notabene.js +106 -105
- package/docs/README.md +0 -4
- package/docs/_media/TransactionOptions.md +0 -4
- package/docs/types/interfaces/TransactionOptions.md +0 -4
- package/package.json +1 -1
- package/src/notabene.ts +2 -0
- package/src/types.ts +15 -2
- package/src/utils/arbitraries.ts +0 -1
package/dist/notabene.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (e, t, n) =>
|
|
4
|
-
var
|
|
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
7
|
o(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
8
|
o(this, "port");
|
|
@@ -42,8 +42,8 @@ class O {
|
|
|
42
42
|
* @param callback - The callback function to remove
|
|
43
43
|
*/
|
|
44
44
|
off(t, n) {
|
|
45
|
-
const
|
|
46
|
-
|
|
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.
|
|
@@ -56,8 +56,8 @@ class O {
|
|
|
56
56
|
handleMessage(t) {
|
|
57
57
|
const n = t.data;
|
|
58
58
|
if (typeof n == "object" && n !== null && "type" in n) {
|
|
59
|
-
const
|
|
60
|
-
|
|
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 O {
|
|
|
68
68
|
this.port && this.port.postMessage(t);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
class
|
|
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(t, n,
|
|
77
|
+
constructor(t, n, s) {
|
|
78
78
|
o(this, "_url");
|
|
79
79
|
o(this, "_value");
|
|
80
80
|
o(this, "_options");
|
|
@@ -82,10 +82,10 @@ class x {
|
|
|
82
82
|
o(this, "iframe");
|
|
83
83
|
o(this, "eventManager");
|
|
84
84
|
o(this, "modal");
|
|
85
|
-
this._url = t, this._value = n, this._options =
|
|
86
|
-
|
|
87
|
-
}), this.on(l.RESIZE, (
|
|
88
|
-
|
|
85
|
+
this._url = t, this._value = n, this._options = s, this.eventManager = new x(), 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 x {
|
|
|
129
129
|
* @param parent - The parent element to embed the component into
|
|
130
130
|
*/
|
|
131
131
|
embed(t, n = !1) {
|
|
132
|
-
var
|
|
132
|
+
var s, r;
|
|
133
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
134
|
var a, c;
|
|
135
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() {
|
|
139
139
|
this.iframe && this.iframe.remove();
|
|
@@ -174,13 +174,13 @@ class x {
|
|
|
174
174
|
*/
|
|
175
175
|
completion() {
|
|
176
176
|
return new Promise((t, n) => {
|
|
177
|
-
let
|
|
177
|
+
let s, r, i;
|
|
178
178
|
function a() {
|
|
179
|
-
|
|
179
|
+
s && s(), r && r(), i && i();
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
s = this.on(l.COMPLETE, (c) => {
|
|
182
182
|
t(c.response), a();
|
|
183
|
-
}),
|
|
183
|
+
}), r = this.on(l.CANCEL, () => {
|
|
184
184
|
n(new Error("User cancelled")), a();
|
|
185
185
|
}), i = this.on("error", (c) => {
|
|
186
186
|
n(new Error(c.message)), a();
|
|
@@ -223,63 +223,63 @@ class x {
|
|
|
223
223
|
"_blank",
|
|
224
224
|
"popup=true,width=600,height=600"
|
|
225
225
|
);
|
|
226
|
-
window.addEventListener("message", (
|
|
226
|
+
window.addEventListener("message", (r) => {
|
|
227
227
|
var i;
|
|
228
|
-
|
|
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
231
|
t == null || t.close();
|
|
232
|
-
}),
|
|
232
|
+
}), s = this.on(l.COMPLETE, () => {
|
|
233
233
|
t == null || t.close();
|
|
234
234
|
});
|
|
235
235
|
return this.completion().finally(() => {
|
|
236
|
-
n(),
|
|
236
|
+
n(), s();
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function T(e) {
|
|
241
241
|
return Object.entries(e).map(([t, n]) => {
|
|
242
242
|
if (n == null) return;
|
|
243
|
-
const
|
|
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
|
-
return `${
|
|
247
|
+
return `${s}=${r}`;
|
|
248
248
|
}).filter((t) => t !== void 0).join("&");
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function B(e) {
|
|
251
251
|
const t = e.slice(1);
|
|
252
252
|
return t ? t.split("&").filter(Boolean).reduce(
|
|
253
|
-
(
|
|
254
|
-
const [i, a] =
|
|
255
|
-
return i && (
|
|
253
|
+
(s, r) => {
|
|
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
|
|
261
|
-
const n = JSON.stringify(e),
|
|
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
267
|
), a = crypto.getRandomValues(new Uint8Array(12)), c = await crypto.subtle.encrypt(
|
|
268
268
|
{ name: "AES-GCM", iv: a },
|
|
269
269
|
i,
|
|
270
|
-
|
|
270
|
+
s.encode(n)
|
|
271
271
|
);
|
|
272
272
|
return {
|
|
273
|
-
ciphertext: `${
|
|
274
|
-
key:
|
|
273
|
+
ciphertext: `${E(a)}-${E(c)}`,
|
|
274
|
+
key: E(r)
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
|
-
async function
|
|
278
|
-
const [n,
|
|
277
|
+
async function A({ ciphertext: e, key: t }) {
|
|
278
|
+
const [n, s] = e.split("-"), r = new Uint8Array(
|
|
279
279
|
atob(t).split("").map((w) => w.charCodeAt(0))
|
|
280
|
-
), i =
|
|
280
|
+
), i = u(n), a = u(s), c = await crypto.subtle.importKey(
|
|
281
281
|
"raw",
|
|
282
|
-
|
|
282
|
+
r,
|
|
283
283
|
{ name: "AES-GCM" },
|
|
284
284
|
!1,
|
|
285
285
|
["decrypt"]
|
|
@@ -290,20 +290,20 @@ async function f({ ciphertext: e, key: t }) {
|
|
|
290
290
|
);
|
|
291
291
|
return JSON.parse(h.decode(d));
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function E(e) {
|
|
294
294
|
const t = new Uint8Array(e);
|
|
295
295
|
let n = "";
|
|
296
|
-
for (let
|
|
297
|
-
n += String.fromCharCode(t[
|
|
296
|
+
for (let s = 0; s < t.length; s++)
|
|
297
|
+
n += String.fromCharCode(t[s]);
|
|
298
298
|
return btoa(n);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function u(e) {
|
|
301
301
|
const t = atob(e), n = new Uint8Array(t.length);
|
|
302
|
-
for (let
|
|
303
|
-
n[
|
|
302
|
+
for (let s = 0; s < t.length; s++)
|
|
303
|
+
n[s] = t.charCodeAt(s);
|
|
304
304
|
return n;
|
|
305
305
|
}
|
|
306
|
-
async function
|
|
306
|
+
async function k(e) {
|
|
307
307
|
const t = await fetch(e.url, {
|
|
308
308
|
method: "GET"
|
|
309
309
|
});
|
|
@@ -312,26 +312,26 @@ async function P(e) {
|
|
|
312
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
|
-
const
|
|
315
|
+
const s = {
|
|
316
316
|
id: n.id,
|
|
317
317
|
metadata: n.metadata,
|
|
318
318
|
status: n.status
|
|
319
319
|
};
|
|
320
320
|
if (n.status === "closed")
|
|
321
|
-
return
|
|
322
|
-
const
|
|
323
|
-
ciphertext:
|
|
321
|
+
return s;
|
|
322
|
+
const r = n.sealed[n.sealed.length - 1], i = await A({
|
|
323
|
+
ciphertext: r,
|
|
324
324
|
key: e.key
|
|
325
325
|
});
|
|
326
326
|
return n.status === "completed" ? {
|
|
327
|
-
...
|
|
327
|
+
...s,
|
|
328
328
|
result: i.result
|
|
329
329
|
} : {
|
|
330
|
-
...
|
|
330
|
+
...s,
|
|
331
331
|
tx: i.tx
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
class
|
|
334
|
+
class P {
|
|
335
335
|
constructor(t) {
|
|
336
336
|
o(this, "endpoint");
|
|
337
337
|
this.endpoint = t;
|
|
@@ -344,15 +344,15 @@ class T {
|
|
|
344
344
|
* @returns Promise resolving to connection details including ID, version, and encryption key
|
|
345
345
|
*/
|
|
346
346
|
async create(t, n) {
|
|
347
|
-
const
|
|
347
|
+
const s = await m(t), r = {
|
|
348
348
|
metadata: n,
|
|
349
|
-
sealed:
|
|
349
|
+
sealed: s.ciphertext
|
|
350
350
|
}, i = await fetch(this.endpoint, {
|
|
351
351
|
method: "POST",
|
|
352
352
|
headers: {
|
|
353
353
|
"Content-Type": "application/json"
|
|
354
354
|
},
|
|
355
|
-
body: JSON.stringify(
|
|
355
|
+
body: JSON.stringify(r)
|
|
356
356
|
});
|
|
357
357
|
if (!i.ok)
|
|
358
358
|
throw new Error(`Failed to create connection: ${await i.text()}`);
|
|
@@ -363,7 +363,7 @@ class T {
|
|
|
363
363
|
status: a.status,
|
|
364
364
|
metadata: n,
|
|
365
365
|
data: t,
|
|
366
|
-
key:
|
|
366
|
+
key: s.key
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
@@ -376,11 +376,11 @@ class T {
|
|
|
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(t, n,
|
|
380
|
-
const a = await
|
|
379
|
+
async update(t, n, s, r, i) {
|
|
380
|
+
const a = await m(n, i), c = {
|
|
381
381
|
sealed: a.ciphertext,
|
|
382
|
-
version:
|
|
383
|
-
status:
|
|
382
|
+
version: s,
|
|
383
|
+
status: r
|
|
384
384
|
}, h = await fetch(`${this.endpoint}/${t}`, {
|
|
385
385
|
method: "PATCH",
|
|
386
386
|
headers: {
|
|
@@ -408,20 +408,20 @@ class T {
|
|
|
408
408
|
* @returns Promise resolving to connection details including decrypted data
|
|
409
409
|
*/
|
|
410
410
|
async get(t, n) {
|
|
411
|
-
const
|
|
411
|
+
const s = await fetch(`${this.endpoint}/${t}`, {
|
|
412
412
|
method: "GET"
|
|
413
413
|
});
|
|
414
|
-
if (!
|
|
415
|
-
throw new Error(`Failed to get connection: ${await
|
|
416
|
-
const
|
|
414
|
+
if (!s.ok)
|
|
415
|
+
throw new Error(`Failed to get connection: ${await s.text()}`);
|
|
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
|
});
|
|
420
420
|
return {
|
|
421
|
-
id:
|
|
422
|
-
status:
|
|
423
|
-
version:
|
|
424
|
-
metadata:
|
|
421
|
+
id: r.id,
|
|
422
|
+
status: r.status,
|
|
423
|
+
version: r.version,
|
|
424
|
+
metadata: r.metadata,
|
|
425
425
|
data: a,
|
|
426
426
|
key: n
|
|
427
427
|
};
|
|
@@ -439,7 +439,7 @@ class T {
|
|
|
439
439
|
throw new Error(`Failed to close connection: ${await n.text()}`);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
class
|
|
442
|
+
class F {
|
|
443
443
|
/**
|
|
444
444
|
* Creates a new instance of the Notabene SDK
|
|
445
445
|
*
|
|
@@ -463,15 +463,15 @@ class B {
|
|
|
463
463
|
* @returns component URL
|
|
464
464
|
* @internal
|
|
465
465
|
*/
|
|
466
|
-
componentUrl(t, n,
|
|
466
|
+
componentUrl(t, n, s, r) {
|
|
467
467
|
const i = new URL(this.uxUrl);
|
|
468
468
|
i.pathname = t;
|
|
469
|
-
const a =
|
|
469
|
+
const a = T({
|
|
470
470
|
authToken: this.authToken,
|
|
471
471
|
value: n,
|
|
472
|
-
configuration:
|
|
472
|
+
configuration: s
|
|
473
473
|
});
|
|
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),
|
|
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,11 +483,11 @@ class B {
|
|
|
483
483
|
* @returns A new EmbeddedComponent instance
|
|
484
484
|
* @internal
|
|
485
485
|
*/
|
|
486
|
-
createComponent(t, n,
|
|
487
|
-
return new
|
|
488
|
-
this.componentUrl(t, n,
|
|
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
|
);
|
|
492
492
|
}
|
|
493
493
|
/**
|
|
@@ -498,12 +498,12 @@ class B {
|
|
|
498
498
|
* @param callbacks - Optional callback configuration
|
|
499
499
|
* @returns A new EmbeddedComponent instance for withdrawal assistance
|
|
500
500
|
*/
|
|
501
|
-
createWithdrawalAssist(t, n,
|
|
501
|
+
createWithdrawalAssist(t, n, s) {
|
|
502
502
|
return this.createComponent(
|
|
503
503
|
"withdrawal-assist",
|
|
504
504
|
t,
|
|
505
505
|
n,
|
|
506
|
-
|
|
506
|
+
s
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
509
|
/**
|
|
@@ -515,12 +515,12 @@ class B {
|
|
|
515
515
|
* @returns A new EmbeddedComponent instance for connection
|
|
516
516
|
* @alpha
|
|
517
517
|
*/
|
|
518
|
-
createConnectWallet(t, n,
|
|
518
|
+
createConnectWallet(t, n, s) {
|
|
519
519
|
return this.createComponent(
|
|
520
520
|
"connect",
|
|
521
521
|
t,
|
|
522
522
|
n,
|
|
523
|
-
|
|
523
|
+
s
|
|
524
524
|
);
|
|
525
525
|
}
|
|
526
526
|
/**
|
|
@@ -532,12 +532,12 @@ class B {
|
|
|
532
532
|
* @returns A new EmbeddedComponent instance for deposit requests
|
|
533
533
|
* @public
|
|
534
534
|
*/
|
|
535
|
-
createDepositRequest(t, n,
|
|
535
|
+
createDepositRequest(t, n, s) {
|
|
536
536
|
return this.createComponent(
|
|
537
537
|
"deposit-request",
|
|
538
538
|
t,
|
|
539
539
|
n,
|
|
540
|
-
|
|
540
|
+
s
|
|
541
541
|
);
|
|
542
542
|
}
|
|
543
543
|
/**
|
|
@@ -549,32 +549,33 @@ class B {
|
|
|
549
549
|
* @returns A new EmbeddedComponent instance for deposit assistance
|
|
550
550
|
* @public
|
|
551
551
|
*/
|
|
552
|
-
createDepositAssist(t, n,
|
|
552
|
+
createDepositAssist(t, n, s) {
|
|
553
553
|
return this.createComponent(
|
|
554
554
|
"deposit-assist",
|
|
555
555
|
t,
|
|
556
556
|
n,
|
|
557
|
-
|
|
557
|
+
s
|
|
558
558
|
);
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
export {
|
|
562
|
-
|
|
562
|
+
N as AgentType,
|
|
563
563
|
l as CMType,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
564
|
+
D as CodeVerificationStatus,
|
|
565
|
+
P as ConnectionManager,
|
|
566
|
+
S as EmbeddedComponent,
|
|
567
|
+
C as ErrorIdentifierCode,
|
|
568
568
|
p as HMType,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
B as
|
|
579
|
-
|
|
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
|
|
580
581
|
};
|
package/docs/README.md
CHANGED
|
@@ -348,7 +348,6 @@ const withdrawal = notabene.createWithdrawalAssist(
|
|
|
348
348
|
microTransfer: {
|
|
349
349
|
destination: '0x...',
|
|
350
350
|
amountSubunits: '12344',
|
|
351
|
-
timeout: 86440,
|
|
352
351
|
},
|
|
353
352
|
},
|
|
354
353
|
},
|
|
@@ -716,7 +715,6 @@ const options: TransactionOptions = {
|
|
|
716
715
|
microTransfer: {
|
|
717
716
|
destination: '0x...',
|
|
718
717
|
amountSubunits: '12344',
|
|
719
|
-
timeout: 86440,
|
|
720
718
|
},
|
|
721
719
|
fallbacks: [ProofTypes.Screenshot, ProofTypes.SelfDeclaration], // js ['screenshot','self-declaration']
|
|
722
720
|
deminimis: {
|
|
@@ -788,7 +786,6 @@ withdrawal.update(
|
|
|
788
786
|
microTransfer: {
|
|
789
787
|
destination: '0x...',
|
|
790
788
|
amountSubunits: '12344',
|
|
791
|
-
timeout: 86440,
|
|
792
789
|
},
|
|
793
790
|
},
|
|
794
791
|
},
|
|
@@ -869,7 +866,6 @@ const options: TransactionOptions = {
|
|
|
869
866
|
microTransfer: {
|
|
870
867
|
destination: '0x...',
|
|
871
868
|
amountSubunits: '1234',
|
|
872
|
-
timeout: 86440, // Optional timeout in seconds, which is displayed to the user
|
|
873
869
|
},
|
|
874
870
|
fallbacks: [ProofTypes.Screenshot, ProofTypes.SelfDeclaration], // js ['screenshot','self_declaration']
|
|
875
871
|
},
|
package/package.json
CHANGED
package/src/notabene.ts
CHANGED
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
Status,
|
|
78
78
|
ValidationSections,
|
|
79
79
|
VASPSearchControl,
|
|
80
|
+
WarningIdentifierCode,
|
|
80
81
|
} from './types';
|
|
81
82
|
import { type MessageCallback } from './utils/MessageEventManager';
|
|
82
83
|
import { decodeFragmentToObject, encodeObjectToFragment } from './utils/urls';
|
|
@@ -107,6 +108,7 @@ export {
|
|
|
107
108
|
Status,
|
|
108
109
|
ValidationSections,
|
|
109
110
|
VASPSearchControl,
|
|
111
|
+
WarningIdentifierCode,
|
|
110
112
|
};
|
|
111
113
|
export type {
|
|
112
114
|
Account,
|
package/src/types.ts
CHANGED
|
@@ -491,7 +491,7 @@ export type LegalPersonFields = Partial<{
|
|
|
491
491
|
* @public
|
|
492
492
|
*/
|
|
493
493
|
type OriginatorFields = {
|
|
494
|
-
source?: Source;
|
|
494
|
+
source?: Source | Source[];
|
|
495
495
|
};
|
|
496
496
|
|
|
497
497
|
/**
|
|
@@ -877,7 +877,6 @@ export interface TransactionOptions {
|
|
|
877
877
|
microTransfer?: {
|
|
878
878
|
destination: BlockchainAddress;
|
|
879
879
|
amountSubunits: string;
|
|
880
|
-
timeout?: number; // Time to verify in seconds
|
|
881
880
|
};
|
|
882
881
|
fallbacks?: ProofTypes[];
|
|
883
882
|
deminimis?: ThresholdOptions;
|
|
@@ -955,6 +954,18 @@ export enum ErrorIdentifierCode {
|
|
|
955
954
|
TOKEN_INVALID = 'TOKEN_INVALID',
|
|
956
955
|
}
|
|
957
956
|
|
|
957
|
+
/**
|
|
958
|
+
* Identifier codes for warning messages
|
|
959
|
+
* @public
|
|
960
|
+
*/
|
|
961
|
+
export enum WarningIdentifierCode {
|
|
962
|
+
WALLET_ADDRESS_NOT_CONNECTED = 'WALLET_ADDRESS_NOT_CONNECTED',
|
|
963
|
+
WALLET_LOCKED = 'WALLET_LOCKED',
|
|
964
|
+
WALLET_UNREACHABLE = 'WALLET_UNREACHABLE',
|
|
965
|
+
JURISDICTIONAL_REQUIREMENTS_UNAVAILABLE = 'JURISDICTIONAL_REQUIREMENTS_UNAVAILABLE',
|
|
966
|
+
IDV_UNAVAILABLE = 'IDV_UNAVAILABLE',
|
|
967
|
+
}
|
|
968
|
+
|
|
958
969
|
/**
|
|
959
970
|
* Represents an error component message
|
|
960
971
|
* @param message - Error message
|
|
@@ -994,12 +1005,14 @@ export type InvalidValue<T> = {
|
|
|
994
1005
|
* Represents a warning component message
|
|
995
1006
|
* @param message - Warning message
|
|
996
1007
|
* @param description - Description of the warning message
|
|
1008
|
+
* @param identifier - Identifier code of the warning message
|
|
997
1009
|
* @public
|
|
998
1010
|
*/
|
|
999
1011
|
export type Warning = {
|
|
1000
1012
|
type: CMType.WARNING;
|
|
1001
1013
|
message: string;
|
|
1002
1014
|
description?: string;
|
|
1015
|
+
identifier?: WarningIdentifierCode;
|
|
1003
1016
|
};
|
|
1004
1017
|
|
|
1005
1018
|
/**
|
package/src/utils/arbitraries.ts
CHANGED