@paywithglide/glide-react 0.0.20 → 0.0.22

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.
@@ -102,7 +102,9 @@ export type GlideDepositOptions = {
102
102
  onOpen?: () => void;
103
103
  onSuccess?: (hash: Hex) => void;
104
104
  onClose?: () => void;
105
+ onSetMode?: (mode: "deposit" | "withdraw") => void;
105
106
  autoCloseOnSuccess?: boolean;
107
+ container?: HTMLElement;
106
108
  theme?: GlideWidgetTheme;
107
109
  baseUrl?: string;
108
110
  };
package/dist/glide.js CHANGED
@@ -1,31 +1,31 @@
1
- var G = Object.defineProperty;
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 } = {}) {
1
+ var j = Object.defineProperty;
2
+ var H = (s, t, e) => t in s ? j(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var b = (s, t, e) => H(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { useMemo as v } from "react";
5
+ function B(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 T(s) {
9
- return C(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
8
+ function D(s) {
9
+ return B(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
10
10
  }
11
- const D = "2.21.51";
12
- let w = {
11
+ const A = "2.21.51";
12
+ let y = {
13
13
  getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
14
- version: `viem@${D}`
14
+ version: `viem@${A}`
15
15
  };
16
- class y extends Error {
16
+ class w extends Error {
17
17
  constructor(t, e = {}) {
18
- var a;
18
+ var o;
19
19
  const i = (() => {
20
- var o;
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 = [
20
+ var a;
21
+ return e.cause instanceof w ? e.cause.details : (a = e.cause) != null && a.message ? e.cause.message : e.details;
22
+ })(), n = e.cause instanceof w && e.cause.docsPath || e.docsPath, r = (o = y.getDocsUrl) == null ? void 0 : o.call(y, { ...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
- ...w.version ? [`Version: ${w.version}`] : []
28
+ ...y.version ? [`Version: ${y.version}`] : []
29
29
  ].join(`
30
30
  `);
31
31
  super(d, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
@@ -58,40 +58,40 @@ class y extends Error {
58
58
  configurable: !0,
59
59
  writable: !0,
60
60
  value: "BaseError"
61
- }), this.details = i, this.docsPath = n, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = D;
61
+ }), this.details = i, this.docsPath = n, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = A;
62
62
  }
63
63
  walk(t) {
64
- return S(this, t);
64
+ return M(this, t);
65
65
  }
66
66
  }
67
- function S(s, t) {
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;
67
+ function M(s, t) {
68
+ return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? M(s.cause, t) : t ? null : s;
69
69
  }
70
- class A extends y {
70
+ class k extends w {
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
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 });
76
+ return typeof s == "string" ? W(s, { dir: t, size: e }) : L(s, { dir: t, size: e });
77
77
  }
78
- function H(s, { dir: t, size: e = 32 } = {}) {
78
+ function W(s, { dir: t, size: e = 32 } = {}) {
79
79
  if (e === null)
80
80
  return s;
81
81
  const i = s.replace("0x", "");
82
82
  if (i.length > e * 2)
83
- throw new A({
83
+ throw new k({
84
84
  size: Math.ceil(i.length / 2),
85
85
  targetSize: e,
86
86
  type: "hex"
87
87
  });
88
88
  return `0x${i[t === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
89
89
  }
90
- function B(s, { dir: t, size: e = 32 } = {}) {
90
+ function L(s, { dir: t, size: e = 32 } = {}) {
91
91
  if (e === null)
92
92
  return s;
93
93
  if (s.length > e)
94
- throw new A({
94
+ throw new k({
95
95
  size: s.length,
96
96
  targetSize: e,
97
97
  type: "bytes"
@@ -103,67 +103,67 @@ function B(s, { dir: t, size: e = 32 } = {}) {
103
103
  }
104
104
  return i;
105
105
  }
106
- class W extends y {
106
+ class O extends w {
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 y {
111
+ class N extends w {
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
- function M(s, { size: t }) {
117
- if (T(s) > t)
118
- throw new L({
119
- givenSize: T(s),
116
+ function G(s, { size: t }) {
117
+ if (D(s) > t)
118
+ throw new N({
119
+ givenSize: D(s),
120
120
  maxSize: t
121
121
  });
122
122
  }
123
- const O = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
124
- function N(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);
123
+ const R = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
124
+ function F(s, t = {}) {
125
+ return typeof s == "number" || typeof s == "bigint" ? q(s, t) : typeof s == "string" ? J(s, t) : typeof s == "boolean" ? V(s, t) : C(s, t);
126
126
  }
127
- function R(s, t = {}) {
127
+ function V(s, t = {}) {
128
128
  const e = `0x${Number(s)}`;
129
- return typeof t.size == "number" ? (M(e, { size: t.size }), x(e, { size: t.size })) : e;
129
+ return typeof t.size == "number" ? (G(e, { size: t.size }), x(e, { size: t.size })) : e;
130
130
  }
131
- function k(s, t = {}) {
131
+ function C(s, t = {}) {
132
132
  let e = "";
133
133
  for (let n = 0; n < s.length; n++)
134
- e += O[s[n]];
134
+ e += R[s[n]];
135
135
  const i = `0x${e}`;
136
- return typeof t.size == "number" ? (M(i, { size: t.size }), x(i, { dir: "right", size: t.size })) : i;
136
+ return typeof t.size == "number" ? (G(i, { size: t.size }), x(i, { dir: "right", size: t.size })) : i;
137
137
  }
138
- function F(s, t = {}) {
138
+ function q(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));
142
142
  const d = typeof r == "bigint" && e ? -r - 1n : 0;
143
143
  if (r && n > r || n < d) {
144
- const o = typeof s == "bigint" ? "n" : "";
145
- throw new W({
146
- max: r ? `${r}${o}` : void 0,
147
- min: `${d}${o}`,
144
+ const a = typeof s == "bigint" ? "n" : "";
145
+ throw new O({
146
+ max: r ? `${r}${a}` : void 0,
147
+ min: `${d}${a}`,
148
148
  signed: e,
149
149
  size: i,
150
- value: `${s}${o}`
150
+ value: `${s}${a}`
151
151
  });
152
152
  }
153
- const a = `0x${(e && n < 0 ? (1n << BigInt(i * 8)) + BigInt(n) : n).toString(16)}`;
154
- return i ? x(a, { size: i }) : a;
153
+ const o = `0x${(e && n < 0 ? (1n << BigInt(i * 8)) + BigInt(n) : n).toString(16)}`;
154
+ return i ? x(o, { size: i }) : o;
155
155
  }
156
- const V = /* @__PURE__ */ new TextEncoder();
157
- function q(s, t = {}) {
158
- const e = V.encode(s);
159
- return k(e, t);
156
+ const X = /* @__PURE__ */ new TextEncoder();
157
+ function J(s, t = {}) {
158
+ const e = X.encode(s);
159
+ return C(e, t);
160
160
  }
161
- class v {
161
+ class $ {
162
162
  constructor(t) {
163
163
  b(this, "opts");
164
164
  b(this, "open", () => {
165
- if (!document.body.classList.contains("glide-deposit-open")) {
166
- if (document.body.classList.add("glide-deposit-open"), (this.opts.mode === "deposit" || this.opts.mode === "buy") && !this.opts.recipient)
165
+ if (!(!this.opts.container && document.body.classList.contains("glide-deposit-open"))) {
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");
168
168
  if (this.opts.preferGaslessPayment && this.opts.walletProvider && !this.opts.walletProvider.signTypedDataAsync)
169
169
  throw new Error(
@@ -173,7 +173,7 @@ class v {
173
173
  }
174
174
  });
175
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;
176
+ var i, n, r, d, o, a, p, c, h, u, f, l, m, I, P, E, z, U, T, S;
177
177
  const e = t.data;
178
178
  switch (e.type) {
179
179
  case "success":
@@ -182,13 +182,16 @@ class v {
182
182
  case "close":
183
183
  this.removeIframe(), this.destroy(), (d = (r = this.opts) == null ? void 0 : r.onClose) == null || d.call(r);
184
184
  break;
185
+ case "setMode":
186
+ (a = (o = this.opts) == null ? void 0 : o.onSetMode) == null || a.call(o, e.mode);
187
+ break;
185
188
  case "switchChain":
186
189
  if (!this.opts.walletProvider)
187
190
  throw new Error("walletProvider is not set");
188
191
  try {
189
192
  await this.opts.walletProvider.switchChainAsync({
190
193
  chainId: e.chainId
191
- }), (o = (a = this.iframe) == null ? void 0 : a.contentWindow) == null || o.postMessage(
194
+ }), (c = (p = this.iframe) == null ? void 0 : p.contentWindow) == null || c.postMessage(
192
195
  {
193
196
  type: "didSwitchChain",
194
197
  success: !0,
@@ -197,7 +200,7 @@ class v {
197
200
  this.baseUrl
198
201
  );
199
202
  } catch (g) {
200
- (p = (l = this.iframe) == null ? void 0 : l.contentWindow) == null || p.postMessage(
203
+ (u = (h = this.iframe) == null ? void 0 : h.contentWindow) == null || u.postMessage(
201
204
  {
202
205
  type: "didSwitchChain",
203
206
  success: !1,
@@ -215,7 +218,7 @@ class v {
215
218
  const g = await this.opts.walletProvider.sendTransactionAsync(
216
219
  e.tx
217
220
  );
218
- (u = (h = this.iframe) == null ? void 0 : h.contentWindow) == null || u.postMessage(
221
+ (l = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || l.postMessage(
219
222
  {
220
223
  type: "didSendTransaction",
221
224
  success: !0,
@@ -224,7 +227,7 @@ class v {
224
227
  this.baseUrl
225
228
  );
226
229
  } catch (g) {
227
- (c = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || c.postMessage(
230
+ (I = (m = this.iframe) == null ? void 0 : m.contentWindow) == null || I.postMessage(
228
231
  {
229
232
  type: "didSendTransaction",
230
233
  success: !1,
@@ -240,7 +243,7 @@ class v {
240
243
  if (!this.opts.walletProvider)
241
244
  throw new Error("walletProvider is not set");
242
245
  if (!this.opts.walletProvider.signTypedDataAsync) {
243
- (I = (m = this.iframe) == null ? void 0 : m.contentWindow) == null || I.postMessage(
246
+ (E = (P = this.iframe) == null ? void 0 : P.contentWindow) == null || E.postMessage(
244
247
  {
245
248
  type: "didSignTypedData",
246
249
  success: !1,
@@ -254,7 +257,7 @@ class v {
254
257
  const g = await this.opts.walletProvider.signTypedDataAsync(
255
258
  e.data
256
259
  );
257
- (E = (P = this.iframe) == null ? void 0 : P.contentWindow) == null || E.postMessage(
260
+ (U = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || U.postMessage(
258
261
  {
259
262
  type: "didSignTypedData",
260
263
  success: !0,
@@ -263,7 +266,7 @@ class v {
263
266
  this.baseUrl
264
267
  );
265
268
  } catch (g) {
266
- (z = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || z.postMessage(
269
+ (S = (T = this.iframe) == null ? void 0 : T.contentWindow) == null || S.postMessage(
267
270
  {
268
271
  type: "didSignTypedData",
269
272
  success: !1,
@@ -280,7 +283,7 @@ class v {
280
283
  }
281
284
  get externalUrl() {
282
285
  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(",")}` : ""}`;
286
+ 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=${F(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
287
  }
285
288
  initialize() {
286
289
  window.addEventListener("message", this.iframeEventHandler);
@@ -301,21 +304,29 @@ class v {
301
304
  this.removeIframe();
302
305
  const e = document.createElement("iframe");
303
306
  e.id = "glide-deposit-iframe", e.setAttribute(
307
+ "sandbox",
308
+ "allow-popups allow-popups-to-escape-sandbox allow-scripts allow-forms allow-modals"
309
+ );
310
+ const i = this.opts.container;
311
+ i ? e.setAttribute(
312
+ "style",
313
+ "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: relative; width: 100%; height: 100%; opacity: 0;"
314
+ ) : e.setAttribute(
304
315
  "style",
305
316
  "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
317
  ), e.onload = () => {
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);
318
+ var p, c, h, u;
319
+ const n = this.opts.recipient, r = (p = this.opts.walletProvider) == null ? void 0 : p.address, d = (c = this.opts.walletProvider) == null ? void 0 : c.availableChainIds, o = (h = this.opts.walletProvider) == null ? void 0 : h.currentChainId, a = this.opts.preferGaslessPayment || !!((u = this.opts.walletProvider) != null && u.signTypedDataAsync);
309
320
  e.style.opacity = "1", setTimeout(() => {
310
- var u, f, c;
311
- (u = e == null ? void 0 : e.contentWindow) == null || u.postMessage(
321
+ var f, l, m;
322
+ (f = e == null ? void 0 : e.contentWindow) == null || f.postMessage(
312
323
  {
313
324
  type: "initialize",
314
325
  sessionId: this.opts.sessionId,
315
- recipient: i,
316
- connectedWalletAddress: n,
317
- availableChainIds: r,
318
- currentChainId: d,
326
+ recipient: n,
327
+ connectedWalletAddress: r,
328
+ availableChainIds: d,
329
+ currentChainId: o,
319
330
  preferGaslessPayment: a,
320
331
  excludeChainIds: this.opts.excludeChainIds,
321
332
  excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
@@ -329,16 +340,16 @@ class v {
329
340
  theme: this.opts.theme
330
341
  },
331
342
  new URL(this.baseUrl).origin
332
- ), (c = (f = this.opts).onOpen) == null || c.call(f);
343
+ ), (m = (l = this.opts).onOpen) == null || m.call(l);
333
344
  }, 10);
334
- }, e.src = t, e.allow = "payment *; clipboard-write *", document.body.appendChild(e);
345
+ }, e.src = t, e.allow = "payment *; clipboard-write *", i ? i.appendChild(e) : document.body.appendChild(e);
335
346
  }
336
347
  removeIframe() {
337
348
  const t = document.getElementById("glide-deposit-iframe");
338
349
  t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
339
350
  }
340
351
  }
341
- const K = ({
352
+ const Y = ({
342
353
  app: s,
343
354
  recipient: t,
344
355
  preferGaslessPayment: e,
@@ -346,16 +357,16 @@ const K = ({
346
357
  excludeCurrencyTiers: n,
347
358
  excludeFundingSources: r,
348
359
  mode: d,
349
- sessionMetadata: a,
350
- theme: o,
351
- walletProvider: l,
352
- onOpen: p,
360
+ sessionMetadata: o,
361
+ theme: a,
362
+ walletProvider: p,
363
+ onOpen: c,
353
364
  onSuccess: h,
354
365
  onClose: u,
355
366
  autoCloseOnSuccess: f,
356
- baseUrl: c
367
+ baseUrl: l
357
368
  }) => {
358
- const m = $(() => new v({
369
+ const m = v(() => new $({
359
370
  app: s,
360
371
  recipient: t,
361
372
  preferGaslessPayment: e,
@@ -363,14 +374,14 @@ const K = ({
363
374
  excludeCurrencyTiers: n,
364
375
  excludeFundingSources: r,
365
376
  mode: d,
366
- sessionMetadata: a,
367
- theme: o,
368
- walletProvider: l,
369
- onOpen: p,
377
+ sessionMetadata: o,
378
+ theme: a,
379
+ walletProvider: p,
380
+ onOpen: c,
370
381
  onSuccess: h,
371
382
  onClose: u,
372
383
  autoCloseOnSuccess: f,
373
- baseUrl: c
384
+ baseUrl: l
374
385
  }), [
375
386
  s,
376
387
  t,
@@ -379,21 +390,21 @@ const K = ({
379
390
  n,
380
391
  r,
381
392
  d,
382
- a,
383
393
  o,
384
- l,
394
+ a,
385
395
  p,
396
+ c,
386
397
  h,
387
398
  u,
388
399
  f,
389
- c
400
+ l
390
401
  ]);
391
402
  return {
392
403
  openGlideDeposit: m.open,
393
404
  externalUrl: m.externalUrl,
394
405
  opts: m.opts
395
406
  };
396
- }, Q = ({
407
+ }, Z = ({
397
408
  app: s,
398
409
  preferGaslessPayment: t,
399
410
  excludeChainIds: e,
@@ -401,16 +412,16 @@ const K = ({
401
412
  excludeFundingSources: n,
402
413
  amount: r,
403
414
  sessionId: d,
404
- sessionMetadata: a,
405
- theme: o,
406
- walletProvider: l,
407
- onOpen: p,
415
+ sessionMetadata: o,
416
+ theme: a,
417
+ walletProvider: p,
418
+ onOpen: c,
408
419
  onSuccess: h,
409
420
  onClose: u,
410
421
  autoCloseOnSuccess: f,
411
- baseUrl: c
422
+ baseUrl: l
412
423
  }) => {
413
- const m = $(() => new v({
424
+ const m = v(() => new $({
414
425
  app: s,
415
426
  preferGaslessPayment: t,
416
427
  excludeChainIds: e,
@@ -419,14 +430,14 @@ const K = ({
419
430
  mode: "pay",
420
431
  sessionId: d,
421
432
  amount: r,
422
- sessionMetadata: a,
423
- theme: o,
424
- walletProvider: l,
425
- onOpen: p,
433
+ sessionMetadata: o,
434
+ theme: a,
435
+ walletProvider: p,
436
+ onOpen: c,
426
437
  onSuccess: h,
427
438
  onClose: u,
428
439
  autoCloseOnSuccess: f,
429
- baseUrl: c
440
+ baseUrl: l
430
441
  }), [
431
442
  s,
432
443
  t,
@@ -435,21 +446,21 @@ const K = ({
435
446
  n,
436
447
  d,
437
448
  r,
438
- a,
439
449
  o,
440
- l,
450
+ a,
441
451
  p,
452
+ c,
442
453
  h,
443
454
  u,
444
455
  f,
445
- c
456
+ l
446
457
  ]);
447
458
  return {
448
459
  openGlidePay: m.open,
449
460
  externalUrl: m.externalUrl,
450
461
  opts: m.opts
451
462
  };
452
- }, Y = ({
463
+ }, _ = ({
453
464
  app: s,
454
465
  evm: t,
455
466
  approval: e,
@@ -457,16 +468,16 @@ const K = ({
457
468
  excludeChainIds: n,
458
469
  excludeCurrencyTiers: r,
459
470
  excludeFundingSources: d,
460
- sessionMetadata: a,
461
- theme: o,
462
- walletProvider: l,
463
- onOpen: p,
471
+ sessionMetadata: o,
472
+ theme: a,
473
+ walletProvider: p,
474
+ onOpen: c,
464
475
  onSuccess: h,
465
476
  onClose: u,
466
477
  autoCloseOnSuccess: f,
467
- baseUrl: c
478
+ baseUrl: l
468
479
  }) => {
469
- const m = $(() => new v({
480
+ const m = v(() => new $({
470
481
  app: s,
471
482
  evm: t,
472
483
  approval: e,
@@ -474,15 +485,15 @@ const K = ({
474
485
  excludeChainIds: n,
475
486
  excludeCurrencyTiers: r,
476
487
  excludeFundingSources: d,
477
- sessionMetadata: a,
488
+ sessionMetadata: o,
478
489
  mode: "call",
479
- theme: o,
480
- walletProvider: l,
481
- onOpen: p,
490
+ theme: a,
491
+ walletProvider: p,
492
+ onOpen: c,
482
493
  onSuccess: h,
483
494
  onClose: u,
484
495
  autoCloseOnSuccess: f,
485
- baseUrl: c
496
+ baseUrl: l
486
497
  }), [
487
498
  s,
488
499
  t,
@@ -491,21 +502,21 @@ const K = ({
491
502
  n,
492
503
  r,
493
504
  d,
494
- a,
495
505
  o,
496
- l,
506
+ a,
497
507
  p,
508
+ c,
498
509
  h,
499
510
  u,
500
511
  f,
501
- c
512
+ l
502
513
  ]);
503
514
  return {
504
515
  openGlideCall: m.open,
505
516
  externalUrl: m.externalUrl,
506
517
  opts: m.opts
507
518
  };
508
- }, Z = ({
519
+ }, ee = ({
509
520
  app: s,
510
521
  recipient: t,
511
522
  preferGaslessPayment: e,
@@ -513,15 +524,15 @@ const K = ({
513
524
  excludeCurrencyTiers: n,
514
525
  excludeFundingSources: r,
515
526
  sessionMetadata: d,
516
- theme: a,
517
- walletProvider: o,
518
- onOpen: l,
519
- onSuccess: p,
527
+ theme: o,
528
+ walletProvider: a,
529
+ onOpen: p,
530
+ onSuccess: c,
520
531
  onClose: h,
521
532
  autoCloseOnSuccess: u,
522
533
  baseUrl: f
523
534
  }) => {
524
- const c = $(() => new v({
535
+ const l = v(() => new $({
525
536
  app: s,
526
537
  recipient: t,
527
538
  preferGaslessPayment: e,
@@ -530,10 +541,10 @@ const K = ({
530
541
  excludeFundingSources: r,
531
542
  sessionMetadata: d,
532
543
  mode: "buy",
533
- theme: a,
534
- walletProvider: o,
535
- onOpen: l,
536
- onSuccess: p,
544
+ theme: o,
545
+ walletProvider: a,
546
+ onOpen: p,
547
+ onSuccess: c,
537
548
  onClose: h,
538
549
  autoCloseOnSuccess: u,
539
550
  baseUrl: f
@@ -545,24 +556,24 @@ const K = ({
545
556
  n,
546
557
  r,
547
558
  d,
548
- a,
549
559
  o,
550
- l,
560
+ a,
551
561
  p,
562
+ c,
552
563
  h,
553
564
  u,
554
565
  f
555
566
  ]);
556
567
  return {
557
- openGlideBuy: c.open,
558
- externalUrl: c.externalUrl,
559
- opts: c.opts
568
+ openGlideBuy: l.open,
569
+ externalUrl: l.externalUrl,
570
+ opts: l.opts
560
571
  };
561
572
  };
562
573
  export {
563
- v as GlideDeposit,
564
- Z as useGlideBuy,
565
- Y as useGlideCall,
566
- K as useGlideDeposit,
567
- Q as useGlidePay
574
+ $ as GlideDeposit,
575
+ ee as useGlideBuy,
576
+ _ as useGlideCall,
577
+ Y as useGlideDeposit,
578
+ Z as useGlidePay
568
579
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paywithglide/glide-react",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"