@paywithglide/glide-react 0.0.36 → 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 +2 -0
- package/dist/glide.js +193 -173
- package/dist/useGlideBuy.d.ts +2 -1
- package/dist/useGlideCall.d.ts +2 -1
- package/dist/useGlideDeposit.d.ts +3 -1
- package/dist/useGlidePay.d.ts +3 -1
- package/package.json +3 -2
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[];
|
|
@@ -117,6 +118,7 @@ export type GlideDepositOptions = {
|
|
|
117
118
|
autoCloseOnSuccess?: boolean;
|
|
118
119
|
container?: HTMLElement;
|
|
119
120
|
disableWithdrawToSelfSuggestion?: boolean;
|
|
121
|
+
hideSettlementCopy?: boolean;
|
|
120
122
|
theme?: GlideWidgetTheme;
|
|
121
123
|
popupsBlocked?: boolean;
|
|
122
124
|
baseUrl?: string;
|
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 A {
|
|
|
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 A {
|
|
|
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,
|
|
@@ -200,6 +201,7 @@ class A {
|
|
|
200
201
|
sessionMetadata: this.opts.sessionMetadata,
|
|
201
202
|
autoCloseOnSuccess: this.opts.autoCloseOnSuccess,
|
|
202
203
|
disableWithdrawToSelfSuggestion: this.opts.disableWithdrawToSelfSuggestion,
|
|
204
|
+
hideSettlementCopy: this.opts.hideSettlementCopy,
|
|
203
205
|
theme: {
|
|
204
206
|
...this.opts.theme || {},
|
|
205
207
|
colorScheme: ((n = this.opts.theme) == null ? void 0 : n.colorScheme) || getComputedStyle(document.documentElement).colorScheme || ""
|
|
@@ -258,13 +260,13 @@ class A {
|
|
|
258
260
|
break;
|
|
259
261
|
}
|
|
260
262
|
case "success":
|
|
261
|
-
(
|
|
263
|
+
(b = (l = this.opts) == null ? void 0 : l.onSuccess) == null || b.call(l, e.hash, e.session);
|
|
262
264
|
break;
|
|
263
265
|
case "close":
|
|
264
|
-
this.removeIframe(), this.destroy(), (v = (
|
|
266
|
+
this.removeIframe(), this.destroy(), (v = (d = this.opts) == null ? void 0 : d.onClose) == null || v.call(d);
|
|
265
267
|
break;
|
|
266
268
|
case "setMode":
|
|
267
|
-
(
|
|
269
|
+
(x = ($ = this.opts) == null ? void 0 : $.onSetMode) == null || x.call($, e.mode);
|
|
268
270
|
break;
|
|
269
271
|
case "switchChain":
|
|
270
272
|
if (!this.opts.walletProvider)
|
|
@@ -281,7 +283,7 @@ class A {
|
|
|
281
283
|
this.baseUrl
|
|
282
284
|
);
|
|
283
285
|
} catch (p) {
|
|
284
|
-
(
|
|
286
|
+
(U = (k = this.iframe) == null ? void 0 : k.contentWindow) == null || U.postMessage(
|
|
285
287
|
{
|
|
286
288
|
type: "didSwitchChain",
|
|
287
289
|
success: !1,
|
|
@@ -299,7 +301,7 @@ class A {
|
|
|
299
301
|
const p = await this.opts.walletProvider.sendTransactionAsync(
|
|
300
302
|
e.tx
|
|
301
303
|
);
|
|
302
|
-
(
|
|
304
|
+
(S = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || S.postMessage(
|
|
303
305
|
{
|
|
304
306
|
type: "didSendTransaction",
|
|
305
307
|
success: !0,
|
|
@@ -308,7 +310,7 @@ class A {
|
|
|
308
310
|
this.baseUrl
|
|
309
311
|
);
|
|
310
312
|
} catch (p) {
|
|
311
|
-
(
|
|
313
|
+
(G = (j = this.iframe) == null ? void 0 : j.contentWindow) == null || G.postMessage(
|
|
312
314
|
{
|
|
313
315
|
type: "didSendTransaction",
|
|
314
316
|
success: !1,
|
|
@@ -324,7 +326,7 @@ class A {
|
|
|
324
326
|
if (!this.opts.walletProvider)
|
|
325
327
|
throw new Error("walletProvider is not set");
|
|
326
328
|
if (!this.opts.walletProvider.signTypedDataAsync) {
|
|
327
|
-
(B = (
|
|
329
|
+
(B = (W = this.iframe) == null ? void 0 : W.contentWindow) == null || B.postMessage(
|
|
328
330
|
{
|
|
329
331
|
type: "didSignTypedData",
|
|
330
332
|
success: !1,
|
|
@@ -363,10 +365,10 @@ class A {
|
|
|
363
365
|
this.opts = t;
|
|
364
366
|
}
|
|
365
367
|
get externalUrl() {
|
|
366
|
-
var t, e, i, o;
|
|
368
|
+
var t, e, i, o, r;
|
|
367
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(
|
|
368
370
|
this.opts.evm.value || 0n
|
|
369
|
-
)}` : ""}${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))}` : ""}`;
|
|
370
372
|
}
|
|
371
373
|
initialize() {
|
|
372
374
|
window.addEventListener("message", this.iframeEventHandler);
|
|
@@ -409,26 +411,28 @@ const me = ({
|
|
|
409
411
|
amount: o,
|
|
410
412
|
gasRefuelAmountPerChain: r,
|
|
411
413
|
preferGaslessPayment: c,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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,
|
|
421
425
|
walletProvider: d,
|
|
422
|
-
localStorageProvider:
|
|
423
|
-
onOpen:
|
|
424
|
-
onSuccess:
|
|
425
|
-
onClose:
|
|
426
|
-
autoCloseOnSuccess:
|
|
427
|
-
popupsBlocked:
|
|
428
|
-
baseUrl:
|
|
429
|
-
debug:
|
|
426
|
+
localStorageProvider: v,
|
|
427
|
+
onOpen: $,
|
|
428
|
+
onSuccess: x,
|
|
429
|
+
onClose: P,
|
|
430
|
+
autoCloseOnSuccess: E,
|
|
431
|
+
popupsBlocked: k,
|
|
432
|
+
baseUrl: U,
|
|
433
|
+
debug: z
|
|
430
434
|
}) => {
|
|
431
|
-
const
|
|
435
|
+
const S = M(() => new D({
|
|
432
436
|
app: s,
|
|
433
437
|
recipient: t,
|
|
434
438
|
chainId: e,
|
|
@@ -436,24 +440,26 @@ const me = ({
|
|
|
436
440
|
amount: o,
|
|
437
441
|
gasRefuelAmountPerChain: r,
|
|
438
442
|
preferGaslessPayment: c,
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
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,
|
|
448
454
|
walletProvider: d,
|
|
449
|
-
localStorageProvider:
|
|
450
|
-
onOpen:
|
|
451
|
-
onSuccess:
|
|
452
|
-
onClose:
|
|
453
|
-
autoCloseOnSuccess:
|
|
454
|
-
popupsBlocked:
|
|
455
|
-
baseUrl:
|
|
456
|
-
debug:
|
|
455
|
+
localStorageProvider: v,
|
|
456
|
+
onOpen: $,
|
|
457
|
+
onSuccess: x,
|
|
458
|
+
onClose: P,
|
|
459
|
+
autoCloseOnSuccess: E,
|
|
460
|
+
popupsBlocked: k,
|
|
461
|
+
baseUrl: U,
|
|
462
|
+
debug: z
|
|
457
463
|
}), [
|
|
458
464
|
s,
|
|
459
465
|
t,
|
|
@@ -471,63 +477,69 @@ const me = ({
|
|
|
471
477
|
f,
|
|
472
478
|
y,
|
|
473
479
|
w,
|
|
474
|
-
d,
|
|
475
480
|
l,
|
|
476
481
|
b,
|
|
482
|
+
d,
|
|
477
483
|
v,
|
|
478
484
|
$,
|
|
479
|
-
|
|
485
|
+
x,
|
|
480
486
|
P,
|
|
481
487
|
E,
|
|
482
|
-
k
|
|
488
|
+
k,
|
|
489
|
+
U,
|
|
490
|
+
z
|
|
483
491
|
]);
|
|
484
492
|
return {
|
|
485
|
-
openGlideDeposit:
|
|
486
|
-
externalUrl:
|
|
487
|
-
opts:
|
|
493
|
+
openGlideDeposit: S.open,
|
|
494
|
+
externalUrl: S.externalUrl,
|
|
495
|
+
opts: S.opts
|
|
488
496
|
};
|
|
489
497
|
}, ge = ({
|
|
490
498
|
app: s,
|
|
491
499
|
preferGaslessPayment: t,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
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,
|
|
506
516
|
popupsBlocked: d,
|
|
507
|
-
baseUrl:
|
|
508
|
-
debug:
|
|
517
|
+
baseUrl: v,
|
|
518
|
+
debug: $
|
|
509
519
|
}) => {
|
|
510
|
-
const
|
|
520
|
+
const x = M(() => new D({
|
|
511
521
|
app: s,
|
|
512
522
|
preferGaslessPayment: t,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
523
|
+
chainIds: e,
|
|
524
|
+
excludeChainIds: i,
|
|
525
|
+
excludeCurrencyTiers: o,
|
|
526
|
+
excludeFundingSources: r,
|
|
527
|
+
fundingSources: c,
|
|
517
528
|
mode: "pay",
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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,
|
|
528
540
|
popupsBlocked: d,
|
|
529
|
-
baseUrl:
|
|
530
|
-
debug:
|
|
541
|
+
baseUrl: v,
|
|
542
|
+
debug: $
|
|
531
543
|
}), [
|
|
532
544
|
s,
|
|
533
545
|
t,
|
|
@@ -535,65 +547,69 @@ const me = ({
|
|
|
535
547
|
i,
|
|
536
548
|
o,
|
|
537
549
|
r,
|
|
538
|
-
a,
|
|
539
550
|
c,
|
|
540
|
-
|
|
551
|
+
a,
|
|
541
552
|
h,
|
|
553
|
+
n,
|
|
542
554
|
u,
|
|
543
555
|
m,
|
|
544
556
|
g,
|
|
545
557
|
f,
|
|
546
558
|
y,
|
|
547
559
|
w,
|
|
548
|
-
d,
|
|
549
560
|
l,
|
|
550
|
-
b
|
|
561
|
+
b,
|
|
562
|
+
d,
|
|
563
|
+
v,
|
|
564
|
+
$
|
|
551
565
|
]);
|
|
552
566
|
return {
|
|
553
|
-
openGlidePay:
|
|
554
|
-
externalUrl:
|
|
555
|
-
opts:
|
|
567
|
+
openGlidePay: x.open,
|
|
568
|
+
externalUrl: x.externalUrl,
|
|
569
|
+
opts: x.opts
|
|
556
570
|
};
|
|
557
571
|
}, fe = ({
|
|
558
572
|
app: s,
|
|
559
573
|
evm: t,
|
|
560
574
|
approval: e,
|
|
561
575
|
preferGaslessPayment: i,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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
|
|
576
591
|
}) => {
|
|
577
|
-
const
|
|
592
|
+
const v = M(() => new D({
|
|
578
593
|
app: s,
|
|
579
594
|
evm: t,
|
|
580
595
|
approval: e,
|
|
581
596
|
preferGaslessPayment: i,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
597
|
+
chainIds: o,
|
|
598
|
+
excludeChainIds: r,
|
|
599
|
+
excludeCurrencyTiers: c,
|
|
600
|
+
excludeFundingSources: a,
|
|
601
|
+
sessionMetadata: n,
|
|
586
602
|
mode: "call",
|
|
587
|
-
theme:
|
|
588
|
-
walletProvider:
|
|
589
|
-
localStorageProvider:
|
|
590
|
-
onOpen:
|
|
591
|
-
onSuccess:
|
|
592
|
-
onClose:
|
|
593
|
-
autoCloseOnSuccess:
|
|
594
|
-
popupsBlocked:
|
|
595
|
-
baseUrl:
|
|
596
|
-
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
|
|
597
613
|
}), [
|
|
598
614
|
s,
|
|
599
615
|
t,
|
|
@@ -611,13 +627,14 @@ const me = ({
|
|
|
611
627
|
f,
|
|
612
628
|
y,
|
|
613
629
|
w,
|
|
614
|
-
|
|
615
|
-
|
|
630
|
+
l,
|
|
631
|
+
b,
|
|
632
|
+
d
|
|
616
633
|
]);
|
|
617
634
|
return {
|
|
618
|
-
openGlideCall:
|
|
619
|
-
externalUrl:
|
|
620
|
-
opts:
|
|
635
|
+
openGlideCall: v.open,
|
|
636
|
+
externalUrl: v.externalUrl,
|
|
637
|
+
opts: v.opts
|
|
621
638
|
};
|
|
622
639
|
}, ye = ({
|
|
623
640
|
app: s,
|
|
@@ -625,38 +642,40 @@ const me = ({
|
|
|
625
642
|
chainId: e,
|
|
626
643
|
currencyId: i,
|
|
627
644
|
preferGaslessPayment: o,
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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
|
|
640
658
|
}) => {
|
|
641
|
-
const
|
|
659
|
+
const d = M(() => new D({
|
|
642
660
|
app: s,
|
|
643
661
|
recipient: t,
|
|
644
662
|
chainId: e,
|
|
645
663
|
currencyId: i,
|
|
646
664
|
preferGaslessPayment: o,
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
665
|
+
chainIds: r,
|
|
666
|
+
excludeChainIds: c,
|
|
667
|
+
excludeCurrencyTiers: a,
|
|
668
|
+
excludeFundingSources: n,
|
|
669
|
+
sessionMetadata: h,
|
|
651
670
|
mode: "buy",
|
|
652
|
-
theme:
|
|
653
|
-
walletProvider:
|
|
654
|
-
localStorageProvider:
|
|
655
|
-
onOpen:
|
|
656
|
-
onSuccess:
|
|
657
|
-
onClose:
|
|
658
|
-
autoCloseOnSuccess:
|
|
659
|
-
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
|
|
660
679
|
}), [
|
|
661
680
|
s,
|
|
662
681
|
t,
|
|
@@ -674,12 +693,13 @@ const me = ({
|
|
|
674
693
|
f,
|
|
675
694
|
y,
|
|
676
695
|
w,
|
|
677
|
-
|
|
696
|
+
l,
|
|
697
|
+
b
|
|
678
698
|
]);
|
|
679
699
|
return {
|
|
680
|
-
openGlideBuy:
|
|
681
|
-
externalUrl:
|
|
682
|
-
opts:
|
|
700
|
+
openGlideBuy: d.open,
|
|
701
|
+
externalUrl: d.externalUrl,
|
|
702
|
+
opts: d.opts
|
|
683
703
|
};
|
|
684
704
|
}, we = Object.freeze({
|
|
685
705
|
getItem: (s) => new Promise((t, e) => {
|
|
@@ -714,7 +734,7 @@ const me = ({
|
|
|
714
734
|
})
|
|
715
735
|
});
|
|
716
736
|
export {
|
|
717
|
-
|
|
737
|
+
D as GlideDeposit,
|
|
718
738
|
we as browserLocalStorageProvider,
|
|
719
739
|
ye as useGlideBuy,
|
|
720
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,12 +9,14 @@ 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[];
|
|
15
16
|
fundingSources?: FundingSource[];
|
|
16
17
|
mode?: "deposit" | "withdraw";
|
|
17
18
|
hideWithdrawAddress?: boolean;
|
|
19
|
+
hideSettlementCopy?: boolean;
|
|
18
20
|
sessionId?: string;
|
|
19
21
|
sessionMetadata?: string;
|
|
20
22
|
disableWithdrawToSelfSuggestion?: boolean;
|
|
@@ -29,7 +31,7 @@ interface UseGlideDepositProps {
|
|
|
29
31
|
baseUrl?: string;
|
|
30
32
|
debug?: boolean;
|
|
31
33
|
}
|
|
32
|
-
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, mode, 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) => {
|
|
33
35
|
openGlideDeposit: () => void;
|
|
34
36
|
externalUrl: string;
|
|
35
37
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlidePay.d.ts
CHANGED
|
@@ -5,10 +5,12 @@ 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[];
|
|
11
12
|
fundingSources?: FundingSource[];
|
|
13
|
+
hideSettlementCopy?: boolean;
|
|
12
14
|
sessionId?: string;
|
|
13
15
|
sessionMetadata?: string;
|
|
14
16
|
theme?: GlideWidgetTheme;
|
|
@@ -22,7 +24,7 @@ type UseGlidePayProps = {
|
|
|
22
24
|
baseUrl?: string;
|
|
23
25
|
debug?: boolean;
|
|
24
26
|
};
|
|
25
|
-
export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, 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) => {
|
|
26
28
|
openGlidePay: () => void;
|
|
27
29
|
externalUrl: string;
|
|
28
30
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paywithglide/glide-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build": "tsc --p ./tsconfig.build.json && vite build",
|
|
21
21
|
"build-web": "tsc --p ./tsconfig.build.json && vite build --mode web",
|
|
22
22
|
"build-chromeext": "tsc --p ./tsconfig.build.json && vite build --mode chromeext:popup && vite build --mode chromeext:content && vite build --mode chromeext:background",
|
|
23
|
-
"lint": "
|
|
23
|
+
"lint": "prettier --check . && eslint .",
|
|
24
24
|
"preview": "vite preview",
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
40
40
|
"eslint-plugin-react-refresh": "^0.4.14",
|
|
41
41
|
"globals": "^15.12.0",
|
|
42
|
+
"prettier": "^3.6.2",
|
|
42
43
|
"react": "^18.3.1",
|
|
43
44
|
"react-dom": "^18.3.1",
|
|
44
45
|
"typescript": "~5.6.2",
|