@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.
Files changed (55) hide show
  1. package/README.md +22 -5
  2. package/dist/assets/index.cjs +1 -104
  3. package/dist/assets/index.d.cts +2 -1158
  4. package/dist/assets/index.d.mts +2 -0
  5. package/dist/assets/index.mjs +1 -0
  6. package/dist/assets-DXVXPy3w.cjs +47 -0
  7. package/dist/assets-DXVXPy3w.cjs.map +1 -0
  8. package/dist/assets-aAdDxPJu.mjs +38 -0
  9. package/dist/assets-aAdDxPJu.mjs.map +1 -0
  10. package/dist/index-Bqx1gXNe.d.mts +3961 -0
  11. package/dist/index-Bqx1gXNe.d.mts.map +1 -0
  12. package/dist/index-Bs6t5GxR.d.mts +136 -0
  13. package/dist/index-Bs6t5GxR.d.mts.map +1 -0
  14. package/dist/index-DSMUkHcK.d.cts +136 -0
  15. package/dist/index-DSMUkHcK.d.cts.map +1 -0
  16. package/dist/index-V7NUPb1d.d.cts +3961 -0
  17. package/dist/index-V7NUPb1d.d.cts.map +1 -0
  18. package/dist/index.cjs +171 -20660
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +3 -2224
  21. package/dist/index.d.mts +3 -0
  22. package/dist/index.mjs +186 -0
  23. package/dist/index.mjs.map +1 -0
  24. package/dist/utils/index.cjs +1 -265
  25. package/dist/utils/index.d.cts +3 -261
  26. package/dist/utils/index.d.mts +3 -0
  27. package/dist/utils/index.mjs +1 -0
  28. package/dist/utils-Bl-JeVTg.cjs +2 -0
  29. package/dist/utils-Bl-JeVTg.cjs.map +1 -0
  30. package/dist/utils-DAs6kMGs.mjs +2 -0
  31. package/dist/utils-DAs6kMGs.mjs.map +1 -0
  32. package/package.json +155 -104
  33. package/dist/assets/index.cjs.map +0 -1
  34. package/dist/assets/index.d.ts +0 -1158
  35. package/dist/assets/index.js +0 -3
  36. package/dist/assets/index.js.map +0 -1
  37. package/dist/chunk-BCEQ6QWT.js +0 -863
  38. package/dist/chunk-BCEQ6QWT.js.map +0 -1
  39. package/dist/chunk-EESC6JDT.cjs +0 -1897
  40. package/dist/chunk-EESC6JDT.cjs.map +0 -1
  41. package/dist/chunk-M6WTSZ5C.cjs +0 -939
  42. package/dist/chunk-M6WTSZ5C.cjs.map +0 -1
  43. package/dist/chunk-Z4FE6MMP.js +0 -1872
  44. package/dist/chunk-Z4FE6MMP.js.map +0 -1
  45. package/dist/index.d.ts +0 -2224
  46. package/dist/index.js +0 -20322
  47. package/dist/index.js.map +0 -1
  48. package/dist/metafile-cjs.json +0 -1
  49. package/dist/metafile-esm.json +0 -1
  50. package/dist/thorUtils-IptLtkeL.d.cts +0 -230
  51. package/dist/thorUtils-IptLtkeL.d.ts +0 -230
  52. package/dist/utils/index.cjs.map +0 -1
  53. package/dist/utils/index.d.ts +0 -261
  54. package/dist/utils/index.js +0 -4
  55. package/dist/utils/index.js.map +0 -1
@@ -1,261 +0,0 @@
1
- import { Account } from 'viem/accounts';
2
- import { Address } from '@vechain/sdk-core';
3
- import { N as NETWORK_TYPE, d as NFTMediaType } from '../thorUtils-IptLtkeL.js';
4
- export { M as MultipleClausesCallParameters, g as MultipleClausesCallReturnType, V as ViewFunctionResult, p as buildCallClauses, n as executeCallClause, o as executeMultipleClausesCall } from '../thorUtils-IptLtkeL.js';
5
- import '@vechain/sdk-network';
6
- import '@privy-io/react-auth';
7
- import 'abitype';
8
- import 'viem';
9
-
10
- declare const TOKEN_LOGOS: Record<string, string>;
11
- declare const TOKEN_LOGO_COMPONENTS: Record<string, JSX.Element>;
12
- declare const VECHAIN_PRIVY_APP_ID = "cm4wxxujb022fyujl7g0thb21";
13
- declare const notFoundImage = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Image-not-found.png";
14
- declare enum TogglePassportCheck {
15
- WhitelistCheck = 1,
16
- BlacklistCheck = 2,
17
- SignalingCheck = 3,
18
- ParticipationScoreCheck = 4,
19
- GmOwnershipCheck = 5
20
- }
21
- declare const VECHAIN_KIT_STORAGE_KEYS: {
22
- NETWORK: string;
23
- };
24
- declare const getENV: () => {
25
- isDevelopment: boolean;
26
- isProduction: boolean;
27
- };
28
- declare const ENV: {
29
- readonly isDevelopment: boolean;
30
- readonly isProduction: boolean;
31
- };
32
- declare const VECHAIN_KIT_MIXPANEL_TOKENS: {
33
- development: string;
34
- production: string;
35
- };
36
- declare const getVECHAIN_KIT_MIXPANEL_PROJECT_TOKEN: () => string;
37
- declare const VECHAIN_KIT_MIXPANEL_PROJECT_TOKEN: string;
38
- declare const VECHAIN_KIT_MIXPANEL_PROJECT_NAME = "vechain-kit";
39
- type PrivyEcosystemApp = {
40
- id: string;
41
- name: string;
42
- website: string;
43
- };
44
- declare const DEFAULT_PRIVY_ECOSYSTEM_APPS: PrivyEcosystemApp[];
45
- declare const VECHAIN_KIT_TERMS_CONFIG: {
46
- url: string;
47
- version: number;
48
- required: boolean;
49
- displayName: string;
50
- };
51
- declare const VECHAIN_KIT_COOKIES_CONFIG: {
52
- url: string;
53
- version: number;
54
- required: boolean;
55
- displayName: string;
56
- };
57
-
58
- declare const humanAddress: (address: string, charAtStart?: number, charAtEnd?: number) => string;
59
- declare const humanDomain: (domain: string, lengthBefore?: number, lengthAfter?: number) => string;
60
- declare const humanNumber: (formattedValue: BigNumber.Value, originalValue?: BigNumber.Value, symbol?: string | null) => string;
61
- declare const isZero: (value?: BigNumber.Value) => boolean;
62
- declare const getPicassoImage: (address: string, base64?: boolean) => string;
63
-
64
- declare const randomTransactionUser: {
65
- privateKey: string;
66
- account: Account;
67
- address: string;
68
- };
69
-
70
- /**
71
- * Checks if two addresses are equal. Returns true if both values are strings AND:
72
- * - The two values are equal OR
73
- * - The checksumed addresses are equal
74
- *
75
- * @param address1
76
- * @param address2
77
- */
78
- declare const compareAddresses: (address1?: string, address2?: string) => boolean;
79
- declare const compareListOfAddresses: (add1: string[], add2: string[]) => boolean;
80
- declare const regexPattern: () => RegExp;
81
- declare const isValidAddress: typeof Address.isValid;
82
- declare const leftPadWithZeros: (str: string, length: number) => string;
83
-
84
- /**
85
- * Validate IPFS URI strings. An example of a valid IPFS URI is:
86
- * - ipfs://QmfSTia1TJUiKQ2fyW9NTPzEKNdjMGzbUgrC3QPSTpkum6/406.json
87
- * - ipfs://QmVPqKfwRXjg5Fqwy6RNRbKR2ZP4pKKVLvmfjmhQfdM3MH/4
88
- * - ipfs://QmVPqKfwRXjg5Fqwy6RNRbKR2ZP4pKKVLvmfjmhQfdM3MH
89
- * @param uri
90
- * @returns
91
- */
92
- declare const validateIpfsUri: (uri: string) => boolean;
93
- /**
94
- * Converts a CID to an IPFS native URL.
95
- *
96
- * @param cid - The CID to convert.
97
- * @param fileName - The name of the file to append to the URL.
98
- *
99
- * @returns The IPFS URL in the format `ipfs://${cid}/${fileName}`.
100
- */
101
- declare function toIPFSURL(cid: string, fileName?: string): string;
102
- /**
103
- * Uploads a blob to IPFS.
104
- * @param blob The Blob object to upload.
105
- * @param filename A name for the file in the FormData payload.
106
- * @param networkType The network type to use for the IPFS pinning service.
107
- * @returns The IPFS hash of the uploaded blob.
108
- */
109
- declare function uploadBlobToIPFS(blob: Blob, filename: string, networkType: NETWORK_TYPE): Promise<string>;
110
-
111
- declare const resolveMediaTypeFromMimeType: (mimeType: string) => NFTMediaType;
112
-
113
- /**
114
- * Convert a URI to a URL
115
- * We support both IPFS and Arweave URIs. Both should be converted to their https gateway URLs.
116
- * All other URIs should pass through unchanged.
117
- *
118
- * @param uri
119
- */
120
- declare const convertUriToUrl: (uri: string, networkType: NETWORK_TYPE) => string | null;
121
-
122
- declare const gmNfts: {
123
- level: string;
124
- name: string;
125
- image: string;
126
- multiplier: number;
127
- b3trToUpgrade: number;
128
- }[];
129
- /**
130
- * Maps the XNode level to the GM starting level.
131
- */
132
- declare const xNodeToGMstartingLevel: Record<number, number>;
133
-
134
- declare const buildQueryString: (params: {
135
- [key: string]: any;
136
- }) => string;
137
-
138
- /**
139
- * Map strength level coming from contract to hq image
140
- */
141
- declare const NodeStrengthLevelToImage: {
142
- [key: string]: string;
143
- };
144
- declare const MinXNodeLevel = 4;
145
- declare const EconomicNodeStrengthLevelToName: {
146
- [key: string]: string;
147
- };
148
- declare const XNodeStrengthLevelToName: {
149
- [key: string]: string;
150
- };
151
- declare const allNodeStrengthLevelToName: {
152
- [key: string]: string;
153
- };
154
-
155
- declare const TIME: {
156
- SECOND: number;
157
- MINUTE: number;
158
- HOUR: number;
159
- DAY: number;
160
- WEEK: number;
161
- MONTH: number;
162
- YEAR: number;
163
- };
164
-
165
- /**
166
- * Checks if a string contains common rejection-related terms
167
- * @param errorMessage The error message to check
168
- * @returns boolean indicating if the message contains rejection terms
169
- */
170
- declare const isRejectionError: (errorMessage: string) => boolean;
171
-
172
- /**
173
- * Returns the provied hex string with the hex prefix removed.
174
- * If the prefix doesn't exist the hex is returned unmodified
175
- * @param hex - the input hex string
176
- * @returns the input hex string with the hex prefix removed
177
- * @throws an error if the input is not a valid hex string
178
- */
179
- declare const removePrefix: (hex: string) => string;
180
- /**
181
- * Returns the provided hex string with the hex prefix added.
182
- * If the prefix already exists the string is returned unmodified.
183
- * If the string contains an UPPER case `X` in the prefix it will be replaced with a lower case `x`
184
- * @param hex - the input hex string
185
- * @returns the input hex string with the hex prefix added
186
- * @throws an error if the input is not a valid hex string
187
- */
188
- declare const addPrefix: (hex: string) => string;
189
- /**
190
- * Validate the hex string. Throws an Error if not valid
191
- * @param hex - the input hex string
192
- * @throws an error if the input is not a valid hex string
193
- */
194
- declare const validate: (hex: string) => void;
195
- /**
196
- * Check if input string is valid
197
- * @param hex - the input hex string
198
- * @returns boolean representing whether the input hex is valid
199
- */
200
- declare const isValid: (hex?: string | null) => boolean;
201
- declare const isInvalid: (hex?: string | null) => boolean;
202
- declare const normalize: (hex: string) => string;
203
- declare const compare: (hex1: string, hex2: string) => boolean;
204
- /**
205
- * Generate a random hex string of the defined length
206
- * @param size - the length of the random hex output
207
- * @returns a random hex string of length `size`
208
- */
209
- declare const generateRandom: (size: number) => string;
210
-
211
- declare const isValidUrl: (value: string) => boolean;
212
-
213
- /**
214
- * SSR-safe utilities for browser API access
215
- */
216
- /**
217
- * SSR-safe localStorage getter
218
- */
219
- declare const getLocalStorageItem: (key: string) => string | null;
220
- /**
221
- * SSR-safe localStorage setter
222
- */
223
- declare const setLocalStorageItem: (key: string, value: string) => void;
224
- /**
225
- * SSR-safe localStorage remover
226
- */
227
- declare const removeLocalStorageItem: (key: string) => void;
228
- /**
229
- * SSR-safe document.title getter
230
- */
231
- declare const getDocumentTitle: () => string;
232
- /**
233
- * SSR-safe window.location.origin getter
234
- */
235
- declare const getWindowOrigin: () => string;
236
- /**
237
- * Check if we're in a browser environment
238
- */
239
- declare const isBrowser: () => boolean;
240
- /**
241
- * SSR-safe window.open
242
- */
243
- declare const safeWindowOpen: (url?: string, target?: string, features?: string) => void;
244
- /**
245
- * SSR-safe document.querySelector
246
- */
247
- declare const safeQuerySelector: <T extends Element>(selector: string) => T | null;
248
- /**
249
- * SSR-safe navigator check
250
- */
251
- declare const hasNavigator: () => boolean;
252
- /**
253
- * SSR-safe navigator.onLine check
254
- */
255
- declare const isOnline: () => boolean;
256
- /**
257
- * SSR-safe clipboard write
258
- */
259
- declare const copyToClipboard: (text: string) => Promise<boolean>;
260
-
261
- export { DEFAULT_PRIVY_ECOSYSTEM_APPS, ENV, EconomicNodeStrengthLevelToName, MinXNodeLevel, NodeStrengthLevelToImage, type PrivyEcosystemApp, 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, XNodeStrengthLevelToName, addPrefix, allNodeStrengthLevelToName, buildQueryString, compare, compareAddresses, compareListOfAddresses, convertUriToUrl, copyToClipboard, generateRandom, 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 };
@@ -1,4 +0,0 @@
1
- export { DEFAULT_PRIVY_ECOSYSTEM_APPS, ENV, EconomicNodeStrengthLevelToName, MinXNodeLevel, 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, XNodeStrengthLevelToName, addPrefix, allNodeStrengthLevelToName, buildCallClauses, buildQueryString, compare, compareAddresses, compareListOfAddresses, convertUriToUrl, copyToClipboard, executeCallClause, executeMultipleClausesCall, generateRandom, 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 } from '../chunk-BCEQ6QWT.js';
2
- import '../chunk-Z4FE6MMP.js';
3
- //# sourceMappingURL=index.js.map
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}