@paywithglide/glide-react 0.0.20 → 0.0.21

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,25 +1,25 @@
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";
11
+ const M = "2.21.51";
12
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@${D}`
14
+ version: `viem@${M}`
15
15
  };
16
16
  class y 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 y ? e.cause.details : (a = e.cause) != null && a.message ? e.cause.message : e.details;
22
+ })(), n = e.cause instanceof y && e.cause.docsPath || e.docsPath, r = (o = w.getDocsUrl) == null ? void 0 : o.call(w, { ...e, docsPath: n }), d = [
23
23
  t || "An error occurred.",
24
24
  "",
25
25
  ...e.metaMessages ? [...e.metaMessages, ""] : [],
@@ -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 = M;
62
62
  }
63
63
  walk(t) {
64
- return S(this, t);
64
+ return A(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 A(s, t) {
68
+ return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? A(s.cause, t) : t ? null : s;
69
69
  }
70
- class A extends y {
70
+ class k 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
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 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 y {
111
+ class N 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
  }
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, l, h, u, f, c, 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
+ }), (l = (p = this.iframe) == null ? void 0 : p.contentWindow) == null || l.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
+ (c = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || c.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);
@@ -300,22 +303,27 @@ class v {
300
303
  createIframe(t) {
301
304
  this.removeIframe();
302
305
  const e = document.createElement("iframe");
303
- e.id = "glide-deposit-iframe", e.setAttribute(
306
+ e.id = "glide-deposit-iframe";
307
+ const i = this.opts.container;
308
+ i ? e.setAttribute(
309
+ "style",
310
+ "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;"
311
+ ) : e.setAttribute(
304
312
  "style",
305
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: fixed; left: 0px; top: 0px; width: 100%; height: 100%; opacity: 0;"
306
314
  ), 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);
315
+ var p, l, h, u;
316
+ const n = this.opts.recipient, r = (p = this.opts.walletProvider) == null ? void 0 : p.address, d = (l = this.opts.walletProvider) == null ? void 0 : l.availableChainIds, o = (h = this.opts.walletProvider) == null ? void 0 : h.currentChainId, a = this.opts.preferGaslessPayment || !!((u = this.opts.walletProvider) != null && u.signTypedDataAsync);
309
317
  e.style.opacity = "1", setTimeout(() => {
310
- var u, f, c;
311
- (u = e == null ? void 0 : e.contentWindow) == null || u.postMessage(
318
+ var f, c, m;
319
+ (f = e == null ? void 0 : e.contentWindow) == null || f.postMessage(
312
320
  {
313
321
  type: "initialize",
314
322
  sessionId: this.opts.sessionId,
315
- recipient: i,
316
- connectedWalletAddress: n,
317
- availableChainIds: r,
318
- currentChainId: d,
323
+ recipient: n,
324
+ connectedWalletAddress: r,
325
+ availableChainIds: d,
326
+ currentChainId: o,
319
327
  preferGaslessPayment: a,
320
328
  excludeChainIds: this.opts.excludeChainIds,
321
329
  excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
@@ -329,16 +337,16 @@ class v {
329
337
  theme: this.opts.theme
330
338
  },
331
339
  new URL(this.baseUrl).origin
332
- ), (c = (f = this.opts).onOpen) == null || c.call(f);
340
+ ), (m = (c = this.opts).onOpen) == null || m.call(c);
333
341
  }, 10);
334
- }, e.src = t, e.allow = "payment *; clipboard-write *", document.body.appendChild(e);
342
+ }, e.src = t, e.allow = "payment *; clipboard-write *", i ? i.appendChild(e) : document.body.appendChild(e);
335
343
  }
336
344
  removeIframe() {
337
345
  const t = document.getElementById("glide-deposit-iframe");
338
346
  t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
339
347
  }
340
348
  }
341
- const K = ({
349
+ const Y = ({
342
350
  app: s,
343
351
  recipient: t,
344
352
  preferGaslessPayment: e,
@@ -346,16 +354,16 @@ const K = ({
346
354
  excludeCurrencyTiers: n,
347
355
  excludeFundingSources: r,
348
356
  mode: d,
349
- sessionMetadata: a,
350
- theme: o,
351
- walletProvider: l,
352
- onOpen: p,
357
+ sessionMetadata: o,
358
+ theme: a,
359
+ walletProvider: p,
360
+ onOpen: l,
353
361
  onSuccess: h,
354
362
  onClose: u,
355
363
  autoCloseOnSuccess: f,
356
364
  baseUrl: c
357
365
  }) => {
358
- const m = $(() => new v({
366
+ const m = v(() => new $({
359
367
  app: s,
360
368
  recipient: t,
361
369
  preferGaslessPayment: e,
@@ -363,10 +371,10 @@ const K = ({
363
371
  excludeCurrencyTiers: n,
364
372
  excludeFundingSources: r,
365
373
  mode: d,
366
- sessionMetadata: a,
367
- theme: o,
368
- walletProvider: l,
369
- onOpen: p,
374
+ sessionMetadata: o,
375
+ theme: a,
376
+ walletProvider: p,
377
+ onOpen: l,
370
378
  onSuccess: h,
371
379
  onClose: u,
372
380
  autoCloseOnSuccess: f,
@@ -379,10 +387,10 @@ const K = ({
379
387
  n,
380
388
  r,
381
389
  d,
382
- a,
383
390
  o,
384
- l,
391
+ a,
385
392
  p,
393
+ l,
386
394
  h,
387
395
  u,
388
396
  f,
@@ -393,7 +401,7 @@ const K = ({
393
401
  externalUrl: m.externalUrl,
394
402
  opts: m.opts
395
403
  };
396
- }, Q = ({
404
+ }, Z = ({
397
405
  app: s,
398
406
  preferGaslessPayment: t,
399
407
  excludeChainIds: e,
@@ -401,16 +409,16 @@ const K = ({
401
409
  excludeFundingSources: n,
402
410
  amount: r,
403
411
  sessionId: d,
404
- sessionMetadata: a,
405
- theme: o,
406
- walletProvider: l,
407
- onOpen: p,
412
+ sessionMetadata: o,
413
+ theme: a,
414
+ walletProvider: p,
415
+ onOpen: l,
408
416
  onSuccess: h,
409
417
  onClose: u,
410
418
  autoCloseOnSuccess: f,
411
419
  baseUrl: c
412
420
  }) => {
413
- const m = $(() => new v({
421
+ const m = v(() => new $({
414
422
  app: s,
415
423
  preferGaslessPayment: t,
416
424
  excludeChainIds: e,
@@ -419,10 +427,10 @@ const K = ({
419
427
  mode: "pay",
420
428
  sessionId: d,
421
429
  amount: r,
422
- sessionMetadata: a,
423
- theme: o,
424
- walletProvider: l,
425
- onOpen: p,
430
+ sessionMetadata: o,
431
+ theme: a,
432
+ walletProvider: p,
433
+ onOpen: l,
426
434
  onSuccess: h,
427
435
  onClose: u,
428
436
  autoCloseOnSuccess: f,
@@ -435,10 +443,10 @@ const K = ({
435
443
  n,
436
444
  d,
437
445
  r,
438
- a,
439
446
  o,
440
- l,
447
+ a,
441
448
  p,
449
+ l,
442
450
  h,
443
451
  u,
444
452
  f,
@@ -449,7 +457,7 @@ const K = ({
449
457
  externalUrl: m.externalUrl,
450
458
  opts: m.opts
451
459
  };
452
- }, Y = ({
460
+ }, _ = ({
453
461
  app: s,
454
462
  evm: t,
455
463
  approval: e,
@@ -457,16 +465,16 @@ const K = ({
457
465
  excludeChainIds: n,
458
466
  excludeCurrencyTiers: r,
459
467
  excludeFundingSources: d,
460
- sessionMetadata: a,
461
- theme: o,
462
- walletProvider: l,
463
- onOpen: p,
468
+ sessionMetadata: o,
469
+ theme: a,
470
+ walletProvider: p,
471
+ onOpen: l,
464
472
  onSuccess: h,
465
473
  onClose: u,
466
474
  autoCloseOnSuccess: f,
467
475
  baseUrl: c
468
476
  }) => {
469
- const m = $(() => new v({
477
+ const m = v(() => new $({
470
478
  app: s,
471
479
  evm: t,
472
480
  approval: e,
@@ -474,11 +482,11 @@ const K = ({
474
482
  excludeChainIds: n,
475
483
  excludeCurrencyTiers: r,
476
484
  excludeFundingSources: d,
477
- sessionMetadata: a,
485
+ sessionMetadata: o,
478
486
  mode: "call",
479
- theme: o,
480
- walletProvider: l,
481
- onOpen: p,
487
+ theme: a,
488
+ walletProvider: p,
489
+ onOpen: l,
482
490
  onSuccess: h,
483
491
  onClose: u,
484
492
  autoCloseOnSuccess: f,
@@ -491,10 +499,10 @@ const K = ({
491
499
  n,
492
500
  r,
493
501
  d,
494
- a,
495
502
  o,
496
- l,
503
+ a,
497
504
  p,
505
+ l,
498
506
  h,
499
507
  u,
500
508
  f,
@@ -505,7 +513,7 @@ const K = ({
505
513
  externalUrl: m.externalUrl,
506
514
  opts: m.opts
507
515
  };
508
- }, Z = ({
516
+ }, ee = ({
509
517
  app: s,
510
518
  recipient: t,
511
519
  preferGaslessPayment: e,
@@ -513,15 +521,15 @@ const K = ({
513
521
  excludeCurrencyTiers: n,
514
522
  excludeFundingSources: r,
515
523
  sessionMetadata: d,
516
- theme: a,
517
- walletProvider: o,
518
- onOpen: l,
519
- onSuccess: p,
524
+ theme: o,
525
+ walletProvider: a,
526
+ onOpen: p,
527
+ onSuccess: l,
520
528
  onClose: h,
521
529
  autoCloseOnSuccess: u,
522
530
  baseUrl: f
523
531
  }) => {
524
- const c = $(() => new v({
532
+ const c = v(() => new $({
525
533
  app: s,
526
534
  recipient: t,
527
535
  preferGaslessPayment: e,
@@ -530,10 +538,10 @@ const K = ({
530
538
  excludeFundingSources: r,
531
539
  sessionMetadata: d,
532
540
  mode: "buy",
533
- theme: a,
534
- walletProvider: o,
535
- onOpen: l,
536
- onSuccess: p,
541
+ theme: o,
542
+ walletProvider: a,
543
+ onOpen: p,
544
+ onSuccess: l,
537
545
  onClose: h,
538
546
  autoCloseOnSuccess: u,
539
547
  baseUrl: f
@@ -545,10 +553,10 @@ const K = ({
545
553
  n,
546
554
  r,
547
555
  d,
548
- a,
549
556
  o,
550
- l,
557
+ a,
551
558
  p,
559
+ l,
552
560
  h,
553
561
  u,
554
562
  f
@@ -560,9 +568,9 @@ const K = ({
560
568
  };
561
569
  };
562
570
  export {
563
- v as GlideDeposit,
564
- Z as useGlideBuy,
565
- Y as useGlideCall,
566
- K as useGlideDeposit,
567
- Q as useGlidePay
571
+ $ as GlideDeposit,
572
+ ee as useGlideBuy,
573
+ _ as useGlideCall,
574
+ Y as useGlideDeposit,
575
+ Z as useGlidePay
568
576
  };
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.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"