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