@paywithglide/glide-react 0.0.40 → 0.0.41
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 +4 -1
- package/dist/glide.js +224 -198
- package/dist/useGlideBuy.d.ts +4 -2
- package/dist/useGlideCall.d.ts +4 -2
- package/dist/useGlideDeposit.d.ts +4 -2
- package/dist/useGlidePay.d.ts +4 -2
- package/package.json +1 -1
package/dist/GlideDeposit.d.ts
CHANGED
|
@@ -82,8 +82,9 @@ export type GlideLocalStorageProvider = {
|
|
|
82
82
|
removeItem: (key: string) => Promise<void>;
|
|
83
83
|
getKeys: () => Promise<string[]>;
|
|
84
84
|
};
|
|
85
|
-
export type FundingSource = "transfer" | "coinbase" | "coinbase_app" | "interac" | "fiat" | "wallet";
|
|
85
|
+
export type FundingSource = "transfer" | "coinbase" | "coinbase_app" | "interac" | "fiat" | "wallet" | "debit_card_alias";
|
|
86
86
|
export type ShowAppLogo = "default" | "always" | "never";
|
|
87
|
+
export type DebitCardAlias = "fiat" | "coinbase";
|
|
87
88
|
export type GlideDepositOptions = {
|
|
88
89
|
app: string;
|
|
89
90
|
recipient?: string;
|
|
@@ -130,6 +131,8 @@ export type GlideDepositOptions = {
|
|
|
130
131
|
hideSettlementCopy?: boolean;
|
|
131
132
|
showAppLogo?: ShowAppLogo;
|
|
132
133
|
showOnrampFirst?: boolean;
|
|
134
|
+
debitCardAlias?: DebitCardAlias;
|
|
135
|
+
copyOverrides?: Record<string, string>;
|
|
133
136
|
theme?: GlideWidgetTheme;
|
|
134
137
|
popupsBlocked?: boolean;
|
|
135
138
|
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 W = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { useMemo as B } 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 G = {
|
|
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 A 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 A ? e.cause.details : (n = e.cause) != null && n.message ? e.cause.message : e.details;
|
|
22
|
+
})(), o = e.cause instanceof A && e.cause.docsPath || e.docsPath, r = (a = G.getDocsUrl) == null ? void 0 : a.call(G, { ...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
|
+
...G.version ? [`Version: ${G.version}`] : []
|
|
29
29
|
].join(`
|
|
30
30
|
`);
|
|
31
31
|
super(p, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
@@ -67,12 +67,12 @@ class C 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 A {
|
|
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 H(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 A {
|
|
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 A {
|
|
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 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 }), H(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 }), H(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 ? H(a, { size: i }) : a;
|
|
155
155
|
}
|
|
156
156
|
const le = /* @__PURE__ */ new TextEncoder();
|
|
157
157
|
function ce(s, t = {}) {
|
|
158
158
|
const e = le.encode(s);
|
|
159
159
|
return J(e, t);
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class O {
|
|
162
162
|
constructor(t) {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
W(this, "opts");
|
|
164
|
+
W(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 W {
|
|
|
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, p, a, n, d,
|
|
175
|
+
W(this, "iframeEventHandler", async (t) => {
|
|
176
|
+
var i, o, r, p, a, n, d, g, f, y, w, b, $, l, v, c, S, h, x, u, I, U, E, k, M, C, P, T, D, j, R, z, L;
|
|
177
177
|
const e = t.data;
|
|
178
178
|
switch (e.type) {
|
|
179
179
|
case "sendInit": {
|
|
180
|
-
const
|
|
180
|
+
const m = 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
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: m,
|
|
186
186
|
connectedWalletAddress: X,
|
|
187
187
|
availableChainIds: Q,
|
|
188
188
|
currentChainId: Y,
|
|
@@ -208,6 +208,8 @@ class W {
|
|
|
208
208
|
hideSettlementCopy: this.opts.hideSettlementCopy,
|
|
209
209
|
showAppLogo: this.opts.showAppLogo,
|
|
210
210
|
showOnrampFirst: this.opts.showOnrampFirst,
|
|
211
|
+
debitCardAlias: this.opts.debitCardAlias,
|
|
212
|
+
copyOverrides: this.opts.copyOverrides,
|
|
211
213
|
theme: {
|
|
212
214
|
...this.opts.theme || {},
|
|
213
215
|
colorScheme: ((n = this.opts.theme) == null ? void 0 : n.colorScheme) || getComputedStyle(document.documentElement).colorScheme || ""
|
|
@@ -222,17 +224,17 @@ class W {
|
|
|
222
224
|
break;
|
|
223
225
|
}
|
|
224
226
|
case "didOpen": {
|
|
225
|
-
this.iframe.style.opacity = "1", (
|
|
227
|
+
this.iframe.style.opacity = "1", (f = (g = this.opts).onOpen) == null || f.call(g);
|
|
226
228
|
break;
|
|
227
229
|
}
|
|
228
230
|
case "localStorage.getKeys": {
|
|
229
231
|
if (!this.opts.localStorageProvider)
|
|
230
232
|
throw new Error("localStorageProvider is not set");
|
|
231
|
-
const
|
|
232
|
-
(
|
|
233
|
+
const m = await this.opts.localStorageProvider.getKeys();
|
|
234
|
+
(w = (y = this.iframe) == null ? void 0 : y.contentWindow) == null || w.postMessage(
|
|
233
235
|
{
|
|
234
236
|
type: "localStorage.didGetKeys",
|
|
235
|
-
keys:
|
|
237
|
+
keys: m
|
|
236
238
|
},
|
|
237
239
|
this.baseUrl
|
|
238
240
|
);
|
|
@@ -254,25 +256,25 @@ class W {
|
|
|
254
256
|
case "localStorage.getItem": {
|
|
255
257
|
if (!this.opts.localStorageProvider)
|
|
256
258
|
throw new Error("localStorageProvider is not set");
|
|
257
|
-
const
|
|
258
|
-
(
|
|
259
|
+
const m = await this.opts.localStorageProvider.getItem(e.key);
|
|
260
|
+
($ = (b = this.iframe) == null ? void 0 : b.contentWindow) == null || $.postMessage(
|
|
259
261
|
{
|
|
260
262
|
type: "localStorage.didGetItem",
|
|
261
263
|
key: e.key,
|
|
262
|
-
value:
|
|
264
|
+
value: m
|
|
263
265
|
},
|
|
264
266
|
this.baseUrl
|
|
265
267
|
);
|
|
266
268
|
break;
|
|
267
269
|
}
|
|
268
270
|
case "success":
|
|
269
|
-
(
|
|
271
|
+
(v = (l = this.opts) == null ? void 0 : l.onSuccess) == null || v.call(l, e.hash, e.session);
|
|
270
272
|
break;
|
|
271
273
|
case "close":
|
|
272
|
-
this.removeIframe(), this.destroy(), (
|
|
274
|
+
this.removeIframe(), this.destroy(), (S = (c = this.opts) == null ? void 0 : c.onClose) == null || S.call(c);
|
|
273
275
|
break;
|
|
274
276
|
case "setMode":
|
|
275
|
-
(x = (
|
|
277
|
+
(x = (h = this.opts) == null ? void 0 : h.onSetMode) == null || x.call(h, e.mode);
|
|
276
278
|
break;
|
|
277
279
|
case "switchChain":
|
|
278
280
|
if (!this.opts.walletProvider)
|
|
@@ -280,7 +282,7 @@ class W {
|
|
|
280
282
|
try {
|
|
281
283
|
await this.opts.walletProvider.switchChainAsync({
|
|
282
284
|
chainId: e.chainId
|
|
283
|
-
}), (
|
|
285
|
+
}), (I = (u = this.iframe) == null ? void 0 : u.contentWindow) == null || I.postMessage(
|
|
284
286
|
{
|
|
285
287
|
type: "didSwitchChain",
|
|
286
288
|
success: !0,
|
|
@@ -288,12 +290,12 @@ class W {
|
|
|
288
290
|
},
|
|
289
291
|
this.baseUrl
|
|
290
292
|
);
|
|
291
|
-
} catch (
|
|
292
|
-
(
|
|
293
|
+
} catch (m) {
|
|
294
|
+
(E = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || E.postMessage(
|
|
293
295
|
{
|
|
294
296
|
type: "didSwitchChain",
|
|
295
297
|
success: !1,
|
|
296
|
-
error:
|
|
298
|
+
error: m
|
|
297
299
|
},
|
|
298
300
|
this.baseUrl
|
|
299
301
|
);
|
|
@@ -304,23 +306,23 @@ class W {
|
|
|
304
306
|
if (!this.opts.walletProvider)
|
|
305
307
|
throw new Error("walletProvider is not set");
|
|
306
308
|
try {
|
|
307
|
-
const
|
|
309
|
+
const m = await this.opts.walletProvider.sendTransactionAsync(
|
|
308
310
|
e.tx
|
|
309
311
|
);
|
|
310
|
-
(
|
|
312
|
+
(M = (k = this.iframe) == null ? void 0 : k.contentWindow) == null || M.postMessage(
|
|
311
313
|
{
|
|
312
314
|
type: "didSendTransaction",
|
|
313
315
|
success: !0,
|
|
314
|
-
txHash:
|
|
316
|
+
txHash: m
|
|
315
317
|
},
|
|
316
318
|
this.baseUrl
|
|
317
319
|
);
|
|
318
|
-
} catch (
|
|
319
|
-
(
|
|
320
|
+
} catch (m) {
|
|
321
|
+
(P = (C = this.iframe) == null ? void 0 : C.contentWindow) == null || P.postMessage(
|
|
320
322
|
{
|
|
321
323
|
type: "didSendTransaction",
|
|
322
324
|
success: !1,
|
|
323
|
-
error:
|
|
325
|
+
error: m
|
|
324
326
|
},
|
|
325
327
|
this.baseUrl
|
|
326
328
|
);
|
|
@@ -332,7 +334,7 @@ class W {
|
|
|
332
334
|
if (!this.opts.walletProvider)
|
|
333
335
|
throw new Error("walletProvider is not set");
|
|
334
336
|
if (!this.opts.walletProvider.signTypedDataAsync) {
|
|
335
|
-
(D = (
|
|
337
|
+
(D = (T = this.iframe) == null ? void 0 : T.contentWindow) == null || D.postMessage(
|
|
336
338
|
{
|
|
337
339
|
type: "didSignTypedData",
|
|
338
340
|
success: !1,
|
|
@@ -343,23 +345,23 @@ class W {
|
|
|
343
345
|
return;
|
|
344
346
|
}
|
|
345
347
|
try {
|
|
346
|
-
const
|
|
348
|
+
const m = await this.opts.walletProvider.signTypedDataAsync(
|
|
347
349
|
e.data
|
|
348
350
|
);
|
|
349
|
-
(
|
|
351
|
+
(R = (j = this.iframe) == null ? void 0 : j.contentWindow) == null || R.postMessage(
|
|
350
352
|
{
|
|
351
353
|
type: "didSignTypedData",
|
|
352
354
|
success: !0,
|
|
353
|
-
signature:
|
|
355
|
+
signature: m
|
|
354
356
|
},
|
|
355
357
|
this.baseUrl
|
|
356
358
|
);
|
|
357
|
-
} catch (
|
|
358
|
-
(
|
|
359
|
+
} catch (m) {
|
|
360
|
+
(L = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || L.postMessage(
|
|
359
361
|
{
|
|
360
362
|
type: "didSignTypedData",
|
|
361
363
|
success: !1,
|
|
362
|
-
error:
|
|
364
|
+
error: m
|
|
363
365
|
},
|
|
364
366
|
this.baseUrl
|
|
365
367
|
);
|
|
@@ -374,7 +376,7 @@ class W {
|
|
|
374
376
|
var t, e, i, o, r, p, a, n, d;
|
|
375
377
|
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(
|
|
376
378
|
this.opts.evm.value || 0n
|
|
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))}` : ""}`;
|
|
379
|
+
)}` : ""}${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.debitCardAlias ? `&debitCardAlias=${this.opts.debitCardAlias}` : ""}${this.opts.copyOverrides ? `©Overrides=${encodeURIComponent(JSON.stringify(this.opts.copyOverrides))}` : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
|
|
378
380
|
}
|
|
379
381
|
initialize() {
|
|
380
382
|
window.addEventListener("message", this.iframeEventHandler);
|
|
@@ -420,30 +422,32 @@ const me = ({
|
|
|
420
422
|
chainIds: a,
|
|
421
423
|
excludeChainIds: n,
|
|
422
424
|
excludeCurrencyTiers: d,
|
|
423
|
-
excludeFundingSources:
|
|
424
|
-
fundingSources:
|
|
425
|
-
appMetadata:
|
|
426
|
-
enableRefundEmails:
|
|
427
|
-
payerEmail:
|
|
428
|
-
mode:
|
|
429
|
-
hideSettlementCopy:
|
|
430
|
-
showAppLogo:
|
|
431
|
-
showOnrampFirst:
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
425
|
+
excludeFundingSources: g,
|
|
426
|
+
fundingSources: f,
|
|
427
|
+
appMetadata: y,
|
|
428
|
+
enableRefundEmails: w,
|
|
429
|
+
payerEmail: b,
|
|
430
|
+
mode: $,
|
|
431
|
+
hideSettlementCopy: l,
|
|
432
|
+
showAppLogo: v,
|
|
433
|
+
showOnrampFirst: c,
|
|
434
|
+
debitCardAlias: S,
|
|
435
|
+
copyOverrides: h,
|
|
436
|
+
sessionId: x,
|
|
437
|
+
sessionMetadata: u,
|
|
438
|
+
disableWithdrawToSelfSuggestion: I,
|
|
439
|
+
theme: U,
|
|
440
|
+
walletProvider: E,
|
|
441
|
+
localStorageProvider: k,
|
|
442
|
+
onOpen: M,
|
|
443
|
+
onSuccess: C,
|
|
444
|
+
onClose: P,
|
|
445
|
+
autoCloseOnSuccess: T,
|
|
446
|
+
popupsBlocked: D,
|
|
447
|
+
baseUrl: j,
|
|
448
|
+
debug: R
|
|
445
449
|
}) => {
|
|
446
|
-
const
|
|
450
|
+
const z = B(() => new O({
|
|
447
451
|
app: s,
|
|
448
452
|
recipient: t,
|
|
449
453
|
chainId: e,
|
|
@@ -454,28 +458,30 @@ const me = ({
|
|
|
454
458
|
chainIds: a,
|
|
455
459
|
excludeChainIds: n,
|
|
456
460
|
excludeCurrencyTiers: d,
|
|
457
|
-
excludeFundingSources:
|
|
458
|
-
fundingSources:
|
|
459
|
-
appMetadata:
|
|
460
|
-
enableRefundEmails:
|
|
461
|
-
payerEmail:
|
|
462
|
-
mode:
|
|
463
|
-
hideSettlementCopy:
|
|
464
|
-
showAppLogo:
|
|
465
|
-
showOnrampFirst:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
461
|
+
excludeFundingSources: g,
|
|
462
|
+
fundingSources: f,
|
|
463
|
+
appMetadata: y,
|
|
464
|
+
enableRefundEmails: w,
|
|
465
|
+
payerEmail: b,
|
|
466
|
+
mode: $,
|
|
467
|
+
hideSettlementCopy: l,
|
|
468
|
+
showAppLogo: v,
|
|
469
|
+
showOnrampFirst: c,
|
|
470
|
+
debitCardAlias: S,
|
|
471
|
+
copyOverrides: h,
|
|
472
|
+
sessionId: x,
|
|
473
|
+
sessionMetadata: u,
|
|
474
|
+
disableWithdrawToSelfSuggestion: I,
|
|
475
|
+
theme: U,
|
|
476
|
+
walletProvider: E,
|
|
477
|
+
localStorageProvider: k,
|
|
478
|
+
onOpen: M,
|
|
479
|
+
onSuccess: C,
|
|
480
|
+
onClose: P,
|
|
481
|
+
autoCloseOnSuccess: T,
|
|
482
|
+
popupsBlocked: D,
|
|
483
|
+
baseUrl: j,
|
|
484
|
+
debug: R
|
|
479
485
|
}), [
|
|
480
486
|
s,
|
|
481
487
|
t,
|
|
@@ -487,33 +493,35 @@ const me = ({
|
|
|
487
493
|
a,
|
|
488
494
|
n,
|
|
489
495
|
d,
|
|
490
|
-
m,
|
|
491
496
|
g,
|
|
492
497
|
f,
|
|
493
498
|
y,
|
|
494
499
|
w,
|
|
495
500
|
b,
|
|
496
|
-
c,
|
|
497
501
|
$,
|
|
498
|
-
h,
|
|
499
|
-
v,
|
|
500
502
|
l,
|
|
503
|
+
v,
|
|
504
|
+
c,
|
|
505
|
+
S,
|
|
506
|
+
h,
|
|
501
507
|
x,
|
|
508
|
+
u,
|
|
502
509
|
I,
|
|
503
|
-
P,
|
|
504
|
-
E,
|
|
505
510
|
U,
|
|
511
|
+
E,
|
|
506
512
|
k,
|
|
507
|
-
|
|
508
|
-
|
|
513
|
+
M,
|
|
514
|
+
C,
|
|
515
|
+
P,
|
|
509
516
|
T,
|
|
510
|
-
|
|
511
|
-
|
|
517
|
+
D,
|
|
518
|
+
j,
|
|
519
|
+
R
|
|
512
520
|
]);
|
|
513
521
|
return {
|
|
514
|
-
openGlideDeposit:
|
|
515
|
-
externalUrl:
|
|
516
|
-
opts:
|
|
522
|
+
openGlideDeposit: z.open,
|
|
523
|
+
externalUrl: z.externalUrl,
|
|
524
|
+
opts: z.opts
|
|
517
525
|
};
|
|
518
526
|
}, ge = ({
|
|
519
527
|
app: s,
|
|
@@ -526,25 +534,27 @@ const me = ({
|
|
|
526
534
|
allowedPaymentCurrencies: a,
|
|
527
535
|
appMetadata: n,
|
|
528
536
|
enableRefundEmails: d,
|
|
529
|
-
payerEmail:
|
|
530
|
-
hideSettlementCopy:
|
|
531
|
-
showAppLogo:
|
|
532
|
-
showOnrampFirst:
|
|
533
|
-
|
|
534
|
-
|
|
537
|
+
payerEmail: g,
|
|
538
|
+
hideSettlementCopy: f,
|
|
539
|
+
showAppLogo: y,
|
|
540
|
+
showOnrampFirst: w,
|
|
541
|
+
debitCardAlias: b,
|
|
542
|
+
copyOverrides: $,
|
|
543
|
+
amount: l,
|
|
544
|
+
sessionId: v,
|
|
535
545
|
sessionMetadata: c,
|
|
536
|
-
theme:
|
|
546
|
+
theme: S,
|
|
537
547
|
walletProvider: h,
|
|
538
|
-
localStorageProvider:
|
|
539
|
-
onOpen:
|
|
540
|
-
onSuccess:
|
|
541
|
-
onClose:
|
|
542
|
-
autoCloseOnSuccess:
|
|
543
|
-
popupsBlocked:
|
|
544
|
-
baseUrl:
|
|
545
|
-
debug:
|
|
548
|
+
localStorageProvider: x,
|
|
549
|
+
onOpen: u,
|
|
550
|
+
onSuccess: I,
|
|
551
|
+
onClose: U,
|
|
552
|
+
autoCloseOnSuccess: E,
|
|
553
|
+
popupsBlocked: k,
|
|
554
|
+
baseUrl: M,
|
|
555
|
+
debug: C
|
|
546
556
|
}) => {
|
|
547
|
-
const
|
|
557
|
+
const P = B(() => new O({
|
|
548
558
|
app: s,
|
|
549
559
|
preferGaslessPayment: t,
|
|
550
560
|
chainIds: e,
|
|
@@ -555,24 +565,26 @@ const me = ({
|
|
|
555
565
|
allowedPaymentCurrencies: a,
|
|
556
566
|
appMetadata: n,
|
|
557
567
|
enableRefundEmails: d,
|
|
558
|
-
payerEmail:
|
|
568
|
+
payerEmail: g,
|
|
559
569
|
mode: "pay",
|
|
560
|
-
hideSettlementCopy:
|
|
561
|
-
showAppLogo:
|
|
562
|
-
showOnrampFirst:
|
|
563
|
-
|
|
564
|
-
|
|
570
|
+
hideSettlementCopy: f,
|
|
571
|
+
showAppLogo: y,
|
|
572
|
+
showOnrampFirst: w,
|
|
573
|
+
debitCardAlias: b,
|
|
574
|
+
copyOverrides: $,
|
|
575
|
+
sessionId: v,
|
|
576
|
+
amount: l,
|
|
565
577
|
sessionMetadata: c,
|
|
566
|
-
theme:
|
|
578
|
+
theme: S,
|
|
567
579
|
walletProvider: h,
|
|
568
|
-
localStorageProvider:
|
|
569
|
-
onOpen:
|
|
570
|
-
onSuccess:
|
|
571
|
-
onClose:
|
|
572
|
-
autoCloseOnSuccess:
|
|
573
|
-
popupsBlocked:
|
|
574
|
-
baseUrl:
|
|
575
|
-
debug:
|
|
580
|
+
localStorageProvider: x,
|
|
581
|
+
onOpen: u,
|
|
582
|
+
onSuccess: I,
|
|
583
|
+
onClose: U,
|
|
584
|
+
autoCloseOnSuccess: E,
|
|
585
|
+
popupsBlocked: k,
|
|
586
|
+
baseUrl: M,
|
|
587
|
+
debug: C
|
|
576
588
|
}), [
|
|
577
589
|
s,
|
|
578
590
|
t,
|
|
@@ -584,28 +596,30 @@ const me = ({
|
|
|
584
596
|
a,
|
|
585
597
|
n,
|
|
586
598
|
d,
|
|
587
|
-
m,
|
|
588
599
|
g,
|
|
589
600
|
f,
|
|
590
601
|
y,
|
|
591
|
-
b,
|
|
592
602
|
w,
|
|
593
|
-
|
|
603
|
+
b,
|
|
594
604
|
$,
|
|
595
|
-
h,
|
|
596
605
|
v,
|
|
597
606
|
l,
|
|
607
|
+
c,
|
|
608
|
+
S,
|
|
609
|
+
h,
|
|
598
610
|
x,
|
|
611
|
+
u,
|
|
599
612
|
I,
|
|
600
|
-
P,
|
|
601
|
-
E,
|
|
602
613
|
U,
|
|
603
|
-
|
|
614
|
+
E,
|
|
615
|
+
k,
|
|
616
|
+
M,
|
|
617
|
+
C
|
|
604
618
|
]);
|
|
605
619
|
return {
|
|
606
|
-
openGlidePay:
|
|
607
|
-
externalUrl:
|
|
608
|
-
opts:
|
|
620
|
+
openGlidePay: P.open,
|
|
621
|
+
externalUrl: P.externalUrl,
|
|
622
|
+
opts: P.opts
|
|
609
623
|
};
|
|
610
624
|
}, fe = ({
|
|
611
625
|
app: s,
|
|
@@ -618,19 +632,21 @@ const me = ({
|
|
|
618
632
|
excludeFundingSources: a,
|
|
619
633
|
sessionMetadata: n,
|
|
620
634
|
showAppLogo: d,
|
|
621
|
-
showOnrampFirst:
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
635
|
+
showOnrampFirst: g,
|
|
636
|
+
debitCardAlias: f,
|
|
637
|
+
copyOverrides: y,
|
|
638
|
+
theme: w,
|
|
639
|
+
walletProvider: b,
|
|
640
|
+
localStorageProvider: $,
|
|
641
|
+
onOpen: l,
|
|
642
|
+
onSuccess: v,
|
|
627
643
|
onClose: c,
|
|
628
|
-
autoCloseOnSuccess:
|
|
644
|
+
autoCloseOnSuccess: S,
|
|
629
645
|
popupsBlocked: h,
|
|
630
|
-
baseUrl:
|
|
631
|
-
debug:
|
|
646
|
+
baseUrl: x,
|
|
647
|
+
debug: u
|
|
632
648
|
}) => {
|
|
633
|
-
const
|
|
649
|
+
const I = B(() => new O({
|
|
634
650
|
app: s,
|
|
635
651
|
evm: t,
|
|
636
652
|
approval: e,
|
|
@@ -641,18 +657,20 @@ const me = ({
|
|
|
641
657
|
excludeFundingSources: a,
|
|
642
658
|
sessionMetadata: n,
|
|
643
659
|
showAppLogo: d,
|
|
644
|
-
showOnrampFirst:
|
|
660
|
+
showOnrampFirst: g,
|
|
661
|
+
debitCardAlias: f,
|
|
662
|
+
copyOverrides: y,
|
|
645
663
|
mode: "call",
|
|
646
|
-
theme:
|
|
647
|
-
walletProvider:
|
|
648
|
-
localStorageProvider:
|
|
649
|
-
onOpen:
|
|
650
|
-
onSuccess:
|
|
664
|
+
theme: w,
|
|
665
|
+
walletProvider: b,
|
|
666
|
+
localStorageProvider: $,
|
|
667
|
+
onOpen: l,
|
|
668
|
+
onSuccess: v,
|
|
651
669
|
onClose: c,
|
|
652
|
-
autoCloseOnSuccess:
|
|
670
|
+
autoCloseOnSuccess: S,
|
|
653
671
|
popupsBlocked: h,
|
|
654
|
-
baseUrl:
|
|
655
|
-
debug:
|
|
672
|
+
baseUrl: x,
|
|
673
|
+
debug: u
|
|
656
674
|
}), [
|
|
657
675
|
s,
|
|
658
676
|
t,
|
|
@@ -664,22 +682,24 @@ const me = ({
|
|
|
664
682
|
a,
|
|
665
683
|
n,
|
|
666
684
|
d,
|
|
667
|
-
m,
|
|
668
685
|
g,
|
|
669
686
|
f,
|
|
670
687
|
y,
|
|
671
688
|
w,
|
|
672
689
|
b,
|
|
673
|
-
c,
|
|
674
690
|
$,
|
|
675
|
-
|
|
691
|
+
l,
|
|
676
692
|
v,
|
|
677
|
-
|
|
693
|
+
c,
|
|
694
|
+
S,
|
|
695
|
+
h,
|
|
696
|
+
x,
|
|
697
|
+
u
|
|
678
698
|
]);
|
|
679
699
|
return {
|
|
680
|
-
openGlideCall:
|
|
681
|
-
externalUrl:
|
|
682
|
-
opts:
|
|
700
|
+
openGlideCall: I.open,
|
|
701
|
+
externalUrl: I.externalUrl,
|
|
702
|
+
opts: I.opts
|
|
683
703
|
};
|
|
684
704
|
}, ye = ({
|
|
685
705
|
app: s,
|
|
@@ -692,18 +712,20 @@ const me = ({
|
|
|
692
712
|
excludeCurrencyTiers: a,
|
|
693
713
|
excludeFundingSources: n,
|
|
694
714
|
sessionMetadata: d,
|
|
695
|
-
showAppLogo:
|
|
696
|
-
showOnrampFirst:
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
715
|
+
showAppLogo: g,
|
|
716
|
+
showOnrampFirst: f,
|
|
717
|
+
debitCardAlias: y,
|
|
718
|
+
copyOverrides: w,
|
|
719
|
+
theme: b,
|
|
720
|
+
walletProvider: $,
|
|
721
|
+
localStorageProvider: l,
|
|
722
|
+
onOpen: v,
|
|
701
723
|
onSuccess: c,
|
|
702
|
-
onClose:
|
|
724
|
+
onClose: S,
|
|
703
725
|
autoCloseOnSuccess: h,
|
|
704
|
-
baseUrl:
|
|
726
|
+
baseUrl: x
|
|
705
727
|
}) => {
|
|
706
|
-
const
|
|
728
|
+
const u = B(() => new O({
|
|
707
729
|
app: s,
|
|
708
730
|
recipient: t,
|
|
709
731
|
chainId: e,
|
|
@@ -714,17 +736,19 @@ const me = ({
|
|
|
714
736
|
excludeCurrencyTiers: a,
|
|
715
737
|
excludeFundingSources: n,
|
|
716
738
|
sessionMetadata: d,
|
|
717
|
-
showAppLogo:
|
|
718
|
-
showOnrampFirst:
|
|
739
|
+
showAppLogo: g,
|
|
740
|
+
showOnrampFirst: f,
|
|
741
|
+
debitCardAlias: y,
|
|
742
|
+
copyOverrides: w,
|
|
719
743
|
mode: "buy",
|
|
720
|
-
theme:
|
|
721
|
-
walletProvider:
|
|
722
|
-
localStorageProvider:
|
|
723
|
-
onOpen:
|
|
744
|
+
theme: b,
|
|
745
|
+
walletProvider: $,
|
|
746
|
+
localStorageProvider: l,
|
|
747
|
+
onOpen: v,
|
|
724
748
|
onSuccess: c,
|
|
725
|
-
onClose:
|
|
749
|
+
onClose: S,
|
|
726
750
|
autoCloseOnSuccess: h,
|
|
727
|
-
baseUrl:
|
|
751
|
+
baseUrl: x
|
|
728
752
|
}), [
|
|
729
753
|
s,
|
|
730
754
|
t,
|
|
@@ -736,21 +760,23 @@ const me = ({
|
|
|
736
760
|
a,
|
|
737
761
|
n,
|
|
738
762
|
d,
|
|
739
|
-
m,
|
|
740
763
|
g,
|
|
741
764
|
f,
|
|
742
765
|
y,
|
|
743
766
|
w,
|
|
744
767
|
b,
|
|
745
|
-
c,
|
|
746
768
|
$,
|
|
769
|
+
l,
|
|
770
|
+
v,
|
|
771
|
+
c,
|
|
772
|
+
S,
|
|
747
773
|
h,
|
|
748
|
-
|
|
774
|
+
x
|
|
749
775
|
]);
|
|
750
776
|
return {
|
|
751
|
-
openGlideBuy:
|
|
752
|
-
externalUrl:
|
|
753
|
-
opts:
|
|
777
|
+
openGlideBuy: u.open,
|
|
778
|
+
externalUrl: u.externalUrl,
|
|
779
|
+
opts: u.opts
|
|
754
780
|
};
|
|
755
781
|
}, we = Object.freeze({
|
|
756
782
|
getItem: (s) => new Promise((t, e) => {
|
|
@@ -785,7 +811,7 @@ const me = ({
|
|
|
785
811
|
})
|
|
786
812
|
});
|
|
787
813
|
export {
|
|
788
|
-
|
|
814
|
+
O as GlideDeposit,
|
|
789
815
|
we as browserLocalStorageProvider,
|
|
790
816
|
ye as useGlideBuy,
|
|
791
817
|
fe as useGlideCall,
|
package/dist/useGlideBuy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex, ShowAppLogo } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex, ShowAppLogo, DebitCardAlias } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Session } from '@paywithglide/glide-js';
|
|
4
4
|
interface UseGlideBuyProps {
|
|
@@ -14,6 +14,8 @@ interface UseGlideBuyProps {
|
|
|
14
14
|
sessionMetadata?: string;
|
|
15
15
|
showAppLogo?: ShowAppLogo;
|
|
16
16
|
showOnrampFirst?: boolean;
|
|
17
|
+
debitCardAlias?: DebitCardAlias;
|
|
18
|
+
copyOverrides?: Record<string, string>;
|
|
17
19
|
theme?: GlideWidgetTheme;
|
|
18
20
|
walletProvider?: GlideDepositWalletProvider;
|
|
19
21
|
localStorageProvider?: GlideLocalStorageProvider;
|
|
@@ -23,7 +25,7 @@ interface UseGlideBuyProps {
|
|
|
23
25
|
autoCloseOnSuccess?: boolean;
|
|
24
26
|
baseUrl?: string;
|
|
25
27
|
}
|
|
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) => {
|
|
28
|
+
export declare const useGlideBuy: ({ app, recipient, chainId, currencyId, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, showAppLogo, showOnrampFirst, debitCardAlias, copyOverrides, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
|
|
27
29
|
openGlideBuy: () => void;
|
|
28
30
|
externalUrl: string;
|
|
29
31
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlideCall.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex, ShowAppLogo } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, Hex, ShowAppLogo, DebitCardAlias } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Session } from '@paywithglide/glide-js';
|
|
4
4
|
interface UseGlideCallProps {
|
|
@@ -21,6 +21,8 @@ interface UseGlideCallProps {
|
|
|
21
21
|
sessionMetadata?: string;
|
|
22
22
|
showAppLogo?: ShowAppLogo;
|
|
23
23
|
showOnrampFirst?: boolean;
|
|
24
|
+
debitCardAlias?: DebitCardAlias;
|
|
25
|
+
copyOverrides?: Record<string, string>;
|
|
24
26
|
theme?: GlideWidgetTheme;
|
|
25
27
|
walletProvider?: GlideDepositWalletProvider;
|
|
26
28
|
localStorageProvider?: GlideLocalStorageProvider;
|
|
@@ -32,7 +34,7 @@ interface UseGlideCallProps {
|
|
|
32
34
|
baseUrl?: string;
|
|
33
35
|
debug?: boolean;
|
|
34
36
|
}
|
|
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) => {
|
|
37
|
+
export declare const useGlideCall: ({ app, evm, approval, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, showAppLogo, showOnrampFirst, debitCardAlias, copyOverrides, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideCallProps) => {
|
|
36
38
|
openGlideCall: () => void;
|
|
37
39
|
externalUrl: string;
|
|
38
40
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, ShowAppLogo } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, ShowAppLogo, DebitCardAlias } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Hex, Session } from '@paywithglide/glide-js';
|
|
4
4
|
interface UseGlideDepositProps {
|
|
@@ -26,6 +26,8 @@ interface UseGlideDepositProps {
|
|
|
26
26
|
hideSettlementCopy?: boolean;
|
|
27
27
|
showAppLogo?: ShowAppLogo;
|
|
28
28
|
showOnrampFirst?: boolean;
|
|
29
|
+
debitCardAlias?: DebitCardAlias;
|
|
30
|
+
copyOverrides?: Record<string, string>;
|
|
29
31
|
sessionId?: string;
|
|
30
32
|
sessionMetadata?: string;
|
|
31
33
|
disableWithdrawToSelfSuggestion?: boolean;
|
|
@@ -40,7 +42,7 @@ interface UseGlideDepositProps {
|
|
|
40
42
|
baseUrl?: string;
|
|
41
43
|
debug?: boolean;
|
|
42
44
|
}
|
|
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) => {
|
|
45
|
+
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, appMetadata, enableRefundEmails, payerEmail, mode, hideSettlementCopy, showAppLogo, showOnrampFirst, debitCardAlias, copyOverrides, sessionId, sessionMetadata, disableWithdrawToSelfSuggestion, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideDepositProps) => {
|
|
44
46
|
openGlideDeposit: () => void;
|
|
45
47
|
externalUrl: string;
|
|
46
48
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlidePay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, ShowAppLogo } from './GlideDeposit.ts';
|
|
1
|
+
import { FundingSource, GlideDepositWalletProvider, GlideLocalStorageProvider, ShowAppLogo, DebitCardAlias } from './GlideDeposit.ts';
|
|
2
2
|
import { GlideWidgetTheme } from './theme.ts';
|
|
3
3
|
import { CAIP2, Hex, Session } from '@paywithglide/glide-js';
|
|
4
4
|
type UseGlidePayProps = {
|
|
@@ -21,6 +21,8 @@ type UseGlidePayProps = {
|
|
|
21
21
|
hideSettlementCopy?: boolean;
|
|
22
22
|
showAppLogo?: ShowAppLogo;
|
|
23
23
|
showOnrampFirst?: boolean;
|
|
24
|
+
debitCardAlias?: DebitCardAlias;
|
|
25
|
+
copyOverrides?: Record<string, string>;
|
|
24
26
|
sessionId?: string;
|
|
25
27
|
sessionMetadata?: string;
|
|
26
28
|
theme?: GlideWidgetTheme;
|
|
@@ -34,7 +36,7 @@ type UseGlidePayProps = {
|
|
|
34
36
|
baseUrl?: string;
|
|
35
37
|
debug?: boolean;
|
|
36
38
|
};
|
|
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) => {
|
|
39
|
+
export declare const useGlidePay: ({ app, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, allowedPaymentCurrencies, appMetadata, enableRefundEmails, payerEmail, hideSettlementCopy, showAppLogo, showOnrampFirst, debitCardAlias, copyOverrides, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
|
|
38
40
|
openGlidePay: () => void;
|
|
39
41
|
externalUrl: string;
|
|
40
42
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|