@paywithglide/glide-react 0.0.21 → 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 -242
- 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
|
-
class
|
|
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
|
|
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 y 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);
|
|
@@ -311,266 +380,282 @@ class $ {
|
|
|
311
380
|
) : e.setAttribute(
|
|
312
381
|
"style",
|
|
313
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;"
|
|
314
|
-
), e.
|
|
315
|
-
var p, l, h, u;
|
|
316
|
-
const n = this.opts.recipient, r = (p = this.opts.walletProvider) == null ? void 0 : p.address, d = (l = this.opts.walletProvider) == null ? void 0 : l.availableChainIds, o = (h = this.opts.walletProvider) == null ? void 0 : h.currentChainId, a = this.opts.preferGaslessPayment || !!((u = this.opts.walletProvider) != null && u.signTypedDataAsync);
|
|
317
|
-
e.style.opacity = "1", setTimeout(() => {
|
|
318
|
-
var f, c, m;
|
|
319
|
-
(f = e == null ? void 0 : e.contentWindow) == null || f.postMessage(
|
|
320
|
-
{
|
|
321
|
-
type: "initialize",
|
|
322
|
-
sessionId: this.opts.sessionId,
|
|
323
|
-
recipient: n,
|
|
324
|
-
connectedWalletAddress: r,
|
|
325
|
-
availableChainIds: d,
|
|
326
|
-
currentChainId: o,
|
|
327
|
-
preferGaslessPayment: a,
|
|
328
|
-
excludeChainIds: this.opts.excludeChainIds,
|
|
329
|
-
excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
|
|
330
|
-
excludeFundingSources: this.opts.excludeFundingSources,
|
|
331
|
-
mode: this.opts.mode,
|
|
332
|
-
amount: this.opts.amount,
|
|
333
|
-
evmTx: this.opts.evm,
|
|
334
|
-
tokenApproval: this.opts.approval,
|
|
335
|
-
sessionMetadata: this.opts.sessionMetadata,
|
|
336
|
-
autoCloseOnSuccess: this.opts.autoCloseOnSuccess,
|
|
337
|
-
theme: this.opts.theme
|
|
338
|
-
},
|
|
339
|
-
new URL(this.baseUrl).origin
|
|
340
|
-
), (m = (c = this.opts).onOpen) == null || m.call(c);
|
|
341
|
-
}, 10);
|
|
342
|
-
}, 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);
|
|
343
384
|
}
|
|
344
385
|
removeIframe() {
|
|
345
386
|
const t = document.getElementById("glide-deposit-iframe");
|
|
346
387
|
t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
|
|
347
388
|
}
|
|
348
389
|
}
|
|
349
|
-
const
|
|
390
|
+
const ue = ({
|
|
350
391
|
app: s,
|
|
351
392
|
recipient: t,
|
|
352
393
|
preferGaslessPayment: e,
|
|
353
394
|
excludeChainIds: i,
|
|
354
|
-
excludeCurrencyTiers:
|
|
355
|
-
excludeFundingSources:
|
|
356
|
-
mode:
|
|
357
|
-
sessionMetadata:
|
|
358
|
-
theme:
|
|
395
|
+
excludeCurrencyTiers: r,
|
|
396
|
+
excludeFundingSources: o,
|
|
397
|
+
mode: c,
|
|
398
|
+
sessionMetadata: a,
|
|
399
|
+
theme: n,
|
|
359
400
|
walletProvider: p,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
401
|
+
localStorageProvider: h,
|
|
402
|
+
onOpen: u,
|
|
403
|
+
onSuccess: m,
|
|
404
|
+
onClose: f,
|
|
405
|
+
autoCloseOnSuccess: g,
|
|
406
|
+
baseUrl: d
|
|
365
407
|
}) => {
|
|
366
|
-
const
|
|
408
|
+
const y = I(() => new P({
|
|
367
409
|
app: s,
|
|
368
410
|
recipient: t,
|
|
369
411
|
preferGaslessPayment: e,
|
|
370
412
|
excludeChainIds: i,
|
|
371
|
-
excludeCurrencyTiers:
|
|
372
|
-
excludeFundingSources:
|
|
373
|
-
mode:
|
|
374
|
-
sessionMetadata:
|
|
375
|
-
theme:
|
|
413
|
+
excludeCurrencyTiers: r,
|
|
414
|
+
excludeFundingSources: o,
|
|
415
|
+
mode: c,
|
|
416
|
+
sessionMetadata: a,
|
|
417
|
+
theme: n,
|
|
376
418
|
walletProvider: p,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
419
|
+
localStorageProvider: h,
|
|
420
|
+
onOpen: u,
|
|
421
|
+
onSuccess: m,
|
|
422
|
+
onClose: f,
|
|
423
|
+
autoCloseOnSuccess: g,
|
|
424
|
+
baseUrl: d
|
|
382
425
|
}), [
|
|
383
426
|
s,
|
|
384
427
|
t,
|
|
385
428
|
e,
|
|
386
429
|
i,
|
|
387
|
-
n,
|
|
388
430
|
r,
|
|
389
|
-
d,
|
|
390
431
|
o,
|
|
432
|
+
c,
|
|
391
433
|
a,
|
|
434
|
+
n,
|
|
392
435
|
p,
|
|
393
|
-
l,
|
|
394
436
|
h,
|
|
395
437
|
u,
|
|
438
|
+
m,
|
|
396
439
|
f,
|
|
397
|
-
|
|
440
|
+
g,
|
|
441
|
+
d
|
|
398
442
|
]);
|
|
399
443
|
return {
|
|
400
|
-
openGlideDeposit:
|
|
401
|
-
externalUrl:
|
|
402
|
-
opts:
|
|
444
|
+
openGlideDeposit: y.open,
|
|
445
|
+
externalUrl: y.externalUrl,
|
|
446
|
+
opts: y.opts
|
|
403
447
|
};
|
|
404
|
-
},
|
|
448
|
+
}, me = ({
|
|
405
449
|
app: s,
|
|
406
450
|
preferGaslessPayment: t,
|
|
407
451
|
excludeChainIds: e,
|
|
408
452
|
excludeCurrencyTiers: i,
|
|
409
|
-
excludeFundingSources:
|
|
410
|
-
amount:
|
|
411
|
-
sessionId:
|
|
412
|
-
sessionMetadata:
|
|
413
|
-
theme:
|
|
453
|
+
excludeFundingSources: r,
|
|
454
|
+
amount: o,
|
|
455
|
+
sessionId: c,
|
|
456
|
+
sessionMetadata: a,
|
|
457
|
+
theme: n,
|
|
414
458
|
walletProvider: p,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
459
|
+
localStorageProvider: h,
|
|
460
|
+
onOpen: u,
|
|
461
|
+
onSuccess: m,
|
|
462
|
+
onClose: f,
|
|
463
|
+
autoCloseOnSuccess: g,
|
|
464
|
+
baseUrl: d
|
|
420
465
|
}) => {
|
|
421
|
-
const
|
|
466
|
+
const y = I(() => new P({
|
|
422
467
|
app: s,
|
|
423
468
|
preferGaslessPayment: t,
|
|
424
469
|
excludeChainIds: e,
|
|
425
470
|
excludeCurrencyTiers: i,
|
|
426
|
-
excludeFundingSources:
|
|
471
|
+
excludeFundingSources: r,
|
|
427
472
|
mode: "pay",
|
|
428
|
-
sessionId:
|
|
429
|
-
amount:
|
|
430
|
-
sessionMetadata:
|
|
431
|
-
theme:
|
|
473
|
+
sessionId: c,
|
|
474
|
+
amount: o,
|
|
475
|
+
sessionMetadata: a,
|
|
476
|
+
theme: n,
|
|
432
477
|
walletProvider: p,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
478
|
+
localStorageProvider: h,
|
|
479
|
+
onOpen: u,
|
|
480
|
+
onSuccess: m,
|
|
481
|
+
onClose: f,
|
|
482
|
+
autoCloseOnSuccess: g,
|
|
483
|
+
baseUrl: d
|
|
438
484
|
}), [
|
|
439
485
|
s,
|
|
440
486
|
t,
|
|
441
487
|
e,
|
|
442
488
|
i,
|
|
443
|
-
n,
|
|
444
|
-
d,
|
|
445
489
|
r,
|
|
490
|
+
c,
|
|
446
491
|
o,
|
|
447
492
|
a,
|
|
493
|
+
n,
|
|
448
494
|
p,
|
|
449
|
-
l,
|
|
450
495
|
h,
|
|
451
496
|
u,
|
|
497
|
+
m,
|
|
452
498
|
f,
|
|
453
|
-
|
|
499
|
+
g,
|
|
500
|
+
d
|
|
454
501
|
]);
|
|
455
502
|
return {
|
|
456
|
-
openGlidePay:
|
|
457
|
-
externalUrl:
|
|
458
|
-
opts:
|
|
503
|
+
openGlidePay: y.open,
|
|
504
|
+
externalUrl: y.externalUrl,
|
|
505
|
+
opts: y.opts
|
|
459
506
|
};
|
|
460
|
-
},
|
|
507
|
+
}, fe = ({
|
|
461
508
|
app: s,
|
|
462
509
|
evm: t,
|
|
463
510
|
approval: e,
|
|
464
511
|
preferGaslessPayment: i,
|
|
465
|
-
excludeChainIds:
|
|
466
|
-
excludeCurrencyTiers:
|
|
467
|
-
excludeFundingSources:
|
|
468
|
-
sessionMetadata:
|
|
469
|
-
theme:
|
|
512
|
+
excludeChainIds: r,
|
|
513
|
+
excludeCurrencyTiers: o,
|
|
514
|
+
excludeFundingSources: c,
|
|
515
|
+
sessionMetadata: a,
|
|
516
|
+
theme: n,
|
|
470
517
|
walletProvider: p,
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
518
|
+
localStorageProvider: h,
|
|
519
|
+
onOpen: u,
|
|
520
|
+
onSuccess: m,
|
|
521
|
+
onClose: f,
|
|
522
|
+
autoCloseOnSuccess: g,
|
|
523
|
+
baseUrl: d
|
|
476
524
|
}) => {
|
|
477
|
-
const
|
|
525
|
+
const y = I(() => new P({
|
|
478
526
|
app: s,
|
|
479
527
|
evm: t,
|
|
480
528
|
approval: e,
|
|
481
529
|
preferGaslessPayment: i,
|
|
482
|
-
excludeChainIds:
|
|
483
|
-
excludeCurrencyTiers:
|
|
484
|
-
excludeFundingSources:
|
|
485
|
-
sessionMetadata:
|
|
530
|
+
excludeChainIds: r,
|
|
531
|
+
excludeCurrencyTiers: o,
|
|
532
|
+
excludeFundingSources: c,
|
|
533
|
+
sessionMetadata: a,
|
|
486
534
|
mode: "call",
|
|
487
|
-
theme:
|
|
535
|
+
theme: n,
|
|
488
536
|
walletProvider: p,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
537
|
+
localStorageProvider: h,
|
|
538
|
+
onOpen: u,
|
|
539
|
+
onSuccess: m,
|
|
540
|
+
onClose: f,
|
|
541
|
+
autoCloseOnSuccess: g,
|
|
542
|
+
baseUrl: d
|
|
494
543
|
}), [
|
|
495
544
|
s,
|
|
496
545
|
t,
|
|
497
546
|
e,
|
|
498
547
|
i,
|
|
499
|
-
n,
|
|
500
548
|
r,
|
|
501
|
-
d,
|
|
502
549
|
o,
|
|
550
|
+
c,
|
|
503
551
|
a,
|
|
552
|
+
n,
|
|
504
553
|
p,
|
|
505
|
-
l,
|
|
506
554
|
h,
|
|
507
555
|
u,
|
|
556
|
+
m,
|
|
508
557
|
f,
|
|
509
|
-
|
|
558
|
+
g,
|
|
559
|
+
d
|
|
510
560
|
]);
|
|
511
561
|
return {
|
|
512
|
-
openGlideCall:
|
|
513
|
-
externalUrl:
|
|
514
|
-
opts:
|
|
562
|
+
openGlideCall: y.open,
|
|
563
|
+
externalUrl: y.externalUrl,
|
|
564
|
+
opts: y.opts
|
|
515
565
|
};
|
|
516
|
-
},
|
|
566
|
+
}, ge = ({
|
|
517
567
|
app: s,
|
|
518
568
|
recipient: t,
|
|
519
569
|
preferGaslessPayment: e,
|
|
520
570
|
excludeChainIds: i,
|
|
521
|
-
excludeCurrencyTiers:
|
|
522
|
-
excludeFundingSources:
|
|
523
|
-
sessionMetadata:
|
|
524
|
-
theme:
|
|
525
|
-
walletProvider:
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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
|
|
531
582
|
}) => {
|
|
532
|
-
const
|
|
583
|
+
const d = I(() => new P({
|
|
533
584
|
app: s,
|
|
534
585
|
recipient: t,
|
|
535
586
|
preferGaslessPayment: e,
|
|
536
587
|
excludeChainIds: i,
|
|
537
|
-
excludeCurrencyTiers:
|
|
538
|
-
excludeFundingSources:
|
|
539
|
-
sessionMetadata:
|
|
588
|
+
excludeCurrencyTiers: r,
|
|
589
|
+
excludeFundingSources: o,
|
|
590
|
+
sessionMetadata: c,
|
|
540
591
|
mode: "buy",
|
|
541
|
-
theme:
|
|
542
|
-
walletProvider:
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
592
|
+
theme: a,
|
|
593
|
+
walletProvider: n,
|
|
594
|
+
localStorageProvider: p,
|
|
595
|
+
onOpen: h,
|
|
596
|
+
onSuccess: u,
|
|
597
|
+
onClose: m,
|
|
598
|
+
autoCloseOnSuccess: f,
|
|
599
|
+
baseUrl: g
|
|
548
600
|
}), [
|
|
549
601
|
s,
|
|
550
602
|
t,
|
|
551
603
|
e,
|
|
552
604
|
i,
|
|
553
|
-
n,
|
|
554
605
|
r,
|
|
555
|
-
d,
|
|
556
606
|
o,
|
|
607
|
+
c,
|
|
557
608
|
a,
|
|
609
|
+
n,
|
|
558
610
|
p,
|
|
559
|
-
l,
|
|
560
611
|
h,
|
|
561
612
|
u,
|
|
562
|
-
|
|
613
|
+
m,
|
|
614
|
+
f,
|
|
615
|
+
g
|
|
563
616
|
]);
|
|
564
617
|
return {
|
|
565
|
-
openGlideBuy:
|
|
566
|
-
externalUrl:
|
|
567
|
-
opts:
|
|
618
|
+
openGlideBuy: d.open,
|
|
619
|
+
externalUrl: d.externalUrl,
|
|
620
|
+
opts: d.opts
|
|
568
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
|
+
})
|
|
569
653
|
};
|
|
570
654
|
export {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
655
|
+
P as GlideDeposit,
|
|
656
|
+
ye as browserLocalStorageProvider,
|
|
657
|
+
ge as useGlideBuy,
|
|
658
|
+
fe as useGlideCall,
|
|
659
|
+
ue as useGlideDeposit,
|
|
660
|
+
me as useGlidePay
|
|
576
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;
|