@paywithglide/glide-react 0.0.45 → 0.0.46
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/glide.js +110 -116
- package/package.json +1 -1
package/dist/glide.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var te = Object.defineProperty;
|
|
2
|
+
var se = (s, t, e) => t in s ? te(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var W = (s, t, e) => se(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { useMemo as G } from "react";
|
|
5
|
-
function
|
|
5
|
+
function ie(s, { strict: t = !0 } = {}) {
|
|
6
6
|
return !s || typeof s != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(s) : s.startsWith("0x");
|
|
7
7
|
}
|
|
8
8
|
function q(s) {
|
|
9
|
-
return
|
|
9
|
+
return ie(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
let
|
|
11
|
+
const V = "2.21.51";
|
|
12
|
+
let L = {
|
|
13
13
|
getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
|
|
14
|
-
version: `viem@${
|
|
14
|
+
version: `viem@${V}`
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class A extends Error {
|
|
17
17
|
constructor(t, e = {}) {
|
|
18
18
|
var d;
|
|
19
19
|
const i = (() => {
|
|
20
20
|
var a;
|
|
21
|
-
return e.cause instanceof
|
|
22
|
-
})(), o = e.cause instanceof
|
|
21
|
+
return e.cause instanceof A ? e.cause.details : (a = e.cause) != null && a.message ? e.cause.message : e.details;
|
|
22
|
+
})(), o = e.cause instanceof A && e.cause.docsPath || e.docsPath, n = (d = L.getDocsUrl) == null ? void 0 : d.call(L, { ...e, docsPath: o }), c = [
|
|
23
23
|
t || "An error occurred.",
|
|
24
24
|
"",
|
|
25
25
|
...e.metaMessages ? [...e.metaMessages, ""] : [],
|
|
26
26
|
...n ? [`Docs: ${n}`] : [],
|
|
27
27
|
...i ? [`Details: ${i}`] : [],
|
|
28
|
-
...
|
|
28
|
+
...L.version ? [`Version: ${L.version}`] : []
|
|
29
29
|
].join(`
|
|
30
30
|
`);
|
|
31
31
|
super(c, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
@@ -58,40 +58,40 @@ class D extends Error {
|
|
|
58
58
|
configurable: !0,
|
|
59
59
|
writable: !0,
|
|
60
60
|
value: "BaseError"
|
|
61
|
-
}), this.details = i, this.docsPath = o, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version =
|
|
61
|
+
}), this.details = i, this.docsPath = o, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = V;
|
|
62
62
|
}
|
|
63
63
|
walk(t) {
|
|
64
|
-
return
|
|
64
|
+
return F(this, t);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ?
|
|
67
|
+
function F(s, t) {
|
|
68
|
+
return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? F(s.cause, t) : t ? null : s;
|
|
69
69
|
}
|
|
70
|
-
class
|
|
70
|
+
class J extends A {
|
|
71
71
|
constructor({ size: t, targetSize: e, type: i }) {
|
|
72
72
|
super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${t}) exceeds padding size (${e}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
function H(s, { dir: t, size: e = 32 } = {}) {
|
|
76
|
-
return typeof s == "string" ?
|
|
76
|
+
return typeof s == "string" ? oe(s, { dir: t, size: e }) : ne(s, { dir: t, size: e });
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function oe(s, { dir: t, size: e = 32 } = {}) {
|
|
79
79
|
if (e === null)
|
|
80
80
|
return s;
|
|
81
81
|
const i = s.replace("0x", "");
|
|
82
82
|
if (i.length > e * 2)
|
|
83
|
-
throw new
|
|
83
|
+
throw new J({
|
|
84
84
|
size: Math.ceil(i.length / 2),
|
|
85
85
|
targetSize: e,
|
|
86
86
|
type: "hex"
|
|
87
87
|
});
|
|
88
88
|
return `0x${i[t === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function ne(s, { dir: t, size: e = 32 } = {}) {
|
|
91
91
|
if (e === null)
|
|
92
92
|
return s;
|
|
93
93
|
if (s.length > e)
|
|
94
|
-
throw new
|
|
94
|
+
throw new J({
|
|
95
95
|
size: s.length,
|
|
96
96
|
targetSize: e,
|
|
97
97
|
type: "bytes"
|
|
@@ -103,46 +103,46 @@ function oe(s, { dir: t, size: e = 32 } = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
return i;
|
|
105
105
|
}
|
|
106
|
-
class
|
|
106
|
+
class re extends A {
|
|
107
107
|
constructor({ max: t, min: e, signed: i, size: o, value: n }) {
|
|
108
108
|
super(`Number "${n}" is not in safe ${o ? `${o * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${e} to ${t})` : `(above ${e})`}`, { name: "IntegerOutOfRangeError" });
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
class
|
|
111
|
+
class ae extends A {
|
|
112
112
|
constructor({ givenSize: t, maxSize: e }) {
|
|
113
113
|
super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function _(s, { size: t }) {
|
|
117
117
|
if (q(s) > t)
|
|
118
|
-
throw new
|
|
118
|
+
throw new ae({
|
|
119
119
|
givenSize: q(s),
|
|
120
120
|
maxSize: t
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
function de(s, t = {}) {
|
|
125
|
-
return typeof s == "number" || typeof s == "bigint" ? pe(s, t) : typeof s == "string" ? he(s, t) : typeof s == "boolean" ? ce(s, t) : X(s, t);
|
|
126
|
-
}
|
|
123
|
+
const de = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
|
|
127
124
|
function ce(s, t = {}) {
|
|
125
|
+
return typeof s == "number" || typeof s == "bigint" ? le(s, t) : typeof s == "string" ? ue(s, t) : typeof s == "boolean" ? pe(s, t) : X(s, t);
|
|
126
|
+
}
|
|
127
|
+
function pe(s, t = {}) {
|
|
128
128
|
const e = `0x${Number(s)}`;
|
|
129
|
-
return typeof t.size == "number" ? (
|
|
129
|
+
return typeof t.size == "number" ? (_(e, { size: t.size }), H(e, { size: t.size })) : e;
|
|
130
130
|
}
|
|
131
131
|
function X(s, t = {}) {
|
|
132
132
|
let e = "";
|
|
133
133
|
for (let o = 0; o < s.length; o++)
|
|
134
|
-
e +=
|
|
134
|
+
e += de[s[o]];
|
|
135
135
|
const i = `0x${e}`;
|
|
136
|
-
return typeof t.size == "number" ? (
|
|
136
|
+
return typeof t.size == "number" ? (_(i, { size: t.size }), H(i, { dir: "right", size: t.size })) : i;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function le(s, t = {}) {
|
|
139
139
|
const { signed: e, size: i } = t, o = BigInt(s);
|
|
140
140
|
let n;
|
|
141
141
|
i ? e ? n = (1n << BigInt(i) * 8n - 1n) - 1n : n = 2n ** (BigInt(i) * 8n) - 1n : typeof s == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
|
|
142
142
|
const c = typeof n == "bigint" && e ? -n - 1n : 0;
|
|
143
143
|
if (n && o > n || o < c) {
|
|
144
144
|
const a = typeof s == "bigint" ? "n" : "";
|
|
145
|
-
throw new
|
|
145
|
+
throw new re({
|
|
146
146
|
max: n ? `${n}${a}` : void 0,
|
|
147
147
|
min: `${c}${a}`,
|
|
148
148
|
signed: e,
|
|
@@ -153,19 +153,19 @@ function pe(s, t = {}) {
|
|
|
153
153
|
const d = `0x${(e && o < 0 ? (1n << BigInt(i * 8)) + BigInt(o) : o).toString(16)}`;
|
|
154
154
|
return i ? H(d, { size: i }) : d;
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
const e =
|
|
156
|
+
const he = /* @__PURE__ */ new TextEncoder();
|
|
157
|
+
function ue(s, t = {}) {
|
|
158
|
+
const e = he.encode(s);
|
|
159
159
|
return X(e, t);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function me(s) {
|
|
162
162
|
return s instanceof Error;
|
|
163
163
|
}
|
|
164
|
-
let
|
|
165
|
-
function
|
|
166
|
-
if (
|
|
164
|
+
let N = !1;
|
|
165
|
+
function ge(s) {
|
|
166
|
+
if (N)
|
|
167
167
|
return;
|
|
168
|
-
|
|
168
|
+
N = !0;
|
|
169
169
|
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = (c) => {
|
|
170
170
|
const d = c.detail;
|
|
171
171
|
t.has(d.info.uuid) || t.set(d.info.uuid, d);
|
|
@@ -212,7 +212,7 @@ function me(s) {
|
|
|
212
212
|
});
|
|
213
213
|
i.delete(r), n(r, { result: u });
|
|
214
214
|
} catch (u) {
|
|
215
|
-
i.delete(r),
|
|
215
|
+
i.delete(r), me(u) ? n(r, {
|
|
216
216
|
error: u.message || String(u),
|
|
217
217
|
code: u.code,
|
|
218
218
|
data: u.data
|
|
@@ -273,23 +273,23 @@ function me(s) {
|
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
const
|
|
277
|
-
name:
|
|
278
|
-
version:
|
|
279
|
-
type:
|
|
280
|
-
files:
|
|
281
|
-
module:
|
|
282
|
-
types:
|
|
283
|
-
exports:
|
|
276
|
+
const fe = "@paywithglide/glide-react", ye = "0.0.46", we = "module", ve = ["dist"], be = "dist/glide.js", $e = "dist/index.d.ts", Ie = { ".": { types: "./dist/index.d.ts", default: "./dist/glide.js" }, "./package.json": "./package.json" }, xe = !1, Se = { dev: "vite", build: "bun run lint && vite build", "build-web": "tsc --p ./tsconfig.build.json && vite build --mode web", "build-chromeext": "tsc --p ./tsconfig.build.json && vite build --mode chromeext:popup && vite build --mode chromeext:content && vite build --mode chromeext:background", lint: "prettier --check . && eslint . --max-warnings 0 && tsc --p ./tsconfig.build.json", preview: "vite preview", prepublishOnly: "bun run build" }, Pe = { "@paywithglide/glide-js": "0.13.10" }, Ee = { "@antiwork/shortest": "^0.2.1", "@eslint/js": "^9.15.0", "@tanstack/react-query": "^5.61.5", "@types/chrome": "^0.0.299", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", eslint: "^9.15.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.14", globals: "^15.12.0", prettier: "^3.6.2", react: "^18.3.1", "react-dom": "^18.3.1", typescript: "~5.6.2", "typescript-eslint": "^8.15.0", viem: "^2.21.51", vite: "^6.0.1", "vite-plugin-dts": "^4.3.0", "vite-plugin-static-copy": "^2.2.0", wagmi: "^2.13.0" }, ke = {
|
|
277
|
+
name: fe,
|
|
278
|
+
version: ye,
|
|
279
|
+
type: we,
|
|
280
|
+
files: ve,
|
|
281
|
+
module: be,
|
|
282
|
+
types: $e,
|
|
283
|
+
exports: Ie,
|
|
284
284
|
sideEffects: xe,
|
|
285
|
-
scripts:
|
|
286
|
-
dependencies:
|
|
287
|
-
devDependencies:
|
|
288
|
-
},
|
|
285
|
+
scripts: Se,
|
|
286
|
+
dependencies: Pe,
|
|
287
|
+
devDependencies: Ee
|
|
288
|
+
}, Ue = ke.version, K = 999999;
|
|
289
289
|
class O {
|
|
290
290
|
constructor(t) {
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
W(this, "opts");
|
|
292
|
+
W(this, "open", () => {
|
|
293
293
|
if (!(!this.opts.container && document.body.classList.contains("glide-deposit-open"))) {
|
|
294
294
|
if (this.opts.container || document.body.classList.add("glide-deposit-open"), (this.opts.mode === "deposit" || this.opts.mode === "buy") && !this.opts.recipient)
|
|
295
295
|
throw new Error("recipient is required for deposit/buy mode");
|
|
@@ -300,21 +300,21 @@ class O {
|
|
|
300
300
|
this.openUrl(`${this.baseUrl}${this.opts.app}?init=true&embed=true`), this.initialize();
|
|
301
301
|
}
|
|
302
302
|
});
|
|
303
|
-
|
|
304
|
-
var i, o, n, c, d, a, f, p, r, h, l, m, u, g, $, y,
|
|
303
|
+
W(this, "iframeEventHandler", async (t) => {
|
|
304
|
+
var i, o, n, c, d, a, f, p, r, h, l, m, u, g, $, y, I, w, x, v, S, E, k, U, M, C, P, z, j, T, R, B, D;
|
|
305
305
|
const e = t.data;
|
|
306
306
|
switch (e.type) {
|
|
307
307
|
case "sendInit": {
|
|
308
|
-
const b = this.opts.recipient,
|
|
308
|
+
const b = this.opts.recipient, Z = (i = this.opts.walletProvider) == null ? void 0 : i.address, Q = (o = this.opts.walletProvider) == null ? void 0 : o.availableChainIds, Y = (n = this.opts.walletProvider) == null ? void 0 : n.currentChainId, ee = this.opts.preferGaslessPayment || !!((c = this.opts.walletProvider) != null && c.signTypedDataAsync);
|
|
309
309
|
(f = (d = this.iframe) == null ? void 0 : d.contentWindow) == null || f.postMessage(
|
|
310
310
|
{
|
|
311
311
|
type: "initialize",
|
|
312
312
|
sessionId: this.opts.sessionId,
|
|
313
313
|
recipient: b,
|
|
314
|
-
connectedWalletAddress:
|
|
315
|
-
availableChainIds:
|
|
316
|
-
currentChainId:
|
|
317
|
-
preferGaslessPayment:
|
|
314
|
+
connectedWalletAddress: Z,
|
|
315
|
+
availableChainIds: Q,
|
|
316
|
+
currentChainId: Y,
|
|
317
|
+
preferGaslessPayment: ee,
|
|
318
318
|
chainIds: this.opts.chainIds,
|
|
319
319
|
excludeChainIds: this.opts.excludeChainIds,
|
|
320
320
|
excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
|
|
@@ -348,7 +348,7 @@ class O {
|
|
|
348
348
|
debug: this.opts.debug,
|
|
349
349
|
popupsBlocked: this.opts.popupsBlocked,
|
|
350
350
|
gasRefuelAmountPerChain: this.opts.gasRefuelAmountPerChain,
|
|
351
|
-
sdkVersion:
|
|
351
|
+
sdkVersion: Ue,
|
|
352
352
|
referrerDomain: typeof window < "u" ? window.location.origin : void 0
|
|
353
353
|
},
|
|
354
354
|
new URL(this.baseUrl).origin
|
|
@@ -403,10 +403,10 @@ class O {
|
|
|
403
403
|
($ = (g = this.opts) == null ? void 0 : g.onSuccess) == null || $.call(g, e.hash, e.session);
|
|
404
404
|
break;
|
|
405
405
|
case "close":
|
|
406
|
-
this.removeIframe(), this.destroy(), (
|
|
406
|
+
this.removeIframe(), this.destroy(), (I = (y = this.opts) == null ? void 0 : y.onClose) == null || I.call(y);
|
|
407
407
|
break;
|
|
408
408
|
case "setMode":
|
|
409
|
-
(
|
|
409
|
+
(x = (w = this.opts) == null ? void 0 : w.onSetMode) == null || x.call(w, e.mode);
|
|
410
410
|
break;
|
|
411
411
|
case "switchChain":
|
|
412
412
|
if (!this.opts.walletProvider)
|
|
@@ -489,7 +489,7 @@ class O {
|
|
|
489
489
|
this.baseUrl
|
|
490
490
|
);
|
|
491
491
|
} catch (b) {
|
|
492
|
-
(
|
|
492
|
+
(D = (B = this.iframe) == null ? void 0 : B.contentWindow) == null || D.postMessage(
|
|
493
493
|
{
|
|
494
494
|
type: "didSignTypedData",
|
|
495
495
|
success: !1,
|
|
@@ -506,14 +506,14 @@ class O {
|
|
|
506
506
|
}
|
|
507
507
|
get externalUrl() {
|
|
508
508
|
var t, e, i, o, n, c, d, a, f;
|
|
509
|
-
return `${this.baseUrl}${this.opts.app}?${this.opts.recipient ? `&recipient=${this.opts.recipient}` : ""}${this.opts.preferGaslessPayment ? "&preferGaslessPayment=true" : ""}${this.opts.mode ? `&mode=${this.opts.mode}` : ""}${this.opts.amount ? `&amount=${this.opts.amount}` : ""}${this.opts.chainId ? `&chainId=${this.opts.chainId}` : ""}${this.opts.currencyId ? `¤cyId=${this.opts.currencyId}` : ""}${this.opts.evm ? `&evm.chainId=${this.opts.evm.chainId}&evm.to=${this.opts.evm.to}&evm.data=${this.opts.evm.data || "0x0"}&evm.value=${
|
|
509
|
+
return `${this.baseUrl}${this.opts.app}?${this.opts.recipient ? `&recipient=${this.opts.recipient}` : ""}${this.opts.preferGaslessPayment ? "&preferGaslessPayment=true" : ""}${this.opts.mode ? `&mode=${this.opts.mode}` : ""}${this.opts.amount ? `&amount=${this.opts.amount}` : ""}${this.opts.chainId ? `&chainId=${this.opts.chainId}` : ""}${this.opts.currencyId ? `¤cyId=${this.opts.currencyId}` : ""}${this.opts.evm ? `&evm.chainId=${this.opts.evm.chainId}&evm.to=${this.opts.evm.to}&evm.data=${this.opts.evm.data || "0x0"}&evm.value=${ce(
|
|
510
510
|
this.opts.evm.value || 0n
|
|
511
511
|
)}` : ""}${this.opts.approval ? `&approval.token=${this.opts.approval.token}&approval.amount=${this.opts.approval.amount}` : ""}${this.opts.sessionMetadata ? `&metadata=${this.opts.sessionMetadata}` : ""}${this.opts.autoCloseOnSuccess ? "&autoCloseOnSuccess=true" : ""}${this.opts.sessionId ? `&sessionId=${this.opts.sessionId}` : ""}${(t = this.opts.chainIds) != null && t.length ? `&chainIds=${this.opts.chainIds.join(",")}` : ""}${(e = this.opts.excludeChainIds) != null && e.length ? `&excludeChainIds=${this.opts.excludeChainIds.join(",")}` : ""}${(i = this.opts.excludeCurrencyTiers) != null && i.length ? `&excludeCurrencyTiers=${this.opts.excludeCurrencyTiers.join(",")}` : ""}${(o = this.opts.excludeFundingSources) != null && o.length ? `&excludeFundingSources=${this.opts.excludeFundingSources.join(",")}` : ""}${(n = this.opts.fundingSources) != null && n.length ? `&fundingSources=${this.opts.fundingSources.join(",")}` : ""}${(c = this.opts.allowedPaymentCurrencies) != null && c.length ? `&allowedPaymentCurrencies=${this.opts.allowedPaymentCurrencies.join(",")}` : ""}${(d = this.opts.appMetadata) != null && d.name ? `&appMetadata.name=${encodeURIComponent(this.opts.appMetadata.name)}` : ""}${(a = this.opts.appMetadata) != null && a.logoUrl ? `&appMetadata.logoUrl=${encodeURIComponent(this.opts.appMetadata.logoUrl)}` : ""}${(f = this.opts.appMetadata) != null && f.faviconUrl ? `&appMetadata.faviconUrl=${encodeURIComponent(this.opts.appMetadata.faviconUrl)}` : ""}${this.opts.enableRefundEmails ? "&enableRefundEmails=true" : ""}${this.opts.payerEmail ? `&payerEmail=${encodeURIComponent(this.opts.payerEmail)}` : ""}${this.opts.debug ? "&debug=true" : ""}${this.opts.popupsBlocked ? "&popupsBlocked=true" : ""}${this.opts.disableWithdrawToSelfSuggestion ? "&disableWithdrawToSelfSuggestion=true" : ""}${this.opts.hideSettlementCopy ? "&hideSettlementCopy=true" : ""}${this.opts.showAppLogo ? `&showAppLogo=${this.opts.showAppLogo}` : ""}${this.opts.showOnrampFirst ? "&showOnrampFirst=true" : ""}${this.opts.debitCardAlias ? `&debitCardAlias=${this.opts.debitCardAlias}` : ""}${this.opts.copyOverrides ? `©Overrides=${encodeURIComponent(JSON.stringify(this.opts.copyOverrides))}` : ""}${this.opts.stableDepositAddressKey ? `&stableDepositAddressKey=${encodeURIComponent(this.opts.stableDepositAddressKey)}` : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
|
|
512
512
|
}
|
|
513
513
|
initialize() {
|
|
514
514
|
window.addEventListener("message", this.iframeEventHandler);
|
|
515
515
|
const t = new URL(this.baseUrl).origin;
|
|
516
|
-
|
|
516
|
+
ge(t);
|
|
517
517
|
}
|
|
518
518
|
destroy() {
|
|
519
519
|
window.removeEventListener("message", this.iframeEventHandler);
|
|
@@ -543,21 +543,15 @@ class O {
|
|
|
543
543
|
this.removeIframe();
|
|
544
544
|
const e = document.createElement("iframe");
|
|
545
545
|
e.id = "glide-deposit-iframe";
|
|
546
|
-
const i = this.opts.container;
|
|
547
|
-
i ? e.
|
|
548
|
-
"style",
|
|
549
|
-
"z-index: 2147483647; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: relative; width: 100%; height: 100%; opacity: 0;"
|
|
550
|
-
) : e.setAttribute(
|
|
551
|
-
"style",
|
|
552
|
-
"z-index: 2147483647; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; opacity: 0;"
|
|
553
|
-
), e.src = t, e.allow = "payment *; clipboard-write *", i ? i.appendChild(e) : document.body.appendChild(e);
|
|
546
|
+
const i = this.opts.container, o = i ? `z-index: ${K}; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: relative; width: 100%; height: 100%; opacity: 0;` : `z-index: ${K}; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; opacity: 0;`;
|
|
547
|
+
e.setAttribute("style", o), e.src = t, e.allow = "payment *; clipboard-write *", i ? i.appendChild(e) : document.body.appendChild(e);
|
|
554
548
|
}
|
|
555
549
|
removeIframe() {
|
|
556
550
|
const t = document.getElementById("glide-deposit-iframe");
|
|
557
551
|
t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
|
|
558
552
|
}
|
|
559
553
|
}
|
|
560
|
-
const
|
|
554
|
+
const De = ({
|
|
561
555
|
app: s,
|
|
562
556
|
recipient: t,
|
|
563
557
|
chainId: e,
|
|
@@ -577,9 +571,9 @@ const Ce = ({
|
|
|
577
571
|
hideSettlementCopy: g,
|
|
578
572
|
showAppLogo: $,
|
|
579
573
|
showOnrampFirst: y,
|
|
580
|
-
debitCardAlias:
|
|
574
|
+
debitCardAlias: I,
|
|
581
575
|
copyOverrides: w,
|
|
582
|
-
stableDepositAddressKey:
|
|
576
|
+
stableDepositAddressKey: x,
|
|
583
577
|
sessionId: v,
|
|
584
578
|
sessionMetadata: S,
|
|
585
579
|
disableWithdrawToSelfSuggestion: E,
|
|
@@ -594,7 +588,7 @@ const Ce = ({
|
|
|
594
588
|
baseUrl: R,
|
|
595
589
|
debug: B
|
|
596
590
|
}) => {
|
|
597
|
-
const
|
|
591
|
+
const D = G(() => new O({
|
|
598
592
|
app: s,
|
|
599
593
|
recipient: t,
|
|
600
594
|
chainId: e,
|
|
@@ -614,9 +608,9 @@ const Ce = ({
|
|
|
614
608
|
hideSettlementCopy: g,
|
|
615
609
|
showAppLogo: $,
|
|
616
610
|
showOnrampFirst: y,
|
|
617
|
-
debitCardAlias:
|
|
611
|
+
debitCardAlias: I,
|
|
618
612
|
copyOverrides: w,
|
|
619
|
-
stableDepositAddressKey:
|
|
613
|
+
stableDepositAddressKey: x,
|
|
620
614
|
sessionId: v,
|
|
621
615
|
sessionMetadata: S,
|
|
622
616
|
disableWithdrawToSelfSuggestion: E,
|
|
@@ -650,9 +644,9 @@ const Ce = ({
|
|
|
650
644
|
g,
|
|
651
645
|
$,
|
|
652
646
|
y,
|
|
653
|
-
x,
|
|
654
|
-
w,
|
|
655
647
|
I,
|
|
648
|
+
w,
|
|
649
|
+
x,
|
|
656
650
|
v,
|
|
657
651
|
S,
|
|
658
652
|
E,
|
|
@@ -668,9 +662,9 @@ const Ce = ({
|
|
|
668
662
|
B
|
|
669
663
|
]);
|
|
670
664
|
return {
|
|
671
|
-
openGlideDeposit:
|
|
672
|
-
externalUrl:
|
|
673
|
-
opts:
|
|
665
|
+
openGlideDeposit: D.open,
|
|
666
|
+
externalUrl: D.externalUrl,
|
|
667
|
+
opts: D.opts
|
|
674
668
|
};
|
|
675
669
|
}, Ae = ({
|
|
676
670
|
app: s,
|
|
@@ -692,9 +686,9 @@ const Ce = ({
|
|
|
692
686
|
amount: g,
|
|
693
687
|
sessionId: $,
|
|
694
688
|
sessionMetadata: y,
|
|
695
|
-
theme:
|
|
689
|
+
theme: I,
|
|
696
690
|
walletProvider: w,
|
|
697
|
-
localStorageProvider:
|
|
691
|
+
localStorageProvider: x,
|
|
698
692
|
onOpen: v,
|
|
699
693
|
onSuccess: S,
|
|
700
694
|
onClose: E,
|
|
@@ -724,9 +718,9 @@ const Ce = ({
|
|
|
724
718
|
sessionId: $,
|
|
725
719
|
amount: g,
|
|
726
720
|
sessionMetadata: y,
|
|
727
|
-
theme:
|
|
721
|
+
theme: I,
|
|
728
722
|
walletProvider: w,
|
|
729
|
-
localStorageProvider:
|
|
723
|
+
localStorageProvider: x,
|
|
730
724
|
onOpen: v,
|
|
731
725
|
onSuccess: S,
|
|
732
726
|
onClose: E,
|
|
@@ -754,9 +748,9 @@ const Ce = ({
|
|
|
754
748
|
$,
|
|
755
749
|
g,
|
|
756
750
|
y,
|
|
757
|
-
x,
|
|
758
|
-
w,
|
|
759
751
|
I,
|
|
752
|
+
w,
|
|
753
|
+
x,
|
|
760
754
|
v,
|
|
761
755
|
S,
|
|
762
756
|
E,
|
|
@@ -770,7 +764,7 @@ const Ce = ({
|
|
|
770
764
|
externalUrl: P.externalUrl,
|
|
771
765
|
opts: P.opts
|
|
772
766
|
};
|
|
773
|
-
},
|
|
767
|
+
}, ze = ({
|
|
774
768
|
app: s,
|
|
775
769
|
evm: t,
|
|
776
770
|
approval: e,
|
|
@@ -790,9 +784,9 @@ const Ce = ({
|
|
|
790
784
|
onOpen: g,
|
|
791
785
|
onSuccess: $,
|
|
792
786
|
onClose: y,
|
|
793
|
-
autoCloseOnSuccess:
|
|
787
|
+
autoCloseOnSuccess: I,
|
|
794
788
|
popupsBlocked: w,
|
|
795
|
-
baseUrl:
|
|
789
|
+
baseUrl: x,
|
|
796
790
|
debug: v
|
|
797
791
|
}) => {
|
|
798
792
|
const S = G(() => new O({
|
|
@@ -816,9 +810,9 @@ const Ce = ({
|
|
|
816
810
|
onOpen: g,
|
|
817
811
|
onSuccess: $,
|
|
818
812
|
onClose: y,
|
|
819
|
-
autoCloseOnSuccess:
|
|
813
|
+
autoCloseOnSuccess: I,
|
|
820
814
|
popupsBlocked: w,
|
|
821
|
-
baseUrl:
|
|
815
|
+
baseUrl: x,
|
|
822
816
|
debug: v
|
|
823
817
|
}), [
|
|
824
818
|
s,
|
|
@@ -840,9 +834,9 @@ const Ce = ({
|
|
|
840
834
|
g,
|
|
841
835
|
$,
|
|
842
836
|
y,
|
|
843
|
-
x,
|
|
844
|
-
w,
|
|
845
837
|
I,
|
|
838
|
+
w,
|
|
839
|
+
x,
|
|
846
840
|
v
|
|
847
841
|
]);
|
|
848
842
|
return {
|
|
@@ -850,7 +844,7 @@ const Ce = ({
|
|
|
850
844
|
externalUrl: S.externalUrl,
|
|
851
845
|
opts: S.opts
|
|
852
846
|
};
|
|
853
|
-
},
|
|
847
|
+
}, je = ({
|
|
854
848
|
app: s,
|
|
855
849
|
recipient: t,
|
|
856
850
|
chainId: e,
|
|
@@ -870,9 +864,9 @@ const Ce = ({
|
|
|
870
864
|
localStorageProvider: g,
|
|
871
865
|
onOpen: $,
|
|
872
866
|
onSuccess: y,
|
|
873
|
-
onClose:
|
|
867
|
+
onClose: I,
|
|
874
868
|
autoCloseOnSuccess: w,
|
|
875
|
-
baseUrl:
|
|
869
|
+
baseUrl: x
|
|
876
870
|
}) => {
|
|
877
871
|
const v = G(() => new O({
|
|
878
872
|
app: s,
|
|
@@ -895,9 +889,9 @@ const Ce = ({
|
|
|
895
889
|
localStorageProvider: g,
|
|
896
890
|
onOpen: $,
|
|
897
891
|
onSuccess: y,
|
|
898
|
-
onClose:
|
|
892
|
+
onClose: I,
|
|
899
893
|
autoCloseOnSuccess: w,
|
|
900
|
-
baseUrl:
|
|
894
|
+
baseUrl: x
|
|
901
895
|
}), [
|
|
902
896
|
s,
|
|
903
897
|
t,
|
|
@@ -918,16 +912,16 @@ const Ce = ({
|
|
|
918
912
|
g,
|
|
919
913
|
$,
|
|
920
914
|
y,
|
|
921
|
-
|
|
915
|
+
I,
|
|
922
916
|
w,
|
|
923
|
-
|
|
917
|
+
x
|
|
924
918
|
]);
|
|
925
919
|
return {
|
|
926
920
|
openGlideBuy: v.open,
|
|
927
921
|
externalUrl: v.externalUrl,
|
|
928
922
|
opts: v.opts
|
|
929
923
|
};
|
|
930
|
-
},
|
|
924
|
+
}, Te = Object.freeze({
|
|
931
925
|
getItem: (s) => new Promise((t, e) => {
|
|
932
926
|
try {
|
|
933
927
|
const i = localStorage.getItem(s);
|
|
@@ -961,10 +955,10 @@ const Ce = ({
|
|
|
961
955
|
});
|
|
962
956
|
export {
|
|
963
957
|
O as GlideDeposit,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
958
|
+
Te as browserLocalStorageProvider,
|
|
959
|
+
ge as initializeParentBridge,
|
|
960
|
+
je as useGlideBuy,
|
|
961
|
+
ze as useGlideCall,
|
|
962
|
+
De as useGlideDeposit,
|
|
969
963
|
Ae as useGlidePay
|
|
970
964
|
};
|