@paywithglide/glide-react 0.0.38 → 0.0.40
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 +11 -0
- package/dist/glide.js +261 -210
- package/dist/useGlideBuy.d.ts +4 -2
- package/dist/useGlideCall.d.ts +4 -2
- package/dist/useGlideDeposit.d.ts +11 -2
- package/dist/useGlidePay.d.ts +12 -2
- package/package.json +2 -2
package/dist/GlideDeposit.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export type GlideLocalStorageProvider = {
|
|
|
83
83
|
getKeys: () => Promise<string[]>;
|
|
84
84
|
};
|
|
85
85
|
export type FundingSource = "transfer" | "coinbase" | "coinbase_app" | "interac" | "fiat" | "wallet";
|
|
86
|
+
export type ShowAppLogo = "default" | "always" | "never";
|
|
86
87
|
export type GlideDepositOptions = {
|
|
87
88
|
app: string;
|
|
88
89
|
recipient?: string;
|
|
@@ -109,6 +110,14 @@ export type GlideDepositOptions = {
|
|
|
109
110
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
110
111
|
excludeFundingSources?: FundingSource[];
|
|
111
112
|
fundingSources?: FundingSource[];
|
|
113
|
+
allowedPaymentCurrencies?: string[];
|
|
114
|
+
appMetadata?: {
|
|
115
|
+
name?: string;
|
|
116
|
+
logoUrl?: string;
|
|
117
|
+
faviconUrl?: string;
|
|
118
|
+
};
|
|
119
|
+
enableRefundEmails?: boolean;
|
|
120
|
+
payerEmail?: string;
|
|
112
121
|
walletProvider?: GlideDepositWalletProvider;
|
|
113
122
|
localStorageProvider?: GlideLocalStorageProvider;
|
|
114
123
|
onOpen?: () => void;
|
|
@@ -119,6 +128,8 @@ export type GlideDepositOptions = {
|
|
|
119
128
|
container?: HTMLElement;
|
|
120
129
|
disableWithdrawToSelfSuggestion?: boolean;
|
|
121
130
|
hideSettlementCopy?: boolean;
|
|
131
|
+
showAppLogo?: ShowAppLogo;
|
|
132
|
+
showOnrampFirst?: boolean;
|
|
122
133
|
theme?: GlideWidgetTheme;
|
|
123
134
|
popupsBlocked?: boolean;
|
|
124
135
|
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 G = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { useMemo as R } 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,26 +9,26 @@ 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 j = {
|
|
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 C 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 C ? e.cause.details : (n = e.cause) != null && n.message ? e.cause.message : e.details;
|
|
22
|
+
})(), o = e.cause instanceof C && e.cause.docsPath || e.docsPath, r = (a = j.getDocsUrl) == null ? void 0 : a.call(j, { ...e, docsPath: o }), p = [
|
|
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
|
+
...j.version ? [`Version: ${j.version}`] : []
|
|
29
29
|
].join(`
|
|
30
30
|
`);
|
|
31
|
-
super(
|
|
31
|
+
super(p, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
32
32
|
enumerable: !0,
|
|
33
33
|
configurable: !0,
|
|
34
34
|
writable: !0,
|
|
@@ -67,12 +67,12 @@ class I 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 C {
|
|
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 B(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 C {
|
|
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 C {
|
|
112
112
|
constructor({ givenSize: t, maxSize: e }) {
|
|
113
113
|
super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
114
114
|
}
|
|
@@ -122,46 +122,46 @@ function q(s, { size: t }) {
|
|
|
122
122
|
}
|
|
123
123
|
const ne = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
|
|
124
124
|
function ae(s, t = {}) {
|
|
125
|
-
return typeof s == "number" || typeof s == "bigint" ? de(s, t) : typeof s == "string" ?
|
|
125
|
+
return typeof s == "number" || typeof s == "bigint" ? de(s, t) : typeof s == "string" ? ce(s, t) : typeof s == "boolean" ? pe(s, t) : J(s, t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function pe(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 }), B(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 }), B(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);
|
|
140
140
|
let r;
|
|
141
141
|
i ? e ? r = (1n << BigInt(i) * 8n - 1n) - 1n : r = 2n ** (BigInt(i) * 8n) - 1n : typeof s == "number" && (r = BigInt(Number.MAX_SAFE_INTEGER));
|
|
142
|
-
const
|
|
143
|
-
if (r && o > r || o <
|
|
142
|
+
const p = typeof r == "bigint" && e ? -r - 1n : 0;
|
|
143
|
+
if (r && o > r || o < p) {
|
|
144
144
|
const n = typeof s == "bigint" ? "n" : "";
|
|
145
145
|
throw new oe({
|
|
146
146
|
max: r ? `${r}${n}` : void 0,
|
|
147
|
-
min: `${
|
|
147
|
+
min: `${p}${n}`,
|
|
148
148
|
signed: e,
|
|
149
149
|
size: i,
|
|
150
150
|
value: `${s}${n}`
|
|
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 ? B(a, { size: i }) : a;
|
|
155
155
|
}
|
|
156
156
|
const le = /* @__PURE__ */ new TextEncoder();
|
|
157
|
-
function
|
|
157
|
+
function ce(s, t = {}) {
|
|
158
158
|
const e = le.encode(s);
|
|
159
159
|
return J(e, t);
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class W {
|
|
162
162
|
constructor(t) {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
G(this, "opts");
|
|
164
|
+
G(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,17 +172,17 @@ class D {
|
|
|
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,
|
|
175
|
+
G(this, "iframeEventHandler", async (t) => {
|
|
176
|
+
var i, o, r, p, a, n, d, m, g, f, y, w, b, c, $, h, v, l, x, I, P, E, U, k, S, z, T, A, D, M, H, L, O;
|
|
177
177
|
const e = t.data;
|
|
178
178
|
switch (e.type) {
|
|
179
179
|
case "sendInit": {
|
|
180
|
-
const
|
|
181
|
-
(
|
|
180
|
+
const u = this.opts.recipient, X = (i = this.opts.walletProvider) == null ? void 0 : i.address, Q = (o = this.opts.walletProvider) == null ? void 0 : o.availableChainIds, Y = (r = this.opts.walletProvider) == null ? void 0 : r.currentChainId, Z = this.opts.preferGaslessPayment || !!((p = this.opts.walletProvider) != null && p.signTypedDataAsync);
|
|
181
|
+
(d = (a = this.iframe) == null ? void 0 : a.contentWindow) == null || d.postMessage(
|
|
182
182
|
{
|
|
183
183
|
type: "initialize",
|
|
184
184
|
sessionId: this.opts.sessionId,
|
|
185
|
-
recipient:
|
|
185
|
+
recipient: u,
|
|
186
186
|
connectedWalletAddress: X,
|
|
187
187
|
availableChainIds: Q,
|
|
188
188
|
currentChainId: Y,
|
|
@@ -192,6 +192,10 @@ class D {
|
|
|
192
192
|
excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
|
|
193
193
|
excludeFundingSources: this.opts.excludeFundingSources,
|
|
194
194
|
fundingSources: this.opts.fundingSources,
|
|
195
|
+
allowedPaymentCurrencies: this.opts.allowedPaymentCurrencies,
|
|
196
|
+
appMetadata: this.opts.appMetadata,
|
|
197
|
+
enableRefundEmails: this.opts.enableRefundEmails,
|
|
198
|
+
payerEmail: this.opts.payerEmail,
|
|
195
199
|
mode: this.opts.mode,
|
|
196
200
|
amount: this.opts.amount,
|
|
197
201
|
chainId: this.opts.chainId,
|
|
@@ -202,6 +206,8 @@ class D {
|
|
|
202
206
|
autoCloseOnSuccess: this.opts.autoCloseOnSuccess,
|
|
203
207
|
disableWithdrawToSelfSuggestion: this.opts.disableWithdrawToSelfSuggestion,
|
|
204
208
|
hideSettlementCopy: this.opts.hideSettlementCopy,
|
|
209
|
+
showAppLogo: this.opts.showAppLogo,
|
|
210
|
+
showOnrampFirst: this.opts.showOnrampFirst,
|
|
205
211
|
theme: {
|
|
206
212
|
...this.opts.theme || {},
|
|
207
213
|
colorScheme: ((n = this.opts.theme) == null ? void 0 : n.colorScheme) || getComputedStyle(document.documentElement).colorScheme || ""
|
|
@@ -216,17 +222,17 @@ class D {
|
|
|
216
222
|
break;
|
|
217
223
|
}
|
|
218
224
|
case "didOpen": {
|
|
219
|
-
this.iframe.style.opacity = "1", (
|
|
225
|
+
this.iframe.style.opacity = "1", (g = (m = this.opts).onOpen) == null || g.call(m);
|
|
220
226
|
break;
|
|
221
227
|
}
|
|
222
228
|
case "localStorage.getKeys": {
|
|
223
229
|
if (!this.opts.localStorageProvider)
|
|
224
230
|
throw new Error("localStorageProvider is not set");
|
|
225
|
-
const
|
|
226
|
-
(
|
|
231
|
+
const u = await this.opts.localStorageProvider.getKeys();
|
|
232
|
+
(y = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || y.postMessage(
|
|
227
233
|
{
|
|
228
234
|
type: "localStorage.didGetKeys",
|
|
229
|
-
keys:
|
|
235
|
+
keys: u
|
|
230
236
|
},
|
|
231
237
|
this.baseUrl
|
|
232
238
|
);
|
|
@@ -248,25 +254,25 @@ class D {
|
|
|
248
254
|
case "localStorage.getItem": {
|
|
249
255
|
if (!this.opts.localStorageProvider)
|
|
250
256
|
throw new Error("localStorageProvider is not set");
|
|
251
|
-
const
|
|
252
|
-
(
|
|
257
|
+
const u = await this.opts.localStorageProvider.getItem(e.key);
|
|
258
|
+
(b = (w = this.iframe) == null ? void 0 : w.contentWindow) == null || b.postMessage(
|
|
253
259
|
{
|
|
254
260
|
type: "localStorage.didGetItem",
|
|
255
261
|
key: e.key,
|
|
256
|
-
value:
|
|
262
|
+
value: u
|
|
257
263
|
},
|
|
258
264
|
this.baseUrl
|
|
259
265
|
);
|
|
260
266
|
break;
|
|
261
267
|
}
|
|
262
268
|
case "success":
|
|
263
|
-
(
|
|
269
|
+
($ = (c = this.opts) == null ? void 0 : c.onSuccess) == null || $.call(c, e.hash, e.session);
|
|
264
270
|
break;
|
|
265
271
|
case "close":
|
|
266
|
-
this.removeIframe(), this.destroy(), (v = (
|
|
272
|
+
this.removeIframe(), this.destroy(), (v = (h = this.opts) == null ? void 0 : h.onClose) == null || v.call(h);
|
|
267
273
|
break;
|
|
268
274
|
case "setMode":
|
|
269
|
-
(x = (
|
|
275
|
+
(x = (l = this.opts) == null ? void 0 : l.onSetMode) == null || x.call(l, e.mode);
|
|
270
276
|
break;
|
|
271
277
|
case "switchChain":
|
|
272
278
|
if (!this.opts.walletProvider)
|
|
@@ -274,7 +280,7 @@ class D {
|
|
|
274
280
|
try {
|
|
275
281
|
await this.opts.walletProvider.switchChainAsync({
|
|
276
282
|
chainId: e.chainId
|
|
277
|
-
}), (
|
|
283
|
+
}), (P = (I = this.iframe) == null ? void 0 : I.contentWindow) == null || P.postMessage(
|
|
278
284
|
{
|
|
279
285
|
type: "didSwitchChain",
|
|
280
286
|
success: !0,
|
|
@@ -282,12 +288,12 @@ class D {
|
|
|
282
288
|
},
|
|
283
289
|
this.baseUrl
|
|
284
290
|
);
|
|
285
|
-
} catch (
|
|
286
|
-
(U = (
|
|
291
|
+
} catch (u) {
|
|
292
|
+
(U = (E = this.iframe) == null ? void 0 : E.contentWindow) == null || U.postMessage(
|
|
287
293
|
{
|
|
288
294
|
type: "didSwitchChain",
|
|
289
295
|
success: !1,
|
|
290
|
-
error:
|
|
296
|
+
error: u
|
|
291
297
|
},
|
|
292
298
|
this.baseUrl
|
|
293
299
|
);
|
|
@@ -298,23 +304,23 @@ class D {
|
|
|
298
304
|
if (!this.opts.walletProvider)
|
|
299
305
|
throw new Error("walletProvider is not set");
|
|
300
306
|
try {
|
|
301
|
-
const
|
|
307
|
+
const u = await this.opts.walletProvider.sendTransactionAsync(
|
|
302
308
|
e.tx
|
|
303
309
|
);
|
|
304
|
-
(S = (
|
|
310
|
+
(S = (k = this.iframe) == null ? void 0 : k.contentWindow) == null || S.postMessage(
|
|
305
311
|
{
|
|
306
312
|
type: "didSendTransaction",
|
|
307
313
|
success: !0,
|
|
308
|
-
txHash:
|
|
314
|
+
txHash: u
|
|
309
315
|
},
|
|
310
316
|
this.baseUrl
|
|
311
317
|
);
|
|
312
|
-
} catch (
|
|
313
|
-
(
|
|
318
|
+
} catch (u) {
|
|
319
|
+
(T = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || T.postMessage(
|
|
314
320
|
{
|
|
315
321
|
type: "didSendTransaction",
|
|
316
322
|
success: !1,
|
|
317
|
-
error:
|
|
323
|
+
error: u
|
|
318
324
|
},
|
|
319
325
|
this.baseUrl
|
|
320
326
|
);
|
|
@@ -326,7 +332,7 @@ class D {
|
|
|
326
332
|
if (!this.opts.walletProvider)
|
|
327
333
|
throw new Error("walletProvider is not set");
|
|
328
334
|
if (!this.opts.walletProvider.signTypedDataAsync) {
|
|
329
|
-
(
|
|
335
|
+
(D = (A = this.iframe) == null ? void 0 : A.contentWindow) == null || D.postMessage(
|
|
330
336
|
{
|
|
331
337
|
type: "didSignTypedData",
|
|
332
338
|
success: !1,
|
|
@@ -337,23 +343,23 @@ class D {
|
|
|
337
343
|
return;
|
|
338
344
|
}
|
|
339
345
|
try {
|
|
340
|
-
const
|
|
346
|
+
const u = await this.opts.walletProvider.signTypedDataAsync(
|
|
341
347
|
e.data
|
|
342
348
|
);
|
|
343
|
-
(
|
|
349
|
+
(H = (M = this.iframe) == null ? void 0 : M.contentWindow) == null || H.postMessage(
|
|
344
350
|
{
|
|
345
351
|
type: "didSignTypedData",
|
|
346
352
|
success: !0,
|
|
347
|
-
signature:
|
|
353
|
+
signature: u
|
|
348
354
|
},
|
|
349
355
|
this.baseUrl
|
|
350
356
|
);
|
|
351
|
-
} catch (
|
|
352
|
-
(
|
|
357
|
+
} catch (u) {
|
|
358
|
+
(O = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || O.postMessage(
|
|
353
359
|
{
|
|
354
360
|
type: "didSignTypedData",
|
|
355
361
|
success: !1,
|
|
356
|
-
error:
|
|
362
|
+
error: u
|
|
357
363
|
},
|
|
358
364
|
this.baseUrl
|
|
359
365
|
);
|
|
@@ -365,10 +371,10 @@ class D {
|
|
|
365
371
|
this.opts = t;
|
|
366
372
|
}
|
|
367
373
|
get externalUrl() {
|
|
368
|
-
var t, e, i, o, r;
|
|
374
|
+
var t, e, i, o, r, p, a, n, d;
|
|
369
375
|
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(
|
|
370
376
|
this.opts.evm.value || 0n
|
|
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))}` : ""}`;
|
|
377
|
+
)}` : ""}${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(",")}` : ""}${(p = this.opts.allowedPaymentCurrencies) != null && p.length ? `&allowedPaymentCurrencies=${this.opts.allowedPaymentCurrencies.join(",")}` : ""}${(a = this.opts.appMetadata) != null && a.name ? `&appMetadata.name=${encodeURIComponent(this.opts.appMetadata.name)}` : ""}${(n = this.opts.appMetadata) != null && n.logoUrl ? `&appMetadata.logoUrl=${encodeURIComponent(this.opts.appMetadata.logoUrl)}` : ""}${(d = this.opts.appMetadata) != null && d.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.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
|
|
372
378
|
}
|
|
373
379
|
initialize() {
|
|
374
380
|
window.addEventListener("message", this.iframeEventHandler);
|
|
@@ -410,56 +416,66 @@ const me = ({
|
|
|
410
416
|
currencyId: i,
|
|
411
417
|
amount: o,
|
|
412
418
|
gasRefuelAmountPerChain: r,
|
|
413
|
-
preferGaslessPayment:
|
|
419
|
+
preferGaslessPayment: p,
|
|
414
420
|
chainIds: a,
|
|
415
421
|
excludeChainIds: n,
|
|
416
|
-
excludeCurrencyTiers:
|
|
417
|
-
excludeFundingSources:
|
|
418
|
-
fundingSources:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
422
|
+
excludeCurrencyTiers: d,
|
|
423
|
+
excludeFundingSources: m,
|
|
424
|
+
fundingSources: g,
|
|
425
|
+
appMetadata: f,
|
|
426
|
+
enableRefundEmails: y,
|
|
427
|
+
payerEmail: w,
|
|
428
|
+
mode: b,
|
|
429
|
+
hideSettlementCopy: c,
|
|
430
|
+
showAppLogo: $,
|
|
431
|
+
showOnrampFirst: h,
|
|
432
|
+
sessionId: v,
|
|
433
|
+
sessionMetadata: l,
|
|
434
|
+
disableWithdrawToSelfSuggestion: x,
|
|
435
|
+
theme: I,
|
|
436
|
+
walletProvider: P,
|
|
437
|
+
localStorageProvider: E,
|
|
438
|
+
onOpen: U,
|
|
439
|
+
onSuccess: k,
|
|
440
|
+
onClose: S,
|
|
441
|
+
autoCloseOnSuccess: z,
|
|
442
|
+
popupsBlocked: T,
|
|
443
|
+
baseUrl: A,
|
|
444
|
+
debug: D
|
|
434
445
|
}) => {
|
|
435
|
-
const
|
|
446
|
+
const M = R(() => new W({
|
|
436
447
|
app: s,
|
|
437
448
|
recipient: t,
|
|
438
449
|
chainId: e,
|
|
439
450
|
currencyId: i,
|
|
440
451
|
amount: o,
|
|
441
452
|
gasRefuelAmountPerChain: r,
|
|
442
|
-
preferGaslessPayment:
|
|
453
|
+
preferGaslessPayment: p,
|
|
443
454
|
chainIds: a,
|
|
444
455
|
excludeChainIds: n,
|
|
445
|
-
excludeCurrencyTiers:
|
|
446
|
-
excludeFundingSources:
|
|
447
|
-
fundingSources:
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
456
|
+
excludeCurrencyTiers: d,
|
|
457
|
+
excludeFundingSources: m,
|
|
458
|
+
fundingSources: g,
|
|
459
|
+
appMetadata: f,
|
|
460
|
+
enableRefundEmails: y,
|
|
461
|
+
payerEmail: w,
|
|
462
|
+
mode: b,
|
|
463
|
+
hideSettlementCopy: c,
|
|
464
|
+
showAppLogo: $,
|
|
465
|
+
showOnrampFirst: h,
|
|
466
|
+
sessionId: v,
|
|
467
|
+
sessionMetadata: l,
|
|
468
|
+
disableWithdrawToSelfSuggestion: x,
|
|
469
|
+
theme: I,
|
|
470
|
+
walletProvider: P,
|
|
471
|
+
localStorageProvider: E,
|
|
472
|
+
onOpen: U,
|
|
473
|
+
onSuccess: k,
|
|
474
|
+
onClose: S,
|
|
475
|
+
autoCloseOnSuccess: z,
|
|
476
|
+
popupsBlocked: T,
|
|
477
|
+
baseUrl: A,
|
|
478
|
+
debug: D
|
|
463
479
|
}), [
|
|
464
480
|
s,
|
|
465
481
|
t,
|
|
@@ -467,32 +483,37 @@ const me = ({
|
|
|
467
483
|
i,
|
|
468
484
|
o,
|
|
469
485
|
r,
|
|
470
|
-
|
|
486
|
+
p,
|
|
471
487
|
a,
|
|
472
488
|
n,
|
|
473
|
-
|
|
474
|
-
u,
|
|
489
|
+
d,
|
|
475
490
|
m,
|
|
476
491
|
g,
|
|
477
492
|
f,
|
|
478
493
|
y,
|
|
479
494
|
w,
|
|
480
|
-
l,
|
|
481
495
|
b,
|
|
482
|
-
|
|
483
|
-
v,
|
|
496
|
+
c,
|
|
484
497
|
$,
|
|
498
|
+
h,
|
|
499
|
+
v,
|
|
500
|
+
l,
|
|
485
501
|
x,
|
|
502
|
+
I,
|
|
486
503
|
P,
|
|
487
504
|
E,
|
|
488
|
-
k,
|
|
489
505
|
U,
|
|
490
|
-
|
|
506
|
+
k,
|
|
507
|
+
S,
|
|
508
|
+
z,
|
|
509
|
+
T,
|
|
510
|
+
A,
|
|
511
|
+
D
|
|
491
512
|
]);
|
|
492
513
|
return {
|
|
493
|
-
openGlideDeposit:
|
|
494
|
-
externalUrl:
|
|
495
|
-
opts:
|
|
514
|
+
openGlideDeposit: M.open,
|
|
515
|
+
externalUrl: M.externalUrl,
|
|
516
|
+
opts: M.opts
|
|
496
517
|
};
|
|
497
518
|
}, ge = ({
|
|
498
519
|
app: s,
|
|
@@ -501,45 +522,57 @@ const me = ({
|
|
|
501
522
|
excludeChainIds: i,
|
|
502
523
|
excludeCurrencyTiers: o,
|
|
503
524
|
excludeFundingSources: r,
|
|
504
|
-
fundingSources:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
525
|
+
fundingSources: p,
|
|
526
|
+
allowedPaymentCurrencies: a,
|
|
527
|
+
appMetadata: n,
|
|
528
|
+
enableRefundEmails: d,
|
|
529
|
+
payerEmail: m,
|
|
530
|
+
hideSettlementCopy: g,
|
|
531
|
+
showAppLogo: f,
|
|
532
|
+
showOnrampFirst: y,
|
|
533
|
+
amount: w,
|
|
534
|
+
sessionId: b,
|
|
535
|
+
sessionMetadata: c,
|
|
536
|
+
theme: $,
|
|
537
|
+
walletProvider: h,
|
|
538
|
+
localStorageProvider: v,
|
|
539
|
+
onOpen: l,
|
|
540
|
+
onSuccess: x,
|
|
541
|
+
onClose: I,
|
|
542
|
+
autoCloseOnSuccess: P,
|
|
543
|
+
popupsBlocked: E,
|
|
544
|
+
baseUrl: U,
|
|
545
|
+
debug: k
|
|
519
546
|
}) => {
|
|
520
|
-
const
|
|
547
|
+
const S = R(() => new W({
|
|
521
548
|
app: s,
|
|
522
549
|
preferGaslessPayment: t,
|
|
523
550
|
chainIds: e,
|
|
524
551
|
excludeChainIds: i,
|
|
525
552
|
excludeCurrencyTiers: o,
|
|
526
553
|
excludeFundingSources: r,
|
|
527
|
-
fundingSources:
|
|
554
|
+
fundingSources: p,
|
|
555
|
+
allowedPaymentCurrencies: a,
|
|
556
|
+
appMetadata: n,
|
|
557
|
+
enableRefundEmails: d,
|
|
558
|
+
payerEmail: m,
|
|
528
559
|
mode: "pay",
|
|
529
|
-
hideSettlementCopy:
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
560
|
+
hideSettlementCopy: g,
|
|
561
|
+
showAppLogo: f,
|
|
562
|
+
showOnrampFirst: y,
|
|
563
|
+
sessionId: b,
|
|
564
|
+
amount: w,
|
|
565
|
+
sessionMetadata: c,
|
|
566
|
+
theme: $,
|
|
567
|
+
walletProvider: h,
|
|
568
|
+
localStorageProvider: v,
|
|
569
|
+
onOpen: l,
|
|
570
|
+
onSuccess: x,
|
|
571
|
+
onClose: I,
|
|
572
|
+
autoCloseOnSuccess: P,
|
|
573
|
+
popupsBlocked: E,
|
|
574
|
+
baseUrl: U,
|
|
575
|
+
debug: k
|
|
543
576
|
}), [
|
|
544
577
|
s,
|
|
545
578
|
t,
|
|
@@ -547,26 +580,32 @@ const me = ({
|
|
|
547
580
|
i,
|
|
548
581
|
o,
|
|
549
582
|
r,
|
|
550
|
-
|
|
583
|
+
p,
|
|
551
584
|
a,
|
|
552
|
-
h,
|
|
553
585
|
n,
|
|
554
|
-
|
|
586
|
+
d,
|
|
555
587
|
m,
|
|
556
588
|
g,
|
|
557
589
|
f,
|
|
558
590
|
y,
|
|
559
|
-
w,
|
|
560
|
-
l,
|
|
561
591
|
b,
|
|
562
|
-
|
|
592
|
+
w,
|
|
593
|
+
c,
|
|
594
|
+
$,
|
|
595
|
+
h,
|
|
563
596
|
v,
|
|
564
|
-
|
|
597
|
+
l,
|
|
598
|
+
x,
|
|
599
|
+
I,
|
|
600
|
+
P,
|
|
601
|
+
E,
|
|
602
|
+
U,
|
|
603
|
+
k
|
|
565
604
|
]);
|
|
566
605
|
return {
|
|
567
|
-
openGlidePay:
|
|
568
|
-
externalUrl:
|
|
569
|
-
opts:
|
|
606
|
+
openGlidePay: S.open,
|
|
607
|
+
externalUrl: S.externalUrl,
|
|
608
|
+
opts: S.opts
|
|
570
609
|
};
|
|
571
610
|
}, fe = ({
|
|
572
611
|
app: s,
|
|
@@ -575,41 +614,45 @@ const me = ({
|
|
|
575
614
|
preferGaslessPayment: i,
|
|
576
615
|
chainIds: o,
|
|
577
616
|
excludeChainIds: r,
|
|
578
|
-
excludeCurrencyTiers:
|
|
617
|
+
excludeCurrencyTiers: p,
|
|
579
618
|
excludeFundingSources: a,
|
|
580
619
|
sessionMetadata: n,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
620
|
+
showAppLogo: d,
|
|
621
|
+
showOnrampFirst: m,
|
|
622
|
+
theme: g,
|
|
623
|
+
walletProvider: f,
|
|
624
|
+
localStorageProvider: y,
|
|
625
|
+
onOpen: w,
|
|
626
|
+
onSuccess: b,
|
|
627
|
+
onClose: c,
|
|
628
|
+
autoCloseOnSuccess: $,
|
|
629
|
+
popupsBlocked: h,
|
|
630
|
+
baseUrl: v,
|
|
631
|
+
debug: l
|
|
591
632
|
}) => {
|
|
592
|
-
const
|
|
633
|
+
const x = R(() => new W({
|
|
593
634
|
app: s,
|
|
594
635
|
evm: t,
|
|
595
636
|
approval: e,
|
|
596
637
|
preferGaslessPayment: i,
|
|
597
638
|
chainIds: o,
|
|
598
639
|
excludeChainIds: r,
|
|
599
|
-
excludeCurrencyTiers:
|
|
640
|
+
excludeCurrencyTiers: p,
|
|
600
641
|
excludeFundingSources: a,
|
|
601
642
|
sessionMetadata: n,
|
|
643
|
+
showAppLogo: d,
|
|
644
|
+
showOnrampFirst: m,
|
|
602
645
|
mode: "call",
|
|
603
|
-
theme:
|
|
604
|
-
walletProvider:
|
|
605
|
-
localStorageProvider:
|
|
606
|
-
onOpen:
|
|
607
|
-
onSuccess:
|
|
608
|
-
onClose:
|
|
609
|
-
autoCloseOnSuccess:
|
|
610
|
-
popupsBlocked:
|
|
611
|
-
baseUrl:
|
|
612
|
-
debug:
|
|
646
|
+
theme: g,
|
|
647
|
+
walletProvider: f,
|
|
648
|
+
localStorageProvider: y,
|
|
649
|
+
onOpen: w,
|
|
650
|
+
onSuccess: b,
|
|
651
|
+
onClose: c,
|
|
652
|
+
autoCloseOnSuccess: $,
|
|
653
|
+
popupsBlocked: h,
|
|
654
|
+
baseUrl: v,
|
|
655
|
+
debug: l
|
|
613
656
|
}), [
|
|
614
657
|
s,
|
|
615
658
|
t,
|
|
@@ -617,24 +660,26 @@ const me = ({
|
|
|
617
660
|
i,
|
|
618
661
|
o,
|
|
619
662
|
r,
|
|
620
|
-
|
|
663
|
+
p,
|
|
621
664
|
a,
|
|
622
665
|
n,
|
|
623
|
-
|
|
624
|
-
u,
|
|
666
|
+
d,
|
|
625
667
|
m,
|
|
626
668
|
g,
|
|
627
669
|
f,
|
|
628
670
|
y,
|
|
629
671
|
w,
|
|
630
|
-
l,
|
|
631
672
|
b,
|
|
632
|
-
|
|
673
|
+
c,
|
|
674
|
+
$,
|
|
675
|
+
h,
|
|
676
|
+
v,
|
|
677
|
+
l
|
|
633
678
|
]);
|
|
634
679
|
return {
|
|
635
|
-
openGlideCall:
|
|
636
|
-
externalUrl:
|
|
637
|
-
opts:
|
|
680
|
+
openGlideCall: x.open,
|
|
681
|
+
externalUrl: x.externalUrl,
|
|
682
|
+
opts: x.opts
|
|
638
683
|
};
|
|
639
684
|
}, ye = ({
|
|
640
685
|
app: s,
|
|
@@ -643,39 +688,43 @@ const me = ({
|
|
|
643
688
|
currencyId: i,
|
|
644
689
|
preferGaslessPayment: o,
|
|
645
690
|
chainIds: r,
|
|
646
|
-
excludeChainIds:
|
|
691
|
+
excludeChainIds: p,
|
|
647
692
|
excludeCurrencyTiers: a,
|
|
648
693
|
excludeFundingSources: n,
|
|
649
|
-
sessionMetadata:
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
694
|
+
sessionMetadata: d,
|
|
695
|
+
showAppLogo: m,
|
|
696
|
+
showOnrampFirst: g,
|
|
697
|
+
theme: f,
|
|
698
|
+
walletProvider: y,
|
|
699
|
+
localStorageProvider: w,
|
|
700
|
+
onOpen: b,
|
|
701
|
+
onSuccess: c,
|
|
702
|
+
onClose: $,
|
|
703
|
+
autoCloseOnSuccess: h,
|
|
704
|
+
baseUrl: v
|
|
658
705
|
}) => {
|
|
659
|
-
const
|
|
706
|
+
const l = R(() => new W({
|
|
660
707
|
app: s,
|
|
661
708
|
recipient: t,
|
|
662
709
|
chainId: e,
|
|
663
710
|
currencyId: i,
|
|
664
711
|
preferGaslessPayment: o,
|
|
665
712
|
chainIds: r,
|
|
666
|
-
excludeChainIds:
|
|
713
|
+
excludeChainIds: p,
|
|
667
714
|
excludeCurrencyTiers: a,
|
|
668
715
|
excludeFundingSources: n,
|
|
669
|
-
sessionMetadata:
|
|
716
|
+
sessionMetadata: d,
|
|
717
|
+
showAppLogo: m,
|
|
718
|
+
showOnrampFirst: g,
|
|
670
719
|
mode: "buy",
|
|
671
|
-
theme:
|
|
672
|
-
walletProvider:
|
|
673
|
-
localStorageProvider:
|
|
674
|
-
onOpen:
|
|
675
|
-
onSuccess:
|
|
676
|
-
onClose:
|
|
677
|
-
autoCloseOnSuccess:
|
|
678
|
-
baseUrl:
|
|
720
|
+
theme: f,
|
|
721
|
+
walletProvider: y,
|
|
722
|
+
localStorageProvider: w,
|
|
723
|
+
onOpen: b,
|
|
724
|
+
onSuccess: c,
|
|
725
|
+
onClose: $,
|
|
726
|
+
autoCloseOnSuccess: h,
|
|
727
|
+
baseUrl: v
|
|
679
728
|
}), [
|
|
680
729
|
s,
|
|
681
730
|
t,
|
|
@@ -683,23 +732,25 @@ const me = ({
|
|
|
683
732
|
i,
|
|
684
733
|
o,
|
|
685
734
|
r,
|
|
686
|
-
|
|
735
|
+
p,
|
|
687
736
|
a,
|
|
688
737
|
n,
|
|
689
|
-
|
|
690
|
-
u,
|
|
738
|
+
d,
|
|
691
739
|
m,
|
|
692
740
|
g,
|
|
693
741
|
f,
|
|
694
742
|
y,
|
|
695
743
|
w,
|
|
696
|
-
|
|
697
|
-
|
|
744
|
+
b,
|
|
745
|
+
c,
|
|
746
|
+
$,
|
|
747
|
+
h,
|
|
748
|
+
v
|
|
698
749
|
]);
|
|
699
750
|
return {
|
|
700
|
-
openGlideBuy:
|
|
701
|
-
externalUrl:
|
|
702
|
-
opts:
|
|
751
|
+
openGlideBuy: l.open,
|
|
752
|
+
externalUrl: l.externalUrl,
|
|
753
|
+
opts: l.opts
|
|
703
754
|
};
|
|
704
755
|
}, we = Object.freeze({
|
|
705
756
|
getItem: (s) => new Promise((t, e) => {
|
|
@@ -734,7 +785,7 @@ const me = ({
|
|
|
734
785
|
})
|
|
735
786
|
});
|
|
736
787
|
export {
|
|
737
|
-
|
|
788
|
+
W as GlideDeposit,
|
|
738
789
|
we as browserLocalStorageProvider,
|
|
739
790
|
ye as useGlideBuy,
|
|
740
791
|
fe as useGlideCall,
|
package/dist/useGlideBuy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex, ShowAppLogo } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Session } from '@paywithglide/glide-js';
|
|
4
4
|
interface UseGlideBuyProps {
|
|
@@ -12,6 +12,8 @@ interface UseGlideBuyProps {
|
|
|
12
12
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
13
13
|
excludeFundingSources?: FundingSource[];
|
|
14
14
|
sessionMetadata?: string;
|
|
15
|
+
showAppLogo?: ShowAppLogo;
|
|
16
|
+
showOnrampFirst?: boolean;
|
|
15
17
|
theme?: GlideWidgetTheme;
|
|
16
18
|
walletProvider?: GlideDepositWalletProvider;
|
|
17
19
|
localStorageProvider?: GlideLocalStorageProvider;
|
|
@@ -21,7 +23,7 @@ interface UseGlideBuyProps {
|
|
|
21
23
|
autoCloseOnSuccess?: boolean;
|
|
22
24
|
baseUrl?: string;
|
|
23
25
|
}
|
|
24
|
-
export declare const useGlideBuy: ({ app, recipient, chainId, currencyId, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
|
|
26
|
+
export declare const useGlideBuy: ({ app, recipient, chainId, currencyId, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, showAppLogo, showOnrampFirst, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
|
|
25
27
|
openGlideBuy: () => void;
|
|
26
28
|
externalUrl: string;
|
|
27
29
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlideCall.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex, ShowAppLogo } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Session } from '@paywithglide/glide-js';
|
|
4
4
|
interface UseGlideCallProps {
|
|
@@ -19,6 +19,8 @@ interface UseGlideCallProps {
|
|
|
19
19
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
20
20
|
excludeFundingSources?: FundingSource[];
|
|
21
21
|
sessionMetadata?: string;
|
|
22
|
+
showAppLogo?: ShowAppLogo;
|
|
23
|
+
showOnrampFirst?: boolean;
|
|
22
24
|
theme?: GlideWidgetTheme;
|
|
23
25
|
walletProvider?: GlideDepositWalletProvider;
|
|
24
26
|
localStorageProvider?: GlideLocalStorageProvider;
|
|
@@ -30,7 +32,7 @@ interface UseGlideCallProps {
|
|
|
30
32
|
baseUrl?: string;
|
|
31
33
|
debug?: boolean;
|
|
32
34
|
}
|
|
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) => {
|
|
35
|
+
export declare const useGlideCall: ({ app, evm, approval, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, showAppLogo, showOnrampFirst, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideCallProps) => {
|
|
34
36
|
openGlideCall: () => void;
|
|
35
37
|
externalUrl: string;
|
|
36
38
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, ShowAppLogo } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Hex, Session } from '@paywithglide/glide-js';
|
|
4
4
|
interface UseGlideDepositProps {
|
|
@@ -14,9 +14,18 @@ interface UseGlideDepositProps {
|
|
|
14
14
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
15
15
|
excludeFundingSources?: FundingSource[];
|
|
16
16
|
fundingSources?: FundingSource[];
|
|
17
|
+
appMetadata?: {
|
|
18
|
+
name?: string;
|
|
19
|
+
logoUrl?: string;
|
|
20
|
+
faviconUrl?: string;
|
|
21
|
+
};
|
|
22
|
+
enableRefundEmails?: boolean;
|
|
23
|
+
payerEmail?: string;
|
|
17
24
|
mode?: "deposit" | "withdraw";
|
|
18
25
|
hideWithdrawAddress?: boolean;
|
|
19
26
|
hideSettlementCopy?: boolean;
|
|
27
|
+
showAppLogo?: ShowAppLogo;
|
|
28
|
+
showOnrampFirst?: boolean;
|
|
20
29
|
sessionId?: string;
|
|
21
30
|
sessionMetadata?: string;
|
|
22
31
|
disableWithdrawToSelfSuggestion?: boolean;
|
|
@@ -31,7 +40,7 @@ interface UseGlideDepositProps {
|
|
|
31
40
|
baseUrl?: string;
|
|
32
41
|
debug?: boolean;
|
|
33
42
|
}
|
|
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) => {
|
|
43
|
+
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, appMetadata, enableRefundEmails, payerEmail, mode, hideSettlementCopy, showAppLogo, showOnrampFirst, sessionId, sessionMetadata, disableWithdrawToSelfSuggestion, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideDepositProps) => {
|
|
35
44
|
openGlideDeposit: () => void;
|
|
36
45
|
externalUrl: string;
|
|
37
46
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlidePay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, ShowAppLogo } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Hex, Session } from '@paywithglide/glide-js';
|
|
4
4
|
type UseGlidePayProps = {
|
|
@@ -10,7 +10,17 @@ type UseGlidePayProps = {
|
|
|
10
10
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
11
11
|
excludeFundingSources?: FundingSource[];
|
|
12
12
|
fundingSources?: FundingSource[];
|
|
13
|
+
allowedPaymentCurrencies?: string[];
|
|
14
|
+
appMetadata?: {
|
|
15
|
+
name?: string;
|
|
16
|
+
logoUrl?: string;
|
|
17
|
+
faviconUrl?: string;
|
|
18
|
+
};
|
|
19
|
+
enableRefundEmails?: boolean;
|
|
20
|
+
payerEmail?: string;
|
|
13
21
|
hideSettlementCopy?: boolean;
|
|
22
|
+
showAppLogo?: ShowAppLogo;
|
|
23
|
+
showOnrampFirst?: boolean;
|
|
14
24
|
sessionId?: string;
|
|
15
25
|
sessionMetadata?: string;
|
|
16
26
|
theme?: GlideWidgetTheme;
|
|
@@ -24,7 +34,7 @@ type UseGlidePayProps = {
|
|
|
24
34
|
baseUrl?: string;
|
|
25
35
|
debug?: boolean;
|
|
26
36
|
};
|
|
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) => {
|
|
37
|
+
export declare const useGlidePay: ({ app, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, allowedPaymentCurrencies, appMetadata, enableRefundEmails, payerEmail, hideSettlementCopy, showAppLogo, showOnrampFirst, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
|
|
28
38
|
openGlidePay: () => void;
|
|
29
39
|
externalUrl: string;
|
|
30
40
|
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.40",
|
|
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": "prettier --check . && eslint .",
|
|
23
|
+
"lint": "prettier --check . && eslint . --max-warnings 0 && tsc --p ./tsconfig.build.json",
|
|
24
24
|
"preview": "vite preview",
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|