@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.
@@ -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 G = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
4
- import { useMemo as R } from "react";
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 j = {
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 C extends Error {
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 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 = [
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
- ...j.version ? [`Version: ${j.version}`] : []
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 C {
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 B(s, { dir: t, size: e = 32 } = {}) {
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 C {
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 C {
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 }), B(e, { size: t.size })) : e;
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 }), B(i, { dir: "right", size: t.size })) : i;
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 ? B(a, { size: i }) : a;
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 W {
161
+ class O {
162
162
  constructor(t) {
163
- G(this, "opts");
164
- G(this, "open", () => {
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
- 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;
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 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);
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: u,
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", (g = (m = this.opts).onOpen) == null || g.call(m);
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 u = await this.opts.localStorageProvider.getKeys();
232
- (y = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || y.postMessage(
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: u
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 u = await this.opts.localStorageProvider.getItem(e.key);
258
- (b = (w = this.iframe) == null ? void 0 : w.contentWindow) == null || b.postMessage(
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: u
264
+ value: m
263
265
  },
264
266
  this.baseUrl
265
267
  );
266
268
  break;
267
269
  }
268
270
  case "success":
269
- ($ = (c = this.opts) == null ? void 0 : c.onSuccess) == null || $.call(c, e.hash, e.session);
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(), (v = (h = this.opts) == null ? void 0 : h.onClose) == null || v.call(h);
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 = (l = this.opts) == null ? void 0 : l.onSetMode) == null || x.call(l, e.mode);
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
- }), (P = (I = this.iframe) == null ? void 0 : I.contentWindow) == null || P.postMessage(
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 (u) {
292
- (U = (E = this.iframe) == null ? void 0 : E.contentWindow) == null || U.postMessage(
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: u
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 u = await this.opts.walletProvider.sendTransactionAsync(
309
+ const m = await this.opts.walletProvider.sendTransactionAsync(
308
310
  e.tx
309
311
  );
310
- (S = (k = this.iframe) == null ? void 0 : k.contentWindow) == null || S.postMessage(
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: u
316
+ txHash: m
315
317
  },
316
318
  this.baseUrl
317
319
  );
318
- } catch (u) {
319
- (T = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || T.postMessage(
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: u
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 = (A = this.iframe) == null ? void 0 : A.contentWindow) == null || D.postMessage(
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 u = await this.opts.walletProvider.signTypedDataAsync(
348
+ const m = await this.opts.walletProvider.signTypedDataAsync(
347
349
  e.data
348
350
  );
349
- (H = (M = this.iframe) == null ? void 0 : M.contentWindow) == null || H.postMessage(
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: u
355
+ signature: m
354
356
  },
355
357
  this.baseUrl
356
358
  );
357
- } catch (u) {
358
- (O = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || O.postMessage(
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: u
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 ? `&currencyId=${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 ? `&copyOverrides=${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: 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
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 M = R(() => new W({
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: 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
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
- S,
508
- z,
513
+ M,
514
+ C,
515
+ P,
509
516
  T,
510
- A,
511
- D
517
+ D,
518
+ j,
519
+ R
512
520
  ]);
513
521
  return {
514
- openGlideDeposit: M.open,
515
- externalUrl: M.externalUrl,
516
- opts: M.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: m,
530
- hideSettlementCopy: g,
531
- showAppLogo: f,
532
- showOnrampFirst: y,
533
- amount: w,
534
- sessionId: b,
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: v,
539
- onOpen: l,
540
- onSuccess: x,
541
- onClose: I,
542
- autoCloseOnSuccess: P,
543
- popupsBlocked: E,
544
- baseUrl: U,
545
- debug: k
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 S = R(() => new W({
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: m,
568
+ payerEmail: g,
559
569
  mode: "pay",
560
- hideSettlementCopy: g,
561
- showAppLogo: f,
562
- showOnrampFirst: y,
563
- sessionId: b,
564
- amount: w,
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: v,
569
- onOpen: l,
570
- onSuccess: x,
571
- onClose: I,
572
- autoCloseOnSuccess: P,
573
- popupsBlocked: E,
574
- baseUrl: U,
575
- debug: k
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
- c,
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
- k
614
+ E,
615
+ k,
616
+ M,
617
+ C
604
618
  ]);
605
619
  return {
606
- openGlidePay: S.open,
607
- externalUrl: S.externalUrl,
608
- opts: S.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: m,
622
- theme: g,
623
- walletProvider: f,
624
- localStorageProvider: y,
625
- onOpen: w,
626
- onSuccess: b,
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: v,
631
- debug: l
646
+ baseUrl: x,
647
+ debug: u
632
648
  }) => {
633
- const x = R(() => new W({
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: m,
660
+ showOnrampFirst: g,
661
+ debitCardAlias: f,
662
+ copyOverrides: y,
645
663
  mode: "call",
646
- theme: g,
647
- walletProvider: f,
648
- localStorageProvider: y,
649
- onOpen: w,
650
- onSuccess: b,
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: v,
655
- debug: l
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
- h,
691
+ l,
676
692
  v,
677
- l
693
+ c,
694
+ S,
695
+ h,
696
+ x,
697
+ u
678
698
  ]);
679
699
  return {
680
- openGlideCall: x.open,
681
- externalUrl: x.externalUrl,
682
- opts: x.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: m,
696
- showOnrampFirst: g,
697
- theme: f,
698
- walletProvider: y,
699
- localStorageProvider: w,
700
- onOpen: b,
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: v
726
+ baseUrl: x
705
727
  }) => {
706
- const l = R(() => new W({
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: m,
718
- showOnrampFirst: g,
739
+ showAppLogo: g,
740
+ showOnrampFirst: f,
741
+ debitCardAlias: y,
742
+ copyOverrides: w,
719
743
  mode: "buy",
720
- theme: f,
721
- walletProvider: y,
722
- localStorageProvider: w,
723
- onOpen: b,
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: v
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
- v
774
+ x
749
775
  ]);
750
776
  return {
751
- openGlideBuy: l.open,
752
- externalUrl: l.externalUrl,
753
- opts: l.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
- W as GlideDeposit,
814
+ O as GlideDeposit,
789
815
  we as browserLocalStorageProvider,
790
816
  ye as useGlideBuy,
791
817
  fe as useGlideCall,
@@ -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;
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paywithglide/glide-react",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"