@paywithglide/glide-react 0.0.37 → 0.0.38
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/GlideDeposit.d.ts +1 -0
- package/dist/glide.js +188 -175
- package/dist/useGlideBuy.d.ts +2 -1
- package/dist/useGlideCall.d.ts +2 -1
- package/dist/useGlideDeposit.d.ts +2 -1
- package/dist/useGlidePay.d.ts +2 -1
- package/package.json +1 -1
package/dist/GlideDeposit.d.ts
CHANGED
|
@@ -104,6 +104,7 @@ export type GlideDepositOptions = {
|
|
|
104
104
|
gasRefuelAmountPerChain?: Record<CAIP2, string>;
|
|
105
105
|
sessionMetadata?: string;
|
|
106
106
|
preferGaslessPayment?: boolean;
|
|
107
|
+
chainIds?: CAIP2[];
|
|
107
108
|
excludeChainIds?: CAIP2[];
|
|
108
109
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
109
110
|
excludeFundingSources?: FundingSource[];
|
package/dist/glide.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
2
|
var ee = (s, t, e) => t in s ? _(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
-
var
|
|
4
|
-
import { useMemo as
|
|
3
|
+
var A = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { useMemo as M } from "react";
|
|
5
5
|
function te(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
|
}
|
|
@@ -9,23 +9,23 @@ function N(s) {
|
|
|
9
9
|
return te(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
|
|
10
10
|
}
|
|
11
11
|
const K = "2.21.51";
|
|
12
|
-
let
|
|
12
|
+
let T = {
|
|
13
13
|
getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
|
|
14
14
|
version: `viem@${K}`
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class I extends Error {
|
|
17
17
|
constructor(t, e = {}) {
|
|
18
18
|
var a;
|
|
19
19
|
const i = (() => {
|
|
20
20
|
var n;
|
|
21
|
-
return e.cause instanceof
|
|
22
|
-
})(), o = e.cause instanceof
|
|
21
|
+
return e.cause instanceof I ? e.cause.details : (n = e.cause) != null && n.message ? e.cause.message : e.details;
|
|
22
|
+
})(), o = e.cause instanceof I && e.cause.docsPath || e.docsPath, r = (a = T.getDocsUrl) == null ? void 0 : a.call(T, { ...e, docsPath: o }), c = [
|
|
23
23
|
t || "An error occurred.",
|
|
24
24
|
"",
|
|
25
25
|
...e.metaMessages ? [...e.metaMessages, ""] : [],
|
|
26
26
|
...r ? [`Docs: ${r}`] : [],
|
|
27
27
|
...i ? [`Details: ${i}`] : [],
|
|
28
|
-
...
|
|
28
|
+
...T.version ? [`Version: ${T.version}`] : []
|
|
29
29
|
].join(`
|
|
30
30
|
`);
|
|
31
31
|
super(c, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
@@ -67,12 +67,12 @@ class S extends Error {
|
|
|
67
67
|
function F(s, t) {
|
|
68
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 V extends
|
|
70
|
+
class V extends I {
|
|
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
|
-
function
|
|
75
|
+
function C(s, { dir: t, size: e = 32 } = {}) {
|
|
76
76
|
return typeof s == "string" ? se(s, { dir: t, size: e }) : ie(s, { dir: t, size: e });
|
|
77
77
|
}
|
|
78
78
|
function se(s, { dir: t, size: e = 32 } = {}) {
|
|
@@ -103,12 +103,12 @@ function ie(s, { dir: t, size: e = 32 } = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
return i;
|
|
105
105
|
}
|
|
106
|
-
class oe extends
|
|
106
|
+
class oe extends I {
|
|
107
107
|
constructor({ max: t, min: e, signed: i, size: o, value: r }) {
|
|
108
108
|
super(`Number "${r}" 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 re extends
|
|
111
|
+
class re extends I {
|
|
112
112
|
constructor({ givenSize: t, maxSize: e }) {
|
|
113
113
|
super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
114
114
|
}
|
|
@@ -126,14 +126,14 @@ function ae(s, t = {}) {
|
|
|
126
126
|
}
|
|
127
127
|
function ce(s, t = {}) {
|
|
128
128
|
const e = `0x${Number(s)}`;
|
|
129
|
-
return typeof t.size == "number" ? (q(e, { size: t.size }),
|
|
129
|
+
return typeof t.size == "number" ? (q(e, { size: t.size }), C(e, { size: t.size })) : e;
|
|
130
130
|
}
|
|
131
131
|
function J(s, t = {}) {
|
|
132
132
|
let e = "";
|
|
133
133
|
for (let o = 0; o < s.length; o++)
|
|
134
134
|
e += ne[s[o]];
|
|
135
135
|
const i = `0x${e}`;
|
|
136
|
-
return typeof t.size == "number" ? (q(i, { size: t.size }),
|
|
136
|
+
return typeof t.size == "number" ? (q(i, { size: t.size }), C(i, { dir: "right", size: t.size })) : i;
|
|
137
137
|
}
|
|
138
138
|
function de(s, t = {}) {
|
|
139
139
|
const { signed: e, size: i } = t, o = BigInt(s);
|
|
@@ -151,17 +151,17 @@ function de(s, t = {}) {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
const a = `0x${(e && o < 0 ? (1n << BigInt(i * 8)) + BigInt(o) : o).toString(16)}`;
|
|
154
|
-
return i ?
|
|
154
|
+
return i ? C(a, { size: i }) : a;
|
|
155
155
|
}
|
|
156
156
|
const le = /* @__PURE__ */ new TextEncoder();
|
|
157
157
|
function pe(s, t = {}) {
|
|
158
158
|
const e = le.encode(s);
|
|
159
159
|
return J(e, t);
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class D {
|
|
162
162
|
constructor(t) {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
A(this, "opts");
|
|
164
|
+
A(this, "open", () => {
|
|
165
165
|
if (!(!this.opts.container && document.body.classList.contains("glide-deposit-open"))) {
|
|
166
166
|
if (this.opts.container || document.body.classList.add("glide-deposit-open"), (this.opts.mode === "deposit" || this.opts.mode === "buy") && !this.opts.recipient)
|
|
167
167
|
throw new Error("recipient is required for deposit/buy mode");
|
|
@@ -172,8 +172,8 @@ class M {
|
|
|
172
172
|
this.openUrl(`${this.baseUrl}${this.opts.app}?init=true&embed=true`), this.initialize();
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
|
-
|
|
176
|
-
var i, o, r, c, a, n, h, u, m, g, f, y, w,
|
|
175
|
+
A(this, "iframeEventHandler", async (t) => {
|
|
176
|
+
var i, o, r, c, a, n, h, u, m, g, f, y, w, l, b, d, v, $, x, P, E, k, U, z, S, j, G, W, B, H, O, L, R;
|
|
177
177
|
const e = t.data;
|
|
178
178
|
switch (e.type) {
|
|
179
179
|
case "sendInit": {
|
|
@@ -187,6 +187,7 @@ class M {
|
|
|
187
187
|
availableChainIds: Q,
|
|
188
188
|
currentChainId: Y,
|
|
189
189
|
preferGaslessPayment: Z,
|
|
190
|
+
chainIds: this.opts.chainIds,
|
|
190
191
|
excludeChainIds: this.opts.excludeChainIds,
|
|
191
192
|
excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
|
|
192
193
|
excludeFundingSources: this.opts.excludeFundingSources,
|
|
@@ -259,13 +260,13 @@ class M {
|
|
|
259
260
|
break;
|
|
260
261
|
}
|
|
261
262
|
case "success":
|
|
262
|
-
(
|
|
263
|
+
(b = (l = this.opts) == null ? void 0 : l.onSuccess) == null || b.call(l, e.hash, e.session);
|
|
263
264
|
break;
|
|
264
265
|
case "close":
|
|
265
|
-
this.removeIframe(), this.destroy(), (
|
|
266
|
+
this.removeIframe(), this.destroy(), (v = (d = this.opts) == null ? void 0 : d.onClose) == null || v.call(d);
|
|
266
267
|
break;
|
|
267
268
|
case "setMode":
|
|
268
|
-
(
|
|
269
|
+
(x = ($ = this.opts) == null ? void 0 : $.onSetMode) == null || x.call($, e.mode);
|
|
269
270
|
break;
|
|
270
271
|
case "switchChain":
|
|
271
272
|
if (!this.opts.walletProvider)
|
|
@@ -300,7 +301,7 @@ class M {
|
|
|
300
301
|
const p = await this.opts.walletProvider.sendTransactionAsync(
|
|
301
302
|
e.tx
|
|
302
303
|
);
|
|
303
|
-
(
|
|
304
|
+
(S = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || S.postMessage(
|
|
304
305
|
{
|
|
305
306
|
type: "didSendTransaction",
|
|
306
307
|
success: !0,
|
|
@@ -309,7 +310,7 @@ class M {
|
|
|
309
310
|
this.baseUrl
|
|
310
311
|
);
|
|
311
312
|
} catch (p) {
|
|
312
|
-
(
|
|
313
|
+
(G = (j = this.iframe) == null ? void 0 : j.contentWindow) == null || G.postMessage(
|
|
313
314
|
{
|
|
314
315
|
type: "didSendTransaction",
|
|
315
316
|
success: !1,
|
|
@@ -325,7 +326,7 @@ class M {
|
|
|
325
326
|
if (!this.opts.walletProvider)
|
|
326
327
|
throw new Error("walletProvider is not set");
|
|
327
328
|
if (!this.opts.walletProvider.signTypedDataAsync) {
|
|
328
|
-
(B = (
|
|
329
|
+
(B = (W = this.iframe) == null ? void 0 : W.contentWindow) == null || B.postMessage(
|
|
329
330
|
{
|
|
330
331
|
type: "didSignTypedData",
|
|
331
332
|
success: !1,
|
|
@@ -364,10 +365,10 @@ class M {
|
|
|
364
365
|
this.opts = t;
|
|
365
366
|
}
|
|
366
367
|
get externalUrl() {
|
|
367
|
-
var t, e, i, o;
|
|
368
|
+
var t, e, i, o, r;
|
|
368
369
|
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=${ae(
|
|
369
370
|
this.opts.evm.value || 0n
|
|
370
|
-
)}` : ""}${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.
|
|
371
|
+
)}` : ""}${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(",")}` : ""}${(r = this.opts.fundingSources) != null && r.length ? `&fundingSources=${this.opts.fundingSources.join(",")}` : ""}${this.opts.debug ? "&debug=true" : ""}${this.opts.popupsBlocked ? "&popupsBlocked=true" : ""}${this.opts.disableWithdrawToSelfSuggestion ? "&disableWithdrawToSelfSuggestion=true" : ""}${this.opts.hideSettlementCopy ? "&hideSettlementCopy=true" : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
|
|
371
372
|
}
|
|
372
373
|
initialize() {
|
|
373
374
|
window.addEventListener("message", this.iframeEventHandler);
|
|
@@ -410,27 +411,28 @@ const me = ({
|
|
|
410
411
|
amount: o,
|
|
411
412
|
gasRefuelAmountPerChain: r,
|
|
412
413
|
preferGaslessPayment: c,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
414
|
+
chainIds: a,
|
|
415
|
+
excludeChainIds: n,
|
|
416
|
+
excludeCurrencyTiers: h,
|
|
417
|
+
excludeFundingSources: u,
|
|
418
|
+
fundingSources: m,
|
|
419
|
+
mode: g,
|
|
420
|
+
hideSettlementCopy: f,
|
|
421
|
+
sessionId: y,
|
|
422
|
+
sessionMetadata: w,
|
|
423
|
+
disableWithdrawToSelfSuggestion: l,
|
|
424
|
+
theme: b,
|
|
425
|
+
walletProvider: d,
|
|
426
|
+
localStorageProvider: v,
|
|
425
427
|
onOpen: $,
|
|
426
|
-
onSuccess:
|
|
427
|
-
onClose:
|
|
428
|
-
autoCloseOnSuccess:
|
|
429
|
-
popupsBlocked:
|
|
430
|
-
baseUrl:
|
|
431
|
-
debug:
|
|
428
|
+
onSuccess: x,
|
|
429
|
+
onClose: P,
|
|
430
|
+
autoCloseOnSuccess: E,
|
|
431
|
+
popupsBlocked: k,
|
|
432
|
+
baseUrl: U,
|
|
433
|
+
debug: z
|
|
432
434
|
}) => {
|
|
433
|
-
const
|
|
435
|
+
const S = M(() => new D({
|
|
434
436
|
app: s,
|
|
435
437
|
recipient: t,
|
|
436
438
|
chainId: e,
|
|
@@ -438,25 +440,26 @@ const me = ({
|
|
|
438
440
|
amount: o,
|
|
439
441
|
gasRefuelAmountPerChain: r,
|
|
440
442
|
preferGaslessPayment: c,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
443
|
+
chainIds: a,
|
|
444
|
+
excludeChainIds: n,
|
|
445
|
+
excludeCurrencyTiers: h,
|
|
446
|
+
excludeFundingSources: u,
|
|
447
|
+
fundingSources: m,
|
|
448
|
+
mode: g,
|
|
449
|
+
hideSettlementCopy: f,
|
|
450
|
+
sessionId: y,
|
|
451
|
+
sessionMetadata: w,
|
|
452
|
+
disableWithdrawToSelfSuggestion: l,
|
|
453
|
+
theme: b,
|
|
454
|
+
walletProvider: d,
|
|
455
|
+
localStorageProvider: v,
|
|
453
456
|
onOpen: $,
|
|
454
|
-
onSuccess:
|
|
455
|
-
onClose:
|
|
456
|
-
autoCloseOnSuccess:
|
|
457
|
-
popupsBlocked:
|
|
458
|
-
baseUrl:
|
|
459
|
-
debug:
|
|
457
|
+
onSuccess: x,
|
|
458
|
+
onClose: P,
|
|
459
|
+
autoCloseOnSuccess: E,
|
|
460
|
+
popupsBlocked: k,
|
|
461
|
+
baseUrl: U,
|
|
462
|
+
debug: z
|
|
460
463
|
}), [
|
|
461
464
|
s,
|
|
462
465
|
t,
|
|
@@ -474,65 +477,68 @@ const me = ({
|
|
|
474
477
|
f,
|
|
475
478
|
y,
|
|
476
479
|
w,
|
|
477
|
-
d,
|
|
478
480
|
l,
|
|
479
481
|
b,
|
|
480
|
-
|
|
482
|
+
d,
|
|
481
483
|
v,
|
|
482
|
-
|
|
484
|
+
$,
|
|
485
|
+
x,
|
|
483
486
|
P,
|
|
484
487
|
E,
|
|
485
488
|
k,
|
|
486
|
-
U
|
|
489
|
+
U,
|
|
490
|
+
z
|
|
487
491
|
]);
|
|
488
492
|
return {
|
|
489
|
-
openGlideDeposit:
|
|
490
|
-
externalUrl:
|
|
491
|
-
opts:
|
|
493
|
+
openGlideDeposit: S.open,
|
|
494
|
+
externalUrl: S.externalUrl,
|
|
495
|
+
opts: S.opts
|
|
492
496
|
};
|
|
493
497
|
}, ge = ({
|
|
494
498
|
app: s,
|
|
495
499
|
preferGaslessPayment: t,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
500
|
+
chainIds: e,
|
|
501
|
+
excludeChainIds: i,
|
|
502
|
+
excludeCurrencyTiers: o,
|
|
503
|
+
excludeFundingSources: r,
|
|
504
|
+
fundingSources: c,
|
|
505
|
+
hideSettlementCopy: a,
|
|
506
|
+
amount: n,
|
|
507
|
+
sessionId: h,
|
|
508
|
+
sessionMetadata: u,
|
|
509
|
+
theme: m,
|
|
510
|
+
walletProvider: g,
|
|
511
|
+
localStorageProvider: f,
|
|
512
|
+
onOpen: y,
|
|
513
|
+
onSuccess: w,
|
|
514
|
+
onClose: l,
|
|
515
|
+
autoCloseOnSuccess: b,
|
|
516
|
+
popupsBlocked: d,
|
|
517
|
+
baseUrl: v,
|
|
513
518
|
debug: $
|
|
514
519
|
}) => {
|
|
515
|
-
const
|
|
520
|
+
const x = M(() => new D({
|
|
516
521
|
app: s,
|
|
517
522
|
preferGaslessPayment: t,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
523
|
+
chainIds: e,
|
|
524
|
+
excludeChainIds: i,
|
|
525
|
+
excludeCurrencyTiers: o,
|
|
526
|
+
excludeFundingSources: r,
|
|
527
|
+
fundingSources: c,
|
|
522
528
|
mode: "pay",
|
|
523
|
-
hideSettlementCopy:
|
|
524
|
-
sessionId:
|
|
525
|
-
amount:
|
|
526
|
-
sessionMetadata:
|
|
527
|
-
theme:
|
|
528
|
-
walletProvider:
|
|
529
|
-
localStorageProvider:
|
|
530
|
-
onOpen:
|
|
531
|
-
onSuccess:
|
|
532
|
-
onClose:
|
|
533
|
-
autoCloseOnSuccess:
|
|
534
|
-
popupsBlocked:
|
|
535
|
-
baseUrl:
|
|
529
|
+
hideSettlementCopy: a,
|
|
530
|
+
sessionId: h,
|
|
531
|
+
amount: n,
|
|
532
|
+
sessionMetadata: u,
|
|
533
|
+
theme: m,
|
|
534
|
+
walletProvider: g,
|
|
535
|
+
localStorageProvider: f,
|
|
536
|
+
onOpen: y,
|
|
537
|
+
onSuccess: w,
|
|
538
|
+
onClose: l,
|
|
539
|
+
autoCloseOnSuccess: b,
|
|
540
|
+
popupsBlocked: d,
|
|
541
|
+
baseUrl: v,
|
|
536
542
|
debug: $
|
|
537
543
|
}), [
|
|
538
544
|
s,
|
|
@@ -542,65 +548,68 @@ const me = ({
|
|
|
542
548
|
o,
|
|
543
549
|
r,
|
|
544
550
|
c,
|
|
545
|
-
n,
|
|
546
551
|
a,
|
|
547
552
|
h,
|
|
553
|
+
n,
|
|
548
554
|
u,
|
|
549
555
|
m,
|
|
550
556
|
g,
|
|
551
557
|
f,
|
|
552
558
|
y,
|
|
553
559
|
w,
|
|
554
|
-
d,
|
|
555
560
|
l,
|
|
556
561
|
b,
|
|
562
|
+
d,
|
|
563
|
+
v,
|
|
557
564
|
$
|
|
558
565
|
]);
|
|
559
566
|
return {
|
|
560
|
-
openGlidePay:
|
|
561
|
-
externalUrl:
|
|
562
|
-
opts:
|
|
567
|
+
openGlidePay: x.open,
|
|
568
|
+
externalUrl: x.externalUrl,
|
|
569
|
+
opts: x.opts
|
|
563
570
|
};
|
|
564
571
|
}, fe = ({
|
|
565
572
|
app: s,
|
|
566
573
|
evm: t,
|
|
567
574
|
approval: e,
|
|
568
575
|
preferGaslessPayment: i,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
576
|
+
chainIds: o,
|
|
577
|
+
excludeChainIds: r,
|
|
578
|
+
excludeCurrencyTiers: c,
|
|
579
|
+
excludeFundingSources: a,
|
|
580
|
+
sessionMetadata: n,
|
|
581
|
+
theme: h,
|
|
582
|
+
walletProvider: u,
|
|
583
|
+
localStorageProvider: m,
|
|
584
|
+
onOpen: g,
|
|
585
|
+
onSuccess: f,
|
|
586
|
+
onClose: y,
|
|
587
|
+
autoCloseOnSuccess: w,
|
|
588
|
+
popupsBlocked: l,
|
|
589
|
+
baseUrl: b,
|
|
590
|
+
debug: d
|
|
583
591
|
}) => {
|
|
584
|
-
const
|
|
592
|
+
const v = M(() => new D({
|
|
585
593
|
app: s,
|
|
586
594
|
evm: t,
|
|
587
595
|
approval: e,
|
|
588
596
|
preferGaslessPayment: i,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
597
|
+
chainIds: o,
|
|
598
|
+
excludeChainIds: r,
|
|
599
|
+
excludeCurrencyTiers: c,
|
|
600
|
+
excludeFundingSources: a,
|
|
601
|
+
sessionMetadata: n,
|
|
593
602
|
mode: "call",
|
|
594
|
-
theme:
|
|
595
|
-
walletProvider:
|
|
596
|
-
localStorageProvider:
|
|
597
|
-
onOpen:
|
|
598
|
-
onSuccess:
|
|
599
|
-
onClose:
|
|
600
|
-
autoCloseOnSuccess:
|
|
601
|
-
popupsBlocked:
|
|
602
|
-
baseUrl:
|
|
603
|
-
debug:
|
|
603
|
+
theme: h,
|
|
604
|
+
walletProvider: u,
|
|
605
|
+
localStorageProvider: m,
|
|
606
|
+
onOpen: g,
|
|
607
|
+
onSuccess: f,
|
|
608
|
+
onClose: y,
|
|
609
|
+
autoCloseOnSuccess: w,
|
|
610
|
+
popupsBlocked: l,
|
|
611
|
+
baseUrl: b,
|
|
612
|
+
debug: d
|
|
604
613
|
}), [
|
|
605
614
|
s,
|
|
606
615
|
t,
|
|
@@ -618,13 +627,14 @@ const me = ({
|
|
|
618
627
|
f,
|
|
619
628
|
y,
|
|
620
629
|
w,
|
|
621
|
-
|
|
622
|
-
|
|
630
|
+
l,
|
|
631
|
+
b,
|
|
632
|
+
d
|
|
623
633
|
]);
|
|
624
634
|
return {
|
|
625
|
-
openGlideCall:
|
|
626
|
-
externalUrl:
|
|
627
|
-
opts:
|
|
635
|
+
openGlideCall: v.open,
|
|
636
|
+
externalUrl: v.externalUrl,
|
|
637
|
+
opts: v.opts
|
|
628
638
|
};
|
|
629
639
|
}, ye = ({
|
|
630
640
|
app: s,
|
|
@@ -632,38 +642,40 @@ const me = ({
|
|
|
632
642
|
chainId: e,
|
|
633
643
|
currencyId: i,
|
|
634
644
|
preferGaslessPayment: o,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
645
|
+
chainIds: r,
|
|
646
|
+
excludeChainIds: c,
|
|
647
|
+
excludeCurrencyTiers: a,
|
|
648
|
+
excludeFundingSources: n,
|
|
649
|
+
sessionMetadata: h,
|
|
650
|
+
theme: u,
|
|
651
|
+
walletProvider: m,
|
|
652
|
+
localStorageProvider: g,
|
|
653
|
+
onOpen: f,
|
|
654
|
+
onSuccess: y,
|
|
655
|
+
onClose: w,
|
|
656
|
+
autoCloseOnSuccess: l,
|
|
657
|
+
baseUrl: b
|
|
647
658
|
}) => {
|
|
648
|
-
const
|
|
659
|
+
const d = M(() => new D({
|
|
649
660
|
app: s,
|
|
650
661
|
recipient: t,
|
|
651
662
|
chainId: e,
|
|
652
663
|
currencyId: i,
|
|
653
664
|
preferGaslessPayment: o,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
665
|
+
chainIds: r,
|
|
666
|
+
excludeChainIds: c,
|
|
667
|
+
excludeCurrencyTiers: a,
|
|
668
|
+
excludeFundingSources: n,
|
|
669
|
+
sessionMetadata: h,
|
|
658
670
|
mode: "buy",
|
|
659
|
-
theme:
|
|
660
|
-
walletProvider:
|
|
661
|
-
localStorageProvider:
|
|
662
|
-
onOpen:
|
|
663
|
-
onSuccess:
|
|
664
|
-
onClose:
|
|
665
|
-
autoCloseOnSuccess:
|
|
666
|
-
baseUrl:
|
|
671
|
+
theme: u,
|
|
672
|
+
walletProvider: m,
|
|
673
|
+
localStorageProvider: g,
|
|
674
|
+
onOpen: f,
|
|
675
|
+
onSuccess: y,
|
|
676
|
+
onClose: w,
|
|
677
|
+
autoCloseOnSuccess: l,
|
|
678
|
+
baseUrl: b
|
|
667
679
|
}), [
|
|
668
680
|
s,
|
|
669
681
|
t,
|
|
@@ -681,12 +693,13 @@ const me = ({
|
|
|
681
693
|
f,
|
|
682
694
|
y,
|
|
683
695
|
w,
|
|
684
|
-
|
|
696
|
+
l,
|
|
697
|
+
b
|
|
685
698
|
]);
|
|
686
699
|
return {
|
|
687
|
-
openGlideBuy:
|
|
688
|
-
externalUrl:
|
|
689
|
-
opts:
|
|
700
|
+
openGlideBuy: d.open,
|
|
701
|
+
externalUrl: d.externalUrl,
|
|
702
|
+
opts: d.opts
|
|
690
703
|
};
|
|
691
704
|
}, we = Object.freeze({
|
|
692
705
|
getItem: (s) => new Promise((t, e) => {
|
|
@@ -721,7 +734,7 @@ const me = ({
|
|
|
721
734
|
})
|
|
722
735
|
});
|
|
723
736
|
export {
|
|
724
|
-
|
|
737
|
+
D as GlideDeposit,
|
|
725
738
|
we as browserLocalStorageProvider,
|
|
726
739
|
ye as useGlideBuy,
|
|
727
740
|
fe as useGlideCall,
|
package/dist/useGlideBuy.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ interface UseGlideBuyProps {
|
|
|
7
7
|
chainId?: CAIP2;
|
|
8
8
|
currencyId?: string;
|
|
9
9
|
preferGaslessPayment?: boolean;
|
|
10
|
+
chainIds?: CAIP2[];
|
|
10
11
|
excludeChainIds?: CAIP2[];
|
|
11
12
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
12
13
|
excludeFundingSources?: FundingSource[];
|
|
@@ -20,7 +21,7 @@ interface UseGlideBuyProps {
|
|
|
20
21
|
autoCloseOnSuccess?: boolean;
|
|
21
22
|
baseUrl?: string;
|
|
22
23
|
}
|
|
23
|
-
export declare const useGlideBuy: ({ app, recipient, chainId, currencyId, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
|
|
24
|
+
export declare const useGlideBuy: ({ app, recipient, chainId, currencyId, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
|
|
24
25
|
openGlideBuy: () => void;
|
|
25
26
|
externalUrl: string;
|
|
26
27
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlideCall.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ interface UseGlideCallProps {
|
|
|
14
14
|
amount: bigint;
|
|
15
15
|
};
|
|
16
16
|
preferGaslessPayment?: boolean;
|
|
17
|
+
chainIds?: CAIP2[];
|
|
17
18
|
excludeChainIds?: CAIP2[];
|
|
18
19
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
19
20
|
excludeFundingSources?: FundingSource[];
|
|
@@ -29,7 +30,7 @@ interface UseGlideCallProps {
|
|
|
29
30
|
baseUrl?: string;
|
|
30
31
|
debug?: boolean;
|
|
31
32
|
}
|
|
32
|
-
export declare const useGlideCall: ({ app, evm, approval, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideCallProps) => {
|
|
33
|
+
export declare const useGlideCall: ({ app, evm, approval, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideCallProps) => {
|
|
33
34
|
openGlideCall: () => void;
|
|
34
35
|
externalUrl: string;
|
|
35
36
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
|
@@ -9,6 +9,7 @@ interface UseGlideDepositProps {
|
|
|
9
9
|
amount?: string;
|
|
10
10
|
gasRefuelAmountPerChain?: Record<CAIP2, string>;
|
|
11
11
|
preferGaslessPayment?: boolean;
|
|
12
|
+
chainIds?: CAIP2[];
|
|
12
13
|
excludeChainIds?: CAIP2[];
|
|
13
14
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
14
15
|
excludeFundingSources?: FundingSource[];
|
|
@@ -30,7 +31,7 @@ interface UseGlideDepositProps {
|
|
|
30
31
|
baseUrl?: string;
|
|
31
32
|
debug?: boolean;
|
|
32
33
|
}
|
|
33
|
-
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, mode, hideSettlementCopy, sessionId, sessionMetadata, disableWithdrawToSelfSuggestion, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideDepositProps) => {
|
|
34
|
+
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, mode, hideSettlementCopy, sessionId, sessionMetadata, disableWithdrawToSelfSuggestion, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideDepositProps) => {
|
|
34
35
|
openGlideDeposit: () => void;
|
|
35
36
|
externalUrl: string;
|
|
36
37
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlidePay.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ type UseGlidePayProps = {
|
|
|
5
5
|
app: string;
|
|
6
6
|
amount?: string;
|
|
7
7
|
preferGaslessPayment?: boolean;
|
|
8
|
+
chainIds?: CAIP2[];
|
|
8
9
|
excludeChainIds?: CAIP2[];
|
|
9
10
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
10
11
|
excludeFundingSources?: FundingSource[];
|
|
@@ -23,7 +24,7 @@ type UseGlidePayProps = {
|
|
|
23
24
|
baseUrl?: string;
|
|
24
25
|
debug?: boolean;
|
|
25
26
|
};
|
|
26
|
-
export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, hideSettlementCopy, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
|
|
27
|
+
export declare const useGlidePay: ({ app, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, hideSettlementCopy, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
|
|
27
28
|
openGlidePay: () => void;
|
|
28
29
|
externalUrl: string;
|
|
29
30
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|