@oikos/core-addresses 0.1.0 → 0.1.1
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 +112 -13
- package/dist/cli.cjs +2647 -13
- package/dist/cli.js +2647 -13
- package/dist/index.cjs +2626 -9
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +2618 -8
- package/package.json +9 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
type AbiItem = Readonly<Record<string, unknown>>;
|
|
2
|
+
type Abi = ReadonlyArray<AbiItem>;
|
|
3
|
+
type AbiContractStatus = {
|
|
4
|
+
available: boolean;
|
|
5
|
+
source?: string;
|
|
6
|
+
artifact?: string;
|
|
7
|
+
items?: number;
|
|
8
|
+
sha256?: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
};
|
|
11
|
+
type AbiSourceMeta = {
|
|
12
|
+
ref: string;
|
|
13
|
+
fetchedAt: string;
|
|
14
|
+
contracts: Record<string, AbiContractStatus>;
|
|
15
|
+
};
|
|
16
|
+
declare const ABI_SOURCE_REF: string;
|
|
17
|
+
declare const ABI_FETCHED_AT: string;
|
|
18
|
+
declare function listAbis(): string[];
|
|
19
|
+
declare function hasAbi(contract: string): boolean;
|
|
20
|
+
declare function getAbi(contract: string): Abi;
|
|
21
|
+
declare function getAbiSourceMeta(): AbiSourceMeta;
|
|
22
|
+
|
|
1
23
|
type NetworkInfo = {
|
|
2
24
|
chainId: number;
|
|
3
25
|
name: string;
|
|
@@ -26,6 +48,10 @@ declare function getAddresses(network: number | string): ContractAddresses;
|
|
|
26
48
|
declare function getAddress(network: number | string, contract: ContractName): string;
|
|
27
49
|
declare function getSupportedNetworks(): NetworkInfo[];
|
|
28
50
|
declare function isSupported(network: number | string): boolean;
|
|
51
|
+
declare function getContract(network: number | string, contract: ContractName): {
|
|
52
|
+
address: string;
|
|
53
|
+
abi: Abi;
|
|
54
|
+
};
|
|
29
55
|
declare function getNetworkInfo(network: number | string): NetworkInfo | undefined;
|
|
30
56
|
|
|
31
|
-
export { type ContractAddresses, type ContractName, type Deployment, FETCHED_AT, type KnownContractName, NETWORKS, type NetworkInfo, SOURCE_SHA256, SOURCE_TAG, SOURCE_URL, type SourceMeta, deployment, getAddress, getAddresses, getNetworkInfo, getSourceMeta, getSupportedNetworks, isSupported };
|
|
57
|
+
export { ABI_FETCHED_AT, ABI_SOURCE_REF, type Abi, type AbiContractStatus, type AbiItem, type AbiSourceMeta, type ContractAddresses, type ContractName, type Deployment, FETCHED_AT, type KnownContractName, NETWORKS, type NetworkInfo, SOURCE_SHA256, SOURCE_TAG, SOURCE_URL, type SourceMeta, deployment, getAbi, getAbiSourceMeta, getAddress, getAddresses, getContract, getNetworkInfo, getSourceMeta, getSupportedNetworks, hasAbi, isSupported, listAbis };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
type AbiItem = Readonly<Record<string, unknown>>;
|
|
2
|
+
type Abi = ReadonlyArray<AbiItem>;
|
|
3
|
+
type AbiContractStatus = {
|
|
4
|
+
available: boolean;
|
|
5
|
+
source?: string;
|
|
6
|
+
artifact?: string;
|
|
7
|
+
items?: number;
|
|
8
|
+
sha256?: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
};
|
|
11
|
+
type AbiSourceMeta = {
|
|
12
|
+
ref: string;
|
|
13
|
+
fetchedAt: string;
|
|
14
|
+
contracts: Record<string, AbiContractStatus>;
|
|
15
|
+
};
|
|
16
|
+
declare const ABI_SOURCE_REF: string;
|
|
17
|
+
declare const ABI_FETCHED_AT: string;
|
|
18
|
+
declare function listAbis(): string[];
|
|
19
|
+
declare function hasAbi(contract: string): boolean;
|
|
20
|
+
declare function getAbi(contract: string): Abi;
|
|
21
|
+
declare function getAbiSourceMeta(): AbiSourceMeta;
|
|
22
|
+
|
|
1
23
|
type NetworkInfo = {
|
|
2
24
|
chainId: number;
|
|
3
25
|
name: string;
|
|
@@ -26,6 +48,10 @@ declare function getAddresses(network: number | string): ContractAddresses;
|
|
|
26
48
|
declare function getAddress(network: number | string, contract: ContractName): string;
|
|
27
49
|
declare function getSupportedNetworks(): NetworkInfo[];
|
|
28
50
|
declare function isSupported(network: number | string): boolean;
|
|
51
|
+
declare function getContract(network: number | string, contract: ContractName): {
|
|
52
|
+
address: string;
|
|
53
|
+
abi: Abi;
|
|
54
|
+
};
|
|
29
55
|
declare function getNetworkInfo(network: number | string): NetworkInfo | undefined;
|
|
30
56
|
|
|
31
|
-
export { type ContractAddresses, type ContractName, type Deployment, FETCHED_AT, type KnownContractName, NETWORKS, type NetworkInfo, SOURCE_SHA256, SOURCE_TAG, SOURCE_URL, type SourceMeta, deployment, getAddress, getAddresses, getNetworkInfo, getSourceMeta, getSupportedNetworks, isSupported };
|
|
57
|
+
export { ABI_FETCHED_AT, ABI_SOURCE_REF, type Abi, type AbiContractStatus, type AbiItem, type AbiSourceMeta, type ContractAddresses, type ContractName, type Deployment, FETCHED_AT, type KnownContractName, NETWORKS, type NetworkInfo, SOURCE_SHA256, SOURCE_TAG, SOURCE_URL, type SourceMeta, deployment, getAbi, getAbiSourceMeta, getAddress, getAddresses, getContract, getNetworkInfo, getSourceMeta, getSupportedNetworks, hasAbi, isSupported, listAbis };
|