@paywithglide/glide-react 0.0.19 → 0.0.20

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.
@@ -76,6 +76,7 @@ export type GlideDepositWalletProvider = {
76
76
  sendTransactionAsync: (tx: EVMTransaction) => Promise<Hex>;
77
77
  signTypedDataAsync?: (args: PermitTypedData<bigint>) => Promise<Hex>;
78
78
  };
79
+ export type FundingSource = "transfer" | "coinbase" | "coinbase_app" | "interac" | "fiat";
79
80
  export type GlideDepositOptions = {
80
81
  app: string;
81
82
  recipient?: string;
@@ -96,6 +97,7 @@ export type GlideDepositOptions = {
96
97
  preferGaslessPayment?: boolean;
97
98
  excludeChainIds?: CAIP2[];
98
99
  excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
100
+ excludeFundingSources?: FundingSource[];
99
101
  walletProvider?: GlideDepositWalletProvider;
100
102
  onOpen?: () => void;
101
103
  onSuccess?: (hash: Hex) => void;
package/dist/glide.js CHANGED
@@ -1,31 +1,31 @@
1
1
  var G = Object.defineProperty;
2
- var C = (s, t, e) => t in s ? G(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var w = (s, t, e) => C(s, typeof t != "symbol" ? t + "" : t, e);
4
- import { useMemo as b } from "react";
5
- function H(s, { strict: t = !0 } = {}) {
2
+ var j = (s, t, e) => t in s ? G(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var b = (s, t, e) => j(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { useMemo as $ } from "react";
5
+ function C(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
8
  function T(s) {
9
- return H(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
9
+ return C(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
10
10
  }
11
11
  const D = "2.21.51";
12
- let y = {
12
+ let w = {
13
13
  getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
14
14
  version: `viem@${D}`
15
15
  };
16
- class g extends Error {
16
+ class y extends Error {
17
17
  constructor(t, e = {}) {
18
18
  var a;
19
19
  const i = (() => {
20
20
  var o;
21
- return e.cause instanceof g ? e.cause.details : (o = e.cause) != null && o.message ? e.cause.message : e.details;
22
- })(), n = e.cause instanceof g && e.cause.docsPath || e.docsPath, r = (a = y.getDocsUrl) == null ? void 0 : a.call(y, { ...e, docsPath: n }), d = [
21
+ return e.cause instanceof y ? e.cause.details : (o = e.cause) != null && o.message ? e.cause.message : e.details;
22
+ })(), n = e.cause instanceof y && e.cause.docsPath || e.docsPath, r = (a = w.getDocsUrl) == null ? void 0 : a.call(w, { ...e, docsPath: n }), d = [
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
- ...y.version ? [`Version: ${y.version}`] : []
28
+ ...w.version ? [`Version: ${w.version}`] : []
29
29
  ].join(`
30
30
  `);
31
31
  super(d, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
@@ -67,15 +67,15 @@ class g extends Error {
67
67
  function S(s, t) {
68
68
  return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? S(s.cause, t) : t ? null : s;
69
69
  }
70
- class A extends g {
70
+ class A extends y {
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 $(s, { dir: t, size: e = 32 } = {}) {
76
- return typeof s == "string" ? j(s, { dir: t, size: e }) : B(s, { dir: t, size: e });
75
+ function x(s, { dir: t, size: e = 32 } = {}) {
76
+ return typeof s == "string" ? H(s, { dir: t, size: e }) : B(s, { dir: t, size: e });
77
77
  }
78
- function j(s, { dir: t, size: e = 32 } = {}) {
78
+ function H(s, { dir: t, size: e = 32 } = {}) {
79
79
  if (e === null)
80
80
  return s;
81
81
  const i = s.replace("0x", "");
@@ -103,12 +103,12 @@ function B(s, { dir: t, size: e = 32 } = {}) {
103
103
  }
104
104
  return i;
105
105
  }
106
- class W extends g {
106
+ class W extends y {
107
107
  constructor({ max: t, min: e, signed: i, size: n, value: r }) {
108
108
  super(`Number "${r}" is not in safe ${n ? `${n * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${e} to ${t})` : `(above ${e})`}`, { name: "IntegerOutOfRangeError" });
109
109
  }
110
110
  }
111
- class L extends g {
111
+ class L extends y {
112
112
  constructor({ givenSize: t, maxSize: e }) {
113
113
  super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
114
114
  }
@@ -122,20 +122,20 @@ function M(s, { size: t }) {
122
122
  }
123
123
  const O = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
124
124
  function N(s, t = {}) {
125
- return typeof s == "number" || typeof s == "bigint" ? V(s, t) : typeof s == "string" ? F(s, t) : typeof s == "boolean" ? R(s, t) : k(s, t);
125
+ return typeof s == "number" || typeof s == "bigint" ? F(s, t) : typeof s == "string" ? q(s, t) : typeof s == "boolean" ? R(s, t) : k(s, t);
126
126
  }
127
127
  function R(s, t = {}) {
128
128
  const e = `0x${Number(s)}`;
129
- return typeof t.size == "number" ? (M(e, { size: t.size }), $(e, { size: t.size })) : e;
129
+ return typeof t.size == "number" ? (M(e, { size: t.size }), x(e, { size: t.size })) : e;
130
130
  }
131
131
  function k(s, t = {}) {
132
132
  let e = "";
133
133
  for (let n = 0; n < s.length; n++)
134
134
  e += O[s[n]];
135
135
  const i = `0x${e}`;
136
- return typeof t.size == "number" ? (M(i, { size: t.size }), $(i, { dir: "right", size: t.size })) : i;
136
+ return typeof t.size == "number" ? (M(i, { size: t.size }), x(i, { dir: "right", size: t.size })) : i;
137
137
  }
138
- function V(s, t = {}) {
138
+ function F(s, t = {}) {
139
139
  const { signed: e, size: i } = t, n = BigInt(s);
140
140
  let r;
141
141
  i ? e ? r = (1n << BigInt(i) * 8n - 1n) - 1n : r = 2n ** (BigInt(i) * 8n) - 1n : typeof s == "number" && (r = BigInt(Number.MAX_SAFE_INTEGER));
@@ -151,17 +151,17 @@ function V(s, t = {}) {
151
151
  });
152
152
  }
153
153
  const a = `0x${(e && n < 0 ? (1n << BigInt(i * 8)) + BigInt(n) : n).toString(16)}`;
154
- return i ? $(a, { size: i }) : a;
154
+ return i ? x(a, { size: i }) : a;
155
155
  }
156
- const q = /* @__PURE__ */ new TextEncoder();
157
- function F(s, t = {}) {
158
- const e = q.encode(s);
156
+ const V = /* @__PURE__ */ new TextEncoder();
157
+ function q(s, t = {}) {
158
+ const e = V.encode(s);
159
159
  return k(e, t);
160
160
  }
161
161
  class v {
162
162
  constructor(t) {
163
- w(this, "opts");
164
- w(this, "open", () => {
163
+ b(this, "opts");
164
+ b(this, "open", () => {
165
165
  if (!document.body.classList.contains("glide-deposit-open")) {
166
166
  if (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,8 +172,8 @@ class v {
172
172
  this.openUrl(`${this.baseUrl}${this.opts.app}?init=true&embed=true`), this.initialize();
173
173
  }
174
174
  });
175
- w(this, "iframeEventHandler", async (t) => {
176
- var i, n, r, d, a, o, l, p, u, h, c, f, x, I, P, E, U, z;
175
+ b(this, "iframeEventHandler", async (t) => {
176
+ var i, n, r, d, a, o, l, p, h, u, f, c, m, I, P, E, U, z;
177
177
  const e = t.data;
178
178
  switch (e.type) {
179
179
  case "success":
@@ -196,12 +196,12 @@ class v {
196
196
  },
197
197
  this.baseUrl
198
198
  );
199
- } catch (m) {
199
+ } catch (g) {
200
200
  (p = (l = this.iframe) == null ? void 0 : l.contentWindow) == null || p.postMessage(
201
201
  {
202
202
  type: "didSwitchChain",
203
203
  success: !1,
204
- error: m
204
+ error: g
205
205
  },
206
206
  this.baseUrl
207
207
  );
@@ -212,23 +212,23 @@ class v {
212
212
  if (!this.opts.walletProvider)
213
213
  throw new Error("walletProvider is not set");
214
214
  try {
215
- const m = await this.opts.walletProvider.sendTransactionAsync(
215
+ const g = await this.opts.walletProvider.sendTransactionAsync(
216
216
  e.tx
217
217
  );
218
- (h = (u = this.iframe) == null ? void 0 : u.contentWindow) == null || h.postMessage(
218
+ (u = (h = this.iframe) == null ? void 0 : h.contentWindow) == null || u.postMessage(
219
219
  {
220
220
  type: "didSendTransaction",
221
221
  success: !0,
222
- txHash: m
222
+ txHash: g
223
223
  },
224
224
  this.baseUrl
225
225
  );
226
- } catch (m) {
227
- (f = (c = this.iframe) == null ? void 0 : c.contentWindow) == null || f.postMessage(
226
+ } catch (g) {
227
+ (c = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || c.postMessage(
228
228
  {
229
229
  type: "didSendTransaction",
230
230
  success: !1,
231
- error: m
231
+ error: g
232
232
  },
233
233
  this.baseUrl
234
234
  );
@@ -240,7 +240,7 @@ class v {
240
240
  if (!this.opts.walletProvider)
241
241
  throw new Error("walletProvider is not set");
242
242
  if (!this.opts.walletProvider.signTypedDataAsync) {
243
- (I = (x = this.iframe) == null ? void 0 : x.contentWindow) == null || I.postMessage(
243
+ (I = (m = this.iframe) == null ? void 0 : m.contentWindow) == null || I.postMessage(
244
244
  {
245
245
  type: "didSignTypedData",
246
246
  success: !1,
@@ -251,23 +251,23 @@ class v {
251
251
  return;
252
252
  }
253
253
  try {
254
- const m = await this.opts.walletProvider.signTypedDataAsync(
254
+ const g = await this.opts.walletProvider.signTypedDataAsync(
255
255
  e.data
256
256
  );
257
257
  (E = (P = this.iframe) == null ? void 0 : P.contentWindow) == null || E.postMessage(
258
258
  {
259
259
  type: "didSignTypedData",
260
260
  success: !0,
261
- signature: m
261
+ signature: g
262
262
  },
263
263
  this.baseUrl
264
264
  );
265
- } catch (m) {
265
+ } catch (g) {
266
266
  (z = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || z.postMessage(
267
267
  {
268
268
  type: "didSignTypedData",
269
269
  success: !1,
270
- error: m
270
+ error: g
271
271
  },
272
272
  this.baseUrl
273
273
  );
@@ -279,8 +279,8 @@ class v {
279
279
  this.opts = t;
280
280
  }
281
281
  get externalUrl() {
282
- var t, e;
283
- 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.evm ? `&evm.chainId=${this.opts.evm.chainId}&evm.to=${this.opts.evm.to}&evm.data=${this.opts.evm.data || "0x0"}&evm.value=${N(this.opts.evm.value || 0n)}` : ""}${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.excludeChainIds) != null && t.length ? `&excludeChainIds=${this.opts.excludeChainIds.join(",")}` : ""}${(e = this.opts.excludeCurrencyTiers) != null && e.length ? `&excludeCurrencyTiers=${this.opts.excludeCurrencyTiers.join(",")}` : ""}`;
282
+ var t, e, i;
283
+ 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.evm ? `&evm.chainId=${this.opts.evm.chainId}&evm.to=${this.opts.evm.to}&evm.data=${this.opts.evm.data || "0x0"}&evm.value=${N(this.opts.evm.value || 0n)}` : ""}${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.excludeChainIds) != null && t.length ? `&excludeChainIds=${this.opts.excludeChainIds.join(",")}` : ""}${(e = this.opts.excludeCurrencyTiers) != null && e.length ? `&excludeCurrencyTiers=${this.opts.excludeCurrencyTiers.join(",")}` : ""}${(i = this.opts.excludeFundingSources) != null && i.length ? `&excludeFundingSources=${this.opts.excludeFundingSources.join(",")}` : ""}`;
284
284
  }
285
285
  initialize() {
286
286
  window.addEventListener("message", this.iframeEventHandler);
@@ -304,11 +304,11 @@ class v {
304
304
  "style",
305
305
  "z-index: 2147483647; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; opacity: 0;"
306
306
  ), e.onload = () => {
307
- var o, l, p, u;
308
- const i = this.opts.recipient, n = (o = this.opts.walletProvider) == null ? void 0 : o.address, r = (l = this.opts.walletProvider) == null ? void 0 : l.availableChainIds, d = (p = this.opts.walletProvider) == null ? void 0 : p.currentChainId, a = this.opts.preferGaslessPayment || !!((u = this.opts.walletProvider) != null && u.signTypedDataAsync);
307
+ var o, l, p, h;
308
+ const i = this.opts.recipient, n = (o = this.opts.walletProvider) == null ? void 0 : o.address, r = (l = this.opts.walletProvider) == null ? void 0 : l.availableChainIds, d = (p = this.opts.walletProvider) == null ? void 0 : p.currentChainId, a = this.opts.preferGaslessPayment || !!((h = this.opts.walletProvider) != null && h.signTypedDataAsync);
309
309
  e.style.opacity = "1", setTimeout(() => {
310
- var h, c, f;
311
- (h = e == null ? void 0 : e.contentWindow) == null || h.postMessage(
310
+ var u, f, c;
311
+ (u = e == null ? void 0 : e.contentWindow) == null || u.postMessage(
312
312
  {
313
313
  type: "initialize",
314
314
  sessionId: this.opts.sessionId,
@@ -319,6 +319,7 @@ class v {
319
319
  preferGaslessPayment: a,
320
320
  excludeChainIds: this.opts.excludeChainIds,
321
321
  excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
322
+ excludeFundingSources: this.opts.excludeFundingSources,
322
323
  mode: this.opts.mode,
323
324
  amount: this.opts.amount,
324
325
  evmTx: this.opts.evm,
@@ -328,7 +329,7 @@ class v {
328
329
  theme: this.opts.theme
329
330
  },
330
331
  new URL(this.baseUrl).origin
331
- ), (f = (c = this.opts).onOpen) == null || f.call(c);
332
+ ), (c = (f = this.opts).onOpen) == null || c.call(f);
332
333
  }, 10);
333
334
  }, e.src = t, e.allow = "payment *; clipboard-write *", document.body.appendChild(e);
334
335
  }
@@ -343,30 +344,32 @@ const K = ({
343
344
  preferGaslessPayment: e,
344
345
  excludeChainIds: i,
345
346
  excludeCurrencyTiers: n,
346
- mode: r,
347
- sessionMetadata: d,
348
- theme: a,
349
- walletProvider: o,
350
- onOpen: l,
351
- onSuccess: p,
347
+ excludeFundingSources: r,
348
+ mode: d,
349
+ sessionMetadata: a,
350
+ theme: o,
351
+ walletProvider: l,
352
+ onOpen: p,
353
+ onSuccess: h,
352
354
  onClose: u,
353
- autoCloseOnSuccess: h,
355
+ autoCloseOnSuccess: f,
354
356
  baseUrl: c
355
357
  }) => {
356
- const f = b(() => new v({
358
+ const m = $(() => new v({
357
359
  app: s,
358
360
  recipient: t,
359
361
  preferGaslessPayment: e,
360
362
  excludeChainIds: i,
361
363
  excludeCurrencyTiers: n,
362
- mode: r,
363
- sessionMetadata: d,
364
- theme: a,
365
- walletProvider: o,
366
- onOpen: l,
367
- onSuccess: p,
364
+ excludeFundingSources: r,
365
+ mode: d,
366
+ sessionMetadata: a,
367
+ theme: o,
368
+ walletProvider: l,
369
+ onOpen: p,
370
+ onSuccess: h,
368
371
  onClose: u,
369
- autoCloseOnSuccess: h,
372
+ autoCloseOnSuccess: f,
370
373
  baseUrl: c
371
374
  }), [
372
375
  s,
@@ -380,67 +383,71 @@ const K = ({
380
383
  o,
381
384
  l,
382
385
  p,
383
- u,
384
386
  h,
387
+ u,
388
+ f,
385
389
  c
386
390
  ]);
387
391
  return {
388
- openGlideDeposit: f.open,
389
- externalUrl: f.externalUrl,
390
- opts: f.opts
392
+ openGlideDeposit: m.open,
393
+ externalUrl: m.externalUrl,
394
+ opts: m.opts
391
395
  };
392
396
  }, Q = ({
393
397
  app: s,
394
398
  preferGaslessPayment: t,
395
399
  excludeChainIds: e,
396
400
  excludeCurrencyTiers: i,
397
- amount: n,
398
- sessionId: r,
399
- sessionMetadata: d,
400
- theme: a,
401
- walletProvider: o,
402
- onOpen: l,
403
- onSuccess: p,
401
+ excludeFundingSources: n,
402
+ amount: r,
403
+ sessionId: d,
404
+ sessionMetadata: a,
405
+ theme: o,
406
+ walletProvider: l,
407
+ onOpen: p,
408
+ onSuccess: h,
404
409
  onClose: u,
405
- autoCloseOnSuccess: h,
410
+ autoCloseOnSuccess: f,
406
411
  baseUrl: c
407
412
  }) => {
408
- const f = b(() => new v({
413
+ const m = $(() => new v({
409
414
  app: s,
410
415
  preferGaslessPayment: t,
411
416
  excludeChainIds: e,
412
417
  excludeCurrencyTiers: i,
418
+ excludeFundingSources: n,
413
419
  mode: "pay",
414
- sessionId: r,
415
- amount: n,
416
- sessionMetadata: d,
417
- theme: a,
418
- walletProvider: o,
419
- onOpen: l,
420
- onSuccess: p,
420
+ sessionId: d,
421
+ amount: r,
422
+ sessionMetadata: a,
423
+ theme: o,
424
+ walletProvider: l,
425
+ onOpen: p,
426
+ onSuccess: h,
421
427
  onClose: u,
422
- autoCloseOnSuccess: h,
428
+ autoCloseOnSuccess: f,
423
429
  baseUrl: c
424
430
  }), [
425
431
  s,
426
432
  t,
427
433
  e,
428
434
  i,
429
- r,
430
435
  n,
431
436
  d,
437
+ r,
432
438
  a,
433
439
  o,
434
440
  l,
435
441
  p,
436
- u,
437
442
  h,
443
+ u,
444
+ f,
438
445
  c
439
446
  ]);
440
447
  return {
441
- openGlidePay: f.open,
442
- externalUrl: f.externalUrl,
443
- opts: f.opts
448
+ openGlidePay: m.open,
449
+ externalUrl: m.externalUrl,
450
+ opts: m.opts
444
451
  };
445
452
  }, Y = ({
446
453
  app: s,
@@ -449,30 +456,32 @@ const K = ({
449
456
  preferGaslessPayment: i,
450
457
  excludeChainIds: n,
451
458
  excludeCurrencyTiers: r,
452
- sessionMetadata: d,
453
- theme: a,
454
- walletProvider: o,
455
- onOpen: l,
456
- onSuccess: p,
459
+ excludeFundingSources: d,
460
+ sessionMetadata: a,
461
+ theme: o,
462
+ walletProvider: l,
463
+ onOpen: p,
464
+ onSuccess: h,
457
465
  onClose: u,
458
- autoCloseOnSuccess: h,
466
+ autoCloseOnSuccess: f,
459
467
  baseUrl: c
460
468
  }) => {
461
- const f = b(() => new v({
469
+ const m = $(() => new v({
462
470
  app: s,
463
471
  evm: t,
464
472
  approval: e,
465
473
  preferGaslessPayment: i,
466
474
  excludeChainIds: n,
467
475
  excludeCurrencyTiers: r,
468
- sessionMetadata: d,
476
+ excludeFundingSources: d,
477
+ sessionMetadata: a,
469
478
  mode: "call",
470
- theme: a,
471
- walletProvider: o,
472
- onOpen: l,
473
- onSuccess: p,
479
+ theme: o,
480
+ walletProvider: l,
481
+ onOpen: p,
482
+ onSuccess: h,
474
483
  onClose: u,
475
- autoCloseOnSuccess: h,
484
+ autoCloseOnSuccess: f,
476
485
  baseUrl: c
477
486
  }), [
478
487
  s,
@@ -486,14 +495,15 @@ const K = ({
486
495
  o,
487
496
  l,
488
497
  p,
489
- u,
490
498
  h,
499
+ u,
500
+ f,
491
501
  c
492
502
  ]);
493
503
  return {
494
- openGlideCall: f.open,
495
- externalUrl: f.externalUrl,
496
- opts: f.opts
504
+ openGlideCall: m.open,
505
+ externalUrl: m.externalUrl,
506
+ opts: m.opts
497
507
  };
498
508
  }, Z = ({
499
509
  app: s,
@@ -501,30 +511,32 @@ const K = ({
501
511
  preferGaslessPayment: e,
502
512
  excludeChainIds: i,
503
513
  excludeCurrencyTiers: n,
504
- sessionMetadata: r,
505
- theme: d,
506
- walletProvider: a,
507
- onOpen: o,
508
- onSuccess: l,
509
- onClose: p,
514
+ excludeFundingSources: r,
515
+ sessionMetadata: d,
516
+ theme: a,
517
+ walletProvider: o,
518
+ onOpen: l,
519
+ onSuccess: p,
520
+ onClose: h,
510
521
  autoCloseOnSuccess: u,
511
- baseUrl: h
522
+ baseUrl: f
512
523
  }) => {
513
- const c = b(() => new v({
524
+ const c = $(() => new v({
514
525
  app: s,
515
526
  recipient: t,
516
527
  preferGaslessPayment: e,
517
528
  excludeChainIds: i,
518
529
  excludeCurrencyTiers: n,
519
- sessionMetadata: r,
530
+ excludeFundingSources: r,
531
+ sessionMetadata: d,
520
532
  mode: "buy",
521
- theme: d,
522
- walletProvider: a,
523
- onOpen: o,
524
- onSuccess: l,
525
- onClose: p,
533
+ theme: a,
534
+ walletProvider: o,
535
+ onOpen: l,
536
+ onSuccess: p,
537
+ onClose: h,
526
538
  autoCloseOnSuccess: u,
527
- baseUrl: h
539
+ baseUrl: f
528
540
  }), [
529
541
  s,
530
542
  t,
@@ -537,8 +549,9 @@ const K = ({
537
549
  o,
538
550
  l,
539
551
  p,
552
+ h,
540
553
  u,
541
- h
554
+ f
542
555
  ]);
543
556
  return {
544
557
  openGlideBuy: c.open,
@@ -1,4 +1,4 @@
1
- import { GlideDepositWalletProvider, Hex } from './GlideDeposit.ts';
1
+ import { FundingSource, GlideDepositWalletProvider, Hex } from './GlideDeposit.ts';
2
2
  import { GlideWidgetTheme } from './theme.ts';
3
3
  import { CAIP2 } from '@paywithglide/glide-js';
4
4
  interface UseGlideBuyProps {
@@ -7,6 +7,7 @@ interface UseGlideBuyProps {
7
7
  preferGaslessPayment?: boolean;
8
8
  excludeChainIds?: CAIP2[];
9
9
  excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
10
+ excludeFundingSources?: FundingSource[];
10
11
  sessionMetadata?: string;
11
12
  theme?: GlideWidgetTheme;
12
13
  walletProvider?: GlideDepositWalletProvider;
@@ -16,7 +17,7 @@ interface UseGlideBuyProps {
16
17
  autoCloseOnSuccess?: boolean;
17
18
  baseUrl?: string;
18
19
  }
19
- export declare const useGlideBuy: ({ app, recipient, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
20
+ export declare const useGlideBuy: ({ app, recipient, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideBuyProps) => {
20
21
  openGlideBuy: () => void;
21
22
  externalUrl: string;
22
23
  opts: import('./GlideDeposit.ts').GlideDepositOptions;
@@ -1,4 +1,4 @@
1
- import { GlideDepositWalletProvider, Hex } from './GlideDeposit.ts';
1
+ import { FundingSource, GlideDepositWalletProvider, Hex } from './GlideDeposit.ts';
2
2
  import { GlideWidgetTheme } from './theme.ts';
3
3
  import { CAIP2 } from '@paywithglide/glide-js';
4
4
  interface UseGlideCallProps {
@@ -16,6 +16,7 @@ interface UseGlideCallProps {
16
16
  preferGaslessPayment?: boolean;
17
17
  excludeChainIds?: CAIP2[];
18
18
  excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
19
+ excludeFundingSources?: FundingSource[];
19
20
  sessionMetadata?: string;
20
21
  theme?: GlideWidgetTheme;
21
22
  walletProvider?: GlideDepositWalletProvider;
@@ -25,7 +26,7 @@ interface UseGlideCallProps {
25
26
  autoCloseOnSuccess?: boolean;
26
27
  baseUrl?: string;
27
28
  }
28
- export declare const useGlideCall: ({ app, evm, approval, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideCallProps) => {
29
+ export declare const useGlideCall: ({ app, evm, approval, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideCallProps) => {
29
30
  openGlideCall: () => void;
30
31
  externalUrl: string;
31
32
  opts: import('./GlideDeposit.ts').GlideDepositOptions;
@@ -1,4 +1,4 @@
1
- import { GlideDepositWalletProvider } from './GlideDeposit.ts';
1
+ import { FundingSource, GlideDepositWalletProvider } from './GlideDeposit.ts';
2
2
  import { GlideWidgetTheme } from './theme.ts';
3
3
  import { CAIP2 } from '@paywithglide/glide-js';
4
4
  interface UseGlideDepositProps {
@@ -7,6 +7,7 @@ interface UseGlideDepositProps {
7
7
  preferGaslessPayment?: boolean;
8
8
  excludeChainIds?: CAIP2[];
9
9
  excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
10
+ excludeFundingSources?: FundingSource[];
10
11
  mode?: "deposit" | "withdraw";
11
12
  sessionMetadata?: string;
12
13
  theme?: GlideWidgetTheme;
@@ -17,7 +18,7 @@ interface UseGlideDepositProps {
17
18
  autoCloseOnSuccess?: boolean;
18
19
  baseUrl?: string;
19
20
  }
20
- export declare const useGlideDeposit: ({ app, recipient, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, mode, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideDepositProps) => {
21
+ export declare const useGlideDeposit: ({ app, recipient, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, mode, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideDepositProps) => {
21
22
  openGlideDeposit: () => void;
22
23
  externalUrl: string;
23
24
  opts: import('./GlideDeposit.ts').GlideDepositOptions;
@@ -1,4 +1,4 @@
1
- import { GlideDepositWalletProvider } from './GlideDeposit.ts';
1
+ import { FundingSource, GlideDepositWalletProvider } from './GlideDeposit.ts';
2
2
  import { GlideWidgetTheme } from './theme.ts';
3
3
  import { CAIP2 } from '@paywithglide/glide-js';
4
4
  type UseGlidePayProps = {
@@ -7,6 +7,7 @@ type UseGlidePayProps = {
7
7
  preferGaslessPayment?: boolean;
8
8
  excludeChainIds?: CAIP2[];
9
9
  excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
10
+ excludeFundingSources?: FundingSource[];
10
11
  sessionId?: string;
11
12
  sessionMetadata?: string;
12
13
  theme?: GlideWidgetTheme;
@@ -17,7 +18,7 @@ type UseGlidePayProps = {
17
18
  autoCloseOnSuccess?: boolean;
18
19
  baseUrl?: string;
19
20
  };
20
- export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, amount, sessionId, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlidePayProps) => {
21
+ export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, amount, sessionId, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlidePayProps) => {
21
22
  openGlidePay: () => void;
22
23
  externalUrl: string;
23
24
  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.19",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"