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