graz 0.0.44-alpha.1 → 0.0.44
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/chains/index.js.stub +30 -0
- package/chains/index.mjs.stub +20 -0
- package/cli.mjs +219 -0
- package/compiled/p-map/index.d.ts +121 -0
- package/compiled/p-map/index.mjs +1 -0
- package/compiled/p-map/index.mjs.d.ts +123 -0
- package/dist/index.d.ts +18 -502
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +12 -10
- package/dist/cli/index.mjs +0 -141
- package/stubs/chains-generated.ts.stub +0 -20
- package/stubs/chains-index.ts.stub +0 -41
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ChainInfo } from "@keplr-wallet/types";
|
|
2
|
-
|
|
3
|
-
import type { AssetList, Chain } from "../dist";
|
|
4
|
-
|
|
5
|
-
export type MainnetChainName = "REPLACE_MAINNET_CHAIN_NAME";
|
|
6
|
-
export type TestnetChainName = "REPLACE_TESTNET_CHAIN_NAME";
|
|
7
|
-
export type ChainName = MainnetChainName | TestnetChainName;
|
|
8
|
-
export interface ChainData {
|
|
9
|
-
assetlist: Promise<AssetList>;
|
|
10
|
-
chain: Promise<Chain>;
|
|
11
|
-
chainInfo: Promise<ChainInfo>;
|
|
12
|
-
}
|
|
13
|
-
export type ReturnTuple<T> = T extends readonly [ChainName, ...infer Rest] ? [ChainData, ...ReturnTuple<Rest>] : [];
|
|
14
|
-
|
|
15
|
-
export const mainnetChains: Record<MainnetChainName, Chain> = {};
|
|
16
|
-
export const testnetChains: Record<TestnetChainName, Chain> = {};
|
|
17
|
-
export const chains: Record<ChainName, Chain> = {};
|
|
18
|
-
export const mainnetChainNames: MainnetChainName[] = [];
|
|
19
|
-
export const testnetChainNames: TestnetChainName[] = [];
|
|
20
|
-
export const chainNames: ChainName[] = [];
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ChainData, ChainName, ReturnTuple } from "./generated";
|
|
2
|
-
|
|
3
|
-
export * from "./generated";
|
|
4
|
-
|
|
5
|
-
export const getChainData = <T extends ChainName>(pathOrPaths: T | T[]) => {
|
|
6
|
-
const paths = Array.isArray(pathOrPaths) ? pathOrPaths : [pathOrPaths];
|
|
7
|
-
const chainData: any = {};
|
|
8
|
-
for (const path of paths) {
|
|
9
|
-
chainData[path] = {
|
|
10
|
-
get chainInfo() {
|
|
11
|
-
return require(`./${path}`).default;
|
|
12
|
-
},
|
|
13
|
-
get chain() {
|
|
14
|
-
return require(`./${path}/chain`).default;
|
|
15
|
-
},
|
|
16
|
-
get assetlist() {
|
|
17
|
-
return require(`./${path}/assetlist`).default;
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return chainData as Record<T, ChainData>;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const getChainDataArray = <T extends ChainName, const U extends T | readonly T[]>(pathOrPaths: U) => {
|
|
25
|
-
const paths = Array.isArray(pathOrPaths) ? pathOrPaths : [pathOrPaths];
|
|
26
|
-
const chainData: any[] = [];
|
|
27
|
-
for (const path of paths) {
|
|
28
|
-
chainData.push({
|
|
29
|
-
get chainInfo() {
|
|
30
|
-
return require(`./${path}`).default;
|
|
31
|
-
},
|
|
32
|
-
get chain() {
|
|
33
|
-
return require(`./${path}/chain`).default;
|
|
34
|
-
},
|
|
35
|
-
get assetlist() {
|
|
36
|
-
return require(`./${path}/assetlist`).default;
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return chainData as U extends T ? [ChainData] : U extends readonly T[] ? ReturnTuple<U> : never;
|
|
41
|
-
};
|