w3pk 0.10.1 → 0.10.2
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 +2 -0
- package/dist/index.d.mts +39 -12
- package/dist/index.d.ts +39 -12
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -25
- package/dist/index.mjs.map +1 -1
- package/docs/API_REFERENCE.md +9 -90
- package/docs/ARCHITECTURE.md +45 -42
- package/docs/INTEGRATION_GUIDELINES.md +4 -7
- package/docs/SECURITY.md +155 -314
- package/package.json +1 -1
- package/dist/chainlist/index.d.mts +0 -96
- package/dist/chainlist/index.d.ts +0 -96
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chainlist types
|
|
3
|
-
*/
|
|
4
|
-
interface Chain {
|
|
5
|
-
name: string;
|
|
6
|
-
chain: string;
|
|
7
|
-
icon?: string;
|
|
8
|
-
rpc: string[];
|
|
9
|
-
features?: Array<{
|
|
10
|
-
name: string;
|
|
11
|
-
}>;
|
|
12
|
-
faucets: string[];
|
|
13
|
-
nativeCurrency: {
|
|
14
|
-
name: string;
|
|
15
|
-
symbol: string;
|
|
16
|
-
decimals: number;
|
|
17
|
-
};
|
|
18
|
-
infoURL: string;
|
|
19
|
-
shortName: string;
|
|
20
|
-
chainId: number;
|
|
21
|
-
networkId: number;
|
|
22
|
-
slip44?: number;
|
|
23
|
-
ens?: {
|
|
24
|
-
registry: string;
|
|
25
|
-
};
|
|
26
|
-
explorers?: Array<{
|
|
27
|
-
name: string;
|
|
28
|
-
url: string;
|
|
29
|
-
icon?: string;
|
|
30
|
-
standard: string;
|
|
31
|
-
}>;
|
|
32
|
-
title?: string;
|
|
33
|
-
status?: string;
|
|
34
|
-
redFlags?: string[];
|
|
35
|
-
}
|
|
36
|
-
interface ChainlistOptions {
|
|
37
|
-
/**
|
|
38
|
-
* Custom URL for chains.json data
|
|
39
|
-
* @default 'https://chainid.network/chains.json'
|
|
40
|
-
*/
|
|
41
|
-
chainsJsonUrl?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Cache duration in milliseconds
|
|
44
|
-
* @default 3600000 (1 hour)
|
|
45
|
-
*/
|
|
46
|
-
cacheDuration?: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Chainlist module for fetching RPC endpoints
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Get RPC endpoints for a specific chain ID, excluding those that require API keys
|
|
55
|
-
*
|
|
56
|
-
* @param chainId - The chain ID to get endpoints for
|
|
57
|
-
* @param options - Optional configuration
|
|
58
|
-
* @returns Array of RPC URLs that don't require API keys
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* import { getEndpoints } from 'w3pk/chainlist'
|
|
63
|
-
*
|
|
64
|
-
* // Get Ethereum mainnet RPCs
|
|
65
|
-
* const endpoints = await getEndpoints(1)
|
|
66
|
-
* console.log(endpoints)
|
|
67
|
-
* // [
|
|
68
|
-
* // "https://api.mycryptoapi.com/eth",
|
|
69
|
-
* // "https://cloudflare-eth.com",
|
|
70
|
-
* // "https://ethereum-rpc.publicnode.com",
|
|
71
|
-
* // ...
|
|
72
|
-
* // ]
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
declare function getEndpoints(chainId: number, options?: ChainlistOptions): Promise<string[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Get all available chains
|
|
78
|
-
*
|
|
79
|
-
* @param options - Optional configuration
|
|
80
|
-
* @returns Array of all chains
|
|
81
|
-
*/
|
|
82
|
-
declare function getAllChains(options?: ChainlistOptions): Promise<Chain[]>;
|
|
83
|
-
/**
|
|
84
|
-
* Get chain information by chain ID
|
|
85
|
-
*
|
|
86
|
-
* @param chainId - The chain ID to get information for
|
|
87
|
-
* @param options - Optional configuration
|
|
88
|
-
* @returns Chain information or undefined if not found
|
|
89
|
-
*/
|
|
90
|
-
declare function getChainById(chainId: number, options?: ChainlistOptions): Promise<Chain | undefined>;
|
|
91
|
-
/**
|
|
92
|
-
* Clear the chains data cache
|
|
93
|
-
*/
|
|
94
|
-
declare function clearCache(): void;
|
|
95
|
-
|
|
96
|
-
export { type Chain, type ChainlistOptions, clearCache, getAllChains, getChainById, getEndpoints };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chainlist types
|
|
3
|
-
*/
|
|
4
|
-
interface Chain {
|
|
5
|
-
name: string;
|
|
6
|
-
chain: string;
|
|
7
|
-
icon?: string;
|
|
8
|
-
rpc: string[];
|
|
9
|
-
features?: Array<{
|
|
10
|
-
name: string;
|
|
11
|
-
}>;
|
|
12
|
-
faucets: string[];
|
|
13
|
-
nativeCurrency: {
|
|
14
|
-
name: string;
|
|
15
|
-
symbol: string;
|
|
16
|
-
decimals: number;
|
|
17
|
-
};
|
|
18
|
-
infoURL: string;
|
|
19
|
-
shortName: string;
|
|
20
|
-
chainId: number;
|
|
21
|
-
networkId: number;
|
|
22
|
-
slip44?: number;
|
|
23
|
-
ens?: {
|
|
24
|
-
registry: string;
|
|
25
|
-
};
|
|
26
|
-
explorers?: Array<{
|
|
27
|
-
name: string;
|
|
28
|
-
url: string;
|
|
29
|
-
icon?: string;
|
|
30
|
-
standard: string;
|
|
31
|
-
}>;
|
|
32
|
-
title?: string;
|
|
33
|
-
status?: string;
|
|
34
|
-
redFlags?: string[];
|
|
35
|
-
}
|
|
36
|
-
interface ChainlistOptions {
|
|
37
|
-
/**
|
|
38
|
-
* Custom URL for chains.json data
|
|
39
|
-
* @default 'https://chainid.network/chains.json'
|
|
40
|
-
*/
|
|
41
|
-
chainsJsonUrl?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Cache duration in milliseconds
|
|
44
|
-
* @default 3600000 (1 hour)
|
|
45
|
-
*/
|
|
46
|
-
cacheDuration?: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Chainlist module for fetching RPC endpoints
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Get RPC endpoints for a specific chain ID, excluding those that require API keys
|
|
55
|
-
*
|
|
56
|
-
* @param chainId - The chain ID to get endpoints for
|
|
57
|
-
* @param options - Optional configuration
|
|
58
|
-
* @returns Array of RPC URLs that don't require API keys
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* import { getEndpoints } from 'w3pk/chainlist'
|
|
63
|
-
*
|
|
64
|
-
* // Get Ethereum mainnet RPCs
|
|
65
|
-
* const endpoints = await getEndpoints(1)
|
|
66
|
-
* console.log(endpoints)
|
|
67
|
-
* // [
|
|
68
|
-
* // "https://api.mycryptoapi.com/eth",
|
|
69
|
-
* // "https://cloudflare-eth.com",
|
|
70
|
-
* // "https://ethereum-rpc.publicnode.com",
|
|
71
|
-
* // ...
|
|
72
|
-
* // ]
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
declare function getEndpoints(chainId: number, options?: ChainlistOptions): Promise<string[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Get all available chains
|
|
78
|
-
*
|
|
79
|
-
* @param options - Optional configuration
|
|
80
|
-
* @returns Array of all chains
|
|
81
|
-
*/
|
|
82
|
-
declare function getAllChains(options?: ChainlistOptions): Promise<Chain[]>;
|
|
83
|
-
/**
|
|
84
|
-
* Get chain information by chain ID
|
|
85
|
-
*
|
|
86
|
-
* @param chainId - The chain ID to get information for
|
|
87
|
-
* @param options - Optional configuration
|
|
88
|
-
* @returns Chain information or undefined if not found
|
|
89
|
-
*/
|
|
90
|
-
declare function getChainById(chainId: number, options?: ChainlistOptions): Promise<Chain | undefined>;
|
|
91
|
-
/**
|
|
92
|
-
* Clear the chains data cache
|
|
93
|
-
*/
|
|
94
|
-
declare function clearCache(): void;
|
|
95
|
-
|
|
96
|
-
export { type Chain, type ChainlistOptions, clearCache, getAllChains, getChainById, getEndpoints };
|