@coinbase/cdp-react 0.0.55 → 0.0.57
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/chunks/useSendComponentCallOnce.BHZMuo6E.js +273 -0
- package/dist/components/AuthButton/index.js +1 -1
- package/dist/components/Fund/index.js +1 -1
- package/dist/components/FundModal/index.js +1 -1
- package/dist/components/ManageAuth/index.js +1 -1
- package/dist/components/ManageAuthModal/index.js +1 -1
- package/dist/components/OAuthStatusModal/index.js +1 -1
- package/dist/components/SendEvmTransactionButton/index.js +1 -1
- package/dist/components/SendSolanaTransactionButton/index.js +1 -1
- package/dist/components/SignIn/index.js +1 -1
- package/dist/components/SignInModal/index.js +1 -1
- package/dist/components/SignOutButton/index.js +1 -1
- package/dist/index.js +136 -132
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/package.json +5 -5
- package/dist/chunks/useSendComponentCallOnce.CUgcsUye.js +0 -219
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { useRef as M, useEffect as q } from "react";
|
|
2
|
+
function U(s) {
|
|
3
|
+
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
4
|
+
}
|
|
5
|
+
var E = { exports: {} }, T = { exports: {} }, S;
|
|
6
|
+
function H() {
|
|
7
|
+
return S || (S = 1, function() {
|
|
8
|
+
var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = {
|
|
9
|
+
// Bit-wise rotation left
|
|
10
|
+
rotl: function(c, u) {
|
|
11
|
+
return c << u | c >>> 32 - u;
|
|
12
|
+
},
|
|
13
|
+
// Bit-wise rotation right
|
|
14
|
+
rotr: function(c, u) {
|
|
15
|
+
return c << 32 - u | c >>> u;
|
|
16
|
+
},
|
|
17
|
+
// Swap big-endian to little-endian and vice versa
|
|
18
|
+
endian: function(c) {
|
|
19
|
+
if (c.constructor == Number)
|
|
20
|
+
return l.rotl(c, 8) & 16711935 | l.rotl(c, 24) & 4278255360;
|
|
21
|
+
for (var u = 0; u < c.length; u++)
|
|
22
|
+
c[u] = l.endian(c[u]);
|
|
23
|
+
return c;
|
|
24
|
+
},
|
|
25
|
+
// Generate an array of any length of random bytes
|
|
26
|
+
randomBytes: function(c) {
|
|
27
|
+
for (var u = []; c > 0; c--)
|
|
28
|
+
u.push(Math.floor(Math.random() * 256));
|
|
29
|
+
return u;
|
|
30
|
+
},
|
|
31
|
+
// Convert a byte array to big-endian 32-bit words
|
|
32
|
+
bytesToWords: function(c) {
|
|
33
|
+
for (var u = [], a = 0, f = 0; a < c.length; a++, f += 8)
|
|
34
|
+
u[f >>> 5] |= c[a] << 24 - f % 32;
|
|
35
|
+
return u;
|
|
36
|
+
},
|
|
37
|
+
// Convert big-endian 32-bit words to a byte array
|
|
38
|
+
wordsToBytes: function(c) {
|
|
39
|
+
for (var u = [], a = 0; a < c.length * 32; a += 8)
|
|
40
|
+
u.push(c[a >>> 5] >>> 24 - a % 32 & 255);
|
|
41
|
+
return u;
|
|
42
|
+
},
|
|
43
|
+
// Convert a byte array to a hex string
|
|
44
|
+
bytesToHex: function(c) {
|
|
45
|
+
for (var u = [], a = 0; a < c.length; a++)
|
|
46
|
+
u.push((c[a] >>> 4).toString(16)), u.push((c[a] & 15).toString(16));
|
|
47
|
+
return u.join("");
|
|
48
|
+
},
|
|
49
|
+
// Convert a hex string to a byte array
|
|
50
|
+
hexToBytes: function(c) {
|
|
51
|
+
for (var u = [], a = 0; a < c.length; a += 2)
|
|
52
|
+
u.push(parseInt(c.substr(a, 2), 16));
|
|
53
|
+
return u;
|
|
54
|
+
},
|
|
55
|
+
// Convert a byte array to a base-64 string
|
|
56
|
+
bytesToBase64: function(c) {
|
|
57
|
+
for (var u = [], a = 0; a < c.length; a += 3)
|
|
58
|
+
for (var f = c[a] << 16 | c[a + 1] << 8 | c[a + 2], d = 0; d < 4; d++)
|
|
59
|
+
a * 8 + d * 6 <= c.length * 8 ? u.push(s.charAt(f >>> 6 * (3 - d) & 63)) : u.push("=");
|
|
60
|
+
return u.join("");
|
|
61
|
+
},
|
|
62
|
+
// Convert a base-64 string to a byte array
|
|
63
|
+
base64ToBytes: function(c) {
|
|
64
|
+
c = c.replace(/[^A-Z0-9+\/]/ig, "");
|
|
65
|
+
for (var u = [], a = 0, f = 0; a < c.length; f = ++a % 4)
|
|
66
|
+
f != 0 && u.push((s.indexOf(c.charAt(a - 1)) & Math.pow(2, -2 * f + 8) - 1) << f * 2 | s.indexOf(c.charAt(a)) >>> 6 - f * 2);
|
|
67
|
+
return u;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
T.exports = l;
|
|
71
|
+
}()), T.exports;
|
|
72
|
+
}
|
|
73
|
+
var F, m;
|
|
74
|
+
function x() {
|
|
75
|
+
if (m) return F;
|
|
76
|
+
m = 1;
|
|
77
|
+
var s = {
|
|
78
|
+
// UTF-8 encoding
|
|
79
|
+
utf8: {
|
|
80
|
+
// Convert a string to a byte array
|
|
81
|
+
stringToBytes: function(l) {
|
|
82
|
+
return s.bin.stringToBytes(unescape(encodeURIComponent(l)));
|
|
83
|
+
},
|
|
84
|
+
// Convert a byte array to a string
|
|
85
|
+
bytesToString: function(l) {
|
|
86
|
+
return decodeURIComponent(escape(s.bin.bytesToString(l)));
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
// Binary encoding
|
|
90
|
+
bin: {
|
|
91
|
+
// Convert a string to a byte array
|
|
92
|
+
stringToBytes: function(l) {
|
|
93
|
+
for (var c = [], u = 0; u < l.length; u++)
|
|
94
|
+
c.push(l.charCodeAt(u) & 255);
|
|
95
|
+
return c;
|
|
96
|
+
},
|
|
97
|
+
// Convert a byte array to a string
|
|
98
|
+
bytesToString: function(l) {
|
|
99
|
+
for (var c = [], u = 0; u < l.length; u++)
|
|
100
|
+
c.push(String.fromCharCode(l[u]));
|
|
101
|
+
return c.join("");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return F = s, F;
|
|
106
|
+
}
|
|
107
|
+
/*!
|
|
108
|
+
* Determine if an object is a Buffer
|
|
109
|
+
*
|
|
110
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
111
|
+
* @license MIT
|
|
112
|
+
*/
|
|
113
|
+
var B, O;
|
|
114
|
+
function N() {
|
|
115
|
+
if (O) return B;
|
|
116
|
+
O = 1, B = function(c) {
|
|
117
|
+
return c != null && (s(c) || l(c) || !!c._isBuffer);
|
|
118
|
+
};
|
|
119
|
+
function s(c) {
|
|
120
|
+
return !!c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c);
|
|
121
|
+
}
|
|
122
|
+
function l(c) {
|
|
123
|
+
return typeof c.readFloatLE == "function" && typeof c.slice == "function" && s(c.slice(0, 0));
|
|
124
|
+
}
|
|
125
|
+
return B;
|
|
126
|
+
}
|
|
127
|
+
var A;
|
|
128
|
+
function V() {
|
|
129
|
+
return A || (A = 1, function() {
|
|
130
|
+
var s = H(), l = x().utf8, c = N(), u = x().bin, a = function(f, d) {
|
|
131
|
+
f.constructor == String ? d && d.encoding === "binary" ? f = u.stringToBytes(f) : f = l.stringToBytes(f) : c(f) ? f = Array.prototype.slice.call(f, 0) : !Array.isArray(f) && f.constructor !== Uint8Array && (f = f.toString());
|
|
132
|
+
for (var o = s.bytesToWords(f), y = f.length * 8, r = 1732584193, t = -271733879, e = -1732584194, n = 271733878, i = 0; i < o.length; i++)
|
|
133
|
+
o[i] = (o[i] << 8 | o[i] >>> 24) & 16711935 | (o[i] << 24 | o[i] >>> 8) & 4278255360;
|
|
134
|
+
o[y >>> 5] |= 128 << y % 32, o[(y + 64 >>> 9 << 4) + 14] = y;
|
|
135
|
+
for (var p = a._ff, h = a._gg, v = a._hh, _ = a._ii, i = 0; i < o.length; i += 16) {
|
|
136
|
+
var P = r, D = t, I = e, L = n;
|
|
137
|
+
r = p(r, t, e, n, o[i + 0], 7, -680876936), n = p(n, r, t, e, o[i + 1], 12, -389564586), e = p(e, n, r, t, o[i + 2], 17, 606105819), t = p(t, e, n, r, o[i + 3], 22, -1044525330), r = p(r, t, e, n, o[i + 4], 7, -176418897), n = p(n, r, t, e, o[i + 5], 12, 1200080426), e = p(e, n, r, t, o[i + 6], 17, -1473231341), t = p(t, e, n, r, o[i + 7], 22, -45705983), r = p(r, t, e, n, o[i + 8], 7, 1770035416), n = p(n, r, t, e, o[i + 9], 12, -1958414417), e = p(e, n, r, t, o[i + 10], 17, -42063), t = p(t, e, n, r, o[i + 11], 22, -1990404162), r = p(r, t, e, n, o[i + 12], 7, 1804603682), n = p(n, r, t, e, o[i + 13], 12, -40341101), e = p(e, n, r, t, o[i + 14], 17, -1502002290), t = p(t, e, n, r, o[i + 15], 22, 1236535329), r = h(r, t, e, n, o[i + 1], 5, -165796510), n = h(n, r, t, e, o[i + 6], 9, -1069501632), e = h(e, n, r, t, o[i + 11], 14, 643717713), t = h(t, e, n, r, o[i + 0], 20, -373897302), r = h(r, t, e, n, o[i + 5], 5, -701558691), n = h(n, r, t, e, o[i + 10], 9, 38016083), e = h(e, n, r, t, o[i + 15], 14, -660478335), t = h(t, e, n, r, o[i + 4], 20, -405537848), r = h(r, t, e, n, o[i + 9], 5, 568446438), n = h(n, r, t, e, o[i + 14], 9, -1019803690), e = h(e, n, r, t, o[i + 3], 14, -187363961), t = h(t, e, n, r, o[i + 8], 20, 1163531501), r = h(r, t, e, n, o[i + 13], 5, -1444681467), n = h(n, r, t, e, o[i + 2], 9, -51403784), e = h(e, n, r, t, o[i + 7], 14, 1735328473), t = h(t, e, n, r, o[i + 12], 20, -1926607734), r = v(r, t, e, n, o[i + 5], 4, -378558), n = v(n, r, t, e, o[i + 8], 11, -2022574463), e = v(e, n, r, t, o[i + 11], 16, 1839030562), t = v(t, e, n, r, o[i + 14], 23, -35309556), r = v(r, t, e, n, o[i + 1], 4, -1530992060), n = v(n, r, t, e, o[i + 4], 11, 1272893353), e = v(e, n, r, t, o[i + 7], 16, -155497632), t = v(t, e, n, r, o[i + 10], 23, -1094730640), r = v(r, t, e, n, o[i + 13], 4, 681279174), n = v(n, r, t, e, o[i + 0], 11, -358537222), e = v(e, n, r, t, o[i + 3], 16, -722521979), t = v(t, e, n, r, o[i + 6], 23, 76029189), r = v(r, t, e, n, o[i + 9], 4, -640364487), n = v(n, r, t, e, o[i + 12], 11, -421815835), e = v(e, n, r, t, o[i + 15], 16, 530742520), t = v(t, e, n, r, o[i + 2], 23, -995338651), r = _(r, t, e, n, o[i + 0], 6, -198630844), n = _(n, r, t, e, o[i + 7], 10, 1126891415), e = _(e, n, r, t, o[i + 14], 15, -1416354905), t = _(t, e, n, r, o[i + 5], 21, -57434055), r = _(r, t, e, n, o[i + 12], 6, 1700485571), n = _(n, r, t, e, o[i + 3], 10, -1894986606), e = _(e, n, r, t, o[i + 10], 15, -1051523), t = _(t, e, n, r, o[i + 1], 21, -2054922799), r = _(r, t, e, n, o[i + 8], 6, 1873313359), n = _(n, r, t, e, o[i + 15], 10, -30611744), e = _(e, n, r, t, o[i + 6], 15, -1560198380), t = _(t, e, n, r, o[i + 13], 21, 1309151649), r = _(r, t, e, n, o[i + 4], 6, -145523070), n = _(n, r, t, e, o[i + 11], 10, -1120210379), e = _(e, n, r, t, o[i + 2], 15, 718787259), t = _(t, e, n, r, o[i + 9], 21, -343485551), r = r + P >>> 0, t = t + D >>> 0, e = e + I >>> 0, n = n + L >>> 0;
|
|
138
|
+
}
|
|
139
|
+
return s.endian([r, t, e, n]);
|
|
140
|
+
};
|
|
141
|
+
a._ff = function(f, d, o, y, r, t, e) {
|
|
142
|
+
var n = f + (d & o | ~d & y) + (r >>> 0) + e;
|
|
143
|
+
return (n << t | n >>> 32 - t) + d;
|
|
144
|
+
}, a._gg = function(f, d, o, y, r, t, e) {
|
|
145
|
+
var n = f + (d & y | o & ~y) + (r >>> 0) + e;
|
|
146
|
+
return (n << t | n >>> 32 - t) + d;
|
|
147
|
+
}, a._hh = function(f, d, o, y, r, t, e) {
|
|
148
|
+
var n = f + (d ^ o ^ y) + (r >>> 0) + e;
|
|
149
|
+
return (n << t | n >>> 32 - t) + d;
|
|
150
|
+
}, a._ii = function(f, d, o, y, r, t, e) {
|
|
151
|
+
var n = f + (o ^ (d | ~y)) + (r >>> 0) + e;
|
|
152
|
+
return (n << t | n >>> 32 - t) + d;
|
|
153
|
+
}, a._blocksize = 16, a._digestsize = 16, E.exports = function(f, d) {
|
|
154
|
+
if (f == null)
|
|
155
|
+
throw new Error("Illegal argument " + f);
|
|
156
|
+
var o = s.wordsToBytes(a(f, d));
|
|
157
|
+
return d && d.asBytes ? o : d && d.asString ? u.bytesToString(o) : s.bytesToHex(o);
|
|
158
|
+
};
|
|
159
|
+
}()), E.exports;
|
|
160
|
+
}
|
|
161
|
+
var G = V();
|
|
162
|
+
const J = /* @__PURE__ */ U(G);
|
|
163
|
+
function K() {
|
|
164
|
+
try {
|
|
165
|
+
return typeof navigator < "u" && navigator.product === "ReactNative";
|
|
166
|
+
} catch {
|
|
167
|
+
return !1;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function $() {
|
|
171
|
+
try {
|
|
172
|
+
if (typeof window > "u")
|
|
173
|
+
return typeof process < "u" && process.env && "__NEXT_PROCESSED_ENV" in process.env;
|
|
174
|
+
const s = window;
|
|
175
|
+
return !!(s.__NEXT_DATA__ || s.next || document.getElementById("__next"));
|
|
176
|
+
} catch {
|
|
177
|
+
return !1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function z() {
|
|
181
|
+
try {
|
|
182
|
+
if (typeof window > "u")
|
|
183
|
+
return !1;
|
|
184
|
+
const s = window;
|
|
185
|
+
return !!(s.__VUE__ || s.__VUE_DEVTOOLS_GLOBAL_HOOK__ || document.querySelector("[data-v-]"));
|
|
186
|
+
} catch {
|
|
187
|
+
return !1;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function W() {
|
|
191
|
+
try {
|
|
192
|
+
if (typeof window > "u")
|
|
193
|
+
return !1;
|
|
194
|
+
const s = window;
|
|
195
|
+
return s.__REACT_DEVTOOLS_GLOBAL_HOOK__ || s.React ? !0 : !!document.querySelector(
|
|
196
|
+
"[data-reactroot], [data-reactid], ._reactRoot, ._reactRootContainer"
|
|
197
|
+
);
|
|
198
|
+
} catch {
|
|
199
|
+
return !1;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function X() {
|
|
203
|
+
return W() ? "react" : K() ? "react-native" : $() ? "nextjs" : z() ? "vue" : "unknown";
|
|
204
|
+
}
|
|
205
|
+
let R = null;
|
|
206
|
+
function Z() {
|
|
207
|
+
return R === null && (R = X()), R;
|
|
208
|
+
}
|
|
209
|
+
const b = "1f8d3e558f493e38a037dbfadb8ba344", Q = "d473b1dcc969105adab157226cd9cf63", C = Symbol.for("@coinbase/cdp-analytics");
|
|
210
|
+
function Y() {
|
|
211
|
+
const s = globalThis;
|
|
212
|
+
return s[C] || (s[C] = {
|
|
213
|
+
identifier: "",
|
|
214
|
+
enabled: !0,
|
|
215
|
+
isProduction: !1,
|
|
216
|
+
isUsingMocks: !1,
|
|
217
|
+
sendEvent: w,
|
|
218
|
+
sendActionCallEvent: (l) => w({ ...l, type: "action_call" }),
|
|
219
|
+
sendHookCallEvent: (l) => w({ ...l, type: "hook_call" }),
|
|
220
|
+
sendComponentCallEvent: (l) => w({ ...l, type: "component_call" }),
|
|
221
|
+
versionRegistry: {},
|
|
222
|
+
registerPackageVersion: (l, c) => {
|
|
223
|
+
g.versionRegistry[l] = c;
|
|
224
|
+
}
|
|
225
|
+
}), s[C];
|
|
226
|
+
}
|
|
227
|
+
const g = Y();
|
|
228
|
+
async function w(s) {
|
|
229
|
+
if (!g.enabled || !g.identifier)
|
|
230
|
+
return;
|
|
231
|
+
const l = Date.now(), u = [{
|
|
232
|
+
user_id: g.identifier,
|
|
233
|
+
event_type: s.type,
|
|
234
|
+
platform: k() ? "web" : "native",
|
|
235
|
+
timestamp: l,
|
|
236
|
+
event_properties: {
|
|
237
|
+
project_name: "cdp-embedded-wallet",
|
|
238
|
+
framework: Z(),
|
|
239
|
+
isLocalHost: j(),
|
|
240
|
+
isUsingMocks: g.isUsingMocks,
|
|
241
|
+
package_versions: g.versionRegistry,
|
|
242
|
+
...s
|
|
243
|
+
}
|
|
244
|
+
}], a = JSON.stringify(u), f = l.toString(), d = J(a + f), o = {
|
|
245
|
+
client: g.isProduction ? Q : b,
|
|
246
|
+
e: a,
|
|
247
|
+
checksum: d
|
|
248
|
+
};
|
|
249
|
+
await fetch("https://cca-lite.coinbase.com/amp", {
|
|
250
|
+
method: "POST",
|
|
251
|
+
mode: "no-cors",
|
|
252
|
+
headers: {
|
|
253
|
+
"Content-Type": "application/json"
|
|
254
|
+
},
|
|
255
|
+
body: JSON.stringify(o)
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
function k() {
|
|
259
|
+
return typeof window < "u" && typeof document < "u";
|
|
260
|
+
}
|
|
261
|
+
function j() {
|
|
262
|
+
return k() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
|
|
263
|
+
}
|
|
264
|
+
function nt(s) {
|
|
265
|
+
const l = M(!1);
|
|
266
|
+
q(() => {
|
|
267
|
+
l.current || (g.sendComponentCallEvent({ name: s }), l.current = !0);
|
|
268
|
+
}, [s]);
|
|
269
|
+
}
|
|
270
|
+
export {
|
|
271
|
+
g as A,
|
|
272
|
+
nt as u
|
|
273
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u, jsxs as j, Fragment as k } from "react/jsx-runtime";
|
|
2
2
|
import { useIsInitialized as y, useIsSignedIn as z } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as D } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as D } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
4
4
|
import { useState as m, useRef as M, useCallback as x, useEffect as f } from "react";
|
|
5
5
|
import { SignInModal as N } from "../SignInModal/index.js";
|
|
6
6
|
import { SignOutButton as $ } from "../SignOutButton/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as i, Fragment as f } from "react/jsx-runtime";
|
|
2
|
-
import { u as p } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as p } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
3
|
import { useId as c } from "react";
|
|
4
4
|
import { useAppConfig as F } from "../CDPReactProvider/index.js";
|
|
5
5
|
import { CoinbaseFooter as a } from "../ui/CoinbaseFooter/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i, Fragment as p } from "react/jsx-runtime";
|
|
2
|
-
import { u as w } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as w } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
3
|
import { createContext as j, useState as A, useCallback as F, useMemo as S, useId as $, useContext as z } from "react";
|
|
4
4
|
import { c as x } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
5
|
import { useAppConfig as V } from "../CDPReactProvider/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as _ } from "react/jsx-runtime";
|
|
2
2
|
import { useLinkOAuth as d } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as g } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as g } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
4
4
|
import { useCallback as A } from "react";
|
|
5
5
|
import { Error as f } from "../ui/Error/index.js";
|
|
6
6
|
import { unstable_ManageAuthItem as k } from "./ManageAuthItem.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { u as p } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as p } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
3
|
import { createContext as A, useMemo as C, useContext as f } from "react";
|
|
4
4
|
import { unstable_ManageAuth as x } from "../ManageAuth/index.js";
|
|
5
5
|
import { Button as h } from "../ui/Button/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, jsxs as e, Fragment as l } from "react/jsx-runtime";
|
|
2
2
|
import "@coinbase/cdp-core";
|
|
3
3
|
import { useOAuthState as O } from "@coinbase/cdp-hooks";
|
|
4
|
-
import { u as I } from "../../chunks/useSendComponentCallOnce.
|
|
4
|
+
import { u as I } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
5
5
|
import { useState as C, useEffect as u, useRef as g, useCallback as b } from "react";
|
|
6
6
|
import { useProviderName as v } from "../CDPReactProvider/index.js";
|
|
7
7
|
import { OAUTH_PROVIDER_SESSION_STORAGE_KEY as S } from "../SignIn/hooks/useSignInWithOAuth.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { useSendEvmTransaction as _, APIError as S } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as b } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as b } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
4
4
|
import { useState as T, useCallback as y } from "react";
|
|
5
5
|
import { c as C } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
6
|
import { Button as w } from "../ui/Button/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _ } from "react/jsx-runtime";
|
|
2
2
|
import { useSendSolanaTransaction as b, APIError as T } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as w } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as w } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
4
4
|
import { useState as x, useCallback as y } from "react";
|
|
5
5
|
import { c as B } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
6
|
import { Button as C } from "../ui/Button/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { u as d } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as d } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { useAppConfig as u } from "../CDPReactProvider/index.js";
|
|
5
5
|
import { SignInAuthMethodButtons as f } from "./SignInAuthMethodButtons.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as t, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { u as I } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as I } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
3
|
import { createContext as C, useMemo as b, useContext as x } from "react";
|
|
4
4
|
import { c as v } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
5
|
import { useAppConfig as N } from "../CDPReactProvider/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { useSignOut as r } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as e } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as e } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { c } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
6
|
import { Button as a } from "../ui/Button/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,134 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
1
|
+
import { A as o } from "./chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { VERSION as r } from "./version.js";
|
|
4
|
+
import { AuthButton as p } from "./components/AuthButton/index.js";
|
|
5
|
+
import { ALL_AUTH_METHODS as i, AUTH_METHODS as x, CDPReactProvider as s, OAUTH_METHODS as l, useAppConfig as u, useProviderName as c } from "./components/CDPReactProvider/index.js";
|
|
6
|
+
import { Fund as d, FundFooter as I } from "./components/Fund/index.js";
|
|
7
|
+
import { FundModal as S, FundModalContent as T, FundModalTrigger as A } from "./components/FundModal/index.js";
|
|
8
|
+
import { unstable_ManageAuth as h, unstable_ManageAuthContent as F } from "./components/ManageAuth/index.js";
|
|
9
|
+
import { unstable_ManageAuthItem as E } from "./components/ManageAuth/ManageAuthItem.js";
|
|
10
|
+
import { unstable_ManageAuthModal as k, unstable_ManageAuthModalContent as B, unstable_ManageAuthModalTrigger as D } from "./components/ManageAuthModal/index.js";
|
|
11
|
+
import { SendEvmTransactionButton as v } from "./components/SendEvmTransactionButton/index.js";
|
|
12
|
+
import { SendSolanaTransactionButton as H } from "./components/SendSolanaTransactionButton/index.js";
|
|
13
|
+
import { SignIn as R } from "./components/SignIn/index.js";
|
|
14
|
+
import { useSignInReducer as U } from "./components/SignIn/useSignInReducer.js";
|
|
15
|
+
import { SignInModal as N, SignInModalContent as j, SignInModalTrigger as y } from "./components/SignInModal/index.js";
|
|
16
|
+
import { SignOutButton as X } from "./components/SignOutButton/index.js";
|
|
17
|
+
import { ThemeProvider as z, useTheme as J } from "./components/ThemeProvider/index.js";
|
|
18
|
+
import { Button as Q } from "./components/ui/Button/index.js";
|
|
19
|
+
import { Modal as Y, ModalClose as Z, ModalContent as $, ModalDescription as oo, ModalTitle as ro, ModalTrigger as eo } from "./components/ui/Modal/index.js";
|
|
20
|
+
import { cssVariables as no } from "./theme/cssVariables.js";
|
|
21
|
+
import { theme as ao } from "./theme/theme.js";
|
|
22
|
+
import { borderRadius as fo, borderRadiusComponents as io, borderRadiusSemantic as xo, colors as so, colorsBase as lo, colorsComponents as uo, colorsSemantic as co, font as go, fontComponents as Io, fontSemantic as Mo, tokens as So } from "./theme/tokens.js";
|
|
23
|
+
import { flattenTokensObject as Ao, themeToCssVariables as Co } from "./theme/utils.js";
|
|
24
|
+
import { IconAppleLogo as Fo } from "./icons/IconAppleLogo.js";
|
|
25
|
+
import { IconArrowLeft as Eo } from "./icons/IconArrowLeft.js";
|
|
26
|
+
import { IconArrowsUpDown as ko } from "./icons/IconArrowsUpDown.js";
|
|
27
|
+
import { IconCheck as Do } from "./icons/IconCheck.js";
|
|
28
|
+
import { IconCheckCircle as vo } from "./icons/IconCheckCircle.js";
|
|
29
|
+
import { IconChevronDown as Ho } from "./icons/IconChevronDown.js";
|
|
30
|
+
import { IconEnvelope as Ro } from "./icons/IconEnvelope.js";
|
|
31
|
+
import { IconExclamationCircle as Uo } from "./icons/IconExclamationCircle.js";
|
|
32
|
+
import { IconExclamationTriangle as No } from "./icons/IconExclamationTriangle.js";
|
|
33
|
+
import { IconGoogleLogo as yo } from "./icons/IconGoogleLogo.js";
|
|
34
|
+
import { IconLock as Xo } from "./icons/IconLock.js";
|
|
35
|
+
import { IconPhone as zo } from "./icons/IconPhone.js";
|
|
36
|
+
import { IconXMark as Ko } from "./icons/IconXMark.js";
|
|
37
|
+
import { IconMinus as Wo } from "./icons/IconMinus.js";
|
|
38
|
+
import { IconPlus as Zo } from "./icons/IconPlus.js";
|
|
39
|
+
import { clamp as or } from "./utils/clamp.js";
|
|
40
|
+
import { getMessageFromUnknownError as er } from "./utils/getMessageFromUnknownError.js";
|
|
41
|
+
import { isApiError as nr } from "./utils/isApiError.js";
|
|
42
|
+
import { isEmailInvalid as ar } from "./utils/isEmailInvalid.js";
|
|
43
|
+
import { parseValuesFromPhoneNumber as fr } from "./utils/parseValuesFromPhoneNumber.js";
|
|
44
|
+
import { FundForm as xr } from "./components/Fund/FundForm.js";
|
|
45
|
+
import { FundTitle as lr } from "./components/Fund/FundTitle.js";
|
|
46
|
+
import { useFundContext as cr } from "./components/Fund/FundProvider.js";
|
|
47
|
+
import { SignInAuthMethodButtons as dr } from "./components/SignIn/SignInAuthMethodButtons.js";
|
|
48
|
+
import { SignInBackButton as Mr } from "./components/SignIn/SignInBackButton.js";
|
|
49
|
+
import { SignInDescription as Tr } from "./components/SignIn/SignInDescription.js";
|
|
50
|
+
import { SignInFooter as Cr } from "./components/SignIn/SignInFooter.js";
|
|
51
|
+
import { SignInForm as Fr } from "./components/SignIn/SignInForm.js";
|
|
52
|
+
import { SignInImage as Er } from "./components/SignIn/SignInImage.js";
|
|
53
|
+
import { SignInTitle as kr } from "./components/SignIn/SignInTitle.js";
|
|
54
|
+
import { useSignInContext as Dr } from "./components/SignIn/SignInProvider.js";
|
|
55
|
+
o.registerPackageVersion("react", r);
|
|
52
56
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
57
|
+
i as ALL_AUTH_METHODS,
|
|
58
|
+
x as AUTH_METHODS,
|
|
59
|
+
p as AuthButton,
|
|
60
|
+
Q as Button,
|
|
61
|
+
s as CDPReactProvider,
|
|
62
|
+
d as Fund,
|
|
63
|
+
I as FundFooter,
|
|
64
|
+
xr as FundForm,
|
|
65
|
+
S as FundModal,
|
|
66
|
+
T as FundModalContent,
|
|
67
|
+
A as FundModalTrigger,
|
|
68
|
+
lr as FundTitle,
|
|
69
|
+
Fo as IconAppleLogo,
|
|
70
|
+
Eo as IconArrowLeft,
|
|
71
|
+
ko as IconArrowsUpDown,
|
|
72
|
+
Do as IconCheck,
|
|
73
|
+
vo as IconCheckCircle,
|
|
74
|
+
Ho as IconChevronDown,
|
|
75
|
+
Ro as IconEnvelope,
|
|
76
|
+
Uo as IconExclamationCircle,
|
|
77
|
+
No as IconExclamationTriangle,
|
|
78
|
+
yo as IconGoogleLogo,
|
|
79
|
+
Xo as IconLock,
|
|
80
|
+
Wo as IconMinus,
|
|
81
|
+
zo as IconPhone,
|
|
82
|
+
Zo as IconPlus,
|
|
83
|
+
Ko as IconXMark,
|
|
84
|
+
Y as Modal,
|
|
85
|
+
Z as ModalClose,
|
|
86
|
+
$ as ModalContent,
|
|
87
|
+
oo as ModalDescription,
|
|
88
|
+
ro as ModalTitle,
|
|
89
|
+
eo as ModalTrigger,
|
|
90
|
+
l as OAUTH_METHODS,
|
|
91
|
+
v as SendEvmTransactionButton,
|
|
92
|
+
H as SendSolanaTransactionButton,
|
|
93
|
+
R as SignIn,
|
|
94
|
+
dr as SignInAuthMethodButtons,
|
|
95
|
+
Mr as SignInBackButton,
|
|
96
|
+
Tr as SignInDescription,
|
|
97
|
+
Cr as SignInFooter,
|
|
98
|
+
Fr as SignInForm,
|
|
99
|
+
Er as SignInImage,
|
|
100
|
+
N as SignInModal,
|
|
101
|
+
j as SignInModalContent,
|
|
102
|
+
y as SignInModalTrigger,
|
|
103
|
+
kr as SignInTitle,
|
|
104
|
+
X as SignOutButton,
|
|
105
|
+
z as ThemeProvider,
|
|
106
|
+
fo as borderRadius,
|
|
107
|
+
io as borderRadiusComponents,
|
|
108
|
+
xo as borderRadiusSemantic,
|
|
109
|
+
or as clamp,
|
|
110
|
+
so as colors,
|
|
111
|
+
lo as colorsBase,
|
|
112
|
+
uo as colorsComponents,
|
|
113
|
+
co as colorsSemantic,
|
|
114
|
+
no as cssVariables,
|
|
115
|
+
Ao as flattenTokensObject,
|
|
116
|
+
go as font,
|
|
117
|
+
Io as fontComponents,
|
|
118
|
+
Mo as fontSemantic,
|
|
119
|
+
er as getMessageFromUnknownError,
|
|
120
|
+
nr as isApiError,
|
|
121
|
+
ar as isEmailInvalid,
|
|
122
|
+
fr as parseValuesFromPhoneNumber,
|
|
123
|
+
ao as theme,
|
|
124
|
+
Co as themeToCssVariables,
|
|
125
|
+
So as tokens,
|
|
126
|
+
h as unstable_ManageAuth,
|
|
127
|
+
F as unstable_ManageAuthContent,
|
|
128
|
+
E as unstable_ManageAuthItem,
|
|
129
|
+
k as unstable_ManageAuthModal,
|
|
130
|
+
B as unstable_ManageAuthModalContent,
|
|
131
|
+
D as unstable_ManageAuthModalTrigger,
|
|
132
|
+
u as useAppConfig,
|
|
133
|
+
cr as useFundContext,
|
|
134
|
+
c as useProviderName,
|
|
135
|
+
Dr as useSignInContext,
|
|
136
|
+
U as useSignInReducer,
|
|
137
|
+
J as useTheme
|
|
134
138
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "0.0.56";
|
package/dist/version.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@internationalized/number": "3.6.4",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=18.2.0 <19.2.0",
|
|
19
|
-
"@coinbase/cdp-
|
|
20
|
-
"@coinbase/cdp-
|
|
19
|
+
"@coinbase/cdp-hooks": "^0.0.57",
|
|
20
|
+
"@coinbase/cdp-core": "^0.0.57"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"vite": "^7.0.4",
|
|
48
48
|
"vite-plugin-dts": "^4.5.4",
|
|
49
49
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
50
|
-
"@coinbase/cdp-core": "^0.0.
|
|
51
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
50
|
+
"@coinbase/cdp-core": "^0.0.57",
|
|
51
|
+
"@coinbase/cdp-hooks": "^0.0.57"
|
|
52
52
|
},
|
|
53
53
|
"size-limit": [
|
|
54
54
|
{
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { useRef as k, useEffect as q } from "react";
|
|
2
|
-
function U(s) {
|
|
3
|
-
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
4
|
-
}
|
|
5
|
-
var F = { exports: {} }, B = { exports: {} }, S;
|
|
6
|
-
function H() {
|
|
7
|
-
return S || (S = 1, function() {
|
|
8
|
-
var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = {
|
|
9
|
-
// Bit-wise rotation left
|
|
10
|
-
rotl: function(c, u) {
|
|
11
|
-
return c << u | c >>> 32 - u;
|
|
12
|
-
},
|
|
13
|
-
// Bit-wise rotation right
|
|
14
|
-
rotr: function(c, u) {
|
|
15
|
-
return c << 32 - u | c >>> u;
|
|
16
|
-
},
|
|
17
|
-
// Swap big-endian to little-endian and vice versa
|
|
18
|
-
endian: function(c) {
|
|
19
|
-
if (c.constructor == Number)
|
|
20
|
-
return l.rotl(c, 8) & 16711935 | l.rotl(c, 24) & 4278255360;
|
|
21
|
-
for (var u = 0; u < c.length; u++)
|
|
22
|
-
c[u] = l.endian(c[u]);
|
|
23
|
-
return c;
|
|
24
|
-
},
|
|
25
|
-
// Generate an array of any length of random bytes
|
|
26
|
-
randomBytes: function(c) {
|
|
27
|
-
for (var u = []; c > 0; c--)
|
|
28
|
-
u.push(Math.floor(Math.random() * 256));
|
|
29
|
-
return u;
|
|
30
|
-
},
|
|
31
|
-
// Convert a byte array to big-endian 32-bit words
|
|
32
|
-
bytesToWords: function(c) {
|
|
33
|
-
for (var u = [], f = 0, a = 0; f < c.length; f++, a += 8)
|
|
34
|
-
u[a >>> 5] |= c[f] << 24 - a % 32;
|
|
35
|
-
return u;
|
|
36
|
-
},
|
|
37
|
-
// Convert big-endian 32-bit words to a byte array
|
|
38
|
-
wordsToBytes: function(c) {
|
|
39
|
-
for (var u = [], f = 0; f < c.length * 32; f += 8)
|
|
40
|
-
u.push(c[f >>> 5] >>> 24 - f % 32 & 255);
|
|
41
|
-
return u;
|
|
42
|
-
},
|
|
43
|
-
// Convert a byte array to a hex string
|
|
44
|
-
bytesToHex: function(c) {
|
|
45
|
-
for (var u = [], f = 0; f < c.length; f++)
|
|
46
|
-
u.push((c[f] >>> 4).toString(16)), u.push((c[f] & 15).toString(16));
|
|
47
|
-
return u.join("");
|
|
48
|
-
},
|
|
49
|
-
// Convert a hex string to a byte array
|
|
50
|
-
hexToBytes: function(c) {
|
|
51
|
-
for (var u = [], f = 0; f < c.length; f += 2)
|
|
52
|
-
u.push(parseInt(c.substr(f, 2), 16));
|
|
53
|
-
return u;
|
|
54
|
-
},
|
|
55
|
-
// Convert a byte array to a base-64 string
|
|
56
|
-
bytesToBase64: function(c) {
|
|
57
|
-
for (var u = [], f = 0; f < c.length; f += 3)
|
|
58
|
-
for (var a = c[f] << 16 | c[f + 1] << 8 | c[f + 2], d = 0; d < 4; d++)
|
|
59
|
-
f * 8 + d * 6 <= c.length * 8 ? u.push(s.charAt(a >>> 6 * (3 - d) & 63)) : u.push("=");
|
|
60
|
-
return u.join("");
|
|
61
|
-
},
|
|
62
|
-
// Convert a base-64 string to a byte array
|
|
63
|
-
base64ToBytes: function(c) {
|
|
64
|
-
c = c.replace(/[^A-Z0-9+\/]/ig, "");
|
|
65
|
-
for (var u = [], f = 0, a = 0; f < c.length; a = ++f % 4)
|
|
66
|
-
a != 0 && u.push((s.indexOf(c.charAt(f - 1)) & Math.pow(2, -2 * a + 8) - 1) << a * 2 | s.indexOf(c.charAt(f)) >>> 6 - a * 2);
|
|
67
|
-
return u;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
B.exports = l;
|
|
71
|
-
}()), B.exports;
|
|
72
|
-
}
|
|
73
|
-
var E, w;
|
|
74
|
-
function m() {
|
|
75
|
-
if (w) return E;
|
|
76
|
-
w = 1;
|
|
77
|
-
var s = {
|
|
78
|
-
// UTF-8 encoding
|
|
79
|
-
utf8: {
|
|
80
|
-
// Convert a string to a byte array
|
|
81
|
-
stringToBytes: function(l) {
|
|
82
|
-
return s.bin.stringToBytes(unescape(encodeURIComponent(l)));
|
|
83
|
-
},
|
|
84
|
-
// Convert a byte array to a string
|
|
85
|
-
bytesToString: function(l) {
|
|
86
|
-
return decodeURIComponent(escape(s.bin.bytesToString(l)));
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
// Binary encoding
|
|
90
|
-
bin: {
|
|
91
|
-
// Convert a string to a byte array
|
|
92
|
-
stringToBytes: function(l) {
|
|
93
|
-
for (var c = [], u = 0; u < l.length; u++)
|
|
94
|
-
c.push(l.charCodeAt(u) & 255);
|
|
95
|
-
return c;
|
|
96
|
-
},
|
|
97
|
-
// Convert a byte array to a string
|
|
98
|
-
bytesToString: function(l) {
|
|
99
|
-
for (var c = [], u = 0; u < l.length; u++)
|
|
100
|
-
c.push(String.fromCharCode(l[u]));
|
|
101
|
-
return c.join("");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return E = s, E;
|
|
106
|
-
}
|
|
107
|
-
/*!
|
|
108
|
-
* Determine if an object is a Buffer
|
|
109
|
-
*
|
|
110
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
111
|
-
* @license MIT
|
|
112
|
-
*/
|
|
113
|
-
var C, A;
|
|
114
|
-
function L() {
|
|
115
|
-
if (A) return C;
|
|
116
|
-
A = 1, C = function(c) {
|
|
117
|
-
return c != null && (s(c) || l(c) || !!c._isBuffer);
|
|
118
|
-
};
|
|
119
|
-
function s(c) {
|
|
120
|
-
return !!c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c);
|
|
121
|
-
}
|
|
122
|
-
function l(c) {
|
|
123
|
-
return typeof c.readFloatLE == "function" && typeof c.slice == "function" && s(c.slice(0, 0));
|
|
124
|
-
}
|
|
125
|
-
return C;
|
|
126
|
-
}
|
|
127
|
-
var P;
|
|
128
|
-
function J() {
|
|
129
|
-
return P || (P = 1, function() {
|
|
130
|
-
var s = H(), l = m().utf8, c = L(), u = m().bin, f = function(a, d) {
|
|
131
|
-
a.constructor == String ? d && d.encoding === "binary" ? a = u.stringToBytes(a) : a = l.stringToBytes(a) : c(a) ? a = Array.prototype.slice.call(a, 0) : !Array.isArray(a) && a.constructor !== Uint8Array && (a = a.toString());
|
|
132
|
-
for (var o = s.bytesToWords(a), g = a.length * 8, r = 1732584193, n = -271733879, e = -1732584194, t = 271733878, i = 0; i < o.length; i++)
|
|
133
|
-
o[i] = (o[i] << 8 | o[i] >>> 24) & 16711935 | (o[i] << 24 | o[i] >>> 8) & 4278255360;
|
|
134
|
-
o[g >>> 5] |= 128 << g % 32, o[(g + 64 >>> 9 << 4) + 14] = g;
|
|
135
|
-
for (var p = f._ff, h = f._gg, v = f._hh, y = f._ii, i = 0; i < o.length; i += 16) {
|
|
136
|
-
var M = r, O = n, D = e, R = t;
|
|
137
|
-
r = p(r, n, e, t, o[i + 0], 7, -680876936), t = p(t, r, n, e, o[i + 1], 12, -389564586), e = p(e, t, r, n, o[i + 2], 17, 606105819), n = p(n, e, t, r, o[i + 3], 22, -1044525330), r = p(r, n, e, t, o[i + 4], 7, -176418897), t = p(t, r, n, e, o[i + 5], 12, 1200080426), e = p(e, t, r, n, o[i + 6], 17, -1473231341), n = p(n, e, t, r, o[i + 7], 22, -45705983), r = p(r, n, e, t, o[i + 8], 7, 1770035416), t = p(t, r, n, e, o[i + 9], 12, -1958414417), e = p(e, t, r, n, o[i + 10], 17, -42063), n = p(n, e, t, r, o[i + 11], 22, -1990404162), r = p(r, n, e, t, o[i + 12], 7, 1804603682), t = p(t, r, n, e, o[i + 13], 12, -40341101), e = p(e, t, r, n, o[i + 14], 17, -1502002290), n = p(n, e, t, r, o[i + 15], 22, 1236535329), r = h(r, n, e, t, o[i + 1], 5, -165796510), t = h(t, r, n, e, o[i + 6], 9, -1069501632), e = h(e, t, r, n, o[i + 11], 14, 643717713), n = h(n, e, t, r, o[i + 0], 20, -373897302), r = h(r, n, e, t, o[i + 5], 5, -701558691), t = h(t, r, n, e, o[i + 10], 9, 38016083), e = h(e, t, r, n, o[i + 15], 14, -660478335), n = h(n, e, t, r, o[i + 4], 20, -405537848), r = h(r, n, e, t, o[i + 9], 5, 568446438), t = h(t, r, n, e, o[i + 14], 9, -1019803690), e = h(e, t, r, n, o[i + 3], 14, -187363961), n = h(n, e, t, r, o[i + 8], 20, 1163531501), r = h(r, n, e, t, o[i + 13], 5, -1444681467), t = h(t, r, n, e, o[i + 2], 9, -51403784), e = h(e, t, r, n, o[i + 7], 14, 1735328473), n = h(n, e, t, r, o[i + 12], 20, -1926607734), r = v(r, n, e, t, o[i + 5], 4, -378558), t = v(t, r, n, e, o[i + 8], 11, -2022574463), e = v(e, t, r, n, o[i + 11], 16, 1839030562), n = v(n, e, t, r, o[i + 14], 23, -35309556), r = v(r, n, e, t, o[i + 1], 4, -1530992060), t = v(t, r, n, e, o[i + 4], 11, 1272893353), e = v(e, t, r, n, o[i + 7], 16, -155497632), n = v(n, e, t, r, o[i + 10], 23, -1094730640), r = v(r, n, e, t, o[i + 13], 4, 681279174), t = v(t, r, n, e, o[i + 0], 11, -358537222), e = v(e, t, r, n, o[i + 3], 16, -722521979), n = v(n, e, t, r, o[i + 6], 23, 76029189), r = v(r, n, e, t, o[i + 9], 4, -640364487), t = v(t, r, n, e, o[i + 12], 11, -421815835), e = v(e, t, r, n, o[i + 15], 16, 530742520), n = v(n, e, t, r, o[i + 2], 23, -995338651), r = y(r, n, e, t, o[i + 0], 6, -198630844), t = y(t, r, n, e, o[i + 7], 10, 1126891415), e = y(e, t, r, n, o[i + 14], 15, -1416354905), n = y(n, e, t, r, o[i + 5], 21, -57434055), r = y(r, n, e, t, o[i + 12], 6, 1700485571), t = y(t, r, n, e, o[i + 3], 10, -1894986606), e = y(e, t, r, n, o[i + 10], 15, -1051523), n = y(n, e, t, r, o[i + 1], 21, -2054922799), r = y(r, n, e, t, o[i + 8], 6, 1873313359), t = y(t, r, n, e, o[i + 15], 10, -30611744), e = y(e, t, r, n, o[i + 6], 15, -1560198380), n = y(n, e, t, r, o[i + 13], 21, 1309151649), r = y(r, n, e, t, o[i + 4], 6, -145523070), t = y(t, r, n, e, o[i + 11], 10, -1120210379), e = y(e, t, r, n, o[i + 2], 15, 718787259), n = y(n, e, t, r, o[i + 9], 21, -343485551), r = r + M >>> 0, n = n + O >>> 0, e = e + D >>> 0, t = t + R >>> 0;
|
|
138
|
-
}
|
|
139
|
-
return s.endian([r, n, e, t]);
|
|
140
|
-
};
|
|
141
|
-
f._ff = function(a, d, o, g, r, n, e) {
|
|
142
|
-
var t = a + (d & o | ~d & g) + (r >>> 0) + e;
|
|
143
|
-
return (t << n | t >>> 32 - n) + d;
|
|
144
|
-
}, f._gg = function(a, d, o, g, r, n, e) {
|
|
145
|
-
var t = a + (d & g | o & ~g) + (r >>> 0) + e;
|
|
146
|
-
return (t << n | t >>> 32 - n) + d;
|
|
147
|
-
}, f._hh = function(a, d, o, g, r, n, e) {
|
|
148
|
-
var t = a + (d ^ o ^ g) + (r >>> 0) + e;
|
|
149
|
-
return (t << n | t >>> 32 - n) + d;
|
|
150
|
-
}, f._ii = function(a, d, o, g, r, n, e) {
|
|
151
|
-
var t = a + (o ^ (d | ~g)) + (r >>> 0) + e;
|
|
152
|
-
return (t << n | t >>> 32 - n) + d;
|
|
153
|
-
}, f._blocksize = 16, f._digestsize = 16, F.exports = function(a, d) {
|
|
154
|
-
if (a == null)
|
|
155
|
-
throw new Error("Illegal argument " + a);
|
|
156
|
-
var o = s.wordsToBytes(f(a, d));
|
|
157
|
-
return d && d.asBytes ? o : d && d.asString ? u.bytesToString(o) : s.bytesToHex(o);
|
|
158
|
-
};
|
|
159
|
-
}()), F.exports;
|
|
160
|
-
}
|
|
161
|
-
var G = J();
|
|
162
|
-
const N = /* @__PURE__ */ U(G), $ = "1f8d3e558f493e38a037dbfadb8ba344", z = "d473b1dcc969105adab157226cd9cf63", x = Symbol.for("@coinbase/cdp-analytics");
|
|
163
|
-
function W() {
|
|
164
|
-
const s = globalThis;
|
|
165
|
-
return s[x] || (s[x] = {
|
|
166
|
-
identifier: "",
|
|
167
|
-
enabled: !0,
|
|
168
|
-
isProduction: !1,
|
|
169
|
-
isUsingMocks: !1,
|
|
170
|
-
sendEvent: _,
|
|
171
|
-
sendActionCallEvent: (l) => _({ ...l, type: "action_call" }),
|
|
172
|
-
sendHookCallEvent: (l) => _({ ...l, type: "hook_call" }),
|
|
173
|
-
sendComponentCallEvent: (l) => _({ ...l, type: "component_call" })
|
|
174
|
-
}), s[x];
|
|
175
|
-
}
|
|
176
|
-
const T = W();
|
|
177
|
-
async function _(s) {
|
|
178
|
-
if (!T.enabled || !T.identifier)
|
|
179
|
-
return;
|
|
180
|
-
const l = Date.now(), u = [{
|
|
181
|
-
user_id: T.identifier,
|
|
182
|
-
event_type: s.type,
|
|
183
|
-
platform: I() ? "web" : "native",
|
|
184
|
-
timestamp: l,
|
|
185
|
-
event_properties: {
|
|
186
|
-
project_name: "cdp-embedded-wallet",
|
|
187
|
-
isLocalHost: K(),
|
|
188
|
-
isUsingMocks: T.isUsingMocks,
|
|
189
|
-
...s
|
|
190
|
-
}
|
|
191
|
-
}], f = JSON.stringify(u), a = l.toString(), d = N(f + a), o = {
|
|
192
|
-
client: T.isProduction ? z : $,
|
|
193
|
-
e: f,
|
|
194
|
-
checksum: d
|
|
195
|
-
};
|
|
196
|
-
await fetch("https://cca-lite.coinbase.com/amp", {
|
|
197
|
-
method: "POST",
|
|
198
|
-
mode: "no-cors",
|
|
199
|
-
headers: {
|
|
200
|
-
"Content-Type": "application/json"
|
|
201
|
-
},
|
|
202
|
-
body: JSON.stringify(o)
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function I() {
|
|
206
|
-
return typeof window < "u" && typeof document < "u";
|
|
207
|
-
}
|
|
208
|
-
function K() {
|
|
209
|
-
return I() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
|
|
210
|
-
}
|
|
211
|
-
function Z(s) {
|
|
212
|
-
const l = k(!1);
|
|
213
|
-
q(() => {
|
|
214
|
-
l.current || (T.sendComponentCallEvent({ name: s }), l.current = !0);
|
|
215
|
-
}, [s]);
|
|
216
|
-
}
|
|
217
|
-
export {
|
|
218
|
-
Z as u
|
|
219
|
-
};
|