@paywithglide/glide-react 0.0.46 → 0.0.48
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 +40 -0
- package/dist/core.d.ts +2 -0
- package/dist/core.js +797 -0
- package/dist/glide.js +360 -927
- package/dist/pkg/GlideDeposit.d.ts +27 -1
- package/dist/pkg/analytics.d.ts +220 -0
- package/dist/pkg/core.d.ts +5 -0
- package/dist/pkg/index.d.ts +1 -0
- package/dist/pkg/useGlideBuy.d.ts +3 -2
- package/dist/pkg/useGlideCall.d.ts +3 -2
- package/dist/pkg/useGlideDeposit.d.ts +3 -2
- package/dist/pkg/useGlidePay.d.ts +3 -2
- package/package.json +11 -2
- /package/dist/{index.d.ts → glide.d.ts} +0 -0
package/dist/glide.js
CHANGED
|
@@ -1,964 +1,397 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}), Object.defineProperty(this, "metaMessages", {
|
|
42
|
-
enumerable: !0,
|
|
43
|
-
configurable: !0,
|
|
44
|
-
writable: !0,
|
|
45
|
-
value: void 0
|
|
46
|
-
}), Object.defineProperty(this, "shortMessage", {
|
|
47
|
-
enumerable: !0,
|
|
48
|
-
configurable: !0,
|
|
49
|
-
writable: !0,
|
|
50
|
-
value: void 0
|
|
51
|
-
}), Object.defineProperty(this, "version", {
|
|
52
|
-
enumerable: !0,
|
|
53
|
-
configurable: !0,
|
|
54
|
-
writable: !0,
|
|
55
|
-
value: void 0
|
|
56
|
-
}), Object.defineProperty(this, "name", {
|
|
57
|
-
enumerable: !0,
|
|
58
|
-
configurable: !0,
|
|
59
|
-
writable: !0,
|
|
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 = V;
|
|
62
|
-
}
|
|
63
|
-
walk(t) {
|
|
64
|
-
return F(this, t);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
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
|
-
}
|
|
70
|
-
class J extends A {
|
|
71
|
-
constructor({ size: t, targetSize: e, type: i }) {
|
|
72
|
-
super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${t}) exceeds padding size (${e}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function H(s, { dir: t, size: e = 32 } = {}) {
|
|
76
|
-
return typeof s == "string" ? oe(s, { dir: t, size: e }) : ne(s, { dir: t, size: e });
|
|
77
|
-
}
|
|
78
|
-
function oe(s, { dir: t, size: e = 32 } = {}) {
|
|
79
|
-
if (e === null)
|
|
80
|
-
return s;
|
|
81
|
-
const i = s.replace("0x", "");
|
|
82
|
-
if (i.length > e * 2)
|
|
83
|
-
throw new J({
|
|
84
|
-
size: Math.ceil(i.length / 2),
|
|
85
|
-
targetSize: e,
|
|
86
|
-
type: "hex"
|
|
87
|
-
});
|
|
88
|
-
return `0x${i[t === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
|
|
89
|
-
}
|
|
90
|
-
function ne(s, { dir: t, size: e = 32 } = {}) {
|
|
91
|
-
if (e === null)
|
|
92
|
-
return s;
|
|
93
|
-
if (s.length > e)
|
|
94
|
-
throw new J({
|
|
95
|
-
size: s.length,
|
|
96
|
-
targetSize: e,
|
|
97
|
-
type: "bytes"
|
|
98
|
-
});
|
|
99
|
-
const i = new Uint8Array(e);
|
|
100
|
-
for (let o = 0; o < e; o++) {
|
|
101
|
-
const n = t === "right";
|
|
102
|
-
i[n ? o : e - o - 1] = s[n ? o : s.length - o - 1];
|
|
103
|
-
}
|
|
104
|
-
return i;
|
|
105
|
-
}
|
|
106
|
-
class re extends A {
|
|
107
|
-
constructor({ max: t, min: e, signed: i, size: o, value: n }) {
|
|
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
|
-
}
|
|
110
|
-
}
|
|
111
|
-
class ae extends A {
|
|
112
|
-
constructor({ givenSize: t, maxSize: e }) {
|
|
113
|
-
super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function _(s, { size: t }) {
|
|
117
|
-
if (q(s) > t)
|
|
118
|
-
throw new ae({
|
|
119
|
-
givenSize: q(s),
|
|
120
|
-
maxSize: t
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
const de = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
|
|
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
|
-
const e = `0x${Number(s)}`;
|
|
129
|
-
return typeof t.size == "number" ? (_(e, { size: t.size }), H(e, { size: t.size })) : e;
|
|
130
|
-
}
|
|
131
|
-
function X(s, t = {}) {
|
|
132
|
-
let e = "";
|
|
133
|
-
for (let o = 0; o < s.length; o++)
|
|
134
|
-
e += de[s[o]];
|
|
135
|
-
const i = `0x${e}`;
|
|
136
|
-
return typeof t.size == "number" ? (_(i, { size: t.size }), H(i, { dir: "right", size: t.size })) : i;
|
|
137
|
-
}
|
|
138
|
-
function le(s, t = {}) {
|
|
139
|
-
const { signed: e, size: i } = t, o = BigInt(s);
|
|
140
|
-
let n;
|
|
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
|
-
const c = typeof n == "bigint" && e ? -n - 1n : 0;
|
|
143
|
-
if (n && o > n || o < c) {
|
|
144
|
-
const a = typeof s == "bigint" ? "n" : "";
|
|
145
|
-
throw new re({
|
|
146
|
-
max: n ? `${n}${a}` : void 0,
|
|
147
|
-
min: `${c}${a}`,
|
|
148
|
-
signed: e,
|
|
149
|
-
size: i,
|
|
150
|
-
value: `${s}${a}`
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
const d = `0x${(e && o < 0 ? (1n << BigInt(i * 8)) + BigInt(o) : o).toString(16)}`;
|
|
154
|
-
return i ? H(d, { size: i }) : d;
|
|
155
|
-
}
|
|
156
|
-
const he = /* @__PURE__ */ new TextEncoder();
|
|
157
|
-
function ue(s, t = {}) {
|
|
158
|
-
const e = he.encode(s);
|
|
159
|
-
return X(e, t);
|
|
160
|
-
}
|
|
161
|
-
function me(s) {
|
|
162
|
-
return s instanceof Error;
|
|
163
|
-
}
|
|
164
|
-
let N = !1;
|
|
165
|
-
function ge(s) {
|
|
166
|
-
if (N)
|
|
167
|
-
return;
|
|
168
|
-
N = !0;
|
|
169
|
-
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = (c) => {
|
|
170
|
-
const d = c.detail;
|
|
171
|
-
t.has(d.info.uuid) || t.set(d.info.uuid, d);
|
|
172
|
-
};
|
|
173
|
-
window.addEventListener("eip6963:announceProvider", o), window.dispatchEvent(new Event("eip6963:requestProvider")), window.addEventListener("message", async (c) => {
|
|
174
|
-
var f;
|
|
175
|
-
if (c.origin !== s) return;
|
|
176
|
-
const { type: d, data: a } = c.data;
|
|
177
|
-
switch (d) {
|
|
178
|
-
case "glide:getProviders": {
|
|
179
|
-
const p = Array.from(t.values()).map(
|
|
180
|
-
({ info: h, provider: l }) => ({
|
|
181
|
-
info: h,
|
|
182
|
-
isConnected: typeof l.isConnected == "boolean" ? l.isConnected : void 0,
|
|
183
|
-
chainId: l.chainId,
|
|
184
|
-
selectedAddress: l.selectedAddress
|
|
185
|
-
})
|
|
186
|
-
), r = document.getElementById(
|
|
187
|
-
"glide-deposit-iframe"
|
|
188
|
-
);
|
|
189
|
-
r != null && r.contentWindow && r.contentWindow.postMessage(
|
|
190
|
-
{
|
|
191
|
-
type: "glide:providers",
|
|
192
|
-
providers: p
|
|
193
|
-
},
|
|
194
|
-
s
|
|
195
|
-
);
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
case "glide:providerRequest": {
|
|
199
|
-
const { uuid: p, requestId: r, method: h, params: l } = a;
|
|
200
|
-
if (i.has(r))
|
|
201
|
-
return;
|
|
202
|
-
i.set(r, !0);
|
|
203
|
-
const m = t.get(p);
|
|
204
|
-
if (!m) {
|
|
205
|
-
i.delete(r), n(r, { error: "Provider not found" });
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
try {
|
|
209
|
-
const u = await m.provider.request({
|
|
210
|
-
method: h,
|
|
211
|
-
params: l
|
|
212
|
-
});
|
|
213
|
-
i.delete(r), n(r, { result: u });
|
|
214
|
-
} catch (u) {
|
|
215
|
-
i.delete(r), me(u) ? n(r, {
|
|
216
|
-
error: u.message || String(u),
|
|
217
|
-
code: u.code,
|
|
218
|
-
data: u.data
|
|
219
|
-
}) : n(r, {
|
|
220
|
-
error: String(u)
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
case "glide:addEventListener": {
|
|
226
|
-
const { uuid: p, requestId: r, eventName: h } = a, l = t.get(p);
|
|
227
|
-
if (!l || !l.provider.on) {
|
|
228
|
-
n(r, { error: "Provider or method not found" });
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
const m = (...u) => {
|
|
232
|
-
const g = document.getElementById(
|
|
233
|
-
"glide-deposit-iframe"
|
|
234
|
-
);
|
|
235
|
-
g != null && g.contentWindow && g.contentWindow.postMessage(
|
|
236
|
-
{
|
|
237
|
-
type: "glide:providerEvent",
|
|
238
|
-
uuid: p,
|
|
239
|
-
eventName: h,
|
|
240
|
-
args: u
|
|
241
|
-
},
|
|
242
|
-
s
|
|
243
|
-
);
|
|
244
|
-
};
|
|
245
|
-
e.has(p) || e.set(p, /* @__PURE__ */ new Map()), e.get(p).has(h) || e.get(p).set(h, /* @__PURE__ */ new Set()), e.get(p).get(h).add(m), l.provider.on(h, m), n(r, { result: !0 });
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
case "glide:removeEventListener": {
|
|
249
|
-
const { uuid: p, requestId: r, eventName: h } = a, l = t.get(p);
|
|
250
|
-
if (!l || !l.provider.removeListener) {
|
|
251
|
-
n(r, { error: "Provider or method not found" });
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const m = (f = e.get(p)) == null ? void 0 : f.get(h);
|
|
255
|
-
m && (m.forEach((u) => {
|
|
256
|
-
l.provider.removeListener(h, u);
|
|
257
|
-
}), m.clear()), n(r, { result: !0 });
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
function n(c, d) {
|
|
263
|
-
const a = document.getElementById(
|
|
264
|
-
"glide-deposit-iframe"
|
|
265
|
-
);
|
|
266
|
-
a != null && a.contentWindow && a.contentWindow.postMessage(
|
|
267
|
-
{
|
|
268
|
-
type: "glide:providerResponse",
|
|
269
|
-
requestId: c,
|
|
270
|
-
...d
|
|
271
|
-
},
|
|
272
|
-
s
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
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
|
-
sideEffects: xe,
|
|
285
|
-
scripts: Se,
|
|
286
|
-
dependencies: Pe,
|
|
287
|
-
devDependencies: Ee
|
|
288
|
-
}, Ue = ke.version, K = 999999;
|
|
289
|
-
class O {
|
|
290
|
-
constructor(t) {
|
|
291
|
-
W(this, "opts");
|
|
292
|
-
W(this, "open", () => {
|
|
293
|
-
if (!(!this.opts.container && document.body.classList.contains("glide-deposit-open"))) {
|
|
294
|
-
if (this.opts.container || document.body.classList.add("glide-deposit-open"), (this.opts.mode === "deposit" || this.opts.mode === "buy") && !this.opts.recipient)
|
|
295
|
-
throw new Error("recipient is required for deposit/buy mode");
|
|
296
|
-
if (this.opts.preferGaslessPayment && this.opts.walletProvider && !this.opts.walletProvider.signTypedDataAsync)
|
|
297
|
-
throw new Error(
|
|
298
|
-
"walletProvider.signTypedDataAsync is required when preferGaslessPayment=true"
|
|
299
|
-
);
|
|
300
|
-
this.openUrl(`${this.baseUrl}${this.opts.app}?init=true&embed=true`), this.initialize();
|
|
301
|
-
}
|
|
302
|
-
});
|
|
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
|
-
const e = t.data;
|
|
306
|
-
switch (e.type) {
|
|
307
|
-
case "sendInit": {
|
|
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
|
-
(f = (d = this.iframe) == null ? void 0 : d.contentWindow) == null || f.postMessage(
|
|
310
|
-
{
|
|
311
|
-
type: "initialize",
|
|
312
|
-
sessionId: this.opts.sessionId,
|
|
313
|
-
recipient: b,
|
|
314
|
-
connectedWalletAddress: Z,
|
|
315
|
-
availableChainIds: Q,
|
|
316
|
-
currentChainId: Y,
|
|
317
|
-
preferGaslessPayment: ee,
|
|
318
|
-
chainIds: this.opts.chainIds,
|
|
319
|
-
excludeChainIds: this.opts.excludeChainIds,
|
|
320
|
-
excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
|
|
321
|
-
excludeFundingSources: this.opts.excludeFundingSources,
|
|
322
|
-
fundingSources: this.opts.fundingSources,
|
|
323
|
-
allowedPaymentCurrencies: this.opts.allowedPaymentCurrencies,
|
|
324
|
-
appMetadata: this.opts.appMetadata,
|
|
325
|
-
enableRefundEmails: this.opts.enableRefundEmails,
|
|
326
|
-
payerEmail: this.opts.payerEmail,
|
|
327
|
-
mode: this.opts.mode,
|
|
328
|
-
amount: this.opts.amount,
|
|
329
|
-
chainId: this.opts.chainId,
|
|
330
|
-
currencyId: this.opts.currencyId,
|
|
331
|
-
evmTx: this.opts.evm,
|
|
332
|
-
tokenApproval: this.opts.approval,
|
|
333
|
-
sessionMetadata: this.opts.sessionMetadata,
|
|
334
|
-
autoCloseOnSuccess: this.opts.autoCloseOnSuccess,
|
|
335
|
-
disableWithdrawToSelfSuggestion: this.opts.disableWithdrawToSelfSuggestion,
|
|
336
|
-
hideSettlementCopy: this.opts.hideSettlementCopy,
|
|
337
|
-
showAppLogo: this.opts.showAppLogo,
|
|
338
|
-
showOnrampFirst: this.opts.showOnrampFirst,
|
|
339
|
-
debitCardAlias: this.opts.debitCardAlias,
|
|
340
|
-
copyOverrides: this.opts.copyOverrides,
|
|
341
|
-
stableDepositAddressKey: this.opts.stableDepositAddressKey,
|
|
342
|
-
theme: {
|
|
343
|
-
...this.opts.theme || {},
|
|
344
|
-
colorScheme: ((a = this.opts.theme) == null ? void 0 : a.colorScheme) || getComputedStyle(document.documentElement).colorScheme || "",
|
|
345
|
-
safeInsetBottom: this.getSafeInsetBottom()
|
|
346
|
-
},
|
|
347
|
-
didProvideLocalStorage: !!this.opts.localStorageProvider,
|
|
348
|
-
debug: this.opts.debug,
|
|
349
|
-
popupsBlocked: this.opts.popupsBlocked,
|
|
350
|
-
gasRefuelAmountPerChain: this.opts.gasRefuelAmountPerChain,
|
|
351
|
-
sdkVersion: Ue,
|
|
352
|
-
referrerDomain: typeof window < "u" ? window.location.origin : void 0
|
|
353
|
-
},
|
|
354
|
-
new URL(this.baseUrl).origin
|
|
355
|
-
);
|
|
356
|
-
break;
|
|
357
|
-
}
|
|
358
|
-
case "didOpen": {
|
|
359
|
-
this.iframe.style.opacity = "1", (r = (p = this.opts).onOpen) == null || r.call(p);
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
case "localStorage.getKeys": {
|
|
363
|
-
if (!this.opts.localStorageProvider)
|
|
364
|
-
throw new Error("localStorageProvider is not set");
|
|
365
|
-
const b = await this.opts.localStorageProvider.getKeys();
|
|
366
|
-
(l = (h = this.iframe) == null ? void 0 : h.contentWindow) == null || l.postMessage(
|
|
367
|
-
{
|
|
368
|
-
type: "localStorage.didGetKeys",
|
|
369
|
-
keys: b
|
|
370
|
-
},
|
|
371
|
-
this.baseUrl
|
|
372
|
-
);
|
|
373
|
-
break;
|
|
374
|
-
}
|
|
375
|
-
case "localStorage.setItem":
|
|
376
|
-
if (!this.opts.localStorageProvider)
|
|
377
|
-
throw new Error("localStorageProvider is not set");
|
|
378
|
-
await this.opts.localStorageProvider.setItem(
|
|
379
|
-
e.key,
|
|
380
|
-
e.value
|
|
381
|
-
);
|
|
382
|
-
break;
|
|
383
|
-
case "localStorage.removeItem":
|
|
384
|
-
if (!this.opts.localStorageProvider)
|
|
385
|
-
throw new Error("localStorageProvider is not set");
|
|
386
|
-
await this.opts.localStorageProvider.removeItem(e.key);
|
|
387
|
-
break;
|
|
388
|
-
case "localStorage.getItem": {
|
|
389
|
-
if (!this.opts.localStorageProvider)
|
|
390
|
-
throw new Error("localStorageProvider is not set");
|
|
391
|
-
const b = await this.opts.localStorageProvider.getItem(e.key);
|
|
392
|
-
(u = (m = this.iframe) == null ? void 0 : m.contentWindow) == null || u.postMessage(
|
|
393
|
-
{
|
|
394
|
-
type: "localStorage.didGetItem",
|
|
395
|
-
key: e.key,
|
|
396
|
-
value: b
|
|
397
|
-
},
|
|
398
|
-
this.baseUrl
|
|
399
|
-
);
|
|
400
|
-
break;
|
|
401
|
-
}
|
|
402
|
-
case "success":
|
|
403
|
-
($ = (g = this.opts) == null ? void 0 : g.onSuccess) == null || $.call(g, e.hash, e.session);
|
|
404
|
-
break;
|
|
405
|
-
case "close":
|
|
406
|
-
this.removeIframe(), this.destroy(), (I = (y = this.opts) == null ? void 0 : y.onClose) == null || I.call(y);
|
|
407
|
-
break;
|
|
408
|
-
case "setMode":
|
|
409
|
-
(x = (w = this.opts) == null ? void 0 : w.onSetMode) == null || x.call(w, e.mode);
|
|
410
|
-
break;
|
|
411
|
-
case "switchChain":
|
|
412
|
-
if (!this.opts.walletProvider)
|
|
413
|
-
throw new Error("walletProvider is not set");
|
|
414
|
-
try {
|
|
415
|
-
await this.opts.walletProvider.switchChainAsync({
|
|
416
|
-
chainId: e.chainId
|
|
417
|
-
}), (S = (v = this.iframe) == null ? void 0 : v.contentWindow) == null || S.postMessage(
|
|
418
|
-
{
|
|
419
|
-
type: "didSwitchChain",
|
|
420
|
-
success: !0,
|
|
421
|
-
chainId: e.chainId
|
|
422
|
-
},
|
|
423
|
-
this.baseUrl
|
|
424
|
-
);
|
|
425
|
-
} catch (b) {
|
|
426
|
-
(k = (E = this.iframe) == null ? void 0 : E.contentWindow) == null || k.postMessage(
|
|
427
|
-
{
|
|
428
|
-
type: "didSwitchChain",
|
|
429
|
-
success: !1,
|
|
430
|
-
error: b
|
|
431
|
-
},
|
|
432
|
-
this.baseUrl
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
break;
|
|
436
|
-
case "sendTransaction":
|
|
437
|
-
{
|
|
438
|
-
if (!this.opts.walletProvider)
|
|
439
|
-
throw new Error("walletProvider is not set");
|
|
440
|
-
try {
|
|
441
|
-
const b = await this.opts.walletProvider.sendTransactionAsync(
|
|
442
|
-
e.tx
|
|
443
|
-
);
|
|
444
|
-
(M = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || M.postMessage(
|
|
445
|
-
{
|
|
446
|
-
type: "didSendTransaction",
|
|
447
|
-
success: !0,
|
|
448
|
-
txHash: b
|
|
449
|
-
},
|
|
450
|
-
this.baseUrl
|
|
451
|
-
);
|
|
452
|
-
} catch (b) {
|
|
453
|
-
(P = (C = this.iframe) == null ? void 0 : C.contentWindow) == null || P.postMessage(
|
|
454
|
-
{
|
|
455
|
-
type: "didSendTransaction",
|
|
456
|
-
success: !1,
|
|
457
|
-
error: b
|
|
458
|
-
},
|
|
459
|
-
this.baseUrl
|
|
460
|
-
);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
break;
|
|
464
|
-
case "signTypedData":
|
|
465
|
-
{
|
|
466
|
-
if (!this.opts.walletProvider)
|
|
467
|
-
throw new Error("walletProvider is not set");
|
|
468
|
-
if (!this.opts.walletProvider.signTypedDataAsync) {
|
|
469
|
-
(j = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || j.postMessage(
|
|
470
|
-
{
|
|
471
|
-
type: "didSignTypedData",
|
|
472
|
-
success: !1,
|
|
473
|
-
error: "signTypedDataAsync_not_implemented"
|
|
474
|
-
},
|
|
475
|
-
this.baseUrl
|
|
476
|
-
);
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
try {
|
|
480
|
-
const b = await this.opts.walletProvider.signTypedDataAsync(
|
|
481
|
-
e.data
|
|
482
|
-
);
|
|
483
|
-
(R = (T = this.iframe) == null ? void 0 : T.contentWindow) == null || R.postMessage(
|
|
484
|
-
{
|
|
485
|
-
type: "didSignTypedData",
|
|
486
|
-
success: !0,
|
|
487
|
-
signature: b
|
|
488
|
-
},
|
|
489
|
-
this.baseUrl
|
|
490
|
-
);
|
|
491
|
-
} catch (b) {
|
|
492
|
-
(D = (B = this.iframe) == null ? void 0 : B.contentWindow) == null || D.postMessage(
|
|
493
|
-
{
|
|
494
|
-
type: "didSignTypedData",
|
|
495
|
-
success: !1,
|
|
496
|
-
error: b
|
|
497
|
-
},
|
|
498
|
-
this.baseUrl
|
|
499
|
-
);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
break;
|
|
503
|
-
}
|
|
504
|
-
});
|
|
505
|
-
this.opts = t;
|
|
506
|
-
}
|
|
507
|
-
get externalUrl() {
|
|
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=${ce(
|
|
510
|
-
this.opts.evm.value || 0n
|
|
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
|
-
}
|
|
513
|
-
initialize() {
|
|
514
|
-
window.addEventListener("message", this.iframeEventHandler);
|
|
515
|
-
const t = new URL(this.baseUrl).origin;
|
|
516
|
-
ge(t);
|
|
517
|
-
}
|
|
518
|
-
destroy() {
|
|
519
|
-
window.removeEventListener("message", this.iframeEventHandler);
|
|
520
|
-
}
|
|
521
|
-
get baseUrl() {
|
|
522
|
-
return this.opts.baseUrl || "https://deposit.paywithglide.xyz/";
|
|
523
|
-
}
|
|
524
|
-
get iframe() {
|
|
525
|
-
return document.getElementById("glide-deposit-iframe");
|
|
526
|
-
}
|
|
527
|
-
getSafeInsetBottom() {
|
|
528
|
-
if (typeof window > "u" || typeof document > "u")
|
|
529
|
-
return 0;
|
|
530
|
-
try {
|
|
531
|
-
const t = document.createElement("div");
|
|
532
|
-
t.style.cssText = "position: fixed; bottom: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); visibility: hidden; pointer-events: none; z-index: -1;", document.body.appendChild(t);
|
|
533
|
-
const e = window.getComputedStyle(t).paddingBottom;
|
|
534
|
-
return document.body.removeChild(t), parseFloat(e) || 0;
|
|
535
|
-
} catch {
|
|
536
|
-
return 0;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
openUrl(t) {
|
|
540
|
-
this.createIframe(t);
|
|
541
|
-
}
|
|
542
|
-
createIframe(t) {
|
|
543
|
-
this.removeIframe();
|
|
544
|
-
const e = document.createElement("iframe");
|
|
545
|
-
e.id = "glide-deposit-iframe";
|
|
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);
|
|
548
|
-
}
|
|
549
|
-
removeIframe() {
|
|
550
|
-
const t = document.getElementById("glide-deposit-iframe");
|
|
551
|
-
t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
const De = ({
|
|
555
|
-
app: s,
|
|
556
|
-
recipient: t,
|
|
557
|
-
chainId: e,
|
|
558
|
-
currencyId: i,
|
|
559
|
-
amount: o,
|
|
560
|
-
gasRefuelAmountPerChain: n,
|
|
561
|
-
preferGaslessPayment: c,
|
|
562
|
-
chainIds: d,
|
|
563
|
-
excludeChainIds: a,
|
|
564
|
-
excludeCurrencyTiers: f,
|
|
565
|
-
excludeFundingSources: p,
|
|
566
|
-
fundingSources: r,
|
|
567
|
-
appMetadata: h,
|
|
568
|
-
enableRefundEmails: l,
|
|
569
|
-
payerEmail: m,
|
|
570
|
-
mode: u,
|
|
571
|
-
hideSettlementCopy: g,
|
|
572
|
-
showAppLogo: $,
|
|
573
|
-
showOnrampFirst: y,
|
|
574
|
-
debitCardAlias: I,
|
|
575
|
-
copyOverrides: w,
|
|
576
|
-
stableDepositAddressKey: x,
|
|
577
|
-
sessionId: v,
|
|
578
|
-
sessionMetadata: S,
|
|
579
|
-
disableWithdrawToSelfSuggestion: E,
|
|
580
|
-
theme: k,
|
|
581
|
-
walletProvider: U,
|
|
582
|
-
localStorageProvider: M,
|
|
583
|
-
onOpen: C,
|
|
584
|
-
onSuccess: P,
|
|
585
|
-
onClose: z,
|
|
586
|
-
autoCloseOnSuccess: j,
|
|
587
|
-
popupsBlocked: T,
|
|
588
|
-
baseUrl: R,
|
|
589
|
-
debug: B
|
|
1
|
+
import { GlideDeposit as y } from "./core.js";
|
|
2
|
+
import { GlideAnalytics as r, browserLocalStorageProvider as c, glideAnalytics as o, initializeParentBridge as d } from "./core.js";
|
|
3
|
+
import { useMemo as b } from "react";
|
|
4
|
+
const h = ({
|
|
5
|
+
app: G,
|
|
6
|
+
recipient: U,
|
|
7
|
+
chainId: z,
|
|
8
|
+
currencyId: j,
|
|
9
|
+
amount: q,
|
|
10
|
+
gasRefuelAmountPerChain: B,
|
|
11
|
+
preferGaslessPayment: H,
|
|
12
|
+
chainIds: J,
|
|
13
|
+
excludeChainIds: N,
|
|
14
|
+
excludeCurrencyTiers: Q,
|
|
15
|
+
excludeFundingSources: V,
|
|
16
|
+
fundingSources: X,
|
|
17
|
+
appMetadata: Y,
|
|
18
|
+
enableRefundEmails: Z,
|
|
19
|
+
payerEmail: _,
|
|
20
|
+
mode: $,
|
|
21
|
+
hideSettlementCopy: K,
|
|
22
|
+
showAppLogo: x,
|
|
23
|
+
showOnrampFirst: k,
|
|
24
|
+
debitCardAlias: L,
|
|
25
|
+
copyOverrides: R,
|
|
26
|
+
stableDepositAddressKey: E,
|
|
27
|
+
sessionId: M,
|
|
28
|
+
sessionMetadata: D,
|
|
29
|
+
disableWithdrawToSelfSuggestion: T,
|
|
30
|
+
theme: f,
|
|
31
|
+
walletProvider: A,
|
|
32
|
+
solanaWalletProvider: F,
|
|
33
|
+
localStorageProvider: w,
|
|
34
|
+
onOpen: t,
|
|
35
|
+
onSuccess: W,
|
|
36
|
+
onClose: I,
|
|
37
|
+
autoCloseOnSuccess: P,
|
|
38
|
+
popupsBlocked: m,
|
|
39
|
+
baseUrl: O,
|
|
40
|
+
debug: v
|
|
590
41
|
}) => {
|
|
591
|
-
const
|
|
592
|
-
app:
|
|
593
|
-
recipient:
|
|
594
|
-
chainId:
|
|
595
|
-
currencyId:
|
|
596
|
-
amount:
|
|
597
|
-
gasRefuelAmountPerChain:
|
|
598
|
-
preferGaslessPayment:
|
|
599
|
-
chainIds:
|
|
600
|
-
excludeChainIds:
|
|
601
|
-
excludeCurrencyTiers:
|
|
602
|
-
excludeFundingSources:
|
|
603
|
-
fundingSources:
|
|
604
|
-
appMetadata:
|
|
605
|
-
enableRefundEmails:
|
|
606
|
-
payerEmail:
|
|
607
|
-
mode:
|
|
608
|
-
hideSettlementCopy:
|
|
609
|
-
showAppLogo:
|
|
610
|
-
showOnrampFirst:
|
|
611
|
-
debitCardAlias:
|
|
612
|
-
copyOverrides:
|
|
613
|
-
stableDepositAddressKey:
|
|
614
|
-
sessionId:
|
|
615
|
-
sessionMetadata:
|
|
616
|
-
disableWithdrawToSelfSuggestion:
|
|
617
|
-
theme:
|
|
618
|
-
walletProvider:
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
42
|
+
const g = b(() => new y({
|
|
43
|
+
app: G,
|
|
44
|
+
recipient: U,
|
|
45
|
+
chainId: z,
|
|
46
|
+
currencyId: j,
|
|
47
|
+
amount: q,
|
|
48
|
+
gasRefuelAmountPerChain: B,
|
|
49
|
+
preferGaslessPayment: H,
|
|
50
|
+
chainIds: J,
|
|
51
|
+
excludeChainIds: N,
|
|
52
|
+
excludeCurrencyTiers: Q,
|
|
53
|
+
excludeFundingSources: V,
|
|
54
|
+
fundingSources: X,
|
|
55
|
+
appMetadata: Y,
|
|
56
|
+
enableRefundEmails: Z,
|
|
57
|
+
payerEmail: _,
|
|
58
|
+
mode: $,
|
|
59
|
+
hideSettlementCopy: K,
|
|
60
|
+
showAppLogo: x,
|
|
61
|
+
showOnrampFirst: k,
|
|
62
|
+
debitCardAlias: L,
|
|
63
|
+
copyOverrides: R,
|
|
64
|
+
stableDepositAddressKey: E,
|
|
65
|
+
sessionId: M,
|
|
66
|
+
sessionMetadata: D,
|
|
67
|
+
disableWithdrawToSelfSuggestion: T,
|
|
68
|
+
theme: f,
|
|
69
|
+
walletProvider: A,
|
|
70
|
+
solanaWalletProvider: F,
|
|
71
|
+
localStorageProvider: w,
|
|
72
|
+
onOpen: t,
|
|
73
|
+
onSuccess: W,
|
|
74
|
+
onClose: I,
|
|
75
|
+
autoCloseOnSuccess: P,
|
|
76
|
+
popupsBlocked: m,
|
|
77
|
+
baseUrl: O,
|
|
78
|
+
debug: v
|
|
627
79
|
}), [
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
u,
|
|
644
|
-
g,
|
|
80
|
+
G,
|
|
81
|
+
U,
|
|
82
|
+
z,
|
|
83
|
+
j,
|
|
84
|
+
q,
|
|
85
|
+
B,
|
|
86
|
+
H,
|
|
87
|
+
J,
|
|
88
|
+
N,
|
|
89
|
+
Q,
|
|
90
|
+
V,
|
|
91
|
+
X,
|
|
92
|
+
Y,
|
|
93
|
+
Z,
|
|
94
|
+
_,
|
|
645
95
|
$,
|
|
646
|
-
|
|
647
|
-
I,
|
|
648
|
-
w,
|
|
96
|
+
K,
|
|
649
97
|
x,
|
|
650
|
-
v,
|
|
651
|
-
S,
|
|
652
|
-
E,
|
|
653
98
|
k,
|
|
654
|
-
|
|
99
|
+
L,
|
|
100
|
+
R,
|
|
101
|
+
E,
|
|
655
102
|
M,
|
|
656
|
-
|
|
657
|
-
P,
|
|
658
|
-
z,
|
|
659
|
-
j,
|
|
103
|
+
D,
|
|
660
104
|
T,
|
|
661
|
-
|
|
662
|
-
|
|
105
|
+
f,
|
|
106
|
+
A,
|
|
107
|
+
F,
|
|
108
|
+
w,
|
|
109
|
+
t,
|
|
110
|
+
W,
|
|
111
|
+
I,
|
|
112
|
+
P,
|
|
113
|
+
m,
|
|
114
|
+
O,
|
|
115
|
+
v
|
|
663
116
|
]);
|
|
664
117
|
return {
|
|
665
|
-
openGlideDeposit:
|
|
666
|
-
externalUrl:
|
|
667
|
-
opts:
|
|
118
|
+
openGlideDeposit: g.open,
|
|
119
|
+
externalUrl: g.externalUrl,
|
|
120
|
+
opts: g.opts
|
|
668
121
|
};
|
|
669
|
-
},
|
|
670
|
-
app:
|
|
671
|
-
preferGaslessPayment:
|
|
672
|
-
chainIds:
|
|
673
|
-
excludeChainIds:
|
|
674
|
-
excludeCurrencyTiers:
|
|
675
|
-
excludeFundingSources:
|
|
676
|
-
fundingSources:
|
|
677
|
-
allowedPaymentCurrencies:
|
|
678
|
-
appMetadata:
|
|
679
|
-
enableRefundEmails:
|
|
680
|
-
payerEmail:
|
|
681
|
-
hideSettlementCopy:
|
|
682
|
-
showAppLogo:
|
|
683
|
-
showOnrampFirst:
|
|
684
|
-
debitCardAlias:
|
|
685
|
-
copyOverrides:
|
|
686
|
-
amount:
|
|
687
|
-
sessionId:
|
|
688
|
-
sessionMetadata:
|
|
689
|
-
theme:
|
|
690
|
-
walletProvider:
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
122
|
+
}, p = ({
|
|
123
|
+
app: G,
|
|
124
|
+
preferGaslessPayment: U,
|
|
125
|
+
chainIds: z,
|
|
126
|
+
excludeChainIds: j,
|
|
127
|
+
excludeCurrencyTiers: q,
|
|
128
|
+
excludeFundingSources: B,
|
|
129
|
+
fundingSources: H,
|
|
130
|
+
allowedPaymentCurrencies: J,
|
|
131
|
+
appMetadata: N,
|
|
132
|
+
enableRefundEmails: Q,
|
|
133
|
+
payerEmail: V,
|
|
134
|
+
hideSettlementCopy: X,
|
|
135
|
+
showAppLogo: Y,
|
|
136
|
+
showOnrampFirst: Z,
|
|
137
|
+
debitCardAlias: _,
|
|
138
|
+
copyOverrides: $,
|
|
139
|
+
amount: K,
|
|
140
|
+
sessionId: x,
|
|
141
|
+
sessionMetadata: k,
|
|
142
|
+
theme: L,
|
|
143
|
+
walletProvider: R,
|
|
144
|
+
solanaWalletProvider: E,
|
|
145
|
+
localStorageProvider: M,
|
|
146
|
+
onOpen: D,
|
|
147
|
+
onSuccess: T,
|
|
148
|
+
onClose: f,
|
|
149
|
+
autoCloseOnSuccess: A,
|
|
150
|
+
popupsBlocked: F,
|
|
151
|
+
baseUrl: w,
|
|
152
|
+
debug: t
|
|
699
153
|
}) => {
|
|
700
|
-
const
|
|
701
|
-
app:
|
|
702
|
-
preferGaslessPayment:
|
|
703
|
-
chainIds:
|
|
704
|
-
excludeChainIds:
|
|
705
|
-
excludeCurrencyTiers:
|
|
706
|
-
excludeFundingSources:
|
|
707
|
-
fundingSources:
|
|
708
|
-
allowedPaymentCurrencies:
|
|
709
|
-
appMetadata:
|
|
710
|
-
enableRefundEmails:
|
|
711
|
-
payerEmail:
|
|
154
|
+
const W = b(() => new y({
|
|
155
|
+
app: G,
|
|
156
|
+
preferGaslessPayment: U,
|
|
157
|
+
chainIds: z,
|
|
158
|
+
excludeChainIds: j,
|
|
159
|
+
excludeCurrencyTiers: q,
|
|
160
|
+
excludeFundingSources: B,
|
|
161
|
+
fundingSources: H,
|
|
162
|
+
allowedPaymentCurrencies: J,
|
|
163
|
+
appMetadata: N,
|
|
164
|
+
enableRefundEmails: Q,
|
|
165
|
+
payerEmail: V,
|
|
712
166
|
mode: "pay",
|
|
713
|
-
hideSettlementCopy:
|
|
714
|
-
showAppLogo:
|
|
715
|
-
showOnrampFirst:
|
|
716
|
-
debitCardAlias:
|
|
717
|
-
copyOverrides:
|
|
718
|
-
sessionId:
|
|
719
|
-
amount:
|
|
720
|
-
sessionMetadata:
|
|
721
|
-
theme:
|
|
722
|
-
walletProvider:
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
167
|
+
hideSettlementCopy: X,
|
|
168
|
+
showAppLogo: Y,
|
|
169
|
+
showOnrampFirst: Z,
|
|
170
|
+
debitCardAlias: _,
|
|
171
|
+
copyOverrides: $,
|
|
172
|
+
sessionId: x,
|
|
173
|
+
amount: K,
|
|
174
|
+
sessionMetadata: k,
|
|
175
|
+
theme: L,
|
|
176
|
+
walletProvider: R,
|
|
177
|
+
solanaWalletProvider: E,
|
|
178
|
+
localStorageProvider: M,
|
|
179
|
+
onOpen: D,
|
|
180
|
+
onSuccess: T,
|
|
181
|
+
onClose: f,
|
|
182
|
+
autoCloseOnSuccess: A,
|
|
183
|
+
popupsBlocked: F,
|
|
184
|
+
baseUrl: w,
|
|
185
|
+
debug: t
|
|
731
186
|
}), [
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
u,
|
|
187
|
+
G,
|
|
188
|
+
U,
|
|
189
|
+
z,
|
|
190
|
+
j,
|
|
191
|
+
q,
|
|
192
|
+
B,
|
|
193
|
+
H,
|
|
194
|
+
J,
|
|
195
|
+
N,
|
|
196
|
+
Q,
|
|
197
|
+
V,
|
|
198
|
+
X,
|
|
199
|
+
Y,
|
|
200
|
+
Z,
|
|
201
|
+
_,
|
|
748
202
|
$,
|
|
749
|
-
g,
|
|
750
|
-
y,
|
|
751
|
-
I,
|
|
752
|
-
w,
|
|
753
203
|
x,
|
|
754
|
-
|
|
755
|
-
S,
|
|
756
|
-
E,
|
|
204
|
+
K,
|
|
757
205
|
k,
|
|
758
|
-
|
|
206
|
+
L,
|
|
207
|
+
R,
|
|
208
|
+
E,
|
|
759
209
|
M,
|
|
760
|
-
|
|
210
|
+
D,
|
|
211
|
+
T,
|
|
212
|
+
f,
|
|
213
|
+
A,
|
|
214
|
+
F,
|
|
215
|
+
w,
|
|
216
|
+
t
|
|
761
217
|
]);
|
|
762
218
|
return {
|
|
763
|
-
openGlidePay:
|
|
764
|
-
externalUrl:
|
|
765
|
-
opts:
|
|
219
|
+
openGlidePay: W.open,
|
|
220
|
+
externalUrl: W.externalUrl,
|
|
221
|
+
opts: W.opts
|
|
766
222
|
};
|
|
767
|
-
},
|
|
768
|
-
app:
|
|
769
|
-
evm:
|
|
770
|
-
approval:
|
|
771
|
-
preferGaslessPayment:
|
|
772
|
-
chainIds:
|
|
773
|
-
excludeChainIds:
|
|
774
|
-
excludeCurrencyTiers:
|
|
775
|
-
excludeFundingSources:
|
|
776
|
-
sessionMetadata:
|
|
777
|
-
showAppLogo:
|
|
778
|
-
showOnrampFirst:
|
|
779
|
-
debitCardAlias:
|
|
780
|
-
copyOverrides:
|
|
781
|
-
theme:
|
|
782
|
-
walletProvider:
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
223
|
+
}, l = ({
|
|
224
|
+
app: G,
|
|
225
|
+
evm: U,
|
|
226
|
+
approval: z,
|
|
227
|
+
preferGaslessPayment: j,
|
|
228
|
+
chainIds: q,
|
|
229
|
+
excludeChainIds: B,
|
|
230
|
+
excludeCurrencyTiers: H,
|
|
231
|
+
excludeFundingSources: J,
|
|
232
|
+
sessionMetadata: N,
|
|
233
|
+
showAppLogo: Q,
|
|
234
|
+
showOnrampFirst: V,
|
|
235
|
+
debitCardAlias: X,
|
|
236
|
+
copyOverrides: Y,
|
|
237
|
+
theme: Z,
|
|
238
|
+
walletProvider: _,
|
|
239
|
+
solanaWalletProvider: $,
|
|
240
|
+
localStorageProvider: K,
|
|
241
|
+
onOpen: x,
|
|
242
|
+
onSuccess: k,
|
|
243
|
+
onClose: L,
|
|
244
|
+
autoCloseOnSuccess: R,
|
|
245
|
+
popupsBlocked: E,
|
|
246
|
+
baseUrl: M,
|
|
247
|
+
debug: D
|
|
791
248
|
}) => {
|
|
792
|
-
const
|
|
793
|
-
app:
|
|
794
|
-
evm:
|
|
795
|
-
approval:
|
|
796
|
-
preferGaslessPayment:
|
|
797
|
-
chainIds:
|
|
798
|
-
excludeChainIds:
|
|
799
|
-
excludeCurrencyTiers:
|
|
800
|
-
excludeFundingSources:
|
|
801
|
-
sessionMetadata:
|
|
802
|
-
showAppLogo:
|
|
803
|
-
showOnrampFirst:
|
|
804
|
-
debitCardAlias:
|
|
805
|
-
copyOverrides:
|
|
249
|
+
const T = b(() => new y({
|
|
250
|
+
app: G,
|
|
251
|
+
evm: U,
|
|
252
|
+
approval: z,
|
|
253
|
+
preferGaslessPayment: j,
|
|
254
|
+
chainIds: q,
|
|
255
|
+
excludeChainIds: B,
|
|
256
|
+
excludeCurrencyTiers: H,
|
|
257
|
+
excludeFundingSources: J,
|
|
258
|
+
sessionMetadata: N,
|
|
259
|
+
showAppLogo: Q,
|
|
260
|
+
showOnrampFirst: V,
|
|
261
|
+
debitCardAlias: X,
|
|
262
|
+
copyOverrides: Y,
|
|
806
263
|
mode: "call",
|
|
807
|
-
theme:
|
|
808
|
-
walletProvider:
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
264
|
+
theme: Z,
|
|
265
|
+
walletProvider: _,
|
|
266
|
+
solanaWalletProvider: $,
|
|
267
|
+
localStorageProvider: K,
|
|
268
|
+
onOpen: x,
|
|
269
|
+
onSuccess: k,
|
|
270
|
+
onClose: L,
|
|
271
|
+
autoCloseOnSuccess: R,
|
|
272
|
+
popupsBlocked: E,
|
|
273
|
+
baseUrl: M,
|
|
274
|
+
debug: D
|
|
817
275
|
}), [
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
u,
|
|
834
|
-
g,
|
|
276
|
+
G,
|
|
277
|
+
U,
|
|
278
|
+
z,
|
|
279
|
+
j,
|
|
280
|
+
q,
|
|
281
|
+
B,
|
|
282
|
+
H,
|
|
283
|
+
J,
|
|
284
|
+
N,
|
|
285
|
+
Q,
|
|
286
|
+
V,
|
|
287
|
+
X,
|
|
288
|
+
Y,
|
|
289
|
+
Z,
|
|
290
|
+
_,
|
|
835
291
|
$,
|
|
836
|
-
|
|
837
|
-
I,
|
|
838
|
-
w,
|
|
292
|
+
K,
|
|
839
293
|
x,
|
|
840
|
-
|
|
294
|
+
k,
|
|
295
|
+
L,
|
|
296
|
+
R,
|
|
297
|
+
E,
|
|
298
|
+
M,
|
|
299
|
+
D
|
|
841
300
|
]);
|
|
842
301
|
return {
|
|
843
|
-
openGlideCall:
|
|
844
|
-
externalUrl:
|
|
845
|
-
opts:
|
|
302
|
+
openGlideCall: T.open,
|
|
303
|
+
externalUrl: T.externalUrl,
|
|
304
|
+
opts: T.opts
|
|
846
305
|
};
|
|
847
|
-
},
|
|
848
|
-
app:
|
|
849
|
-
recipient:
|
|
850
|
-
chainId:
|
|
851
|
-
currencyId:
|
|
852
|
-
preferGaslessPayment:
|
|
853
|
-
chainIds:
|
|
854
|
-
excludeChainIds:
|
|
855
|
-
excludeCurrencyTiers:
|
|
856
|
-
excludeFundingSources:
|
|
857
|
-
sessionMetadata:
|
|
858
|
-
showAppLogo:
|
|
859
|
-
showOnrampFirst:
|
|
860
|
-
debitCardAlias:
|
|
861
|
-
copyOverrides:
|
|
862
|
-
theme:
|
|
863
|
-
walletProvider:
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
306
|
+
}, i = ({
|
|
307
|
+
app: G,
|
|
308
|
+
recipient: U,
|
|
309
|
+
chainId: z,
|
|
310
|
+
currencyId: j,
|
|
311
|
+
preferGaslessPayment: q,
|
|
312
|
+
chainIds: B,
|
|
313
|
+
excludeChainIds: H,
|
|
314
|
+
excludeCurrencyTiers: J,
|
|
315
|
+
excludeFundingSources: N,
|
|
316
|
+
sessionMetadata: Q,
|
|
317
|
+
showAppLogo: V,
|
|
318
|
+
showOnrampFirst: X,
|
|
319
|
+
debitCardAlias: Y,
|
|
320
|
+
copyOverrides: Z,
|
|
321
|
+
theme: _,
|
|
322
|
+
walletProvider: $,
|
|
323
|
+
solanaWalletProvider: K,
|
|
324
|
+
localStorageProvider: x,
|
|
325
|
+
onOpen: k,
|
|
326
|
+
onSuccess: L,
|
|
327
|
+
onClose: R,
|
|
328
|
+
autoCloseOnSuccess: E,
|
|
329
|
+
baseUrl: M
|
|
870
330
|
}) => {
|
|
871
|
-
const
|
|
872
|
-
app:
|
|
873
|
-
recipient:
|
|
874
|
-
chainId:
|
|
875
|
-
currencyId:
|
|
876
|
-
preferGaslessPayment:
|
|
877
|
-
chainIds:
|
|
878
|
-
excludeChainIds:
|
|
879
|
-
excludeCurrencyTiers:
|
|
880
|
-
excludeFundingSources:
|
|
881
|
-
sessionMetadata:
|
|
882
|
-
showAppLogo:
|
|
883
|
-
showOnrampFirst:
|
|
884
|
-
debitCardAlias:
|
|
885
|
-
copyOverrides:
|
|
331
|
+
const D = b(() => new y({
|
|
332
|
+
app: G,
|
|
333
|
+
recipient: U,
|
|
334
|
+
chainId: z,
|
|
335
|
+
currencyId: j,
|
|
336
|
+
preferGaslessPayment: q,
|
|
337
|
+
chainIds: B,
|
|
338
|
+
excludeChainIds: H,
|
|
339
|
+
excludeCurrencyTiers: J,
|
|
340
|
+
excludeFundingSources: N,
|
|
341
|
+
sessionMetadata: Q,
|
|
342
|
+
showAppLogo: V,
|
|
343
|
+
showOnrampFirst: X,
|
|
344
|
+
debitCardAlias: Y,
|
|
345
|
+
copyOverrides: Z,
|
|
886
346
|
mode: "buy",
|
|
887
|
-
theme:
|
|
888
|
-
walletProvider:
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
347
|
+
theme: _,
|
|
348
|
+
walletProvider: $,
|
|
349
|
+
solanaWalletProvider: K,
|
|
350
|
+
localStorageProvider: x,
|
|
351
|
+
onOpen: k,
|
|
352
|
+
onSuccess: L,
|
|
353
|
+
onClose: R,
|
|
354
|
+
autoCloseOnSuccess: E,
|
|
355
|
+
baseUrl: M
|
|
895
356
|
}), [
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
u,
|
|
912
|
-
g,
|
|
357
|
+
G,
|
|
358
|
+
U,
|
|
359
|
+
z,
|
|
360
|
+
j,
|
|
361
|
+
q,
|
|
362
|
+
B,
|
|
363
|
+
H,
|
|
364
|
+
J,
|
|
365
|
+
N,
|
|
366
|
+
Q,
|
|
367
|
+
V,
|
|
368
|
+
X,
|
|
369
|
+
Y,
|
|
370
|
+
Z,
|
|
371
|
+
_,
|
|
913
372
|
$,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
373
|
+
K,
|
|
374
|
+
x,
|
|
375
|
+
k,
|
|
376
|
+
L,
|
|
377
|
+
R,
|
|
378
|
+
E,
|
|
379
|
+
M
|
|
918
380
|
]);
|
|
919
381
|
return {
|
|
920
|
-
openGlideBuy:
|
|
921
|
-
externalUrl:
|
|
922
|
-
opts:
|
|
382
|
+
openGlideBuy: D.open,
|
|
383
|
+
externalUrl: D.externalUrl,
|
|
384
|
+
opts: D.opts
|
|
923
385
|
};
|
|
924
|
-
}
|
|
925
|
-
getItem: (s) => new Promise((t, e) => {
|
|
926
|
-
try {
|
|
927
|
-
const i = localStorage.getItem(s);
|
|
928
|
-
t(i);
|
|
929
|
-
} catch (i) {
|
|
930
|
-
e(i);
|
|
931
|
-
}
|
|
932
|
-
}),
|
|
933
|
-
setItem: (s, t) => new Promise((e, i) => {
|
|
934
|
-
try {
|
|
935
|
-
localStorage.setItem(s, t), e();
|
|
936
|
-
} catch (o) {
|
|
937
|
-
i(o);
|
|
938
|
-
}
|
|
939
|
-
}),
|
|
940
|
-
removeItem: (s) => new Promise((t, e) => {
|
|
941
|
-
try {
|
|
942
|
-
localStorage.removeItem(s), t();
|
|
943
|
-
} catch (i) {
|
|
944
|
-
e(i);
|
|
945
|
-
}
|
|
946
|
-
}),
|
|
947
|
-
getKeys: () => new Promise((s, t) => {
|
|
948
|
-
try {
|
|
949
|
-
const e = Object.keys(localStorage);
|
|
950
|
-
s(e);
|
|
951
|
-
} catch (e) {
|
|
952
|
-
t(e);
|
|
953
|
-
}
|
|
954
|
-
})
|
|
955
|
-
});
|
|
386
|
+
};
|
|
956
387
|
export {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
388
|
+
r as GlideAnalytics,
|
|
389
|
+
y as GlideDeposit,
|
|
390
|
+
c as browserLocalStorageProvider,
|
|
391
|
+
o as glideAnalytics,
|
|
392
|
+
d as initializeParentBridge,
|
|
393
|
+
i as useGlideBuy,
|
|
394
|
+
l as useGlideCall,
|
|
395
|
+
h as useGlideDeposit,
|
|
396
|
+
p as useGlidePay
|
|
964
397
|
};
|