@paywithglide/glide-react 0.0.32 → 0.0.33

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.
package/dist/glide.js CHANGED
@@ -1,17 +1,17 @@
1
- var Z = Object.defineProperty;
2
- var _ = (s, t, e) => t in s ? Z(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var k = (s, t, e) => _(s, typeof t != "symbol" ? t + "" : t, e);
1
+ var _ = Object.defineProperty;
2
+ var ee = (s, t, e) => t in s ? _(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var k = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { useMemo as U } from "react";
5
- function ee(s, { strict: t = !0 } = {}) {
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 R(s) {
9
- return ee(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
8
+ function N(s) {
9
+ return te(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
10
10
  }
11
- const N = "2.21.51";
11
+ const K = "2.21.51";
12
12
  let E = {
13
13
  getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
14
- version: `viem@${N}`
14
+ version: `viem@${K}`
15
15
  };
16
16
  class x extends Error {
17
17
  constructor(t, e = {}) {
@@ -58,40 +58,40 @@ class x extends Error {
58
58
  configurable: !0,
59
59
  writable: !0,
60
60
  value: "BaseError"
61
- }), this.details = i, this.docsPath = r, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = N;
61
+ }), this.details = i, this.docsPath = r, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = K;
62
62
  }
63
63
  walk(t) {
64
- return K(this, t);
64
+ return F(this, t);
65
65
  }
66
66
  }
67
- function K(s, t) {
68
- return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? K(s.cause, t) : t ? null : s;
67
+ function F(s, t) {
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 F extends x {
70
+ class V extends x {
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 A(s, { dir: t, size: e = 32 } = {}) {
76
- return typeof s == "string" ? te(s, { dir: t, size: e }) : se(s, { dir: t, size: e });
76
+ return typeof s == "string" ? se(s, { dir: t, size: e }) : ie(s, { dir: t, size: e });
77
77
  }
78
- function te(s, { dir: t, size: e = 32 } = {}) {
78
+ function se(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 F({
83
+ throw new V({
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 se(s, { dir: t, size: e = 32 } = {}) {
90
+ function ie(s, { dir: t, size: e = 32 } = {}) {
91
91
  if (e === null)
92
92
  return s;
93
93
  if (s.length > e)
94
- throw new F({
94
+ throw new V({
95
95
  size: s.length,
96
96
  targetSize: e,
97
97
  type: "bytes"
@@ -103,46 +103,46 @@ function se(s, { dir: t, size: e = 32 } = {}) {
103
103
  }
104
104
  return i;
105
105
  }
106
- class ie extends x {
106
+ class re extends x {
107
107
  constructor({ max: t, min: e, signed: i, size: r, value: o }) {
108
108
  super(`Number "${o}" is not in safe ${r ? `${r * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${e} to ${t})` : `(above ${e})`}`, { name: "IntegerOutOfRangeError" });
109
109
  }
110
110
  }
111
- class re extends x {
111
+ class oe extends x {
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 V(s, { size: t }) {
117
- if (R(s) > t)
118
- throw new re({
119
- givenSize: R(s),
116
+ function q(s, { size: t }) {
117
+ if (N(s) > t)
118
+ throw new oe({
119
+ givenSize: N(s),
120
120
  maxSize: t
121
121
  });
122
122
  }
123
- const oe = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
124
- function ne(s, t = {}) {
125
- return typeof s == "number" || typeof s == "bigint" ? ce(s, t) : typeof s == "string" ? le(s, t) : typeof s == "boolean" ? ae(s, t) : q(s, t);
126
- }
123
+ const ne = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
127
124
  function ae(s, t = {}) {
125
+ return typeof s == "number" || typeof s == "bigint" ? de(s, t) : typeof s == "string" ? pe(s, t) : typeof s == "boolean" ? ce(s, t) : J(s, t);
126
+ }
127
+ function ce(s, t = {}) {
128
128
  const e = `0x${Number(s)}`;
129
- return typeof t.size == "number" ? (V(e, { size: t.size }), A(e, { size: t.size })) : e;
129
+ return typeof t.size == "number" ? (q(e, { size: t.size }), A(e, { size: t.size })) : e;
130
130
  }
131
- function q(s, t = {}) {
131
+ function J(s, t = {}) {
132
132
  let e = "";
133
133
  for (let r = 0; r < s.length; r++)
134
- e += oe[s[r]];
134
+ e += ne[s[r]];
135
135
  const i = `0x${e}`;
136
- return typeof t.size == "number" ? (V(i, { size: t.size }), A(i, { dir: "right", size: t.size })) : i;
136
+ return typeof t.size == "number" ? (q(i, { size: t.size }), A(i, { dir: "right", size: t.size })) : i;
137
137
  }
138
- function ce(s, t = {}) {
138
+ function de(s, t = {}) {
139
139
  const { signed: e, size: i } = t, r = BigInt(s);
140
140
  let o;
141
141
  i ? e ? o = (1n << BigInt(i) * 8n - 1n) - 1n : o = 2n ** (BigInt(i) * 8n) - 1n : typeof s == "number" && (o = BigInt(Number.MAX_SAFE_INTEGER));
142
142
  const c = typeof o == "bigint" && e ? -o - 1n : 0;
143
143
  if (o && r > o || r < c) {
144
144
  const n = typeof s == "bigint" ? "n" : "";
145
- throw new ie({
145
+ throw new re({
146
146
  max: o ? `${o}${n}` : void 0,
147
147
  min: `${c}${n}`,
148
148
  signed: e,
@@ -153,10 +153,10 @@ function ce(s, t = {}) {
153
153
  const a = `0x${(e && r < 0 ? (1n << BigInt(i * 8)) + BigInt(r) : r).toString(16)}`;
154
154
  return i ? A(a, { size: i }) : a;
155
155
  }
156
- const de = /* @__PURE__ */ new TextEncoder();
157
- function le(s, t = {}) {
158
- const e = de.encode(s);
159
- return q(e, t);
156
+ const le = /* @__PURE__ */ new TextEncoder();
157
+ function pe(s, t = {}) {
158
+ const e = le.encode(s);
159
+ return J(e, t);
160
160
  }
161
161
  class z {
162
162
  constructor(t) {
@@ -173,20 +173,20 @@ class z {
173
173
  }
174
174
  });
175
175
  k(this, "iframeEventHandler", async (t) => {
176
- var i, r, o, c, a, n, h, u, m, f, g, y, l, w, d, b, v, I, P, S, $, M, T, D, C, G, j, B, W, H, L, O;
176
+ var i, r, o, c, a, n, u, m, f, g, y, w, b, d, l, p, I, v, P, S, $, M, T, D, C, G, j, B, W, H, O, L, R;
177
177
  const e = t.data;
178
178
  switch (e.type) {
179
179
  case "sendInit": {
180
- const p = this.opts.recipient, J = (i = this.opts.walletProvider) == null ? void 0 : i.address, X = (r = this.opts.walletProvider) == null ? void 0 : r.availableChainIds, Q = (o = this.opts.walletProvider) == null ? void 0 : o.currentChainId, Y = this.opts.preferGaslessPayment || !!((c = this.opts.walletProvider) != null && c.signTypedDataAsync);
181
- (n = (a = this.iframe) == null ? void 0 : a.contentWindow) == null || n.postMessage(
180
+ const h = this.opts.recipient, X = (i = this.opts.walletProvider) == null ? void 0 : i.address, Q = (r = this.opts.walletProvider) == null ? void 0 : r.availableChainIds, Y = (o = this.opts.walletProvider) == null ? void 0 : o.currentChainId, Z = this.opts.preferGaslessPayment || !!((c = this.opts.walletProvider) != null && c.signTypedDataAsync);
181
+ (u = (a = this.iframe) == null ? void 0 : a.contentWindow) == null || u.postMessage(
182
182
  {
183
183
  type: "initialize",
184
184
  sessionId: this.opts.sessionId,
185
- recipient: p,
186
- connectedWalletAddress: J,
187
- availableChainIds: X,
188
- currentChainId: Q,
189
- preferGaslessPayment: Y,
185
+ recipient: h,
186
+ connectedWalletAddress: X,
187
+ availableChainIds: Q,
188
+ currentChainId: Y,
189
+ preferGaslessPayment: Z,
190
190
  excludeChainIds: this.opts.excludeChainIds,
191
191
  excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
192
192
  excludeFundingSources: this.opts.excludeFundingSources,
@@ -198,24 +198,31 @@ class z {
198
198
  tokenApproval: this.opts.approval,
199
199
  sessionMetadata: this.opts.sessionMetadata,
200
200
  autoCloseOnSuccess: this.opts.autoCloseOnSuccess,
201
- theme: this.opts.theme,
201
+ theme: {
202
+ ...this.opts.theme || {},
203
+ colorScheme: ((n = this.opts.theme) == null ? void 0 : n.colorScheme) || getComputedStyle(document.documentElement).colorScheme || ""
204
+ },
202
205
  didProvideLocalStorage: !!this.opts.localStorageProvider,
203
206
  debug: this.opts.debug,
204
207
  popupsBlocked: this.opts.popupsBlocked,
205
208
  gasRefuelAmountPerChain: this.opts.gasRefuelAmountPerChain
206
209
  },
207
210
  new URL(this.baseUrl).origin
208
- ), this.iframe.style.opacity = "1", (u = (h = this.opts).onOpen) == null || u.call(h);
211
+ );
212
+ break;
213
+ }
214
+ case "didOpen": {
215
+ this.iframe.style.opacity = "1", (f = (m = this.opts).onOpen) == null || f.call(m);
209
216
  break;
210
217
  }
211
218
  case "localStorage.getKeys": {
212
219
  if (!this.opts.localStorageProvider)
213
220
  throw new Error("localStorageProvider is not set");
214
- const p = await this.opts.localStorageProvider.getKeys();
215
- (f = (m = this.iframe) == null ? void 0 : m.contentWindow) == null || f.postMessage(
221
+ const h = await this.opts.localStorageProvider.getKeys();
222
+ (y = (g = this.iframe) == null ? void 0 : g.contentWindow) == null || y.postMessage(
216
223
  {
217
224
  type: "localStorage.didGetKeys",
218
- keys: p
225
+ keys: h
219
226
  },
220
227
  this.baseUrl
221
228
  );
@@ -237,25 +244,25 @@ class z {
237
244
  case "localStorage.getItem": {
238
245
  if (!this.opts.localStorageProvider)
239
246
  throw new Error("localStorageProvider is not set");
240
- const p = await this.opts.localStorageProvider.getItem(e.key);
241
- (y = (g = this.iframe) == null ? void 0 : g.contentWindow) == null || y.postMessage(
247
+ const h = await this.opts.localStorageProvider.getItem(e.key);
248
+ (b = (w = this.iframe) == null ? void 0 : w.contentWindow) == null || b.postMessage(
242
249
  {
243
250
  type: "localStorage.didGetItem",
244
251
  key: e.key,
245
- value: p
252
+ value: h
246
253
  },
247
254
  this.baseUrl
248
255
  );
249
256
  break;
250
257
  }
251
258
  case "success":
252
- (w = (l = this.opts) == null ? void 0 : l.onSuccess) == null || w.call(l, e.hash, e.session);
259
+ (l = (d = this.opts) == null ? void 0 : d.onSuccess) == null || l.call(d, e.hash, e.session);
253
260
  break;
254
261
  case "close":
255
- this.removeIframe(), this.destroy(), (b = (d = this.opts) == null ? void 0 : d.onClose) == null || b.call(d);
262
+ this.removeIframe(), this.destroy(), (I = (p = this.opts) == null ? void 0 : p.onClose) == null || I.call(p);
256
263
  break;
257
264
  case "setMode":
258
- (I = (v = this.opts) == null ? void 0 : v.onSetMode) == null || I.call(v, e.mode);
265
+ (P = (v = this.opts) == null ? void 0 : v.onSetMode) == null || P.call(v, e.mode);
259
266
  break;
260
267
  case "switchChain":
261
268
  if (!this.opts.walletProvider)
@@ -263,7 +270,7 @@ class z {
263
270
  try {
264
271
  await this.opts.walletProvider.switchChainAsync({
265
272
  chainId: e.chainId
266
- }), (S = (P = this.iframe) == null ? void 0 : P.contentWindow) == null || S.postMessage(
273
+ }), ($ = (S = this.iframe) == null ? void 0 : S.contentWindow) == null || $.postMessage(
267
274
  {
268
275
  type: "didSwitchChain",
269
276
  success: !0,
@@ -271,12 +278,12 @@ class z {
271
278
  },
272
279
  this.baseUrl
273
280
  );
274
- } catch (p) {
275
- (M = ($ = this.iframe) == null ? void 0 : $.contentWindow) == null || M.postMessage(
281
+ } catch (h) {
282
+ (T = (M = this.iframe) == null ? void 0 : M.contentWindow) == null || T.postMessage(
276
283
  {
277
284
  type: "didSwitchChain",
278
285
  success: !1,
279
- error: p
286
+ error: h
280
287
  },
281
288
  this.baseUrl
282
289
  );
@@ -287,23 +294,23 @@ class z {
287
294
  if (!this.opts.walletProvider)
288
295
  throw new Error("walletProvider is not set");
289
296
  try {
290
- const p = await this.opts.walletProvider.sendTransactionAsync(
297
+ const h = await this.opts.walletProvider.sendTransactionAsync(
291
298
  e.tx
292
299
  );
293
- (D = (T = this.iframe) == null ? void 0 : T.contentWindow) == null || D.postMessage(
300
+ (C = (D = this.iframe) == null ? void 0 : D.contentWindow) == null || C.postMessage(
294
301
  {
295
302
  type: "didSendTransaction",
296
303
  success: !0,
297
- txHash: p
304
+ txHash: h
298
305
  },
299
306
  this.baseUrl
300
307
  );
301
- } catch (p) {
302
- (G = (C = this.iframe) == null ? void 0 : C.contentWindow) == null || G.postMessage(
308
+ } catch (h) {
309
+ (j = (G = this.iframe) == null ? void 0 : G.contentWindow) == null || j.postMessage(
303
310
  {
304
311
  type: "didSendTransaction",
305
312
  success: !1,
306
- error: p
313
+ error: h
307
314
  },
308
315
  this.baseUrl
309
316
  );
@@ -315,7 +322,7 @@ class z {
315
322
  if (!this.opts.walletProvider)
316
323
  throw new Error("walletProvider is not set");
317
324
  if (!this.opts.walletProvider.signTypedDataAsync) {
318
- (B = (j = this.iframe) == null ? void 0 : j.contentWindow) == null || B.postMessage(
325
+ (W = (B = this.iframe) == null ? void 0 : B.contentWindow) == null || W.postMessage(
319
326
  {
320
327
  type: "didSignTypedData",
321
328
  success: !1,
@@ -326,23 +333,23 @@ class z {
326
333
  return;
327
334
  }
328
335
  try {
329
- const p = await this.opts.walletProvider.signTypedDataAsync(
336
+ const h = await this.opts.walletProvider.signTypedDataAsync(
330
337
  e.data
331
338
  );
332
- (H = (W = this.iframe) == null ? void 0 : W.contentWindow) == null || H.postMessage(
339
+ (O = (H = this.iframe) == null ? void 0 : H.contentWindow) == null || O.postMessage(
333
340
  {
334
341
  type: "didSignTypedData",
335
342
  success: !0,
336
- signature: p
343
+ signature: h
337
344
  },
338
345
  this.baseUrl
339
346
  );
340
- } catch (p) {
341
- (O = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || O.postMessage(
347
+ } catch (h) {
348
+ (R = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || R.postMessage(
342
349
  {
343
350
  type: "didSignTypedData",
344
351
  success: !1,
345
- error: p
352
+ error: h
346
353
  },
347
354
  this.baseUrl
348
355
  );
@@ -355,7 +362,7 @@ class z {
355
362
  }
356
363
  get externalUrl() {
357
364
  var t, e, i;
358
- 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=${ne(
365
+ 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(
359
366
  this.opts.evm.value || 0n
360
367
  )}` : ""}${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(",")}` : ""}${this.opts.debug ? "&debug=true" : ""}${this.opts.popupsBlocked ? "&popupsBlocked=true" : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
361
368
  }
@@ -392,7 +399,7 @@ class z {
392
399
  t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
393
400
  }
394
401
  }
395
- const ue = ({
402
+ const me = ({
396
403
  app: s,
397
404
  recipient: t,
398
405
  chainId: e,
@@ -402,18 +409,18 @@ const ue = ({
402
409
  preferGaslessPayment: c,
403
410
  excludeChainIds: a,
404
411
  excludeCurrencyTiers: n,
405
- excludeFundingSources: h,
406
- mode: u,
407
- sessionId: m,
408
- sessionMetadata: f,
409
- theme: g,
410
- walletProvider: y,
411
- localStorageProvider: l,
412
- onOpen: w,
413
- onSuccess: d,
414
- onClose: b,
415
- autoCloseOnSuccess: v,
416
- popupsBlocked: I,
412
+ excludeFundingSources: u,
413
+ mode: m,
414
+ sessionId: f,
415
+ sessionMetadata: g,
416
+ theme: y,
417
+ walletProvider: w,
418
+ localStorageProvider: b,
419
+ onOpen: d,
420
+ onSuccess: l,
421
+ onClose: p,
422
+ autoCloseOnSuccess: I,
423
+ popupsBlocked: v,
417
424
  baseUrl: P,
418
425
  debug: S
419
426
  }) => {
@@ -427,18 +434,18 @@ const ue = ({
427
434
  preferGaslessPayment: c,
428
435
  excludeChainIds: a,
429
436
  excludeCurrencyTiers: n,
430
- excludeFundingSources: h,
431
- mode: u,
432
- sessionId: m,
433
- sessionMetadata: f,
434
- theme: g,
435
- walletProvider: y,
436
- localStorageProvider: l,
437
- onOpen: w,
438
- onSuccess: d,
439
- onClose: b,
440
- autoCloseOnSuccess: v,
441
- popupsBlocked: I,
437
+ excludeFundingSources: u,
438
+ mode: m,
439
+ sessionId: f,
440
+ sessionMetadata: g,
441
+ theme: y,
442
+ walletProvider: w,
443
+ localStorageProvider: b,
444
+ onOpen: d,
445
+ onSuccess: l,
446
+ onClose: p,
447
+ autoCloseOnSuccess: I,
448
+ popupsBlocked: v,
442
449
  baseUrl: P,
443
450
  debug: S
444
451
  }), [
@@ -451,18 +458,18 @@ const ue = ({
451
458
  c,
452
459
  a,
453
460
  n,
454
- h,
455
461
  u,
456
462
  m,
457
463
  f,
458
464
  g,
459
465
  y,
460
- l,
461
466
  w,
462
- d,
463
467
  b,
464
- v,
468
+ d,
469
+ l,
470
+ p,
465
471
  I,
472
+ v,
466
473
  P,
467
474
  S
468
475
  ]);
@@ -471,7 +478,7 @@ const ue = ({
471
478
  externalUrl: $.externalUrl,
472
479
  opts: $.opts
473
480
  };
474
- }, me = ({
481
+ }, fe = ({
475
482
  app: s,
476
483
  preferGaslessPayment: t,
477
484
  excludeChainIds: e,
@@ -481,17 +488,17 @@ const ue = ({
481
488
  sessionId: c,
482
489
  sessionMetadata: a,
483
490
  theme: n,
484
- walletProvider: h,
485
- localStorageProvider: u,
486
- onOpen: m,
487
- onSuccess: f,
488
- onClose: g,
489
- autoCloseOnSuccess: y,
490
- popupsBlocked: l,
491
- baseUrl: w,
492
- debug: d
491
+ walletProvider: u,
492
+ localStorageProvider: m,
493
+ onOpen: f,
494
+ onSuccess: g,
495
+ onClose: y,
496
+ autoCloseOnSuccess: w,
497
+ popupsBlocked: b,
498
+ baseUrl: d,
499
+ debug: l
493
500
  }) => {
494
- const b = U(() => new z({
501
+ const p = U(() => new z({
495
502
  app: s,
496
503
  preferGaslessPayment: t,
497
504
  excludeChainIds: e,
@@ -502,15 +509,15 @@ const ue = ({
502
509
  amount: o,
503
510
  sessionMetadata: a,
504
511
  theme: n,
505
- walletProvider: h,
506
- localStorageProvider: u,
507
- onOpen: m,
508
- onSuccess: f,
509
- onClose: g,
510
- autoCloseOnSuccess: y,
511
- popupsBlocked: l,
512
- baseUrl: w,
513
- debug: d
512
+ walletProvider: u,
513
+ localStorageProvider: m,
514
+ onOpen: f,
515
+ onSuccess: g,
516
+ onClose: y,
517
+ autoCloseOnSuccess: w,
518
+ popupsBlocked: b,
519
+ baseUrl: d,
520
+ debug: l
514
521
  }), [
515
522
  s,
516
523
  t,
@@ -521,22 +528,22 @@ const ue = ({
521
528
  o,
522
529
  a,
523
530
  n,
524
- h,
525
531
  u,
526
532
  m,
527
533
  f,
528
534
  g,
529
535
  y,
530
- l,
531
536
  w,
532
- d
537
+ b,
538
+ d,
539
+ l
533
540
  ]);
534
541
  return {
535
- openGlidePay: b.open,
536
- externalUrl: b.externalUrl,
537
- opts: b.opts
542
+ openGlidePay: p.open,
543
+ externalUrl: p.externalUrl,
544
+ opts: p.opts
538
545
  };
539
- }, fe = ({
546
+ }, ge = ({
540
547
  app: s,
541
548
  evm: t,
542
549
  approval: e,
@@ -546,17 +553,17 @@ const ue = ({
546
553
  excludeFundingSources: c,
547
554
  sessionMetadata: a,
548
555
  theme: n,
549
- walletProvider: h,
550
- localStorageProvider: u,
551
- onOpen: m,
552
- onSuccess: f,
553
- onClose: g,
554
- autoCloseOnSuccess: y,
555
- popupsBlocked: l,
556
- baseUrl: w,
557
- debug: d
556
+ walletProvider: u,
557
+ localStorageProvider: m,
558
+ onOpen: f,
559
+ onSuccess: g,
560
+ onClose: y,
561
+ autoCloseOnSuccess: w,
562
+ popupsBlocked: b,
563
+ baseUrl: d,
564
+ debug: l
558
565
  }) => {
559
- const b = U(() => new z({
566
+ const p = U(() => new z({
560
567
  app: s,
561
568
  evm: t,
562
569
  approval: e,
@@ -567,15 +574,15 @@ const ue = ({
567
574
  sessionMetadata: a,
568
575
  mode: "call",
569
576
  theme: n,
570
- walletProvider: h,
571
- localStorageProvider: u,
572
- onOpen: m,
573
- onSuccess: f,
574
- onClose: g,
575
- autoCloseOnSuccess: y,
576
- popupsBlocked: l,
577
- baseUrl: w,
578
- debug: d
577
+ walletProvider: u,
578
+ localStorageProvider: m,
579
+ onOpen: f,
580
+ onSuccess: g,
581
+ onClose: y,
582
+ autoCloseOnSuccess: w,
583
+ popupsBlocked: b,
584
+ baseUrl: d,
585
+ debug: l
579
586
  }), [
580
587
  s,
581
588
  t,
@@ -586,22 +593,22 @@ const ue = ({
586
593
  c,
587
594
  a,
588
595
  n,
589
- h,
590
596
  u,
591
597
  m,
592
598
  f,
593
599
  g,
594
600
  y,
595
- l,
596
601
  w,
597
- d
602
+ b,
603
+ d,
604
+ l
598
605
  ]);
599
606
  return {
600
- openGlideCall: b.open,
601
- externalUrl: b.externalUrl,
602
- opts: b.opts
607
+ openGlideCall: p.open,
608
+ externalUrl: p.externalUrl,
609
+ opts: p.opts
603
610
  };
604
- }, ge = ({
611
+ }, ye = ({
605
612
  app: s,
606
613
  recipient: t,
607
614
  chainId: e,
@@ -611,16 +618,16 @@ const ue = ({
611
618
  excludeCurrencyTiers: c,
612
619
  excludeFundingSources: a,
613
620
  sessionMetadata: n,
614
- theme: h,
615
- walletProvider: u,
616
- localStorageProvider: m,
617
- onOpen: f,
618
- onSuccess: g,
619
- onClose: y,
620
- autoCloseOnSuccess: l,
621
- baseUrl: w
621
+ theme: u,
622
+ walletProvider: m,
623
+ localStorageProvider: f,
624
+ onOpen: g,
625
+ onSuccess: y,
626
+ onClose: w,
627
+ autoCloseOnSuccess: b,
628
+ baseUrl: d
622
629
  }) => {
623
- const d = U(() => new z({
630
+ const l = U(() => new z({
624
631
  app: s,
625
632
  recipient: t,
626
633
  chainId: e,
@@ -631,14 +638,14 @@ const ue = ({
631
638
  excludeFundingSources: a,
632
639
  sessionMetadata: n,
633
640
  mode: "buy",
634
- theme: h,
635
- walletProvider: u,
636
- localStorageProvider: m,
637
- onOpen: f,
638
- onSuccess: g,
639
- onClose: y,
640
- autoCloseOnSuccess: l,
641
- baseUrl: w
641
+ theme: u,
642
+ walletProvider: m,
643
+ localStorageProvider: f,
644
+ onOpen: g,
645
+ onSuccess: y,
646
+ onClose: w,
647
+ autoCloseOnSuccess: b,
648
+ baseUrl: d
642
649
  }), [
643
650
  s,
644
651
  t,
@@ -649,21 +656,21 @@ const ue = ({
649
656
  c,
650
657
  a,
651
658
  n,
652
- h,
653
659
  u,
654
660
  m,
655
661
  f,
656
662
  g,
657
663
  y,
658
- l,
659
- w
664
+ w,
665
+ b,
666
+ d
660
667
  ]);
661
668
  return {
662
- openGlideBuy: d.open,
663
- externalUrl: d.externalUrl,
664
- opts: d.opts
669
+ openGlideBuy: l.open,
670
+ externalUrl: l.externalUrl,
671
+ opts: l.opts
665
672
  };
666
- }, ye = Object.freeze({
673
+ }, we = Object.freeze({
667
674
  getItem: (s) => new Promise((t, e) => {
668
675
  try {
669
676
  const i = localStorage.getItem(s);
@@ -697,9 +704,9 @@ const ue = ({
697
704
  });
698
705
  export {
699
706
  z as GlideDeposit,
700
- ye as browserLocalStorageProvider,
701
- ge as useGlideBuy,
702
- fe as useGlideCall,
703
- ue as useGlideDeposit,
704
- me as useGlidePay
707
+ we as browserLocalStorageProvider,
708
+ ye as useGlideBuy,
709
+ ge as useGlideCall,
710
+ me as useGlideDeposit,
711
+ fe as useGlidePay
705
712
  };
package/dist/theme.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export type GlideWidgetTheme = {
2
+ colorScheme?: string;
2
3
  fontSrcCss?: string;
3
4
  fontFamily?: string;
4
5
  modalBorderWidth?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paywithglide/glide-react",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"