@vechain/vechain-kit 2.0.0-rc.9 → 2.0.0
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/README.md +22 -5
- package/dist/assets/index.cjs +1 -104
- package/dist/assets/index.d.cts +2 -1158
- package/dist/assets/index.d.mts +2 -0
- package/dist/assets/index.mjs +1 -0
- package/dist/assets-DXVXPy3w.cjs +47 -0
- package/dist/assets-DXVXPy3w.cjs.map +1 -0
- package/dist/assets-aAdDxPJu.mjs +38 -0
- package/dist/assets-aAdDxPJu.mjs.map +1 -0
- package/dist/index-Bqx1gXNe.d.mts +3961 -0
- package/dist/index-Bqx1gXNe.d.mts.map +1 -0
- package/dist/index-Bs6t5GxR.d.mts +136 -0
- package/dist/index-Bs6t5GxR.d.mts.map +1 -0
- package/dist/index-DSMUkHcK.d.cts +136 -0
- package/dist/index-DSMUkHcK.d.cts.map +1 -0
- package/dist/index-V7NUPb1d.d.cts +3961 -0
- package/dist/index-V7NUPb1d.d.cts.map +1 -0
- package/dist/index.cjs +171 -20660
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2224
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +186 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils/index.cjs +1 -265
- package/dist/utils/index.d.cts +3 -261
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.mjs +1 -0
- package/dist/utils-Bl-JeVTg.cjs +2 -0
- package/dist/utils-Bl-JeVTg.cjs.map +1 -0
- package/dist/utils-DAs6kMGs.mjs +2 -0
- package/dist/utils-DAs6kMGs.mjs.map +1 -0
- package/package.json +155 -104
- package/dist/assets/index.cjs.map +0 -1
- package/dist/assets/index.d.ts +0 -1158
- package/dist/assets/index.js +0 -3
- package/dist/assets/index.js.map +0 -1
- package/dist/chunk-BCEQ6QWT.js +0 -863
- package/dist/chunk-BCEQ6QWT.js.map +0 -1
- package/dist/chunk-EESC6JDT.cjs +0 -1897
- package/dist/chunk-EESC6JDT.cjs.map +0 -1
- package/dist/chunk-M6WTSZ5C.cjs +0 -939
- package/dist/chunk-M6WTSZ5C.cjs.map +0 -1
- package/dist/chunk-Z4FE6MMP.js +0 -1872
- package/dist/chunk-Z4FE6MMP.js.map +0 -1
- package/dist/index.d.ts +0 -2224
- package/dist/index.js +0 -20322
- package/dist/index.js.map +0 -1
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/thorUtils-IptLtkeL.d.cts +0 -230
- package/dist/thorUtils-IptLtkeL.d.ts +0 -230
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.ts +0 -261
- package/dist/utils/index.js +0 -4
- package/dist/utils/index.js.map +0 -1
package/dist/chunk-BCEQ6QWT.js
DELETED
|
@@ -1,863 +0,0 @@
|
|
|
1
|
-
import { VeBetterIcon, VTHOLogo, VETLogo } from './chunk-Z4FE6MMP.js';
|
|
2
|
-
import { Icon } from '@chakra-ui/react';
|
|
3
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { picasso } from '@vechain/picasso';
|
|
5
|
-
import { BigNumber } from 'bignumber.js';
|
|
6
|
-
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
|
|
7
|
-
import crypto from 'crypto';
|
|
8
|
-
import { Address } from '@vechain/sdk-core';
|
|
9
|
-
|
|
10
|
-
var VOT3Logo = ({ ...props }) => {
|
|
11
|
-
return /* @__PURE__ */ jsxs(Icon, { viewBox: "0 0 1684.56 1684.56", ...props, children: [
|
|
12
|
-
/* @__PURE__ */ jsx(
|
|
13
|
-
"rect",
|
|
14
|
-
{
|
|
15
|
-
fill: "#b1f16c",
|
|
16
|
-
width: "1684.56",
|
|
17
|
-
height: "1684.56",
|
|
18
|
-
rx: "157.74",
|
|
19
|
-
ry: "157.74"
|
|
20
|
-
}
|
|
21
|
-
),
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
"path",
|
|
24
|
-
{
|
|
25
|
-
fill: "#1d1d1d",
|
|
26
|
-
d: "M844.98,1386.28c-41.46,0-75.1-33.9-75.1-75.67,0-142.78-86.35-274.05-158.8-359.01-89.72-105.25-197.89-186.19-265.28-219.75-37.18-18.54-52.43-63.88-34.09-101.35,18.39-37.47,63.39-52.83,100.58-34.35,75.09,37.41,202.11,127.08,312.7,256.82,32.24,37.81,66.77,83.5,97.66,135.35,34.2-108.83,79.98-205.07,121.61-280.12,91.8-165.56,214.37-317.13,319.84-395.63,33.36-24.83,80.39-17.68,105.02,15.93,24.64,33.61,17.55,81-15.81,105.82-88.03,65.47-197.1,201.95-277.93,347.68-70.82,127.7-155.25,323.08-155.25,528.6,0,41.78-33.64,75.67-75.1,75.67h-.06Z"
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
-
] });
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// src/utils/ssrUtils.ts
|
|
33
|
-
var getLocalStorageItem = (key) => {
|
|
34
|
-
try {
|
|
35
|
-
if (typeof window === "undefined") {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
return localStorage.getItem(key);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.warn(`Error accessing localStorage for key "${key}":`, error);
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var setLocalStorageItem = (key, value) => {
|
|
45
|
-
try {
|
|
46
|
-
if (typeof window === "undefined") {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
localStorage.setItem(key, value);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.warn(`Error setting localStorage for key "${key}":`, error);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var removeLocalStorageItem = (key) => {
|
|
55
|
-
try {
|
|
56
|
-
if (typeof window === "undefined") {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
localStorage.removeItem(key);
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.warn(`Error removing localStorage for key "${key}":`, error);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var getDocumentTitle = () => {
|
|
65
|
-
try {
|
|
66
|
-
return typeof document !== "undefined" ? document.title : "";
|
|
67
|
-
} catch {
|
|
68
|
-
return "";
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var getWindowOrigin = () => {
|
|
72
|
-
try {
|
|
73
|
-
return typeof window !== "undefined" && window.location ? window.location.origin : "";
|
|
74
|
-
} catch {
|
|
75
|
-
return "";
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var isBrowser = () => {
|
|
79
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
80
|
-
};
|
|
81
|
-
var safeWindowOpen = (url, target, features) => {
|
|
82
|
-
if (isBrowser()) {
|
|
83
|
-
window.open(url, target, features);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var safeQuerySelector = (selector) => {
|
|
87
|
-
if (typeof document !== "undefined") {
|
|
88
|
-
return document.querySelector(selector);
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
91
|
-
};
|
|
92
|
-
var hasNavigator = () => {
|
|
93
|
-
return typeof navigator !== "undefined";
|
|
94
|
-
};
|
|
95
|
-
var isOnline = () => {
|
|
96
|
-
return hasNavigator() && navigator.onLine;
|
|
97
|
-
};
|
|
98
|
-
var copyToClipboard = async (text) => {
|
|
99
|
-
try {
|
|
100
|
-
if (hasNavigator() && navigator.clipboard) {
|
|
101
|
-
await navigator.clipboard.writeText(text);
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
return false;
|
|
105
|
-
} catch (error) {
|
|
106
|
-
console.warn("Error copying to clipboard:", error);
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
var TOKEN_LOGOS = {
|
|
111
|
-
VET: "https://cryptologos.cc/logos/vechain-vet-logo.png",
|
|
112
|
-
VTHO: "https://s2.coinmarketcap.com/static/img/coins/64x64/3012.png",
|
|
113
|
-
B3TR: "https://vechain.github.io/token-registry/assets/3d55edb42b09a634f7f2f26756a02571de901a5b.png",
|
|
114
|
-
VOT3: "https://vechain.github.io/token-registry/assets/17ff70aa1d898bc97ad690dbfad1a3b5643f7e0b.png",
|
|
115
|
-
veDelegate: "https://vechain.github.io/token-registry/assets/1c641b86096d56bf13d49f38388accd6db8b8b2e.png",
|
|
116
|
-
USDGLO: "https://raw.githubusercontent.com/vechain/app-hub/439fba60c80ba2521d435981102d88c4aec050d6/apps/org.glodollar.app/logo.png"
|
|
117
|
-
};
|
|
118
|
-
var TOKEN_LOGO_COMPONENTS = {
|
|
119
|
-
VET: /* @__PURE__ */ jsx(VETLogo, {}),
|
|
120
|
-
VTHO: /* @__PURE__ */ jsx(VTHOLogo, {}),
|
|
121
|
-
B3TR: /* @__PURE__ */ jsx(VeBetterIcon, {}),
|
|
122
|
-
VOT3: /* @__PURE__ */ jsx(VOT3Logo, {})
|
|
123
|
-
};
|
|
124
|
-
var VECHAIN_PRIVY_APP_ID = "cm4wxxujb022fyujl7g0thb21";
|
|
125
|
-
var notFoundImage = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Image-not-found.png";
|
|
126
|
-
var TogglePassportCheck = /* @__PURE__ */ ((TogglePassportCheck2) => {
|
|
127
|
-
TogglePassportCheck2[TogglePassportCheck2["WhitelistCheck"] = 1] = "WhitelistCheck";
|
|
128
|
-
TogglePassportCheck2[TogglePassportCheck2["BlacklistCheck"] = 2] = "BlacklistCheck";
|
|
129
|
-
TogglePassportCheck2[TogglePassportCheck2["SignalingCheck"] = 3] = "SignalingCheck";
|
|
130
|
-
TogglePassportCheck2[TogglePassportCheck2["ParticipationScoreCheck"] = 4] = "ParticipationScoreCheck";
|
|
131
|
-
TogglePassportCheck2[TogglePassportCheck2["GmOwnershipCheck"] = 5] = "GmOwnershipCheck";
|
|
132
|
-
return TogglePassportCheck2;
|
|
133
|
-
})(TogglePassportCheck || {});
|
|
134
|
-
var VECHAIN_KIT_STORAGE_KEYS = {
|
|
135
|
-
NETWORK: "vechain-kit:network"
|
|
136
|
-
};
|
|
137
|
-
var getENV = () => {
|
|
138
|
-
if (typeof window === "undefined") {
|
|
139
|
-
return {
|
|
140
|
-
isDevelopment: false,
|
|
141
|
-
isProduction: true
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
const network = getLocalStorageItem(VECHAIN_KIT_STORAGE_KEYS.NETWORK);
|
|
145
|
-
return {
|
|
146
|
-
isDevelopment: network === "test",
|
|
147
|
-
isProduction: network === "main"
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
var ENV = {
|
|
151
|
-
get isDevelopment() {
|
|
152
|
-
return getENV().isDevelopment;
|
|
153
|
-
},
|
|
154
|
-
get isProduction() {
|
|
155
|
-
return getENV().isProduction;
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
var VECHAIN_KIT_MIXPANEL_TOKENS = {
|
|
159
|
-
development: "e9627dff3f9ac07c28c28615fa86b181",
|
|
160
|
-
production: "2c9e0d4c8a37e9f31e3d59361f48b0dc"
|
|
161
|
-
};
|
|
162
|
-
var getVECHAIN_KIT_MIXPANEL_PROJECT_TOKEN = () => {
|
|
163
|
-
const env = getENV();
|
|
164
|
-
return env.isProduction ? VECHAIN_KIT_MIXPANEL_TOKENS.production : VECHAIN_KIT_MIXPANEL_TOKENS.development;
|
|
165
|
-
};
|
|
166
|
-
var VECHAIN_KIT_MIXPANEL_PROJECT_TOKEN = VECHAIN_KIT_MIXPANEL_TOKENS.development;
|
|
167
|
-
var VECHAIN_KIT_MIXPANEL_PROJECT_NAME = "vechain-kit";
|
|
168
|
-
var DEFAULT_PRIVY_ECOSYSTEM_APPS = [
|
|
169
|
-
{
|
|
170
|
-
id: "clz41gcg00e4ay75dmq3uzzgr",
|
|
171
|
-
name: "Cleanify",
|
|
172
|
-
website: "https://app.cleanify.vet"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
id: "cm153hrup0817axti38avlfyg",
|
|
176
|
-
name: "GreenCart",
|
|
177
|
-
website: "https://greencart.ai"
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
id: "clv9sfos20j6x1431ga80d95f",
|
|
181
|
-
name: "Mughsot",
|
|
182
|
-
website: "https://mugshot.vet/"
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
id: "cm4l8tiai070i108zo17oieyc",
|
|
186
|
-
name: "EVearn",
|
|
187
|
-
website: "https://evearn.io"
|
|
188
|
-
}
|
|
189
|
-
];
|
|
190
|
-
var VECHAIN_KIT_TERMS_CONFIG = {
|
|
191
|
-
url: "https://vechainkit.vechain.org/terms",
|
|
192
|
-
version: 1,
|
|
193
|
-
required: true,
|
|
194
|
-
displayName: "Vechain Kit Terms"
|
|
195
|
-
};
|
|
196
|
-
var VECHAIN_KIT_COOKIES_CONFIG = {
|
|
197
|
-
url: "https://vechainkit.vechain.org/cookies",
|
|
198
|
-
version: 1,
|
|
199
|
-
required: false,
|
|
200
|
-
displayName: "Vechain Kit Cookies"
|
|
201
|
-
};
|
|
202
|
-
var humanAddress = (address, charAtStart = 6, charAtEnd = 4) => `${address.slice(0, charAtStart)}\u2022\u2022\u2022${address.slice(-charAtEnd)}`;
|
|
203
|
-
var humanDomain = (domain, lengthBefore = 8, lengthAfter = 6) => {
|
|
204
|
-
if (domain.length <= lengthBefore + lengthAfter) return domain;
|
|
205
|
-
const before = domain.substring(0, lengthBefore);
|
|
206
|
-
const after = domain.substring(domain.length - lengthAfter);
|
|
207
|
-
return `${before}\u2022\u2022\u2022${after}`;
|
|
208
|
-
};
|
|
209
|
-
var humanNumber = (formattedValue, originalValue, symbol = null) => {
|
|
210
|
-
const suffix = symbol ? " " + symbol : "";
|
|
211
|
-
originalValue = originalValue || formattedValue;
|
|
212
|
-
const formatter = new Intl.NumberFormat("en-US", {
|
|
213
|
-
style: "decimal",
|
|
214
|
-
minimumFractionDigits: Number.parseFloat(formattedValue.toString()) % 1 === 0 ? 0 : 2
|
|
215
|
-
});
|
|
216
|
-
let value = formatter.format(
|
|
217
|
-
roundDownSignificantDigits(Number(formattedValue), 2)
|
|
218
|
-
);
|
|
219
|
-
if (!isZero(originalValue) && isZero(value)) {
|
|
220
|
-
value = "< 0.01";
|
|
221
|
-
}
|
|
222
|
-
return value + suffix;
|
|
223
|
-
};
|
|
224
|
-
var isZero = (value) => {
|
|
225
|
-
if (!value && value !== 0) return false;
|
|
226
|
-
return new BigNumber(value).isZero();
|
|
227
|
-
};
|
|
228
|
-
var getPicassoImage = (address, base64 = false) => {
|
|
229
|
-
const image = picasso(address.toLowerCase());
|
|
230
|
-
if (base64) {
|
|
231
|
-
const base64data = Buffer.from(image, "utf8").toString("base64");
|
|
232
|
-
return `data:image/svg+xml;base64,${base64data}`;
|
|
233
|
-
}
|
|
234
|
-
return `data:image/svg+xml;utf8,${image}`;
|
|
235
|
-
};
|
|
236
|
-
function roundDownSignificantDigits(numbers, decimals = 0) {
|
|
237
|
-
if (typeof numbers !== "number" || typeof decimals !== "number") {
|
|
238
|
-
throw new Error(
|
|
239
|
-
"Invalid input: number and decimals must be of type number"
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
const significantDigits = parseInt(
|
|
243
|
-
numbers.toExponential().split("e-")[1] || "0",
|
|
244
|
-
10
|
|
245
|
-
);
|
|
246
|
-
const effectiveDecimals = Math.max(0, decimals + significantDigits);
|
|
247
|
-
const scaleFactor = Math.pow(10, effectiveDecimals);
|
|
248
|
-
return Math.floor(numbers * scaleFactor) / scaleFactor;
|
|
249
|
-
}
|
|
250
|
-
var randomTransactionUser = (() => {
|
|
251
|
-
const privateKey = generatePrivateKey();
|
|
252
|
-
const account = privateKeyToAccount(privateKey);
|
|
253
|
-
return {
|
|
254
|
-
privateKey,
|
|
255
|
-
account,
|
|
256
|
-
address: account.address
|
|
257
|
-
};
|
|
258
|
-
})();
|
|
259
|
-
var PREFIX = "0x";
|
|
260
|
-
var PREFIX_REGEX = /^0[xX]/;
|
|
261
|
-
var HEX_REGEX = /^(0[xX])?[a-fA-F0-9]+$/;
|
|
262
|
-
var removePrefix = (hex) => {
|
|
263
|
-
validate(hex);
|
|
264
|
-
return hex.replace(PREFIX_REGEX, "");
|
|
265
|
-
};
|
|
266
|
-
var addPrefix = (hex) => {
|
|
267
|
-
validate(hex);
|
|
268
|
-
return PREFIX_REGEX.test(hex) ? hex.replace(PREFIX_REGEX, PREFIX) : `${PREFIX}${hex}`;
|
|
269
|
-
};
|
|
270
|
-
var validate = (hex) => {
|
|
271
|
-
if (!isValid(hex)) throw Error("Provided hex value is not valid");
|
|
272
|
-
};
|
|
273
|
-
var isValid = (hex) => {
|
|
274
|
-
return !!hex && HEX_REGEX.test(hex);
|
|
275
|
-
};
|
|
276
|
-
var isInvalid = (hex) => {
|
|
277
|
-
return !isValid(hex);
|
|
278
|
-
};
|
|
279
|
-
var normalize = (hex) => {
|
|
280
|
-
return addPrefix(hex.toLowerCase().trim());
|
|
281
|
-
};
|
|
282
|
-
var compare = (hex1, hex2) => {
|
|
283
|
-
try {
|
|
284
|
-
return removePrefix(hex1).toLowerCase() === removePrefix(hex2).toLowerCase();
|
|
285
|
-
} catch (e) {
|
|
286
|
-
return false;
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
var generateRandom = (size) => {
|
|
290
|
-
if (size < 1) throw Error("Size must be > 0");
|
|
291
|
-
const randBuffer = crypto.randomBytes(Math.ceil(size / 2));
|
|
292
|
-
if (!randBuffer) throw Error("Failed to generate random hex");
|
|
293
|
-
return `${PREFIX}${randBuffer.toString("hex").substring(0, size)}`;
|
|
294
|
-
};
|
|
295
|
-
var compareAddresses = (address1, address2) => {
|
|
296
|
-
if (!address1 || !address2) return false;
|
|
297
|
-
if (address2 === address1) {
|
|
298
|
-
return true;
|
|
299
|
-
}
|
|
300
|
-
try {
|
|
301
|
-
return normalize(address1) === normalize(address2);
|
|
302
|
-
} catch (e) {
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
var compareListOfAddresses = (add1, add2) => {
|
|
307
|
-
if (add1.length !== add2.length) return false;
|
|
308
|
-
const sortedAdd1 = [...add1].map((e) => e.toLowerCase()).sort((a, b) => a.localeCompare(b));
|
|
309
|
-
const sortedAdd2 = [...add2].map((e) => e.toLowerCase()).sort((a, b) => a.localeCompare(b));
|
|
310
|
-
for (let i = 0; i < sortedAdd1.length; i++) {
|
|
311
|
-
if (!compareAddresses(sortedAdd1[i], sortedAdd2[i])) return false;
|
|
312
|
-
}
|
|
313
|
-
return true;
|
|
314
|
-
};
|
|
315
|
-
var regexPattern = () => {
|
|
316
|
-
return /^0x[a-fA-F0-9]{40}$/;
|
|
317
|
-
};
|
|
318
|
-
var isValidAddress = Address.isValid;
|
|
319
|
-
var leftPadWithZeros = (str, length) => {
|
|
320
|
-
const cleanStr = str.startsWith("0x") ? str.slice(2) : str;
|
|
321
|
-
if (cleanStr.length > length) {
|
|
322
|
-
throw new Error("Input string is longer than the specified length");
|
|
323
|
-
}
|
|
324
|
-
const paddedStr = cleanStr.padStart(length, "0");
|
|
325
|
-
return `0x${paddedStr}`;
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
// src/config/solo.ts
|
|
329
|
-
var config = {
|
|
330
|
-
ipfsFetchingService: "https://api.dev.gateway-proxy.vechain.org/ipfs",
|
|
331
|
-
ipfsPinningService: "https://api.dev.gateway-proxy.vechain.org/api/v1/pinning/pinFileToIPFS",
|
|
332
|
-
vthoContractAddress: "0x0000000000000000000000000000456E65726779",
|
|
333
|
-
b3trContractAddress: "0xd31A6f2DBa8785cE41AB68Ea192791B5175309F4",
|
|
334
|
-
vot3ContractAddress: "0x028Af33230576c1e073C8245F72a7A4aa53564E4",
|
|
335
|
-
b3trGovernorAddress: "0x36E0e9b46D56dF12Dd69fD560e41954C73cE9ded",
|
|
336
|
-
timelockContractAddress: "0x125389845c93Efcf6471BA8BE1AC19c11e128603",
|
|
337
|
-
xAllocationPoolContractAddress: "0xC8232c91E2f744E533322B99F95f809b9f7ec446",
|
|
338
|
-
xAllocationVotingContractAddress: "0x074F093f4C534a16cDD09cb4b2669713218A762a",
|
|
339
|
-
emissionsContractAddress: "0x6a084E85f38400790043788FcCee39595616aa3A",
|
|
340
|
-
voterRewardsContractAddress: "0xbAb852081C459c0060960287aDcf9a0C2c1dc4b8",
|
|
341
|
-
galaxyMemberContractAddress: "0xbdA1cff75d2D43AB9186Ada41fECF79e25c49Ba3",
|
|
342
|
-
treasuryContractAddress: "0xe9414513Fe0e3b9bf7a61eC5c1AC7Df943fB3e77",
|
|
343
|
-
x2EarnAppsContractAddress: "0x432C46476f4970575C43B19588A170D237dC4929",
|
|
344
|
-
x2EarnRewardsPoolContractAddress: "0x134E4Fce6761f660401808CF86aE0e62cE52a81E",
|
|
345
|
-
nodeManagementContractAddress: "0xa96B5057171D797298A71178b48449A7bC615D8E",
|
|
346
|
-
veBetterPassportContractAddress: "0x8db6D14452fE36ba86C341AfEFaC0f90A0Db2bcb",
|
|
347
|
-
x2EarnCreatorContractAddress: "0x4e5f7eb452e9ecd75c0B29e3540014cBe01bBF52",
|
|
348
|
-
veDelegate: "0xfc32a9895C78CE00A1047d602Bd81Ea8134CC32b",
|
|
349
|
-
veDelegateVotes: "0xeb71148c9B3cd57e228c2152d79f6e78F5F1ef9a",
|
|
350
|
-
veDelegateTokenContractAddress: "0xD3f7b82Df5705D34f64C634d2dEf6B1cB3116950",
|
|
351
|
-
oracleContractAddress: "0x49eC7192BF804Abc289645ca86F1eD01a6C17713",
|
|
352
|
-
accountFactoryAddress: "0xC06Ad8573022e2BE416CA89DA47E8c592971679A",
|
|
353
|
-
cleanifyCampaignsContractAddress: "0x7a11D63338576aE8c038868433ea199d7E5319A6",
|
|
354
|
-
cleanifyChallengesContractAddress: "0xa58681692AdDD2e8E37f9113D40Bb9253C03F65e",
|
|
355
|
-
veWorldSubdomainClaimerContractAddress: "0x0000000000000000000000000000000000000000",
|
|
356
|
-
vetDomainsContractAddress: "0x0000000000000000000000000000000000000000",
|
|
357
|
-
vetDomainsPublicResolverAddress: "0x0000000000000000000000000000000000000000",
|
|
358
|
-
vetDomainsReverseRegistrarAddress: "0x5c970901a587BA3932C835D4ae5FAE2BEa7e78Bc",
|
|
359
|
-
vnsResolverAddress: "0x0000000000000000000000000000000000000000",
|
|
360
|
-
gloDollarContractAddress: "0x0000000000000000000000000000000000000000",
|
|
361
|
-
vetDomainAvatarUrl: "https://testnet.vet.domains/api/avatar",
|
|
362
|
-
indexerUrl: "https://b3tr.testnet.vechain.org/api/v1",
|
|
363
|
-
b3trIndexerUrl: "https://b3tr.testnet.vechain.org/api/v1",
|
|
364
|
-
graphQlIndexerUrl: "https://graph.vet/subgraphs/name/vns",
|
|
365
|
-
nodeUrl: "http://localhost:8669",
|
|
366
|
-
network: {
|
|
367
|
-
id: "solo",
|
|
368
|
-
name: "solo",
|
|
369
|
-
type: "solo",
|
|
370
|
-
defaultNet: true,
|
|
371
|
-
urls: ["http://localhost:8669"],
|
|
372
|
-
explorerUrl: "https://explore-testnet.vechain.org",
|
|
373
|
-
blockTime: 1e4,
|
|
374
|
-
genesis: {
|
|
375
|
-
number: 0,
|
|
376
|
-
id: "0x00000000c05a20fbca2bf6ae3affba6af4a74b800b585bf7a4988aba7aea69f6",
|
|
377
|
-
size: 170,
|
|
378
|
-
parentID: "0xffffffff53616c757465202620526573706563742c20457468657265756d2100",
|
|
379
|
-
timestamp: 1530316800,
|
|
380
|
-
gasLimit: 1e7,
|
|
381
|
-
beneficiary: "0x0000000000000000000000000000000000000000",
|
|
382
|
-
gasUsed: 0,
|
|
383
|
-
totalScore: 0,
|
|
384
|
-
txsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
|
385
|
-
txsFeatures: 0,
|
|
386
|
-
stateRoot: "0x93de0ffb1f33bc0af053abc2a87c4af44594f5dcb1cb879dd823686a15d68550",
|
|
387
|
-
receiptsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
|
388
|
-
signer: "0x0000000000000000000000000000000000000000",
|
|
389
|
-
isTrunk: true,
|
|
390
|
-
transactions: []
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
explorerUrl: "https://explore-testnet.vechain.org"
|
|
394
|
-
};
|
|
395
|
-
var solo_default = config;
|
|
396
|
-
|
|
397
|
-
// src/config/testnet.ts
|
|
398
|
-
var config2 = {
|
|
399
|
-
ipfsFetchingService: "https://api.dev.gateway-proxy.vechain.org/ipfs",
|
|
400
|
-
ipfsPinningService: "https://api.dev.gateway-proxy.vechain.org/api/v1/pinning/pinFileToIPFS",
|
|
401
|
-
vthoContractAddress: "0x0000000000000000000000000000456E65726779",
|
|
402
|
-
b3trContractAddress: "0xbf64cf86894Ee0877C4e7d03936e35Ee8D8b864F",
|
|
403
|
-
vot3ContractAddress: "0xa704c45971995467696EE9544Da77DD42Bc9706E",
|
|
404
|
-
b3trGovernorAddress: "0xDF5E114D391CAC840529802fe8D01f6bdeBE41eC",
|
|
405
|
-
timelockContractAddress: "0x30ee94F303643902a68aD8A7A6456cA69d763192",
|
|
406
|
-
xAllocationPoolContractAddress: "0x9B9CA9D0C41Add1d204f90BA0E9a6844f1843A84",
|
|
407
|
-
xAllocationVotingContractAddress: "0x5859ff910d8b0c127364c98E24233b0af7443c1c",
|
|
408
|
-
emissionsContractAddress: "0x3D7616213191a10460e49CfdB7edBf88D6a10942",
|
|
409
|
-
voterRewardsContractAddress: "0x2E47fc4aabB3403037fB5E1f38995E7a91Ce8Ed2",
|
|
410
|
-
galaxyMemberContractAddress: "0xa9aC49C030c1148b95F056E86f2531f8F3d5bf27",
|
|
411
|
-
x2EarnCreatorContractAddress: "",
|
|
412
|
-
nodeManagementContractAddress: "",
|
|
413
|
-
x2EarnAppsContractAddress: "0xcB23Eb1bBD5c07553795b9538b1061D0f4ABA153",
|
|
414
|
-
treasuryContractAddress: "0x039893EBe092A2D22B08E2b029735D211bfF7F50",
|
|
415
|
-
x2EarnRewardsPoolContractAddress: "0x5F8f86B8D0Fa93cdaE20936d150175dF0205fB38",
|
|
416
|
-
veBetterPassportContractAddress: "0x63c061a2753e84635a22ff05954e1687f104f002",
|
|
417
|
-
veDelegate: "0xfc32a9895C78CE00A1047d602Bd81Ea8134CC32b",
|
|
418
|
-
veDelegateVotes: "0xeb71148c9B3cd57e228c2152d79f6e78F5F1ef9a",
|
|
419
|
-
veDelegateTokenContractAddress: "0xD3f7b82Df5705D34f64C634d2dEf6B1cB3116950",
|
|
420
|
-
oracleContractAddress: "0xdcCAaBd81B38e0dEEf4c202bC7F1261A4D9192C6",
|
|
421
|
-
accountFactoryAddress: "0x713b908Bcf77f3E00EFEf328E50b657a1A23AeaF",
|
|
422
|
-
cleanifyCampaignsContractAddress: "0x22d19ACBD2cBf6b2B6C546395c26B9Cb448248BF",
|
|
423
|
-
cleanifyChallengesContractAddress: "0x8Cc885DC3e5c376632CCEA0e8e1a51F1B3572442",
|
|
424
|
-
veWorldSubdomainClaimerContractAddress: "0xe5af50e7ad1aaab4fbe4efbb2b30f764013918b3",
|
|
425
|
-
vetDomainsContractAddress: "0xcBFB30c1F267914816668d53AcBA7bA7c9806D13",
|
|
426
|
-
vetDomainsPublicResolverAddress: "0xA6eFd130085a127D090ACb0b100294aD1079EA6f",
|
|
427
|
-
vetDomainsReverseRegistrarAddress: "0x6878f1aD5e3015310CfE5B38d7B7071C5D8818Ca",
|
|
428
|
-
vnsResolverAddress: "0xc403b8EA53F707d7d4de095f0A20bC491Cf2bc94",
|
|
429
|
-
gloDollarContractAddress: "0x0000000000000000000000000000000000000000",
|
|
430
|
-
vetDomainAvatarUrl: "https://testnet.vet.domains/api/avatar",
|
|
431
|
-
indexerUrl: "https://indexer.testnet.vechain.org/api/v1",
|
|
432
|
-
b3trIndexerUrl: "https://b3tr.testnet.vechain.org/api/v1",
|
|
433
|
-
graphQlIndexerUrl: "https://graph.vet/subgraphs/name/vns",
|
|
434
|
-
nodeUrl: "https://testnet.vechain.org",
|
|
435
|
-
network: {
|
|
436
|
-
id: "testnet",
|
|
437
|
-
name: "testnet",
|
|
438
|
-
type: "test",
|
|
439
|
-
defaultNet: true,
|
|
440
|
-
urls: [
|
|
441
|
-
"https://testnet.vechain.org",
|
|
442
|
-
"https://vethor-node-test.vechaindev.com",
|
|
443
|
-
"https://sync-testnet.veblocks.net",
|
|
444
|
-
"https://testnet.vecha.in"
|
|
445
|
-
],
|
|
446
|
-
explorerUrl: "https://insight.vecha.in/#/test",
|
|
447
|
-
blockTime: 1e4,
|
|
448
|
-
genesis: {
|
|
449
|
-
number: 0,
|
|
450
|
-
id: "0x000000000b2bce3c70bc649a02749e8687721b09ed2e15997f466536b20bb127",
|
|
451
|
-
size: 170,
|
|
452
|
-
parentID: "0xffffffff00000000000000000000000000000000000000000000000000000000",
|
|
453
|
-
timestamp: 1530014400,
|
|
454
|
-
gasLimit: 1e7,
|
|
455
|
-
beneficiary: "0x0000000000000000000000000000000000000000",
|
|
456
|
-
gasUsed: 0,
|
|
457
|
-
totalScore: 0,
|
|
458
|
-
txsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
|
459
|
-
txsFeatures: 0,
|
|
460
|
-
stateRoot: "0x4ec3af0acbad1ae467ad569337d2fe8576fe303928d35b8cdd91de47e9ac84bb",
|
|
461
|
-
receiptsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
|
462
|
-
signer: "0x0000000000000000000000000000000000000000",
|
|
463
|
-
isTrunk: true,
|
|
464
|
-
transactions: []
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
explorerUrl: "https://explore-testnet.vechain.org/transactions"
|
|
468
|
-
};
|
|
469
|
-
var testnet_default = config2;
|
|
470
|
-
|
|
471
|
-
// src/config/mainnet.ts
|
|
472
|
-
var config3 = {
|
|
473
|
-
ipfsFetchingService: "https://api.gateway-proxy.vechain.org/ipfs",
|
|
474
|
-
indexerUrl: "https://indexer.mainnet.vechain.org/api/v1",
|
|
475
|
-
ipfsPinningService: "https://api.gateway-proxy.vechain.org/api/v1/pinning/pinFileToIPFS",
|
|
476
|
-
b3trIndexerUrl: "https://b3tr.mainnet.vechain.org/api/v1",
|
|
477
|
-
graphQlIndexerUrl: "https://graph.vet/subgraphs/name/vns",
|
|
478
|
-
nodeUrl: "https://mainnet.vechain.org",
|
|
479
|
-
network: {
|
|
480
|
-
id: "main",
|
|
481
|
-
name: "main",
|
|
482
|
-
type: "main",
|
|
483
|
-
defaultNet: true,
|
|
484
|
-
urls: [
|
|
485
|
-
"https://mainnet.vechain.org",
|
|
486
|
-
"https://vethor-node.vechain.com",
|
|
487
|
-
"https://mainnet.veblocks.net",
|
|
488
|
-
"https://mainnet.vecha.in"
|
|
489
|
-
],
|
|
490
|
-
explorerUrl: "https://vechainstats.com",
|
|
491
|
-
blockTime: 1e4,
|
|
492
|
-
genesis: {
|
|
493
|
-
number: 0,
|
|
494
|
-
id: "0x00000000851caf3cfdb6e899cf5958bfb1ac3413d346d43539627e6be7ec1b4a",
|
|
495
|
-
size: 170,
|
|
496
|
-
parentID: "0xffffffff53616c757465202620526573706563742c20457468657265756d2100",
|
|
497
|
-
timestamp: 1530316800,
|
|
498
|
-
gasLimit: 1e7,
|
|
499
|
-
beneficiary: "0x0000000000000000000000000000000000000000",
|
|
500
|
-
gasUsed: 0,
|
|
501
|
-
totalScore: 0,
|
|
502
|
-
txsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
|
503
|
-
txsFeatures: 0,
|
|
504
|
-
stateRoot: "0x09bfdf9e24dd5cd5b63f3c1b5d58b97ff02ca0490214a021ed7d99b93867839c",
|
|
505
|
-
receiptsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
|
506
|
-
signer: "0x0000000000000000000000000000000000000000",
|
|
507
|
-
isTrunk: true,
|
|
508
|
-
transactions: []
|
|
509
|
-
}
|
|
510
|
-
},
|
|
511
|
-
explorerUrl: "https://vechainstats.com/transaction",
|
|
512
|
-
// general
|
|
513
|
-
vthoContractAddress: "0x0000000000000000000000000000456E65726779",
|
|
514
|
-
//VeBetterDAO
|
|
515
|
-
b3trContractAddress: "0x5ef79995FE8a89e0812330E4378eB2660ceDe699",
|
|
516
|
-
vot3ContractAddress: "0x76Ca782B59C74d088C7D2Cce2f211BC00836c602",
|
|
517
|
-
b3trGovernorAddress: "0x1c65C25fABe2fc1bCb82f253fA0C916a322f777C",
|
|
518
|
-
timelockContractAddress: "0x7B7EaF620d88E38782c6491D7Ce0B8D8cF3227e4",
|
|
519
|
-
xAllocationPoolContractAddress: "0x4191776F05f4bE4848d3f4d587345078B439C7d3",
|
|
520
|
-
xAllocationVotingContractAddress: "0x89A00Bb0947a30FF95BEeF77a66AEdE3842Fe5B7",
|
|
521
|
-
emissionsContractAddress: "0xDf94739bd169C84fe6478D8420Bb807F1f47b135",
|
|
522
|
-
voterRewardsContractAddress: "0x838A33AF756a6366f93e201423E1425f67eC0Fa7",
|
|
523
|
-
galaxyMemberContractAddress: "0x93B8cD34A7Fc4f53271b9011161F7A2B5fEA9D1F",
|
|
524
|
-
treasuryContractAddress: "0xD5903BCc66e439c753e525F8AF2FeC7be2429593",
|
|
525
|
-
x2EarnAppsContractAddress: "0x8392B7CCc763dB03b47afcD8E8f5e24F9cf0554D",
|
|
526
|
-
x2EarnRewardsPoolContractAddress: "0x6Bee7DDab6c99d5B2Af0554EaEA484CE18F52631",
|
|
527
|
-
x2EarnCreatorContractAddress: "0xe8e96a768ffd00417d4bd985bec9EcfC6F732a7f",
|
|
528
|
-
nodeManagementContractAddress: "0xB0EF9D89C6b49CbA6BBF86Bf2FDf0Eee4968c6AB",
|
|
529
|
-
veBetterPassportContractAddress: "0x35a267671d8EDD607B2056A9a13E7ba7CF53c8b3",
|
|
530
|
-
//veDelegate
|
|
531
|
-
veDelegate: "0xfc32a9895C78CE00A1047d602Bd81Ea8134CC32b",
|
|
532
|
-
veDelegateVotes: "0xeb71148c9B3cd57e228c2152d79f6e78F5F1ef9a",
|
|
533
|
-
veDelegateTokenContractAddress: "0xD3f7b82Df5705D34f64C634d2dEf6B1cB3116950",
|
|
534
|
-
//utility
|
|
535
|
-
oracleContractAddress: "0x49eC7192BF804Abc289645ca86F1eD01a6C17713",
|
|
536
|
-
accountFactoryAddress: "0xC06Ad8573022e2BE416CA89DA47E8c592971679A",
|
|
537
|
-
//cleanify
|
|
538
|
-
cleanifyCampaignsContractAddress: "0x7a11D63338576aE8c038868433ea199d7E5319A6",
|
|
539
|
-
cleanifyChallengesContractAddress: "0xa58681692AdDD2e8E37f9113D40Bb9253C03F65e",
|
|
540
|
-
veWorldSubdomainClaimerContractAddress: "0xa4173c32fe8a61a8fd0d0234675b559fc360446a",
|
|
541
|
-
vetDomainsContractAddress: "0xa9231da8BF8D10e2df3f6E03Dd5449caD600129b",
|
|
542
|
-
vetDomainsPublicResolverAddress: "0xabac49445584C8b6c1472b030B1076Ac3901D7cf",
|
|
543
|
-
vetDomainsReverseRegistrarAddress: "0x5c970901a587BA3932C835D4ae5FAE2BEa7e78Bc",
|
|
544
|
-
vnsResolverAddress: "0xA11413086e163e41901bb81fdc5617c975Fa5a1A",
|
|
545
|
-
vetDomainAvatarUrl: "https://vet.domains/api/avatar",
|
|
546
|
-
gloDollarContractAddress: "0x29c630cce4ddb23900f5fe66ab55e488c15b9f5e"
|
|
547
|
-
};
|
|
548
|
-
var mainnet_default = config3;
|
|
549
|
-
|
|
550
|
-
// src/config/index.ts
|
|
551
|
-
var getConfig = (env) => {
|
|
552
|
-
if (env === "solo") return solo_default;
|
|
553
|
-
if (env === "test") return testnet_default;
|
|
554
|
-
if (env === "main") return mainnet_default;
|
|
555
|
-
throw new Error(`Unsupported NETWORK_TYPE ${env}`);
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
// src/utils/ipfs.ts
|
|
559
|
-
var validateIpfsUri = (uri) => {
|
|
560
|
-
const trimmedUri = uri.trim();
|
|
561
|
-
return /^ipfs:\/\/[a-zA-Z0-9]+(\/[^/]+)*\/?$/.test(trimmedUri);
|
|
562
|
-
};
|
|
563
|
-
function toIPFSURL(cid, fileName) {
|
|
564
|
-
return `ipfs://${cid}/${fileName ?? ""}`;
|
|
565
|
-
}
|
|
566
|
-
async function uploadBlobToIPFS(blob, filename, networkType) {
|
|
567
|
-
try {
|
|
568
|
-
const form = new FormData();
|
|
569
|
-
form.append("file", blob, filename);
|
|
570
|
-
const response = await fetch(
|
|
571
|
-
getConfig(networkType).ipfsPinningService,
|
|
572
|
-
{
|
|
573
|
-
method: "POST",
|
|
574
|
-
headers: {
|
|
575
|
-
"X-Project-Id": "vechain-kit"
|
|
576
|
-
},
|
|
577
|
-
body: form
|
|
578
|
-
}
|
|
579
|
-
);
|
|
580
|
-
if (!response.ok) {
|
|
581
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
582
|
-
}
|
|
583
|
-
const data = await response.json();
|
|
584
|
-
return data.IpfsHash;
|
|
585
|
-
} catch (error) {
|
|
586
|
-
console.error("Error uploading blob:", error);
|
|
587
|
-
throw new Error("Failed to upload blob to IPFS");
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
// src/types/types.ts
|
|
592
|
-
var NFTMediaType = /* @__PURE__ */ ((NFTMediaType2) => {
|
|
593
|
-
NFTMediaType2["IMAGE"] = "image";
|
|
594
|
-
NFTMediaType2["VIDEO"] = "video";
|
|
595
|
-
NFTMediaType2["UNKNOWN"] = "unknown";
|
|
596
|
-
NFTMediaType2["TEXT"] = "text";
|
|
597
|
-
return NFTMediaType2;
|
|
598
|
-
})(NFTMediaType || {});
|
|
599
|
-
var VePassportUserStatus = /* @__PURE__ */ ((VePassportUserStatus2) => {
|
|
600
|
-
VePassportUserStatus2["NONE"] = "NONE";
|
|
601
|
-
VePassportUserStatus2["WHITELIST"] = "WHITELIST";
|
|
602
|
-
VePassportUserStatus2["BLACKLIST"] = "BLACKLIST";
|
|
603
|
-
return VePassportUserStatus2;
|
|
604
|
-
})(VePassportUserStatus || {});
|
|
605
|
-
var CURRENCY_SYMBOLS = {
|
|
606
|
-
usd: "$",
|
|
607
|
-
gbp: "\xA3",
|
|
608
|
-
eur: "\u20AC"
|
|
609
|
-
};
|
|
610
|
-
|
|
611
|
-
// src/types/ensTextRecords.ts
|
|
612
|
-
var ENS_TEXT_RECORDS = [
|
|
613
|
-
"display",
|
|
614
|
-
"avatar",
|
|
615
|
-
"description",
|
|
616
|
-
"keywords",
|
|
617
|
-
"email",
|
|
618
|
-
"url",
|
|
619
|
-
"header",
|
|
620
|
-
"notice",
|
|
621
|
-
"location",
|
|
622
|
-
"phone",
|
|
623
|
-
"com.x"
|
|
624
|
-
];
|
|
625
|
-
|
|
626
|
-
// src/types/index.ts
|
|
627
|
-
var LegalDocumentType = /* @__PURE__ */ ((LegalDocumentType2) => {
|
|
628
|
-
LegalDocumentType2["TERMS"] = "terms";
|
|
629
|
-
LegalDocumentType2["PRIVACY"] = "privacy";
|
|
630
|
-
LegalDocumentType2["COOKIES"] = "cookies";
|
|
631
|
-
return LegalDocumentType2;
|
|
632
|
-
})(LegalDocumentType || {});
|
|
633
|
-
var LegalDocumentSource = /* @__PURE__ */ ((LegalDocumentSource2) => {
|
|
634
|
-
LegalDocumentSource2["VECHAIN_KIT"] = "vechain-kit";
|
|
635
|
-
LegalDocumentSource2["APPLICATION"] = "application";
|
|
636
|
-
return LegalDocumentSource2;
|
|
637
|
-
})(LegalDocumentSource || {});
|
|
638
|
-
|
|
639
|
-
// src/utils/media.ts
|
|
640
|
-
var isValidMimeType = (mime, type) => {
|
|
641
|
-
const found = type.find((t) => {
|
|
642
|
-
if (mime?.split("/")[0] === t) {
|
|
643
|
-
return true;
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
return !!found;
|
|
647
|
-
};
|
|
648
|
-
var resolveMediaTypeFromMimeType = (mimeType) => {
|
|
649
|
-
if (isValidMimeType(mimeType, ["image" /* IMAGE */])) return "image" /* IMAGE */;
|
|
650
|
-
else if (isValidMimeType(mimeType, ["video" /* VIDEO */])) return "video" /* VIDEO */;
|
|
651
|
-
return "unknown" /* UNKNOWN */;
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
// src/utils/uri.ts
|
|
655
|
-
var convertUriToUrl = (uri, networkType) => {
|
|
656
|
-
if (uri.startsWith("data:")) return uri;
|
|
657
|
-
const splitUri = uri?.split("://");
|
|
658
|
-
if (splitUri.length !== 2) return null;
|
|
659
|
-
const protocol = splitUri?.[0]?.trim();
|
|
660
|
-
const uriWithoutProtocol = splitUri[1];
|
|
661
|
-
switch (protocol) {
|
|
662
|
-
case "ipfs":
|
|
663
|
-
if (!validateIpfsUri(uri))
|
|
664
|
-
throw new Error(`Invalid IPFS URI ${uri}`);
|
|
665
|
-
return `${getConfig(networkType).ipfsFetchingService}/${uriWithoutProtocol}`;
|
|
666
|
-
case "ar":
|
|
667
|
-
return `https://arweave.net/${uriWithoutProtocol}`;
|
|
668
|
-
default:
|
|
669
|
-
return uri;
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
|
|
673
|
-
// src/utils/gmNfts.ts
|
|
674
|
-
var gmNfts = [
|
|
675
|
-
{
|
|
676
|
-
level: "1",
|
|
677
|
-
name: "Earth",
|
|
678
|
-
image: "/images/nft-levels/0.png",
|
|
679
|
-
multiplier: 1,
|
|
680
|
-
b3trToUpgrade: 0
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
level: "2",
|
|
684
|
-
name: "Moon",
|
|
685
|
-
image: "/images/nft-levels/1.png",
|
|
686
|
-
multiplier: 1.1,
|
|
687
|
-
b3trToUpgrade: 1e4
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
level: "3",
|
|
691
|
-
name: "Mercury",
|
|
692
|
-
image: "/images/nft-levels/2.png",
|
|
693
|
-
multiplier: 1.2,
|
|
694
|
-
b3trToUpgrade: 25e3
|
|
695
|
-
},
|
|
696
|
-
{
|
|
697
|
-
level: "4",
|
|
698
|
-
name: "Venus",
|
|
699
|
-
image: "/images/nft-levels/3.png",
|
|
700
|
-
multiplier: 1.5,
|
|
701
|
-
b3trToUpgrade: 5e4
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
level: "5",
|
|
705
|
-
name: "Mars",
|
|
706
|
-
image: "/images/nft-levels/4.png",
|
|
707
|
-
multiplier: 2,
|
|
708
|
-
b3trToUpgrade: 1e5
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
level: "6",
|
|
712
|
-
name: "Jupiter",
|
|
713
|
-
image: "/images/nft-levels/5.png",
|
|
714
|
-
multiplier: 2.5,
|
|
715
|
-
b3trToUpgrade: 25e4
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
level: "7",
|
|
719
|
-
name: "Saturn",
|
|
720
|
-
image: "/images/nft-levels/6.png",
|
|
721
|
-
multiplier: 3,
|
|
722
|
-
b3trToUpgrade: 5e5
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
level: "8",
|
|
726
|
-
name: "Uranus",
|
|
727
|
-
image: "/images/nft-levels/7.png",
|
|
728
|
-
multiplier: 5,
|
|
729
|
-
b3trToUpgrade: 25e5
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
level: "9",
|
|
733
|
-
name: "Neptune",
|
|
734
|
-
image: "/images/nft-levels/8.png",
|
|
735
|
-
multiplier: 10,
|
|
736
|
-
b3trToUpgrade: 5e6
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
level: "10",
|
|
740
|
-
name: "Galaxy",
|
|
741
|
-
image: "/images/nft-levels/9.png",
|
|
742
|
-
multiplier: 25,
|
|
743
|
-
b3trToUpgrade: 25e6
|
|
744
|
-
}
|
|
745
|
-
];
|
|
746
|
-
var xNodeToGMstartingLevel = {
|
|
747
|
-
1: 2,
|
|
748
|
-
2: 4,
|
|
749
|
-
3: 6,
|
|
750
|
-
4: 2,
|
|
751
|
-
5: 4,
|
|
752
|
-
6: 6,
|
|
753
|
-
7: 7
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
// src/utils/buildQueryString.ts
|
|
757
|
-
var buildQueryString = (params) => {
|
|
758
|
-
const searchParams = new URLSearchParams();
|
|
759
|
-
Object.keys(params).forEach((key) => {
|
|
760
|
-
const value = params[key];
|
|
761
|
-
if (value !== void 0 && value !== null) {
|
|
762
|
-
searchParams.append(key, String(value));
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
return searchParams.toString();
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
// src/utils/xNode.ts
|
|
769
|
-
var NodeStrengthLevelToImage = {
|
|
770
|
-
"0": "/images/vnt/00-noNode.webp",
|
|
771
|
-
"1": "/images/vnt/01-strength.webp",
|
|
772
|
-
"2": "/images/vnt/02-thunder.webp",
|
|
773
|
-
"3": "/images/vnt/03-mjolnir.webp",
|
|
774
|
-
"4": "/images/vnt/04-vethorX.webp",
|
|
775
|
-
"5": "/images/vnt/05-strengthX.webp",
|
|
776
|
-
"6": "/images/vnt/06-thunderX.webp",
|
|
777
|
-
"7": "/images/vnt/07-mjolnirX.webp"
|
|
778
|
-
};
|
|
779
|
-
var MinXNodeLevel = 4;
|
|
780
|
-
var EconomicNodeStrengthLevelToName = {
|
|
781
|
-
"1": "Strength",
|
|
782
|
-
"2": "Thunder",
|
|
783
|
-
"3": "Mjolnir"
|
|
784
|
-
};
|
|
785
|
-
var XNodeStrengthLevelToName = {
|
|
786
|
-
"4": "VeThorX",
|
|
787
|
-
"5": "StrengthX",
|
|
788
|
-
"6": "ThunderX",
|
|
789
|
-
"7": "MjolnirX"
|
|
790
|
-
};
|
|
791
|
-
var allNodeStrengthLevelToName = {
|
|
792
|
-
...EconomicNodeStrengthLevelToName,
|
|
793
|
-
...XNodeStrengthLevelToName
|
|
794
|
-
};
|
|
795
|
-
|
|
796
|
-
// src/utils/time.ts
|
|
797
|
-
var TIME = {
|
|
798
|
-
SECOND: 1e3,
|
|
799
|
-
MINUTE: 1e3 * 60,
|
|
800
|
-
HOUR: 1e3 * 60 * 60,
|
|
801
|
-
DAY: 1e3 * 60 * 60 * 24,
|
|
802
|
-
WEEK: 1e3 * 60 * 60 * 24 * 7,
|
|
803
|
-
MONTH: 1e3 * 60 * 60 * 24 * 30,
|
|
804
|
-
YEAR: 1e3 * 60 * 60 * 24 * 365
|
|
805
|
-
};
|
|
806
|
-
|
|
807
|
-
// src/utils/stringUtils.ts
|
|
808
|
-
var isRejectionError = (errorMessage) => {
|
|
809
|
-
if (!errorMessage) return false;
|
|
810
|
-
const rejectionTerms = ["rejected", "cancelled", "user denied", "closed"];
|
|
811
|
-
return rejectionTerms.some(
|
|
812
|
-
(term) => errorMessage.toLowerCase().includes(term.toLowerCase())
|
|
813
|
-
);
|
|
814
|
-
};
|
|
815
|
-
|
|
816
|
-
// src/utils/url.ts
|
|
817
|
-
var isValidUrl = (value) => {
|
|
818
|
-
try {
|
|
819
|
-
new URL(value);
|
|
820
|
-
return true;
|
|
821
|
-
} catch {
|
|
822
|
-
return false;
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
// src/utils/thorUtils.ts
|
|
827
|
-
var executeCallClause = async ({
|
|
828
|
-
thor,
|
|
829
|
-
contractAddress,
|
|
830
|
-
abi,
|
|
831
|
-
method,
|
|
832
|
-
args
|
|
833
|
-
}) => {
|
|
834
|
-
const contract = thor.contracts.load(contractAddress, abi);
|
|
835
|
-
const res = await contract.read[method](...args);
|
|
836
|
-
return res;
|
|
837
|
-
};
|
|
838
|
-
var executeMultipleClausesCall = async ({
|
|
839
|
-
thor,
|
|
840
|
-
calls
|
|
841
|
-
}) => {
|
|
842
|
-
if (!Array.isArray(calls)) throw new Error("calls must be an array");
|
|
843
|
-
const clauses = calls.map(
|
|
844
|
-
(call) => thor.contracts.load(call.address, call.abi).clause[call.functionName](...call.args)
|
|
845
|
-
);
|
|
846
|
-
const res = await thor.transactions.executeMultipleClausesCall(clauses);
|
|
847
|
-
if (!res.every((r) => r.success))
|
|
848
|
-
throw new Error("Failed to execute multiple clauses call");
|
|
849
|
-
return res.map((r) => r.result.plain);
|
|
850
|
-
};
|
|
851
|
-
var buildCallClauses = ({
|
|
852
|
-
thor,
|
|
853
|
-
calls
|
|
854
|
-
}) => {
|
|
855
|
-
if (!Array.isArray(calls)) throw new Error("calls must be an array");
|
|
856
|
-
return calls.map(
|
|
857
|
-
(call) => thor.contracts.load(call.address, call.abi).clause[call.functionName](...call.args)
|
|
858
|
-
);
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
export { CURRENCY_SYMBOLS, DEFAULT_PRIVY_ECOSYSTEM_APPS, ENS_TEXT_RECORDS, ENV, EconomicNodeStrengthLevelToName, LegalDocumentSource, LegalDocumentType, MinXNodeLevel, NFTMediaType, NodeStrengthLevelToImage, TIME, TOKEN_LOGOS, TOKEN_LOGO_COMPONENTS, TogglePassportCheck, VECHAIN_KIT_COOKIES_CONFIG, VECHAIN_KIT_MIXPANEL_PROJECT_NAME, VECHAIN_KIT_MIXPANEL_PROJECT_TOKEN, VECHAIN_KIT_MIXPANEL_TOKENS, VECHAIN_KIT_STORAGE_KEYS, VECHAIN_KIT_TERMS_CONFIG, VECHAIN_PRIVY_APP_ID, VePassportUserStatus, XNodeStrengthLevelToName, addPrefix, allNodeStrengthLevelToName, buildCallClauses, buildQueryString, compare, compareAddresses, compareListOfAddresses, convertUriToUrl, copyToClipboard, executeCallClause, executeMultipleClausesCall, generateRandom, getConfig, getDocumentTitle, getENV, getLocalStorageItem, getPicassoImage, getVECHAIN_KIT_MIXPANEL_PROJECT_TOKEN, getWindowOrigin, gmNfts, hasNavigator, humanAddress, humanDomain, humanNumber, isBrowser, isInvalid, isOnline, isRejectionError, isValid, isValidAddress, isValidUrl, isZero, leftPadWithZeros, normalize, notFoundImage, randomTransactionUser, regexPattern, removeLocalStorageItem, removePrefix, resolveMediaTypeFromMimeType, safeQuerySelector, safeWindowOpen, setLocalStorageItem, toIPFSURL, uploadBlobToIPFS, validate, validateIpfsUri, xNodeToGMstartingLevel };
|
|
862
|
-
//# sourceMappingURL=chunk-BCEQ6QWT.js.map
|
|
863
|
-
//# sourceMappingURL=chunk-BCEQ6QWT.js.map
|