@paywithglide/glide-react 0.0.22 → 0.0.23
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 +7 -0
- package/dist/browserLocalStorageProvider.d.ts +6 -0
- package/dist/glide.js +327 -245
- 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 +3 -2
- package/dist/useGlidePay.d.ts +3 -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;
|
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 x = (s, t, e) => _(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { useMemo as I } 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 b = {
|
|
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
16
|
class w extends Error {
|
|
17
17
|
constructor(t, e = {}) {
|
|
18
|
-
var
|
|
18
|
+
var a;
|
|
19
19
|
const i = (() => {
|
|
20
|
-
var
|
|
21
|
-
return e.cause instanceof w ? e.cause.details : (
|
|
22
|
-
})(),
|
|
20
|
+
var n;
|
|
21
|
+
return e.cause instanceof w ? e.cause.details : (n = e.cause) != null && n.message ? e.cause.message : e.details;
|
|
22
|
+
})(), r = e.cause instanceof w && e.cause.docsPath || e.docsPath, o = (a = b.getDocsUrl) == null ? void 0 : a.call(b, { ...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
|
+
...b.version ? [`Version: ${b.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 w {
|
|
71
71
|
constructor({ size: t, targetSize: e, type: i }) {
|
|
72
72
|
super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${t}) exceeds padding size (${e}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return typeof s == "string" ?
|
|
75
|
+
function S(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 w {
|
|
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 w {
|
|
112
112
|
constructor({ givenSize: t, maxSize: e }) {
|
|
113
113
|
super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
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 }), S(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 }), S(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 ? S(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 P {
|
|
162
162
|
constructor(t) {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
x(this, "opts");
|
|
164
|
+
x(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,85 @@ 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
|
+
x(this, "iframeEventHandler", async (t) => {
|
|
176
|
+
var i, r, o, c, a, n, p, h, u, m, f, g, d, y, v, E, $, k, U, z, M, T, D, A, G, j, C, W, B, 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
|
+
},
|
|
202
|
+
new URL(this.baseUrl).origin
|
|
203
|
+
), this.iframe.style.opacity = "1", (h = (p = this.opts).onOpen) == null || h.call(p);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
case "localStorage.getKeys": {
|
|
207
|
+
if (!this.opts.localStorageProvider)
|
|
208
|
+
throw new Error("localStorageProvider is not set");
|
|
209
|
+
const l = await this.opts.localStorageProvider.getKeys();
|
|
210
|
+
(m = (u = this.iframe) == null ? void 0 : u.contentWindow) == null || m.postMessage(
|
|
211
|
+
{
|
|
212
|
+
type: "localStorage.didGetKeys",
|
|
213
|
+
keys: l
|
|
214
|
+
},
|
|
215
|
+
this.baseUrl
|
|
216
|
+
);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
case "localStorage.setItem":
|
|
220
|
+
if (!this.opts.localStorageProvider)
|
|
221
|
+
throw new Error("localStorageProvider is not set");
|
|
222
|
+
await this.opts.localStorageProvider.setItem(
|
|
223
|
+
e.key,
|
|
224
|
+
e.value
|
|
225
|
+
);
|
|
226
|
+
break;
|
|
227
|
+
case "localStorage.removeItem":
|
|
228
|
+
if (!this.opts.localStorageProvider)
|
|
229
|
+
throw new Error("localStorageProvider is not set");
|
|
230
|
+
await this.opts.localStorageProvider.removeItem(e.key);
|
|
231
|
+
break;
|
|
232
|
+
case "localStorage.getItem": {
|
|
233
|
+
if (!this.opts.localStorageProvider)
|
|
234
|
+
throw new Error("localStorageProvider is not set");
|
|
235
|
+
const l = await this.opts.localStorageProvider.getItem(e.key);
|
|
236
|
+
(g = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || g.postMessage(
|
|
237
|
+
{
|
|
238
|
+
type: "localStorage.didGetItem",
|
|
239
|
+
key: e.key,
|
|
240
|
+
value: l
|
|
241
|
+
},
|
|
242
|
+
this.baseUrl
|
|
243
|
+
);
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
179
246
|
case "success":
|
|
180
|
-
(
|
|
247
|
+
(y = (d = this.opts) == null ? void 0 : d.onSuccess) == null || y.call(d, e.hash);
|
|
181
248
|
break;
|
|
182
249
|
case "close":
|
|
183
|
-
this.removeIframe(), this.destroy(), (
|
|
250
|
+
this.removeIframe(), this.destroy(), (E = (v = this.opts) == null ? void 0 : v.onClose) == null || E.call(v);
|
|
184
251
|
break;
|
|
185
252
|
case "setMode":
|
|
186
|
-
(
|
|
253
|
+
(k = ($ = this.opts) == null ? void 0 : $.onSetMode) == null || k.call($, e.mode);
|
|
187
254
|
break;
|
|
188
255
|
case "switchChain":
|
|
189
256
|
if (!this.opts.walletProvider)
|
|
@@ -191,7 +258,7 @@ class $ {
|
|
|
191
258
|
try {
|
|
192
259
|
await this.opts.walletProvider.switchChainAsync({
|
|
193
260
|
chainId: e.chainId
|
|
194
|
-
}), (
|
|
261
|
+
}), (z = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || z.postMessage(
|
|
195
262
|
{
|
|
196
263
|
type: "didSwitchChain",
|
|
197
264
|
success: !0,
|
|
@@ -199,12 +266,12 @@ class $ {
|
|
|
199
266
|
},
|
|
200
267
|
this.baseUrl
|
|
201
268
|
);
|
|
202
|
-
} catch (
|
|
203
|
-
(
|
|
269
|
+
} catch (l) {
|
|
270
|
+
(T = (M = this.iframe) == null ? void 0 : M.contentWindow) == null || T.postMessage(
|
|
204
271
|
{
|
|
205
272
|
type: "didSwitchChain",
|
|
206
273
|
success: !1,
|
|
207
|
-
error:
|
|
274
|
+
error: l
|
|
208
275
|
},
|
|
209
276
|
this.baseUrl
|
|
210
277
|
);
|
|
@@ -215,23 +282,23 @@ class $ {
|
|
|
215
282
|
if (!this.opts.walletProvider)
|
|
216
283
|
throw new Error("walletProvider is not set");
|
|
217
284
|
try {
|
|
218
|
-
const
|
|
285
|
+
const l = await this.opts.walletProvider.sendTransactionAsync(
|
|
219
286
|
e.tx
|
|
220
287
|
);
|
|
221
|
-
(
|
|
288
|
+
(A = (D = this.iframe) == null ? void 0 : D.contentWindow) == null || A.postMessage(
|
|
222
289
|
{
|
|
223
290
|
type: "didSendTransaction",
|
|
224
291
|
success: !0,
|
|
225
|
-
txHash:
|
|
292
|
+
txHash: l
|
|
226
293
|
},
|
|
227
294
|
this.baseUrl
|
|
228
295
|
);
|
|
229
|
-
} catch (
|
|
230
|
-
(
|
|
296
|
+
} catch (l) {
|
|
297
|
+
(j = (G = this.iframe) == null ? void 0 : G.contentWindow) == null || j.postMessage(
|
|
231
298
|
{
|
|
232
299
|
type: "didSendTransaction",
|
|
233
300
|
success: !1,
|
|
234
|
-
error:
|
|
301
|
+
error: l
|
|
235
302
|
},
|
|
236
303
|
this.baseUrl
|
|
237
304
|
);
|
|
@@ -243,7 +310,7 @@ class $ {
|
|
|
243
310
|
if (!this.opts.walletProvider)
|
|
244
311
|
throw new Error("walletProvider is not set");
|
|
245
312
|
if (!this.opts.walletProvider.signTypedDataAsync) {
|
|
246
|
-
(
|
|
313
|
+
(W = (C = this.iframe) == null ? void 0 : C.contentWindow) == null || W.postMessage(
|
|
247
314
|
{
|
|
248
315
|
type: "didSignTypedData",
|
|
249
316
|
success: !1,
|
|
@@ -254,23 +321,23 @@ class $ {
|
|
|
254
321
|
return;
|
|
255
322
|
}
|
|
256
323
|
try {
|
|
257
|
-
const
|
|
324
|
+
const l = await this.opts.walletProvider.signTypedDataAsync(
|
|
258
325
|
e.data
|
|
259
326
|
);
|
|
260
|
-
(
|
|
327
|
+
(H = (B = this.iframe) == null ? void 0 : B.contentWindow) == null || H.postMessage(
|
|
261
328
|
{
|
|
262
329
|
type: "didSignTypedData",
|
|
263
330
|
success: !0,
|
|
264
|
-
signature:
|
|
331
|
+
signature: l
|
|
265
332
|
},
|
|
266
333
|
this.baseUrl
|
|
267
334
|
);
|
|
268
|
-
} catch (
|
|
269
|
-
(
|
|
335
|
+
} catch (l) {
|
|
336
|
+
(O = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || O.postMessage(
|
|
270
337
|
{
|
|
271
338
|
type: "didSignTypedData",
|
|
272
339
|
success: !1,
|
|
273
|
-
error:
|
|
340
|
+
error: l
|
|
274
341
|
},
|
|
275
342
|
this.baseUrl
|
|
276
343
|
);
|
|
@@ -283,7 +350,9 @@ class $ {
|
|
|
283
350
|
}
|
|
284
351
|
get externalUrl() {
|
|
285
352
|
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=${
|
|
353
|
+
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(
|
|
354
|
+
this.opts.evm.value || 0n
|
|
355
|
+
)}` : ""}${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(",")}` : ""}`;
|
|
287
356
|
}
|
|
288
357
|
initialize() {
|
|
289
358
|
window.addEventListener("message", this.iframeEventHandler);
|
|
@@ -303,10 +372,7 @@ class $ {
|
|
|
303
372
|
createIframe(t) {
|
|
304
373
|
this.removeIframe();
|
|
305
374
|
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
|
-
);
|
|
375
|
+
e.id = "glide-deposit-iframe";
|
|
310
376
|
const i = this.opts.container;
|
|
311
377
|
i ? e.setAttribute(
|
|
312
378
|
"style",
|
|
@@ -314,266 +380,282 @@ class $ {
|
|
|
314
380
|
) : e.setAttribute(
|
|
315
381
|
"style",
|
|
316
382
|
"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);
|
|
383
|
+
), e.src = t, e.allow = "payment *; clipboard-write *", i ? i.appendChild(e) : document.body.appendChild(e);
|
|
346
384
|
}
|
|
347
385
|
removeIframe() {
|
|
348
386
|
const t = document.getElementById("glide-deposit-iframe");
|
|
349
387
|
t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
|
|
350
388
|
}
|
|
351
389
|
}
|
|
352
|
-
const
|
|
390
|
+
const ue = ({
|
|
353
391
|
app: s,
|
|
354
392
|
recipient: t,
|
|
355
393
|
preferGaslessPayment: e,
|
|
356
394
|
excludeChainIds: i,
|
|
357
|
-
excludeCurrencyTiers:
|
|
358
|
-
excludeFundingSources:
|
|
359
|
-
mode:
|
|
360
|
-
sessionMetadata:
|
|
361
|
-
theme:
|
|
395
|
+
excludeCurrencyTiers: r,
|
|
396
|
+
excludeFundingSources: o,
|
|
397
|
+
mode: c,
|
|
398
|
+
sessionMetadata: a,
|
|
399
|
+
theme: n,
|
|
362
400
|
walletProvider: p,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
401
|
+
localStorageProvider: h,
|
|
402
|
+
onOpen: u,
|
|
403
|
+
onSuccess: m,
|
|
404
|
+
onClose: f,
|
|
405
|
+
autoCloseOnSuccess: g,
|
|
406
|
+
baseUrl: d
|
|
368
407
|
}) => {
|
|
369
|
-
const
|
|
408
|
+
const y = I(() => new P({
|
|
370
409
|
app: s,
|
|
371
410
|
recipient: t,
|
|
372
411
|
preferGaslessPayment: e,
|
|
373
412
|
excludeChainIds: i,
|
|
374
|
-
excludeCurrencyTiers:
|
|
375
|
-
excludeFundingSources:
|
|
376
|
-
mode:
|
|
377
|
-
sessionMetadata:
|
|
378
|
-
theme:
|
|
413
|
+
excludeCurrencyTiers: r,
|
|
414
|
+
excludeFundingSources: o,
|
|
415
|
+
mode: c,
|
|
416
|
+
sessionMetadata: a,
|
|
417
|
+
theme: n,
|
|
379
418
|
walletProvider: p,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
419
|
+
localStorageProvider: h,
|
|
420
|
+
onOpen: u,
|
|
421
|
+
onSuccess: m,
|
|
422
|
+
onClose: f,
|
|
423
|
+
autoCloseOnSuccess: g,
|
|
424
|
+
baseUrl: d
|
|
385
425
|
}), [
|
|
386
426
|
s,
|
|
387
427
|
t,
|
|
388
428
|
e,
|
|
389
429
|
i,
|
|
390
|
-
n,
|
|
391
430
|
r,
|
|
392
|
-
d,
|
|
393
431
|
o,
|
|
432
|
+
c,
|
|
394
433
|
a,
|
|
434
|
+
n,
|
|
395
435
|
p,
|
|
396
|
-
c,
|
|
397
436
|
h,
|
|
398
437
|
u,
|
|
438
|
+
m,
|
|
399
439
|
f,
|
|
400
|
-
|
|
440
|
+
g,
|
|
441
|
+
d
|
|
401
442
|
]);
|
|
402
443
|
return {
|
|
403
|
-
openGlideDeposit:
|
|
404
|
-
externalUrl:
|
|
405
|
-
opts:
|
|
444
|
+
openGlideDeposit: y.open,
|
|
445
|
+
externalUrl: y.externalUrl,
|
|
446
|
+
opts: y.opts
|
|
406
447
|
};
|
|
407
|
-
},
|
|
448
|
+
}, me = ({
|
|
408
449
|
app: s,
|
|
409
450
|
preferGaslessPayment: t,
|
|
410
451
|
excludeChainIds: e,
|
|
411
452
|
excludeCurrencyTiers: i,
|
|
412
|
-
excludeFundingSources:
|
|
413
|
-
amount:
|
|
414
|
-
sessionId:
|
|
415
|
-
sessionMetadata:
|
|
416
|
-
theme:
|
|
453
|
+
excludeFundingSources: r,
|
|
454
|
+
amount: o,
|
|
455
|
+
sessionId: c,
|
|
456
|
+
sessionMetadata: a,
|
|
457
|
+
theme: n,
|
|
417
458
|
walletProvider: p,
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
459
|
+
localStorageProvider: h,
|
|
460
|
+
onOpen: u,
|
|
461
|
+
onSuccess: m,
|
|
462
|
+
onClose: f,
|
|
463
|
+
autoCloseOnSuccess: g,
|
|
464
|
+
baseUrl: d
|
|
423
465
|
}) => {
|
|
424
|
-
const
|
|
466
|
+
const y = I(() => new P({
|
|
425
467
|
app: s,
|
|
426
468
|
preferGaslessPayment: t,
|
|
427
469
|
excludeChainIds: e,
|
|
428
470
|
excludeCurrencyTiers: i,
|
|
429
|
-
excludeFundingSources:
|
|
471
|
+
excludeFundingSources: r,
|
|
430
472
|
mode: "pay",
|
|
431
|
-
sessionId:
|
|
432
|
-
amount:
|
|
433
|
-
sessionMetadata:
|
|
434
|
-
theme:
|
|
473
|
+
sessionId: c,
|
|
474
|
+
amount: o,
|
|
475
|
+
sessionMetadata: a,
|
|
476
|
+
theme: n,
|
|
435
477
|
walletProvider: p,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
478
|
+
localStorageProvider: h,
|
|
479
|
+
onOpen: u,
|
|
480
|
+
onSuccess: m,
|
|
481
|
+
onClose: f,
|
|
482
|
+
autoCloseOnSuccess: g,
|
|
483
|
+
baseUrl: d
|
|
441
484
|
}), [
|
|
442
485
|
s,
|
|
443
486
|
t,
|
|
444
487
|
e,
|
|
445
488
|
i,
|
|
446
|
-
n,
|
|
447
|
-
d,
|
|
448
489
|
r,
|
|
490
|
+
c,
|
|
449
491
|
o,
|
|
450
492
|
a,
|
|
493
|
+
n,
|
|
451
494
|
p,
|
|
452
|
-
c,
|
|
453
495
|
h,
|
|
454
496
|
u,
|
|
497
|
+
m,
|
|
455
498
|
f,
|
|
456
|
-
|
|
499
|
+
g,
|
|
500
|
+
d
|
|
457
501
|
]);
|
|
458
502
|
return {
|
|
459
|
-
openGlidePay:
|
|
460
|
-
externalUrl:
|
|
461
|
-
opts:
|
|
503
|
+
openGlidePay: y.open,
|
|
504
|
+
externalUrl: y.externalUrl,
|
|
505
|
+
opts: y.opts
|
|
462
506
|
};
|
|
463
|
-
},
|
|
507
|
+
}, fe = ({
|
|
464
508
|
app: s,
|
|
465
509
|
evm: t,
|
|
466
510
|
approval: e,
|
|
467
511
|
preferGaslessPayment: i,
|
|
468
|
-
excludeChainIds:
|
|
469
|
-
excludeCurrencyTiers:
|
|
470
|
-
excludeFundingSources:
|
|
471
|
-
sessionMetadata:
|
|
472
|
-
theme:
|
|
512
|
+
excludeChainIds: r,
|
|
513
|
+
excludeCurrencyTiers: o,
|
|
514
|
+
excludeFundingSources: c,
|
|
515
|
+
sessionMetadata: a,
|
|
516
|
+
theme: n,
|
|
473
517
|
walletProvider: p,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
518
|
+
localStorageProvider: h,
|
|
519
|
+
onOpen: u,
|
|
520
|
+
onSuccess: m,
|
|
521
|
+
onClose: f,
|
|
522
|
+
autoCloseOnSuccess: g,
|
|
523
|
+
baseUrl: d
|
|
479
524
|
}) => {
|
|
480
|
-
const
|
|
525
|
+
const y = I(() => new P({
|
|
481
526
|
app: s,
|
|
482
527
|
evm: t,
|
|
483
528
|
approval: e,
|
|
484
529
|
preferGaslessPayment: i,
|
|
485
|
-
excludeChainIds:
|
|
486
|
-
excludeCurrencyTiers:
|
|
487
|
-
excludeFundingSources:
|
|
488
|
-
sessionMetadata:
|
|
530
|
+
excludeChainIds: r,
|
|
531
|
+
excludeCurrencyTiers: o,
|
|
532
|
+
excludeFundingSources: c,
|
|
533
|
+
sessionMetadata: a,
|
|
489
534
|
mode: "call",
|
|
490
|
-
theme:
|
|
535
|
+
theme: n,
|
|
491
536
|
walletProvider: p,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
537
|
+
localStorageProvider: h,
|
|
538
|
+
onOpen: u,
|
|
539
|
+
onSuccess: m,
|
|
540
|
+
onClose: f,
|
|
541
|
+
autoCloseOnSuccess: g,
|
|
542
|
+
baseUrl: d
|
|
497
543
|
}), [
|
|
498
544
|
s,
|
|
499
545
|
t,
|
|
500
546
|
e,
|
|
501
547
|
i,
|
|
502
|
-
n,
|
|
503
548
|
r,
|
|
504
|
-
d,
|
|
505
549
|
o,
|
|
550
|
+
c,
|
|
506
551
|
a,
|
|
552
|
+
n,
|
|
507
553
|
p,
|
|
508
|
-
c,
|
|
509
554
|
h,
|
|
510
555
|
u,
|
|
556
|
+
m,
|
|
511
557
|
f,
|
|
512
|
-
|
|
558
|
+
g,
|
|
559
|
+
d
|
|
513
560
|
]);
|
|
514
561
|
return {
|
|
515
|
-
openGlideCall:
|
|
516
|
-
externalUrl:
|
|
517
|
-
opts:
|
|
562
|
+
openGlideCall: y.open,
|
|
563
|
+
externalUrl: y.externalUrl,
|
|
564
|
+
opts: y.opts
|
|
518
565
|
};
|
|
519
|
-
},
|
|
566
|
+
}, ge = ({
|
|
520
567
|
app: s,
|
|
521
568
|
recipient: t,
|
|
522
569
|
preferGaslessPayment: e,
|
|
523
570
|
excludeChainIds: i,
|
|
524
|
-
excludeCurrencyTiers:
|
|
525
|
-
excludeFundingSources:
|
|
526
|
-
sessionMetadata:
|
|
527
|
-
theme:
|
|
528
|
-
walletProvider:
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
571
|
+
excludeCurrencyTiers: r,
|
|
572
|
+
excludeFundingSources: o,
|
|
573
|
+
sessionMetadata: c,
|
|
574
|
+
theme: a,
|
|
575
|
+
walletProvider: n,
|
|
576
|
+
localStorageProvider: p,
|
|
577
|
+
onOpen: h,
|
|
578
|
+
onSuccess: u,
|
|
579
|
+
onClose: m,
|
|
580
|
+
autoCloseOnSuccess: f,
|
|
581
|
+
baseUrl: g
|
|
534
582
|
}) => {
|
|
535
|
-
const
|
|
583
|
+
const d = I(() => new P({
|
|
536
584
|
app: s,
|
|
537
585
|
recipient: t,
|
|
538
586
|
preferGaslessPayment: e,
|
|
539
587
|
excludeChainIds: i,
|
|
540
|
-
excludeCurrencyTiers:
|
|
541
|
-
excludeFundingSources:
|
|
542
|
-
sessionMetadata:
|
|
588
|
+
excludeCurrencyTiers: r,
|
|
589
|
+
excludeFundingSources: o,
|
|
590
|
+
sessionMetadata: c,
|
|
543
591
|
mode: "buy",
|
|
544
|
-
theme:
|
|
545
|
-
walletProvider:
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
592
|
+
theme: a,
|
|
593
|
+
walletProvider: n,
|
|
594
|
+
localStorageProvider: p,
|
|
595
|
+
onOpen: h,
|
|
596
|
+
onSuccess: u,
|
|
597
|
+
onClose: m,
|
|
598
|
+
autoCloseOnSuccess: f,
|
|
599
|
+
baseUrl: g
|
|
551
600
|
}), [
|
|
552
601
|
s,
|
|
553
602
|
t,
|
|
554
603
|
e,
|
|
555
604
|
i,
|
|
556
|
-
n,
|
|
557
605
|
r,
|
|
558
|
-
d,
|
|
559
606
|
o,
|
|
607
|
+
c,
|
|
560
608
|
a,
|
|
609
|
+
n,
|
|
561
610
|
p,
|
|
562
|
-
c,
|
|
563
611
|
h,
|
|
564
612
|
u,
|
|
565
|
-
|
|
613
|
+
m,
|
|
614
|
+
f,
|
|
615
|
+
g
|
|
566
616
|
]);
|
|
567
617
|
return {
|
|
568
|
-
openGlideBuy:
|
|
569
|
-
externalUrl:
|
|
570
|
-
opts:
|
|
618
|
+
openGlideBuy: d.open,
|
|
619
|
+
externalUrl: d.externalUrl,
|
|
620
|
+
opts: d.opts
|
|
571
621
|
};
|
|
622
|
+
}, ye = {
|
|
623
|
+
getItem: (s) => new Promise((t, e) => {
|
|
624
|
+
try {
|
|
625
|
+
const i = localStorage.getItem(s);
|
|
626
|
+
t(i);
|
|
627
|
+
} catch (i) {
|
|
628
|
+
e(i);
|
|
629
|
+
}
|
|
630
|
+
}),
|
|
631
|
+
setItem: (s, t) => new Promise((e, i) => {
|
|
632
|
+
try {
|
|
633
|
+
localStorage.setItem(s, t), e();
|
|
634
|
+
} catch (r) {
|
|
635
|
+
i(r);
|
|
636
|
+
}
|
|
637
|
+
}),
|
|
638
|
+
removeItem: (s) => new Promise((t, e) => {
|
|
639
|
+
try {
|
|
640
|
+
localStorage.removeItem(s), t();
|
|
641
|
+
} catch (i) {
|
|
642
|
+
e(i);
|
|
643
|
+
}
|
|
644
|
+
}),
|
|
645
|
+
getKeys: () => new Promise((s, t) => {
|
|
646
|
+
try {
|
|
647
|
+
const e = Object.keys(localStorage);
|
|
648
|
+
s(e);
|
|
649
|
+
} catch (e) {
|
|
650
|
+
t(e);
|
|
651
|
+
}
|
|
652
|
+
})
|
|
572
653
|
};
|
|
573
654
|
export {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
655
|
+
P as GlideDeposit,
|
|
656
|
+
ye as browserLocalStorageProvider,
|
|
657
|
+
ge as useGlideBuy,
|
|
658
|
+
fe as useGlideCall,
|
|
659
|
+
ue as useGlideDeposit,
|
|
660
|
+
me as useGlidePay
|
|
579
661
|
};
|
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,14 @@ 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;
|
|
19
20
|
baseUrl?: string;
|
|
20
21
|
}
|
|
21
|
-
export declare const useGlideDeposit: ({ app, recipient, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, mode, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideDepositProps) => {
|
|
22
|
+
export declare const useGlideDeposit: ({ app, recipient, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, mode, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlideDepositProps) => {
|
|
22
23
|
openGlideDeposit: () => void;
|
|
23
24
|
externalUrl: string;
|
|
24
25
|
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,14 @@ 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;
|
|
19
20
|
baseUrl?: string;
|
|
20
21
|
};
|
|
21
|
-
export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, amount, sessionId, sessionMetadata, theme, walletProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlidePayProps) => {
|
|
22
|
+
export declare const useGlidePay: ({ app, preferGaslessPayment, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, amount, sessionId, sessionMetadata, theme, walletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, baseUrl, }: UseGlidePayProps) => {
|
|
22
23
|
openGlidePay: () => void;
|
|
23
24
|
externalUrl: string;
|
|
24
25
|
opts: import('./GlideDeposit.ts').GlideDepositOptions;
|