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