@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.
@@ -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 G = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
4
- import { useMemo as R } from "react";
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 N(s) {
8
+ function K(s) {
9
9
  return te(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
10
10
  }
11
- const K = "2.21.51";
12
- let j = {
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@${K}`
14
+ version: `viem@${N}`
15
15
  };
16
- class C extends Error {
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 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 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
- ...j.version ? [`Version: ${j.version}`] : []
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 = K;
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 C {
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 B(s, { dir: t, size: e = 32 } = {}) {
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 C {
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 C {
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 (N(s) > t)
117
+ if (K(s) > t)
118
118
  throw new re({
119
- givenSize: N(s),
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 }), B(e, { size: t.size })) : e;
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 }), B(i, { dir: "right", size: t.size })) : i;
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 ? B(a, { size: i }) : a;
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 W {
161
+ class H {
162
162
  constructor(t) {
163
- G(this, "opts");
164
- G(this, "open", () => {
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
- 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
+ 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 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,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", (g = (m = this.opts).onOpen) == null || g.call(m);
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 u = await this.opts.localStorageProvider.getKeys();
232
- (y = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || y.postMessage(
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: u
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 u = await this.opts.localStorageProvider.getItem(e.key);
258
- (b = (w = this.iframe) == null ? void 0 : w.contentWindow) == null || b.postMessage(
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: u
265
+ value: m
263
266
  },
264
267
  this.baseUrl
265
268
  );
266
269
  break;
267
270
  }
268
271
  case "success":
269
- ($ = (c = this.opts) == null ? void 0 : c.onSuccess) == null || $.call(c, e.hash, e.session);
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(), (v = (h = this.opts) == null ? void 0 : h.onClose) == null || v.call(h);
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 = (l = this.opts) == null ? void 0 : l.onSetMode) == null || x.call(l, e.mode);
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
- }), (P = (I = this.iframe) == null ? void 0 : I.contentWindow) == null || P.postMessage(
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 (u) {
292
- (U = (E = this.iframe) == null ? void 0 : E.contentWindow) == null || U.postMessage(
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: u
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 u = await this.opts.walletProvider.sendTransactionAsync(
310
+ const m = await this.opts.walletProvider.sendTransactionAsync(
308
311
  e.tx
309
312
  );
310
- (S = (k = this.iframe) == null ? void 0 : k.contentWindow) == null || S.postMessage(
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: u
317
+ txHash: m
315
318
  },
316
319
  this.baseUrl
317
320
  );
318
- } catch (u) {
319
- (T = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || T.postMessage(
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: u
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
- (D = (A = this.iframe) == null ? void 0 : A.contentWindow) == null || D.postMessage(
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 u = await this.opts.walletProvider.signTypedDataAsync(
349
+ const m = await this.opts.walletProvider.signTypedDataAsync(
347
350
  e.data
348
351
  );
349
- (H = (M = this.iframe) == null ? void 0 : M.contentWindow) == null || H.postMessage(
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: u
356
+ signature: m
354
357
  },
355
358
  this.baseUrl
356
359
  );
357
- } catch (u) {
358
- (O = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || O.postMessage(
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: u
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 ? `&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
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 ? `&copyOverrides=${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: 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
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 M = R(() => new W({
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: m,
458
- fundingSources: g,
459
- appMetadata: f,
460
- enableRefundEmails: y,
461
- payerEmail: w,
462
- mode: b,
463
- hideSettlementCopy: c,
464
- showAppLogo: $,
465
- showOnrampFirst: h,
466
- sessionId: v,
467
- sessionMetadata: l,
468
- disableWithdrawToSelfSuggestion: x,
469
- theme: I,
470
- walletProvider: P,
471
- localStorageProvider: E,
472
- onOpen: U,
473
- onSuccess: k,
474
- onClose: S,
475
- autoCloseOnSuccess: z,
476
- popupsBlocked: T,
477
- baseUrl: A,
478
- debug: D
463
+ 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
- S,
508
- z,
516
+ C,
517
+ M,
518
+ P,
519
+ D,
509
520
  T,
510
- A,
511
- D
521
+ R,
522
+ j,
523
+ G
512
524
  ]);
513
525
  return {
514
- openGlideDeposit: M.open,
515
- externalUrl: M.externalUrl,
516
- opts: M.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: m,
530
- hideSettlementCopy: g,
531
- showAppLogo: f,
532
- showOnrampFirst: y,
533
- amount: w,
534
- sessionId: b,
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: v,
539
- onOpen: l,
540
- onSuccess: x,
541
- onClose: I,
542
- autoCloseOnSuccess: P,
543
- popupsBlocked: E,
544
- baseUrl: U,
545
- debug: k
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 S = R(() => new W({
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: m,
572
+ payerEmail: g,
559
573
  mode: "pay",
560
- hideSettlementCopy: g,
561
- showAppLogo: f,
562
- showOnrampFirst: y,
563
- sessionId: b,
564
- amount: w,
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: v,
569
- onOpen: l,
570
- onSuccess: x,
571
- onClose: I,
572
- autoCloseOnSuccess: P,
573
- popupsBlocked: E,
574
- baseUrl: U,
575
- debug: k
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
- c,
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
- k
618
+ E,
619
+ k,
620
+ C,
621
+ M
604
622
  ]);
605
623
  return {
606
- openGlidePay: S.open,
607
- externalUrl: S.externalUrl,
608
- opts: S.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: m,
622
- theme: g,
623
- walletProvider: f,
624
- localStorageProvider: y,
625
- onOpen: w,
626
- onSuccess: b,
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: v,
631
- debug: l
650
+ baseUrl: x,
651
+ debug: u
632
652
  }) => {
633
- const x = R(() => new W({
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: m,
664
+ showOnrampFirst: g,
665
+ debitCardAlias: f,
666
+ copyOverrides: y,
645
667
  mode: "call",
646
- theme: g,
647
- walletProvider: f,
648
- localStorageProvider: y,
649
- onOpen: w,
650
- onSuccess: b,
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: v,
655
- debug: l
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
- h,
695
+ l,
676
696
  v,
677
- l
697
+ c,
698
+ S,
699
+ h,
700
+ x,
701
+ u
678
702
  ]);
679
703
  return {
680
- openGlideCall: x.open,
681
- externalUrl: x.externalUrl,
682
- opts: x.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: m,
696
- showOnrampFirst: g,
697
- theme: f,
698
- walletProvider: y,
699
- localStorageProvider: w,
700
- onOpen: b,
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: v
730
+ baseUrl: x
705
731
  }) => {
706
- const l = R(() => new W({
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: m,
718
- showOnrampFirst: g,
743
+ showAppLogo: g,
744
+ showOnrampFirst: f,
745
+ debitCardAlias: y,
746
+ copyOverrides: w,
719
747
  mode: "buy",
720
- theme: f,
721
- walletProvider: y,
722
- localStorageProvider: w,
723
- onOpen: b,
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: v
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
- v
778
+ x
749
779
  ]);
750
780
  return {
751
- openGlideBuy: l.open,
752
- externalUrl: l.externalUrl,
753
- opts: l.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
- W as GlideDeposit,
818
+ H as GlideDeposit,
789
819
  we as browserLocalStorageProvider,
790
820
  ye as useGlideBuy,
791
821
  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,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;
@@ -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.42",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"