@paywithglide/glide-react 0.0.34 → 0.0.36
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/GlideDeposit.d.ts +2 -1
- package/dist/glide.js +174 -167
- package/dist/useGlideDeposit.d.ts +2 -1
- package/dist/useGlidePay.d.ts +2 -1
- package/package.json +2 -2
package/dist/GlideDeposit.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export type GlideLocalStorageProvider = {
|
|
|
82
82
|
removeItem: (key: string) => Promise<void>;
|
|
83
83
|
getKeys: () => Promise<string[]>;
|
|
84
84
|
};
|
|
85
|
-
export type FundingSource = "transfer" | "coinbase" | "coinbase_app" | "interac" | "fiat";
|
|
85
|
+
export type FundingSource = "transfer" | "coinbase" | "coinbase_app" | "interac" | "fiat" | "wallet";
|
|
86
86
|
export type GlideDepositOptions = {
|
|
87
87
|
app: string;
|
|
88
88
|
recipient?: string;
|
|
@@ -107,6 +107,7 @@ export type GlideDepositOptions = {
|
|
|
107
107
|
excludeChainIds?: CAIP2[];
|
|
108
108
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
109
109
|
excludeFundingSources?: FundingSource[];
|
|
110
|
+
fundingSources?: FundingSource[];
|
|
110
111
|
walletProvider?: GlideDepositWalletProvider;
|
|
111
112
|
localStorageProvider?: GlideLocalStorageProvider;
|
|
112
113
|
onOpen?: () => void;
|
package/dist/glide.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
2
|
var ee = (s, t, e) => t in s ? _(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
-
var
|
|
4
|
-
import { useMemo as
|
|
3
|
+
var z = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { useMemo as T } from "react";
|
|
5
5
|
function te(s, { strict: t = !0 } = {}) {
|
|
6
6
|
return !s || typeof s != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(s) : s.startsWith("0x");
|
|
7
7
|
}
|
|
@@ -9,23 +9,23 @@ function N(s) {
|
|
|
9
9
|
return te(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
|
|
10
10
|
}
|
|
11
11
|
const K = "2.21.51";
|
|
12
|
-
let
|
|
12
|
+
let U = {
|
|
13
13
|
getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
|
|
14
14
|
version: `viem@${K}`
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class S extends Error {
|
|
17
17
|
constructor(t, e = {}) {
|
|
18
18
|
var a;
|
|
19
19
|
const i = (() => {
|
|
20
20
|
var n;
|
|
21
|
-
return e.cause instanceof
|
|
22
|
-
})(),
|
|
21
|
+
return e.cause instanceof S ? e.cause.details : (n = e.cause) != null && n.message ? e.cause.message : e.details;
|
|
22
|
+
})(), o = e.cause instanceof S && e.cause.docsPath || e.docsPath, r = (a = U.getDocsUrl) == null ? void 0 : a.call(U, { ...e, docsPath: o }), c = [
|
|
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
|
-
...
|
|
28
|
+
...U.version ? [`Version: ${U.version}`] : []
|
|
29
29
|
].join(`
|
|
30
30
|
`);
|
|
31
31
|
super(c, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
@@ -58,7 +58,7 @@ class x extends Error {
|
|
|
58
58
|
configurable: !0,
|
|
59
59
|
writable: !0,
|
|
60
60
|
value: "BaseError"
|
|
61
|
-
}), this.details = i, this.docsPath =
|
|
61
|
+
}), this.details = i, this.docsPath = o, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = K;
|
|
62
62
|
}
|
|
63
63
|
walk(t) {
|
|
64
64
|
return F(this, t);
|
|
@@ -67,12 +67,12 @@ class x extends Error {
|
|
|
67
67
|
function F(s, t) {
|
|
68
68
|
return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? F(s.cause, t) : t ? null : s;
|
|
69
69
|
}
|
|
70
|
-
class V extends
|
|
70
|
+
class V extends S {
|
|
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
|
|
75
|
+
function M(s, { dir: t, size: e = 32 } = {}) {
|
|
76
76
|
return typeof s == "string" ? se(s, { dir: t, size: e }) : ie(s, { dir: t, size: e });
|
|
77
77
|
}
|
|
78
78
|
function se(s, { dir: t, size: e = 32 } = {}) {
|
|
@@ -97,25 +97,25 @@ function ie(s, { dir: t, size: e = 32 } = {}) {
|
|
|
97
97
|
type: "bytes"
|
|
98
98
|
});
|
|
99
99
|
const i = new Uint8Array(e);
|
|
100
|
-
for (let
|
|
101
|
-
const
|
|
102
|
-
i[
|
|
100
|
+
for (let o = 0; o < e; o++) {
|
|
101
|
+
const r = t === "right";
|
|
102
|
+
i[r ? o : e - o - 1] = s[r ? o : s.length - o - 1];
|
|
103
103
|
}
|
|
104
104
|
return i;
|
|
105
105
|
}
|
|
106
|
-
class
|
|
107
|
-
constructor({ max: t, min: e, signed: i, size:
|
|
108
|
-
super(`Number "${
|
|
106
|
+
class oe extends S {
|
|
107
|
+
constructor({ max: t, min: e, signed: i, size: o, value: r }) {
|
|
108
|
+
super(`Number "${r}" is not in safe ${o ? `${o * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${e} to ${t})` : `(above ${e})`}`, { name: "IntegerOutOfRangeError" });
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
class
|
|
111
|
+
class re extends S {
|
|
112
112
|
constructor({ givenSize: t, maxSize: e }) {
|
|
113
113
|
super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
function q(s, { size: t }) {
|
|
117
117
|
if (N(s) > t)
|
|
118
|
-
throw new
|
|
118
|
+
throw new re({
|
|
119
119
|
givenSize: N(s),
|
|
120
120
|
maxSize: t
|
|
121
121
|
});
|
|
@@ -126,42 +126,42 @@ function ae(s, t = {}) {
|
|
|
126
126
|
}
|
|
127
127
|
function ce(s, t = {}) {
|
|
128
128
|
const e = `0x${Number(s)}`;
|
|
129
|
-
return typeof t.size == "number" ? (q(e, { size: t.size }),
|
|
129
|
+
return typeof t.size == "number" ? (q(e, { size: t.size }), M(e, { size: t.size })) : e;
|
|
130
130
|
}
|
|
131
131
|
function J(s, t = {}) {
|
|
132
132
|
let e = "";
|
|
133
|
-
for (let
|
|
134
|
-
e += ne[s[
|
|
133
|
+
for (let o = 0; o < s.length; o++)
|
|
134
|
+
e += ne[s[o]];
|
|
135
135
|
const i = `0x${e}`;
|
|
136
|
-
return typeof t.size == "number" ? (q(i, { size: t.size }),
|
|
136
|
+
return typeof t.size == "number" ? (q(i, { size: t.size }), M(i, { dir: "right", size: t.size })) : i;
|
|
137
137
|
}
|
|
138
138
|
function de(s, t = {}) {
|
|
139
|
-
const { signed: e, size: i } = t,
|
|
140
|
-
let
|
|
141
|
-
i ? e ?
|
|
142
|
-
const c = typeof
|
|
143
|
-
if (
|
|
139
|
+
const { signed: e, size: i } = t, o = BigInt(s);
|
|
140
|
+
let r;
|
|
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
|
+
const c = typeof r == "bigint" && e ? -r - 1n : 0;
|
|
143
|
+
if (r && o > r || o < c) {
|
|
144
144
|
const n = typeof s == "bigint" ? "n" : "";
|
|
145
|
-
throw new
|
|
146
|
-
max:
|
|
145
|
+
throw new oe({
|
|
146
|
+
max: r ? `${r}${n}` : void 0,
|
|
147
147
|
min: `${c}${n}`,
|
|
148
148
|
signed: e,
|
|
149
149
|
size: i,
|
|
150
150
|
value: `${s}${n}`
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
const a = `0x${(e &&
|
|
154
|
-
return i ?
|
|
153
|
+
const a = `0x${(e && o < 0 ? (1n << BigInt(i * 8)) + BigInt(o) : o).toString(16)}`;
|
|
154
|
+
return i ? M(a, { size: i }) : a;
|
|
155
155
|
}
|
|
156
156
|
const le = /* @__PURE__ */ new TextEncoder();
|
|
157
157
|
function pe(s, t = {}) {
|
|
158
158
|
const e = le.encode(s);
|
|
159
159
|
return J(e, t);
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class A {
|
|
162
162
|
constructor(t) {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
z(this, "opts");
|
|
164
|
+
z(this, "open", () => {
|
|
165
165
|
if (!(!this.opts.container && document.body.classList.contains("glide-deposit-open"))) {
|
|
166
166
|
if (this.opts.container || document.body.classList.add("glide-deposit-open"), (this.opts.mode === "deposit" || this.opts.mode === "buy") && !this.opts.recipient)
|
|
167
167
|
throw new Error("recipient is required for deposit/buy mode");
|
|
@@ -172,17 +172,17 @@ class T {
|
|
|
172
172
|
this.openUrl(`${this.baseUrl}${this.opts.app}?init=true&embed=true`), this.initialize();
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
|
-
|
|
176
|
-
var i,
|
|
175
|
+
z(this, "iframeEventHandler", async (t) => {
|
|
176
|
+
var i, o, r, c, a, n, h, u, m, g, f, y, w, d, l, b, v, $, I, P, E, k, x, D, C, G, W, j, B, H, O, L, R;
|
|
177
177
|
const e = t.data;
|
|
178
178
|
switch (e.type) {
|
|
179
179
|
case "sendInit": {
|
|
180
|
-
const
|
|
181
|
-
(
|
|
180
|
+
const p = this.opts.recipient, X = (i = this.opts.walletProvider) == null ? void 0 : i.address, Q = (o = this.opts.walletProvider) == null ? void 0 : o.availableChainIds, Y = (r = this.opts.walletProvider) == null ? void 0 : r.currentChainId, Z = this.opts.preferGaslessPayment || !!((c = this.opts.walletProvider) != null && c.signTypedDataAsync);
|
|
181
|
+
(h = (a = this.iframe) == null ? void 0 : a.contentWindow) == null || h.postMessage(
|
|
182
182
|
{
|
|
183
183
|
type: "initialize",
|
|
184
184
|
sessionId: this.opts.sessionId,
|
|
185
|
-
recipient:
|
|
185
|
+
recipient: p,
|
|
186
186
|
connectedWalletAddress: X,
|
|
187
187
|
availableChainIds: Q,
|
|
188
188
|
currentChainId: Y,
|
|
@@ -190,6 +190,7 @@ class T {
|
|
|
190
190
|
excludeChainIds: this.opts.excludeChainIds,
|
|
191
191
|
excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
|
|
192
192
|
excludeFundingSources: this.opts.excludeFundingSources,
|
|
193
|
+
fundingSources: this.opts.fundingSources,
|
|
193
194
|
mode: this.opts.mode,
|
|
194
195
|
amount: this.opts.amount,
|
|
195
196
|
chainId: this.opts.chainId,
|
|
@@ -213,17 +214,17 @@ class T {
|
|
|
213
214
|
break;
|
|
214
215
|
}
|
|
215
216
|
case "didOpen": {
|
|
216
|
-
this.iframe.style.opacity = "1", (
|
|
217
|
+
this.iframe.style.opacity = "1", (m = (u = this.opts).onOpen) == null || m.call(u);
|
|
217
218
|
break;
|
|
218
219
|
}
|
|
219
220
|
case "localStorage.getKeys": {
|
|
220
221
|
if (!this.opts.localStorageProvider)
|
|
221
222
|
throw new Error("localStorageProvider is not set");
|
|
222
|
-
const
|
|
223
|
-
(
|
|
223
|
+
const p = await this.opts.localStorageProvider.getKeys();
|
|
224
|
+
(f = (g = this.iframe) == null ? void 0 : g.contentWindow) == null || f.postMessage(
|
|
224
225
|
{
|
|
225
226
|
type: "localStorage.didGetKeys",
|
|
226
|
-
keys:
|
|
227
|
+
keys: p
|
|
227
228
|
},
|
|
228
229
|
this.baseUrl
|
|
229
230
|
);
|
|
@@ -245,12 +246,12 @@ class T {
|
|
|
245
246
|
case "localStorage.getItem": {
|
|
246
247
|
if (!this.opts.localStorageProvider)
|
|
247
248
|
throw new Error("localStorageProvider is not set");
|
|
248
|
-
const
|
|
249
|
-
(
|
|
249
|
+
const p = await this.opts.localStorageProvider.getItem(e.key);
|
|
250
|
+
(w = (y = this.iframe) == null ? void 0 : y.contentWindow) == null || w.postMessage(
|
|
250
251
|
{
|
|
251
252
|
type: "localStorage.didGetItem",
|
|
252
253
|
key: e.key,
|
|
253
|
-
value:
|
|
254
|
+
value: p
|
|
254
255
|
},
|
|
255
256
|
this.baseUrl
|
|
256
257
|
);
|
|
@@ -260,10 +261,10 @@ class T {
|
|
|
260
261
|
(l = (d = this.opts) == null ? void 0 : d.onSuccess) == null || l.call(d, e.hash, e.session);
|
|
261
262
|
break;
|
|
262
263
|
case "close":
|
|
263
|
-
this.removeIframe(), this.destroy(), (
|
|
264
|
+
this.removeIframe(), this.destroy(), (v = (b = this.opts) == null ? void 0 : b.onClose) == null || v.call(b);
|
|
264
265
|
break;
|
|
265
266
|
case "setMode":
|
|
266
|
-
(I = (
|
|
267
|
+
(I = ($ = this.opts) == null ? void 0 : $.onSetMode) == null || I.call($, e.mode);
|
|
267
268
|
break;
|
|
268
269
|
case "switchChain":
|
|
269
270
|
if (!this.opts.walletProvider)
|
|
@@ -279,12 +280,12 @@ class T {
|
|
|
279
280
|
},
|
|
280
281
|
this.baseUrl
|
|
281
282
|
);
|
|
282
|
-
} catch (
|
|
283
|
-
(
|
|
283
|
+
} catch (p) {
|
|
284
|
+
(x = (k = this.iframe) == null ? void 0 : k.contentWindow) == null || x.postMessage(
|
|
284
285
|
{
|
|
285
286
|
type: "didSwitchChain",
|
|
286
287
|
success: !1,
|
|
287
|
-
error:
|
|
288
|
+
error: p
|
|
288
289
|
},
|
|
289
290
|
this.baseUrl
|
|
290
291
|
);
|
|
@@ -295,23 +296,23 @@ class T {
|
|
|
295
296
|
if (!this.opts.walletProvider)
|
|
296
297
|
throw new Error("walletProvider is not set");
|
|
297
298
|
try {
|
|
298
|
-
const
|
|
299
|
+
const p = await this.opts.walletProvider.sendTransactionAsync(
|
|
299
300
|
e.tx
|
|
300
301
|
);
|
|
301
302
|
(C = (D = this.iframe) == null ? void 0 : D.contentWindow) == null || C.postMessage(
|
|
302
303
|
{
|
|
303
304
|
type: "didSendTransaction",
|
|
304
305
|
success: !0,
|
|
305
|
-
txHash:
|
|
306
|
+
txHash: p
|
|
306
307
|
},
|
|
307
308
|
this.baseUrl
|
|
308
309
|
);
|
|
309
|
-
} catch (
|
|
310
|
+
} catch (p) {
|
|
310
311
|
(W = (G = this.iframe) == null ? void 0 : G.contentWindow) == null || W.postMessage(
|
|
311
312
|
{
|
|
312
313
|
type: "didSendTransaction",
|
|
313
314
|
success: !1,
|
|
314
|
-
error:
|
|
315
|
+
error: p
|
|
315
316
|
},
|
|
316
317
|
this.baseUrl
|
|
317
318
|
);
|
|
@@ -334,23 +335,23 @@ class T {
|
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
336
337
|
try {
|
|
337
|
-
const
|
|
338
|
+
const p = await this.opts.walletProvider.signTypedDataAsync(
|
|
338
339
|
e.data
|
|
339
340
|
);
|
|
340
341
|
(O = (H = this.iframe) == null ? void 0 : H.contentWindow) == null || O.postMessage(
|
|
341
342
|
{
|
|
342
343
|
type: "didSignTypedData",
|
|
343
344
|
success: !0,
|
|
344
|
-
signature:
|
|
345
|
+
signature: p
|
|
345
346
|
},
|
|
346
347
|
this.baseUrl
|
|
347
348
|
);
|
|
348
|
-
} catch (
|
|
349
|
+
} catch (p) {
|
|
349
350
|
(R = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || R.postMessage(
|
|
350
351
|
{
|
|
351
352
|
type: "didSignTypedData",
|
|
352
353
|
success: !1,
|
|
353
|
-
error:
|
|
354
|
+
error: p
|
|
354
355
|
},
|
|
355
356
|
this.baseUrl
|
|
356
357
|
);
|
|
@@ -362,10 +363,10 @@ class T {
|
|
|
362
363
|
this.opts = t;
|
|
363
364
|
}
|
|
364
365
|
get externalUrl() {
|
|
365
|
-
var t, e, i;
|
|
366
|
+
var t, e, i, o;
|
|
366
367
|
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 ? `¤cyId=${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(
|
|
367
368
|
this.opts.evm.value || 0n
|
|
368
|
-
)}` : ""}${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.disableWithdrawToSelfSuggestion ? "&disableWithdrawToSelfSuggestion=true" : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
|
|
369
|
+
)}` : ""}${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(",")}` : ""}${(o = this.opts.fundingSources) != null && o.length ? `&fundingSources=${this.opts.fundingSources.join(",")}` : ""}${this.opts.debug ? "&debug=true" : ""}${this.opts.popupsBlocked ? "&popupsBlocked=true" : ""}${this.opts.disableWithdrawToSelfSuggestion ? "&disableWithdrawToSelfSuggestion=true" : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
|
|
369
370
|
}
|
|
370
371
|
initialize() {
|
|
371
372
|
window.addEventListener("message", this.iframeEventHandler);
|
|
@@ -405,186 +406,192 @@ const me = ({
|
|
|
405
406
|
recipient: t,
|
|
406
407
|
chainId: e,
|
|
407
408
|
currencyId: i,
|
|
408
|
-
amount:
|
|
409
|
-
gasRefuelAmountPerChain:
|
|
409
|
+
amount: o,
|
|
410
|
+
gasRefuelAmountPerChain: r,
|
|
410
411
|
preferGaslessPayment: c,
|
|
411
412
|
excludeChainIds: a,
|
|
412
413
|
excludeCurrencyTiers: n,
|
|
413
|
-
excludeFundingSources:
|
|
414
|
+
excludeFundingSources: h,
|
|
415
|
+
fundingSources: u,
|
|
414
416
|
mode: m,
|
|
415
417
|
sessionId: g,
|
|
416
418
|
sessionMetadata: f,
|
|
417
419
|
disableWithdrawToSelfSuggestion: y,
|
|
418
420
|
theme: w,
|
|
419
|
-
walletProvider:
|
|
420
|
-
localStorageProvider:
|
|
421
|
-
onOpen:
|
|
422
|
-
onSuccess:
|
|
423
|
-
onClose:
|
|
424
|
-
autoCloseOnSuccess:
|
|
425
|
-
popupsBlocked:
|
|
426
|
-
baseUrl:
|
|
427
|
-
debug:
|
|
421
|
+
walletProvider: d,
|
|
422
|
+
localStorageProvider: l,
|
|
423
|
+
onOpen: b,
|
|
424
|
+
onSuccess: v,
|
|
425
|
+
onClose: $,
|
|
426
|
+
autoCloseOnSuccess: I,
|
|
427
|
+
popupsBlocked: P,
|
|
428
|
+
baseUrl: E,
|
|
429
|
+
debug: k
|
|
428
430
|
}) => {
|
|
429
|
-
const
|
|
431
|
+
const x = T(() => new A({
|
|
430
432
|
app: s,
|
|
431
433
|
recipient: t,
|
|
432
434
|
chainId: e,
|
|
433
435
|
currencyId: i,
|
|
434
|
-
amount:
|
|
435
|
-
gasRefuelAmountPerChain:
|
|
436
|
+
amount: o,
|
|
437
|
+
gasRefuelAmountPerChain: r,
|
|
436
438
|
preferGaslessPayment: c,
|
|
437
439
|
excludeChainIds: a,
|
|
438
440
|
excludeCurrencyTiers: n,
|
|
439
|
-
excludeFundingSources:
|
|
441
|
+
excludeFundingSources: h,
|
|
442
|
+
fundingSources: u,
|
|
440
443
|
mode: m,
|
|
441
444
|
sessionId: g,
|
|
442
445
|
sessionMetadata: f,
|
|
443
446
|
disableWithdrawToSelfSuggestion: y,
|
|
444
447
|
theme: w,
|
|
445
|
-
walletProvider:
|
|
446
|
-
localStorageProvider:
|
|
447
|
-
onOpen:
|
|
448
|
-
onSuccess:
|
|
449
|
-
onClose:
|
|
450
|
-
autoCloseOnSuccess:
|
|
451
|
-
popupsBlocked:
|
|
452
|
-
baseUrl:
|
|
453
|
-
debug:
|
|
448
|
+
walletProvider: d,
|
|
449
|
+
localStorageProvider: l,
|
|
450
|
+
onOpen: b,
|
|
451
|
+
onSuccess: v,
|
|
452
|
+
onClose: $,
|
|
453
|
+
autoCloseOnSuccess: I,
|
|
454
|
+
popupsBlocked: P,
|
|
455
|
+
baseUrl: E,
|
|
456
|
+
debug: k
|
|
454
457
|
}), [
|
|
455
458
|
s,
|
|
456
459
|
t,
|
|
457
460
|
e,
|
|
458
461
|
i,
|
|
459
|
-
r,
|
|
460
462
|
o,
|
|
463
|
+
r,
|
|
461
464
|
c,
|
|
462
465
|
a,
|
|
463
466
|
n,
|
|
467
|
+
h,
|
|
464
468
|
u,
|
|
465
469
|
m,
|
|
466
470
|
g,
|
|
467
471
|
f,
|
|
468
472
|
y,
|
|
469
473
|
w,
|
|
470
|
-
b,
|
|
471
474
|
d,
|
|
472
475
|
l,
|
|
473
|
-
|
|
474
|
-
S,
|
|
476
|
+
b,
|
|
475
477
|
v,
|
|
478
|
+
$,
|
|
476
479
|
I,
|
|
477
480
|
P,
|
|
478
|
-
E
|
|
481
|
+
E,
|
|
482
|
+
k
|
|
479
483
|
]);
|
|
480
484
|
return {
|
|
481
|
-
openGlideDeposit:
|
|
482
|
-
externalUrl:
|
|
483
|
-
opts:
|
|
485
|
+
openGlideDeposit: x.open,
|
|
486
|
+
externalUrl: x.externalUrl,
|
|
487
|
+
opts: x.opts
|
|
484
488
|
};
|
|
485
489
|
}, ge = ({
|
|
486
490
|
app: s,
|
|
487
491
|
preferGaslessPayment: t,
|
|
488
492
|
excludeChainIds: e,
|
|
489
493
|
excludeCurrencyTiers: i,
|
|
490
|
-
excludeFundingSources:
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
494
|
+
excludeFundingSources: o,
|
|
495
|
+
fundingSources: r,
|
|
496
|
+
amount: c,
|
|
497
|
+
sessionId: a,
|
|
498
|
+
sessionMetadata: n,
|
|
499
|
+
theme: h,
|
|
495
500
|
walletProvider: u,
|
|
496
501
|
localStorageProvider: m,
|
|
497
502
|
onOpen: g,
|
|
498
503
|
onSuccess: f,
|
|
499
504
|
onClose: y,
|
|
500
505
|
autoCloseOnSuccess: w,
|
|
501
|
-
popupsBlocked:
|
|
502
|
-
baseUrl:
|
|
503
|
-
debug:
|
|
506
|
+
popupsBlocked: d,
|
|
507
|
+
baseUrl: l,
|
|
508
|
+
debug: b
|
|
504
509
|
}) => {
|
|
505
|
-
const
|
|
510
|
+
const v = T(() => new A({
|
|
506
511
|
app: s,
|
|
507
512
|
preferGaslessPayment: t,
|
|
508
513
|
excludeChainIds: e,
|
|
509
514
|
excludeCurrencyTiers: i,
|
|
510
|
-
excludeFundingSources:
|
|
515
|
+
excludeFundingSources: o,
|
|
516
|
+
fundingSources: r,
|
|
511
517
|
mode: "pay",
|
|
512
|
-
sessionId:
|
|
513
|
-
amount:
|
|
514
|
-
sessionMetadata:
|
|
515
|
-
theme:
|
|
518
|
+
sessionId: a,
|
|
519
|
+
amount: c,
|
|
520
|
+
sessionMetadata: n,
|
|
521
|
+
theme: h,
|
|
516
522
|
walletProvider: u,
|
|
517
523
|
localStorageProvider: m,
|
|
518
524
|
onOpen: g,
|
|
519
525
|
onSuccess: f,
|
|
520
526
|
onClose: y,
|
|
521
527
|
autoCloseOnSuccess: w,
|
|
522
|
-
popupsBlocked:
|
|
523
|
-
baseUrl:
|
|
524
|
-
debug:
|
|
528
|
+
popupsBlocked: d,
|
|
529
|
+
baseUrl: l,
|
|
530
|
+
debug: b
|
|
525
531
|
}), [
|
|
526
532
|
s,
|
|
527
533
|
t,
|
|
528
534
|
e,
|
|
529
535
|
i,
|
|
530
|
-
r,
|
|
531
|
-
c,
|
|
532
536
|
o,
|
|
537
|
+
r,
|
|
533
538
|
a,
|
|
539
|
+
c,
|
|
534
540
|
n,
|
|
541
|
+
h,
|
|
535
542
|
u,
|
|
536
543
|
m,
|
|
537
544
|
g,
|
|
538
545
|
f,
|
|
539
546
|
y,
|
|
540
547
|
w,
|
|
541
|
-
b,
|
|
542
548
|
d,
|
|
543
|
-
l
|
|
549
|
+
l,
|
|
550
|
+
b
|
|
544
551
|
]);
|
|
545
552
|
return {
|
|
546
|
-
openGlidePay:
|
|
547
|
-
externalUrl:
|
|
548
|
-
opts:
|
|
553
|
+
openGlidePay: v.open,
|
|
554
|
+
externalUrl: v.externalUrl,
|
|
555
|
+
opts: v.opts
|
|
549
556
|
};
|
|
550
557
|
}, fe = ({
|
|
551
558
|
app: s,
|
|
552
559
|
evm: t,
|
|
553
560
|
approval: e,
|
|
554
561
|
preferGaslessPayment: i,
|
|
555
|
-
excludeChainIds:
|
|
556
|
-
excludeCurrencyTiers:
|
|
562
|
+
excludeChainIds: o,
|
|
563
|
+
excludeCurrencyTiers: r,
|
|
557
564
|
excludeFundingSources: c,
|
|
558
565
|
sessionMetadata: a,
|
|
559
566
|
theme: n,
|
|
560
|
-
walletProvider:
|
|
561
|
-
localStorageProvider:
|
|
562
|
-
onOpen:
|
|
563
|
-
onSuccess:
|
|
564
|
-
onClose:
|
|
565
|
-
autoCloseOnSuccess:
|
|
566
|
-
popupsBlocked:
|
|
567
|
+
walletProvider: h,
|
|
568
|
+
localStorageProvider: u,
|
|
569
|
+
onOpen: m,
|
|
570
|
+
onSuccess: g,
|
|
571
|
+
onClose: f,
|
|
572
|
+
autoCloseOnSuccess: y,
|
|
573
|
+
popupsBlocked: w,
|
|
567
574
|
baseUrl: d,
|
|
568
575
|
debug: l
|
|
569
576
|
}) => {
|
|
570
|
-
const
|
|
577
|
+
const b = T(() => new A({
|
|
571
578
|
app: s,
|
|
572
579
|
evm: t,
|
|
573
580
|
approval: e,
|
|
574
581
|
preferGaslessPayment: i,
|
|
575
|
-
excludeChainIds:
|
|
576
|
-
excludeCurrencyTiers:
|
|
582
|
+
excludeChainIds: o,
|
|
583
|
+
excludeCurrencyTiers: r,
|
|
577
584
|
excludeFundingSources: c,
|
|
578
585
|
sessionMetadata: a,
|
|
579
586
|
mode: "call",
|
|
580
587
|
theme: n,
|
|
581
|
-
walletProvider:
|
|
582
|
-
localStorageProvider:
|
|
583
|
-
onOpen:
|
|
584
|
-
onSuccess:
|
|
585
|
-
onClose:
|
|
586
|
-
autoCloseOnSuccess:
|
|
587
|
-
popupsBlocked:
|
|
588
|
+
walletProvider: h,
|
|
589
|
+
localStorageProvider: u,
|
|
590
|
+
onOpen: m,
|
|
591
|
+
onSuccess: g,
|
|
592
|
+
onClose: f,
|
|
593
|
+
autoCloseOnSuccess: y,
|
|
594
|
+
popupsBlocked: w,
|
|
588
595
|
baseUrl: d,
|
|
589
596
|
debug: l
|
|
590
597
|
}), [
|
|
@@ -592,81 +599,81 @@ const me = ({
|
|
|
592
599
|
t,
|
|
593
600
|
e,
|
|
594
601
|
i,
|
|
595
|
-
r,
|
|
596
602
|
o,
|
|
603
|
+
r,
|
|
597
604
|
c,
|
|
598
605
|
a,
|
|
599
606
|
n,
|
|
607
|
+
h,
|
|
600
608
|
u,
|
|
601
609
|
m,
|
|
602
610
|
g,
|
|
603
611
|
f,
|
|
604
612
|
y,
|
|
605
613
|
w,
|
|
606
|
-
b,
|
|
607
614
|
d,
|
|
608
615
|
l
|
|
609
616
|
]);
|
|
610
617
|
return {
|
|
611
|
-
openGlideCall:
|
|
612
|
-
externalUrl:
|
|
613
|
-
opts:
|
|
618
|
+
openGlideCall: b.open,
|
|
619
|
+
externalUrl: b.externalUrl,
|
|
620
|
+
opts: b.opts
|
|
614
621
|
};
|
|
615
622
|
}, ye = ({
|
|
616
623
|
app: s,
|
|
617
624
|
recipient: t,
|
|
618
625
|
chainId: e,
|
|
619
626
|
currencyId: i,
|
|
620
|
-
preferGaslessPayment:
|
|
621
|
-
excludeChainIds:
|
|
627
|
+
preferGaslessPayment: o,
|
|
628
|
+
excludeChainIds: r,
|
|
622
629
|
excludeCurrencyTiers: c,
|
|
623
630
|
excludeFundingSources: a,
|
|
624
631
|
sessionMetadata: n,
|
|
625
|
-
theme:
|
|
626
|
-
walletProvider:
|
|
627
|
-
localStorageProvider:
|
|
628
|
-
onOpen:
|
|
629
|
-
onSuccess:
|
|
630
|
-
onClose:
|
|
631
|
-
autoCloseOnSuccess:
|
|
632
|
+
theme: h,
|
|
633
|
+
walletProvider: u,
|
|
634
|
+
localStorageProvider: m,
|
|
635
|
+
onOpen: g,
|
|
636
|
+
onSuccess: f,
|
|
637
|
+
onClose: y,
|
|
638
|
+
autoCloseOnSuccess: w,
|
|
632
639
|
baseUrl: d
|
|
633
640
|
}) => {
|
|
634
|
-
const l =
|
|
641
|
+
const l = T(() => new A({
|
|
635
642
|
app: s,
|
|
636
643
|
recipient: t,
|
|
637
644
|
chainId: e,
|
|
638
645
|
currencyId: i,
|
|
639
|
-
preferGaslessPayment:
|
|
640
|
-
excludeChainIds:
|
|
646
|
+
preferGaslessPayment: o,
|
|
647
|
+
excludeChainIds: r,
|
|
641
648
|
excludeCurrencyTiers: c,
|
|
642
649
|
excludeFundingSources: a,
|
|
643
650
|
sessionMetadata: n,
|
|
644
651
|
mode: "buy",
|
|
645
|
-
theme:
|
|
646
|
-
walletProvider:
|
|
647
|
-
localStorageProvider:
|
|
648
|
-
onOpen:
|
|
649
|
-
onSuccess:
|
|
650
|
-
onClose:
|
|
651
|
-
autoCloseOnSuccess:
|
|
652
|
+
theme: h,
|
|
653
|
+
walletProvider: u,
|
|
654
|
+
localStorageProvider: m,
|
|
655
|
+
onOpen: g,
|
|
656
|
+
onSuccess: f,
|
|
657
|
+
onClose: y,
|
|
658
|
+
autoCloseOnSuccess: w,
|
|
652
659
|
baseUrl: d
|
|
653
660
|
}), [
|
|
654
661
|
s,
|
|
655
662
|
t,
|
|
656
663
|
e,
|
|
657
664
|
i,
|
|
658
|
-
r,
|
|
659
665
|
o,
|
|
666
|
+
r,
|
|
660
667
|
c,
|
|
661
668
|
a,
|
|
662
669
|
n,
|
|
670
|
+
h,
|
|
663
671
|
u,
|
|
664
672
|
m,
|
|
665
673
|
g,
|
|
666
674
|
f,
|
|
667
675
|
y,
|
|
668
676
|
w,
|
|
669
|
-
b,
|
|
670
677
|
d
|
|
671
678
|
]);
|
|
672
679
|
return {
|
|
@@ -686,8 +693,8 @@ const me = ({
|
|
|
686
693
|
setItem: (s, t) => new Promise((e, i) => {
|
|
687
694
|
try {
|
|
688
695
|
localStorage.setItem(s, t), e();
|
|
689
|
-
} catch (
|
|
690
|
-
i(
|
|
696
|
+
} catch (o) {
|
|
697
|
+
i(o);
|
|
691
698
|
}
|
|
692
699
|
}),
|
|
693
700
|
removeItem: (s) => new Promise((t, e) => {
|
|
@@ -707,7 +714,7 @@ const me = ({
|
|
|
707
714
|
})
|
|
708
715
|
});
|
|
709
716
|
export {
|
|
710
|
-
|
|
717
|
+
A as GlideDeposit,
|
|
711
718
|
we as browserLocalStorageProvider,
|
|
712
719
|
ye as useGlideBuy,
|
|
713
720
|
fe as useGlideCall,
|
|
@@ -12,6 +12,7 @@ interface UseGlideDepositProps {
|
|
|
12
12
|
excludeChainIds?: CAIP2[];
|
|
13
13
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
14
14
|
excludeFundingSources?: FundingSource[];
|
|
15
|
+
fundingSources?: FundingSource[];
|
|
15
16
|
mode?: "deposit" | "withdraw";
|
|
16
17
|
hideWithdrawAddress?: boolean;
|
|
17
18
|
sessionId?: string;
|
|
@@ -28,7 +29,7 @@ interface UseGlideDepositProps {
|
|
|
28
29
|
baseUrl?: string;
|
|
29
30
|
debug?: boolean;
|
|
30
31
|
}
|
|
31
|
-
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, mode, sessionId, sessionMetadata, disableWithdrawToSelfSuggestion, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideDepositProps) => {
|
|
32
|
+
export declare const useGlideDeposit: ({ app, recipient, chainId, currencyId, amount, gasRefuelAmountPerChain, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, mode, sessionId, sessionMetadata, disableWithdrawToSelfSuggestion, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlideDepositProps) => {
|
|
32
33
|
openGlideDeposit: () => void;
|
|
33
34
|
externalUrl: string;
|
|
34
35
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|
package/dist/useGlidePay.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type UseGlidePayProps = {
|
|
|
8
8
|
excludeChainIds?: CAIP2[];
|
|
9
9
|
excludeCurrencyTiers?: ("tier1" | "tier2" | "tier3")[];
|
|
10
10
|
excludeFundingSources?: FundingSource[];
|
|
11
|
+
fundingSources?: FundingSource[];
|
|
11
12
|
sessionId?: string;
|
|
12
13
|
sessionMetadata?: string;
|
|
13
14
|
theme?: GlideWidgetTheme;
|
|
@@ -21,7 +22,7 @@ type UseGlidePayProps = {
|
|
|
21
22
|
baseUrl?: string;
|
|
22
23
|
debug?: boolean;
|
|
23
24
|
};
|
|
24
|
-
export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
|
|
25
|
+
export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
|
|
25
26
|
openGlidePay: () => void;
|
|
26
27
|
externalUrl: string;
|
|
27
28
|
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.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@paywithglide/glide-js": "
|
|
28
|
+
"@paywithglide/glide-js": "0.13.10"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@antiwork/shortest": "^0.2.1",
|