@rocketh/export 0.10.11 → 0.10.12
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/CHANGELOG.md +8 -0
- package/dist/esm/cli.d.ts +3 -0
- package/dist/esm/cli.d.ts.map +1 -0
- package/dist/esm/cli.js +31 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/index.d.ts +90 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +114 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +11 -16
- package/src/cli.ts +2 -2
- package/tsconfig.json +13 -10
- package/dist/cli.cjs +0 -90
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.mjs +0 -87
- package/dist/cli.mjs.map +0 -1
- package/dist/index.cjs +0 -136
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -376
- package/dist/index.mjs +0 -134
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/esm/cli.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
import { readAndResolveConfig } from 'rocketh';
|
|
3
|
+
import { run } from './index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
6
|
+
const commandName = pkg.name;
|
|
7
|
+
const program = new Command();
|
|
8
|
+
program
|
|
9
|
+
.name(commandName)
|
|
10
|
+
.description('export deployments to consume elswhere')
|
|
11
|
+
.version(pkg.version)
|
|
12
|
+
.option('-d, --deployments <value>', 'folder where deployments are saved')
|
|
13
|
+
.option('--ts <value>', 'list of filepath where the typescript export will be written, separated by commas')
|
|
14
|
+
.option('--js <value>', 'list of filepath where the javascript export will be written, separated by commas')
|
|
15
|
+
.option('--json <value>', 'list of filepath where the json export will be written, separated by commas')
|
|
16
|
+
.option('--tsm <value>', 'list of filepath where the typescript export with individual export will be written, separated by commas')
|
|
17
|
+
.option('--jsm <value>', 'list of filepath where the javascript export with individual exportwill be written, separated by commas')
|
|
18
|
+
.option('-b, --bytecode', 'if set, the bytecode will also be part of the output')
|
|
19
|
+
.requiredOption('-n, --network <value>', 'network context to use')
|
|
20
|
+
.parse(process.argv);
|
|
21
|
+
const options = program.opts();
|
|
22
|
+
const resolvedConfig = readAndResolveConfig({ ...options, ignoreMissingRPC: true });
|
|
23
|
+
run(resolvedConfig, {
|
|
24
|
+
tots: options.ts ? options.ts.split(',') : undefined,
|
|
25
|
+
tojson: options.json ? options.json.split(',') : undefined,
|
|
26
|
+
tojs: options.js ? options.js.split(',') : undefined,
|
|
27
|
+
totsm: options.tsm ? options.tsm.split(',') : undefined,
|
|
28
|
+
tojsm: options.jsm ? options.jsm.split(',') : undefined,
|
|
29
|
+
includeBytecode: options.bytecode,
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAGtD,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC;AAE7B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO;KACL,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,wCAAwC,CAAC;KACrD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,2BAA2B,EAAE,oCAAoC,CAAC;KACzE,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AC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Abi, Address } from 'abitype';
|
|
2
|
+
import { ResolvedConfig } from 'rocketh';
|
|
3
|
+
export interface ContractExport {
|
|
4
|
+
address: `0x${string}`;
|
|
5
|
+
abi: Abi;
|
|
6
|
+
argsData?: string;
|
|
7
|
+
bytecode?: `0x${string}`;
|
|
8
|
+
}
|
|
9
|
+
type ChainBlockExplorer = {
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
apiUrl?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
type ChainContract = {
|
|
15
|
+
address: Address;
|
|
16
|
+
blockCreated?: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
type ChainNativeCurrency = {
|
|
19
|
+
name: string;
|
|
20
|
+
/** 2-6 characters long */
|
|
21
|
+
symbol: string;
|
|
22
|
+
decimals: number;
|
|
23
|
+
};
|
|
24
|
+
type ChainRpcUrls = {
|
|
25
|
+
http: readonly string[];
|
|
26
|
+
webSocket?: readonly string[] | undefined;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @description Combines members of an intersection into a readable type.
|
|
30
|
+
*
|
|
31
|
+
* @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}
|
|
32
|
+
* @example
|
|
33
|
+
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
|
|
34
|
+
* => { a: string, b: string, c: number, d: bigint }
|
|
35
|
+
*/
|
|
36
|
+
type Prettify<T> = {
|
|
37
|
+
[K in keyof T]: T[K];
|
|
38
|
+
} & {};
|
|
39
|
+
export type ChainInfo = {
|
|
40
|
+
/** ID in number form */
|
|
41
|
+
id: number;
|
|
42
|
+
/** Human-readable name */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Collection of block explorers */
|
|
45
|
+
blockExplorers?: {
|
|
46
|
+
[key: string]: ChainBlockExplorer;
|
|
47
|
+
default: ChainBlockExplorer;
|
|
48
|
+
} | undefined;
|
|
49
|
+
/** Collection of contracts */
|
|
50
|
+
contracts?: Prettify<{
|
|
51
|
+
[key: string]: ChainContract | {
|
|
52
|
+
[sourceId: number]: ChainContract | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
} & {
|
|
55
|
+
ensRegistry?: ChainContract | undefined;
|
|
56
|
+
ensUniversalResolver?: ChainContract | undefined;
|
|
57
|
+
multicall3?: ChainContract | undefined;
|
|
58
|
+
}> | undefined;
|
|
59
|
+
/** Currency used by chain */
|
|
60
|
+
nativeCurrency: ChainNativeCurrency;
|
|
61
|
+
/** Collection of RPC endpoints */
|
|
62
|
+
rpcUrls: {
|
|
63
|
+
[key: string]: ChainRpcUrls;
|
|
64
|
+
default: ChainRpcUrls;
|
|
65
|
+
};
|
|
66
|
+
/** Source Chain ID (ie. the L1 chain) */
|
|
67
|
+
sourceId?: number | undefined;
|
|
68
|
+
/** Flag for test networks */
|
|
69
|
+
testnet?: boolean | undefined;
|
|
70
|
+
chainType: 'zksync' | 'op-stack' | 'celo' | 'default';
|
|
71
|
+
};
|
|
72
|
+
export type ExportedDeployments = {
|
|
73
|
+
chainId: string;
|
|
74
|
+
genesisHash?: string;
|
|
75
|
+
chainInfo: ChainInfo;
|
|
76
|
+
name: string;
|
|
77
|
+
contracts: {
|
|
78
|
+
[name: string]: ContractExport;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export declare function run(config: ResolvedConfig, options: {
|
|
82
|
+
tojs?: string[];
|
|
83
|
+
tots?: string[];
|
|
84
|
+
tojson?: string[];
|
|
85
|
+
totsm?: string[];
|
|
86
|
+
tojsm?: string[];
|
|
87
|
+
includeBytecode?: boolean;
|
|
88
|
+
}): Promise<void>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B,iBAyID"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { chainTypes, getChain, loadDeployments } from 'rocketh';
|
|
4
|
+
function objectMap(object, mapFn) {
|
|
5
|
+
return Object.keys(object).reduce((result, key) => {
|
|
6
|
+
result[key] = mapFn(object[key]);
|
|
7
|
+
return result;
|
|
8
|
+
}, {});
|
|
9
|
+
}
|
|
10
|
+
export async function run(config, options) {
|
|
11
|
+
if (!options.tots && !options.tojs && !options.tojson && !options.tojsm && !options.totsm) {
|
|
12
|
+
console.log(`no filepath to export to are specified`);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const { deployments, chainId, genesisHash } = loadDeployments(config.deployments, config.network.name);
|
|
16
|
+
if (!deployments || Object.keys(deployments).length === 0) {
|
|
17
|
+
console.log(`no deployments to export`);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (!chainId) {
|
|
21
|
+
throw new Error(`no chainId found for ${config.network.name}`);
|
|
22
|
+
}
|
|
23
|
+
const chain = getChain(chainId);
|
|
24
|
+
const chainInfo = {
|
|
25
|
+
id: chain.id,
|
|
26
|
+
name: chain.name,
|
|
27
|
+
nativeCurrency: chain.nativeCurrency,
|
|
28
|
+
rpcUrls: chain.rpcUrls,
|
|
29
|
+
blockExplorers: chain.blockExplorers,
|
|
30
|
+
chainType: chainTypes[chainId] || 'default',
|
|
31
|
+
contracts: chain.contracts,
|
|
32
|
+
sourceId: chain.sourceId,
|
|
33
|
+
testnet: chain.testnet,
|
|
34
|
+
};
|
|
35
|
+
const exportData = {
|
|
36
|
+
chainId,
|
|
37
|
+
genesisHash,
|
|
38
|
+
chainInfo,
|
|
39
|
+
contracts: objectMap(deployments, (d) => ({
|
|
40
|
+
abi: d.abi,
|
|
41
|
+
address: d.address,
|
|
42
|
+
linkedData: d.linkedData,
|
|
43
|
+
bytecode: options.includeBytecode ? d.bytecode : undefined,
|
|
44
|
+
argsData: options.includeBytecode ? d.argsData : undefined,
|
|
45
|
+
startBlock: d.receipt?.blockNumber ? parseInt(d.receipt.blockNumber.slice(2), 16) : undefined,
|
|
46
|
+
})),
|
|
47
|
+
name: config.network.name,
|
|
48
|
+
};
|
|
49
|
+
const js = typeof options.tojs === 'string' ? [options.tojs] : options.tojs || [];
|
|
50
|
+
const ts = typeof options.tots === 'string' ? [options.tots] : options.tots || [];
|
|
51
|
+
const json = typeof options.tojson === 'string' ? [options.tojson] : options.tojson || [];
|
|
52
|
+
const tsmodule = typeof options.totsm === 'string' ? [options.totsm] : options.totsm || [];
|
|
53
|
+
const jsmodule = typeof options.tojsm === 'string' ? [options.tojsm] : options.tojsm || [];
|
|
54
|
+
if (ts.length > 0) {
|
|
55
|
+
const newContent = `export default ${JSON.stringify(exportData, null, 2)} as const;`;
|
|
56
|
+
for (const tsFile of ts) {
|
|
57
|
+
const folderPath = path.dirname(tsFile);
|
|
58
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
59
|
+
fs.writeFileSync(tsFile, newContent);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (js.length > 0) {
|
|
63
|
+
const newContent = `export default /** @type {const} **/ (${JSON.stringify(exportData, null, 2)});`;
|
|
64
|
+
const dtsContent = `export = ${JSON.stringify(exportData, null, 2)} as const;`;
|
|
65
|
+
for (const jsFile of js) {
|
|
66
|
+
const folderPath = path.dirname(jsFile);
|
|
67
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
68
|
+
fs.writeFileSync(jsFile, newContent);
|
|
69
|
+
fs.writeFileSync(jsFile.replace('.js', '.d.ts'), dtsContent);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (json.length > 0) {
|
|
73
|
+
const newContent = JSON.stringify(exportData, null, 2);
|
|
74
|
+
for (const jsonFile of json) {
|
|
75
|
+
const folderPath = path.dirname(jsonFile);
|
|
76
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
77
|
+
fs.writeFileSync(jsonFile, newContent);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (tsmodule.length > 0) {
|
|
81
|
+
let newContent = `export const chain = ${JSON.stringify({
|
|
82
|
+
chainId: exportData.chainId,
|
|
83
|
+
genesisHash: exportData.genesisHash,
|
|
84
|
+
chainInfo: exportData.chainInfo,
|
|
85
|
+
name: exportData.name,
|
|
86
|
+
}, null, 2)} as const;\n`;
|
|
87
|
+
for (const contractName of Object.keys(exportData.contracts)) {
|
|
88
|
+
newContent += `export const ${contractName} = ${JSON.stringify(exportData.contracts[contractName], null, 2)} as const;`;
|
|
89
|
+
}
|
|
90
|
+
for (const tsFile of tsmodule) {
|
|
91
|
+
const folderPath = path.dirname(tsFile);
|
|
92
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
93
|
+
fs.writeFileSync(tsFile, newContent);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (jsmodule.length > 0) {
|
|
97
|
+
// TODO test
|
|
98
|
+
let newContent = `export const chain = /** @type {const} **/ (${JSON.stringify({
|
|
99
|
+
chainId: exportData.chainId,
|
|
100
|
+
genesisHash: exportData.genesisHash,
|
|
101
|
+
chainInfo: exportData.chainInfo,
|
|
102
|
+
name: exportData.name,
|
|
103
|
+
}, null, 2)});\n`;
|
|
104
|
+
for (const contractName of Object.keys(exportData.contracts)) {
|
|
105
|
+
newContent += `export const ${contractName} = /** @type {const} **/ (${JSON.stringify(exportData.contracts[contractName], null, 2)});`;
|
|
106
|
+
}
|
|
107
|
+
for (const jsFile of jsmodule) {
|
|
108
|
+
const folderPath = path.dirname(jsFile);
|
|
109
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
110
|
+
fs.writeFileSync(jsFile, newContent);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=index.js.map
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CAAC;QACP,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACxC,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;YAC5C,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,47 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocketh/export",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.12",
|
|
4
4
|
"description": "export deployments",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"types": "dist/index.d.ts",
|
|
9
|
+
"module": "dist/esm/index.js",
|
|
10
|
+
"types": "dist/esm/index.d.ts",
|
|
12
11
|
".": {
|
|
13
|
-
"require": {
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"default": "./dist/index.cjs"
|
|
16
|
-
},
|
|
17
12
|
"import": {
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"default": "./dist/index.
|
|
13
|
+
"types": "./dist/esm/index.d.ts",
|
|
14
|
+
"default": "./dist/esm/index.js"
|
|
20
15
|
}
|
|
21
16
|
},
|
|
22
17
|
"bin": {
|
|
23
|
-
"rocketh-export": "dist/cli.
|
|
18
|
+
"rocketh-export": "dist/esm/cli.js"
|
|
24
19
|
},
|
|
25
20
|
"devDependencies": {
|
|
26
21
|
"@types/node": "^20.14.8",
|
|
27
22
|
"abitype": "^1.0.4",
|
|
28
23
|
"eip-1193": "^0.5.0",
|
|
29
|
-
"
|
|
24
|
+
"as-soon": "^0.0.11",
|
|
30
25
|
"rimraf": "^5.0.7",
|
|
31
26
|
"typescript": "^5.5.2"
|
|
32
27
|
},
|
|
33
28
|
"peerDependencies": {
|
|
34
|
-
"rocketh": "0.10.
|
|
29
|
+
"rocketh": "0.10.16"
|
|
35
30
|
},
|
|
36
31
|
"dependencies": {
|
|
37
32
|
"@types/fs-extra": "^11.0.4",
|
|
38
33
|
"chalk": "5.3.0",
|
|
39
34
|
"commander": "^12.1.0",
|
|
40
35
|
"fs-extra": "^11.2.0",
|
|
41
|
-
"rocketh": "0.10.
|
|
36
|
+
"rocketh": "0.10.16"
|
|
42
37
|
},
|
|
43
38
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"dev": "
|
|
39
|
+
"build": "tsc --project tsconfig.json",
|
|
40
|
+
"dev": "as-soon -w src pnpm build"
|
|
46
41
|
}
|
|
47
42
|
}
|
package/src/cli.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
import {readAndResolveConfig} from 'rocketh';
|
|
3
|
-
import {run} from '.';
|
|
3
|
+
import {run} from './index.js';
|
|
4
4
|
import {Command} from 'commander';
|
|
5
|
-
import pkg from '../package.json';
|
|
5
|
+
import pkg from '../package.json' with {type: 'json'};
|
|
6
6
|
import {ConfigOptions} from 'rocketh';
|
|
7
7
|
|
|
8
8
|
const commandName = pkg.name;
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"moduleResolution": "Node",
|
|
4
|
-
"lib": ["ES2020", "dom"],
|
|
5
|
-
"target": "ES2020",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
3
|
"strict": true,
|
|
10
|
-
"
|
|
11
|
-
"
|
|
4
|
+
"strictNullChecks": true,
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "NodeNext",
|
|
7
|
+
"lib": ["ESNext", "dom"],
|
|
8
|
+
"moduleResolution": "NodeNext",
|
|
12
9
|
"resolveJsonModule": true,
|
|
13
|
-
"
|
|
14
|
-
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"declarationMap": true,
|
|
14
|
+
"rootDir": "./src",
|
|
15
|
+
"outDir": "./dist/esm"
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*.ts"]
|
|
15
18
|
}
|
package/dist/cli.cjs
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var rocketh = require('rocketh');
|
|
5
|
-
var index = require('./index.cjs');
|
|
6
|
-
var commander = require('commander');
|
|
7
|
-
require('node:fs');
|
|
8
|
-
require('node:path');
|
|
9
|
-
|
|
10
|
-
var name = "@rocketh/export";
|
|
11
|
-
var version = "0.10.11";
|
|
12
|
-
var description = "export deployments";
|
|
13
|
-
var publishConfig = {
|
|
14
|
-
access: "public"
|
|
15
|
-
};
|
|
16
|
-
var type = "module";
|
|
17
|
-
var main = "dist/index.cjs";
|
|
18
|
-
var module$1 = "dist/index.mjs";
|
|
19
|
-
var types = "dist/index.d.ts";
|
|
20
|
-
var bin = {
|
|
21
|
-
"rocketh-export": "dist/cli.cjs"
|
|
22
|
-
};
|
|
23
|
-
var devDependencies = {
|
|
24
|
-
"@types/node": "^20.14.8",
|
|
25
|
-
abitype: "^1.0.4",
|
|
26
|
-
"eip-1193": "^0.5.0",
|
|
27
|
-
pkgroll: "^2.1.1",
|
|
28
|
-
rimraf: "^5.0.7",
|
|
29
|
-
typescript: "^5.5.2"
|
|
30
|
-
};
|
|
31
|
-
var peerDependencies = {
|
|
32
|
-
rocketh: "workspace:*"
|
|
33
|
-
};
|
|
34
|
-
var dependencies = {
|
|
35
|
-
"@types/fs-extra": "^11.0.4",
|
|
36
|
-
chalk: "5.3.0",
|
|
37
|
-
commander: "^12.1.0",
|
|
38
|
-
"fs-extra": "^11.2.0",
|
|
39
|
-
rocketh: "workspace:*"
|
|
40
|
-
};
|
|
41
|
-
var scripts = {
|
|
42
|
-
build: "rimraf dist && pkgroll --sourcemap",
|
|
43
|
-
dev: "pkgroll --watch"
|
|
44
|
-
};
|
|
45
|
-
var pkg = {
|
|
46
|
-
name: name,
|
|
47
|
-
version: version,
|
|
48
|
-
description: description,
|
|
49
|
-
publishConfig: publishConfig,
|
|
50
|
-
type: type,
|
|
51
|
-
main: main,
|
|
52
|
-
module: module$1,
|
|
53
|
-
types: types,
|
|
54
|
-
".": {
|
|
55
|
-
require: {
|
|
56
|
-
types: "./dist/index.d.ts",
|
|
57
|
-
"default": "./dist/index.cjs"
|
|
58
|
-
},
|
|
59
|
-
"import": {
|
|
60
|
-
types: "./dist/index.d.ts",
|
|
61
|
-
"default": "./dist/index.mjs"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
bin: bin,
|
|
65
|
-
devDependencies: devDependencies,
|
|
66
|
-
peerDependencies: peerDependencies,
|
|
67
|
-
dependencies: dependencies,
|
|
68
|
-
scripts: scripts
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const commandName = pkg.name;
|
|
72
|
-
const program = new commander.Command();
|
|
73
|
-
program.name(commandName).description("export deployments to consume elswhere").version(pkg.version).option("-d, --deployments <value>", "folder where deployments are saved").option("--ts <value>", "list of filepath where the typescript export will be written, separated by commas").option("--js <value>", "list of filepath where the javascript export will be written, separated by commas").option("--json <value>", "list of filepath where the json export will be written, separated by commas").option(
|
|
74
|
-
"--tsm <value>",
|
|
75
|
-
"list of filepath where the typescript export with individual export will be written, separated by commas"
|
|
76
|
-
).option(
|
|
77
|
-
"--jsm <value>",
|
|
78
|
-
"list of filepath where the javascript export with individual exportwill be written, separated by commas"
|
|
79
|
-
).option("-b, --bytecode", "if set, the bytecode will also be part of the output").requiredOption("-n, --network <value>", "network context to use").parse(process.argv);
|
|
80
|
-
const options = program.opts();
|
|
81
|
-
const resolvedConfig = rocketh.readAndResolveConfig({ ...options, ignoreMissingRPC: true });
|
|
82
|
-
index.run(resolvedConfig, {
|
|
83
|
-
tots: options.ts ? options.ts.split(",") : void 0,
|
|
84
|
-
tojson: options.json ? options.json.split(",") : void 0,
|
|
85
|
-
tojs: options.js ? options.js.split(",") : void 0,
|
|
86
|
-
totsm: options.tsm ? options.tsm.split(",") : void 0,
|
|
87
|
-
tojsm: options.jsm ? options.jsm.split(",") : void 0,
|
|
88
|
-
includeBytecode: options.bytecode
|
|
89
|
-
});
|
|
90
|
-
//# sourceMappingURL=cli.cjs.map
|
package/dist/cli.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","sources":["../src/cli.ts"],"sourcesContent":["#! /usr/bin/env node\nimport {readAndResolveConfig} from 'rocketh';\nimport {run} from '.';\nimport {Command} from 'commander';\nimport pkg from '../package.json';\nimport {ConfigOptions} from 'rocketh';\n\nconst commandName = pkg.name;\n\nconst program = new Command();\nprogram\n\t.name(commandName)\n\t.description('export deployments to consume elswhere')\n\t.version(pkg.version)\n\t.option('-d, --deployments <value>', 'folder where deployments are saved')\n\t.option('--ts <value>', 'list of filepath where the typescript export will be written, separated by commas')\n\t.option('--js <value>', 'list of filepath where the javascript export will be written, separated by commas')\n\t.option('--json <value>', 'list of filepath where the json export will be written, separated by commas')\n\t.option(\n\t\t'--tsm <value>',\n\t\t'list of filepath where the typescript export with individual export will be written, separated by commas'\n\t)\n\t.option(\n\t\t'--jsm <value>',\n\t\t'list of filepath where the javascript export with individual exportwill be written, separated by commas'\n\t)\n\t.option('-b, --bytecode', 'if set, the bytecode will also be part of the output')\n\t.requiredOption('-n, --network <value>', 'network context to use')\n\t.parse(process.argv);\n\nconst options = program.opts();\nconst resolvedConfig = readAndResolveConfig({...(options as ConfigOptions), ignoreMissingRPC: true});\nrun(resolvedConfig, {\n\ttots: options.ts ? options.ts.split(',') : undefined,\n\ttojson: options.json ? options.json.split(',') : undefined,\n\ttojs: options.js ? options.js.split(',') : undefined,\n\ttotsm: options.tsm ? options.tsm.split(',') : undefined,\n\ttojsm: options.jsm ? options.jsm.split(',') : undefined,\n\tincludeBytecode: options.bytecode,\n});\n"],"names":["Command","readAndResolveConfig","run"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAG,CAAA,CAAA,CAAC,IAAI,CAAC;AAC7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,EAAA,CAAA;AACA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,IAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CA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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA;AACF,CAAA,CAAE,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACT,CAAC,CAAC"}
|
package/dist/cli.mjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { readAndResolveConfig } from 'rocketh';
|
|
2
|
-
import { run } from './index.mjs';
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import 'node:fs';
|
|
5
|
-
import 'node:path';
|
|
6
|
-
|
|
7
|
-
var name = "@rocketh/export";
|
|
8
|
-
var version = "0.10.11";
|
|
9
|
-
var description = "export deployments";
|
|
10
|
-
var publishConfig = {
|
|
11
|
-
access: "public"
|
|
12
|
-
};
|
|
13
|
-
var type = "module";
|
|
14
|
-
var main = "dist/index.cjs";
|
|
15
|
-
var module = "dist/index.mjs";
|
|
16
|
-
var types = "dist/index.d.ts";
|
|
17
|
-
var bin = {
|
|
18
|
-
"rocketh-export": "dist/cli.cjs"
|
|
19
|
-
};
|
|
20
|
-
var devDependencies = {
|
|
21
|
-
"@types/node": "^20.14.8",
|
|
22
|
-
abitype: "^1.0.4",
|
|
23
|
-
"eip-1193": "^0.5.0",
|
|
24
|
-
pkgroll: "^2.1.1",
|
|
25
|
-
rimraf: "^5.0.7",
|
|
26
|
-
typescript: "^5.5.2"
|
|
27
|
-
};
|
|
28
|
-
var peerDependencies = {
|
|
29
|
-
rocketh: "workspace:*"
|
|
30
|
-
};
|
|
31
|
-
var dependencies = {
|
|
32
|
-
"@types/fs-extra": "^11.0.4",
|
|
33
|
-
chalk: "5.3.0",
|
|
34
|
-
commander: "^12.1.0",
|
|
35
|
-
"fs-extra": "^11.2.0",
|
|
36
|
-
rocketh: "workspace:*"
|
|
37
|
-
};
|
|
38
|
-
var scripts = {
|
|
39
|
-
build: "rimraf dist && pkgroll --sourcemap",
|
|
40
|
-
dev: "pkgroll --watch"
|
|
41
|
-
};
|
|
42
|
-
var pkg = {
|
|
43
|
-
name: name,
|
|
44
|
-
version: version,
|
|
45
|
-
description: description,
|
|
46
|
-
publishConfig: publishConfig,
|
|
47
|
-
type: type,
|
|
48
|
-
main: main,
|
|
49
|
-
module: module,
|
|
50
|
-
types: types,
|
|
51
|
-
".": {
|
|
52
|
-
require: {
|
|
53
|
-
types: "./dist/index.d.ts",
|
|
54
|
-
"default": "./dist/index.cjs"
|
|
55
|
-
},
|
|
56
|
-
"import": {
|
|
57
|
-
types: "./dist/index.d.ts",
|
|
58
|
-
"default": "./dist/index.mjs"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
bin: bin,
|
|
62
|
-
devDependencies: devDependencies,
|
|
63
|
-
peerDependencies: peerDependencies,
|
|
64
|
-
dependencies: dependencies,
|
|
65
|
-
scripts: scripts
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const commandName = pkg.name;
|
|
69
|
-
const program = new Command();
|
|
70
|
-
program.name(commandName).description("export deployments to consume elswhere").version(pkg.version).option("-d, --deployments <value>", "folder where deployments are saved").option("--ts <value>", "list of filepath where the typescript export will be written, separated by commas").option("--js <value>", "list of filepath where the javascript export will be written, separated by commas").option("--json <value>", "list of filepath where the json export will be written, separated by commas").option(
|
|
71
|
-
"--tsm <value>",
|
|
72
|
-
"list of filepath where the typescript export with individual export will be written, separated by commas"
|
|
73
|
-
).option(
|
|
74
|
-
"--jsm <value>",
|
|
75
|
-
"list of filepath where the javascript export with individual exportwill be written, separated by commas"
|
|
76
|
-
).option("-b, --bytecode", "if set, the bytecode will also be part of the output").requiredOption("-n, --network <value>", "network context to use").parse(process.argv);
|
|
77
|
-
const options = program.opts();
|
|
78
|
-
const resolvedConfig = readAndResolveConfig({ ...options, ignoreMissingRPC: true });
|
|
79
|
-
run(resolvedConfig, {
|
|
80
|
-
tots: options.ts ? options.ts.split(",") : void 0,
|
|
81
|
-
tojson: options.json ? options.json.split(",") : void 0,
|
|
82
|
-
tojs: options.js ? options.js.split(",") : void 0,
|
|
83
|
-
totsm: options.tsm ? options.tsm.split(",") : void 0,
|
|
84
|
-
tojsm: options.jsm ? options.jsm.split(",") : void 0,
|
|
85
|
-
includeBytecode: options.bytecode
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","sources":["../src/cli.ts"],"sourcesContent":["#! /usr/bin/env node\nimport {readAndResolveConfig} from 'rocketh';\nimport {run} from '.';\nimport {Command} from 'commander';\nimport pkg from '../package.json';\nimport {ConfigOptions} from 'rocketh';\n\nconst commandName = pkg.name;\n\nconst program = new Command();\nprogram\n\t.name(commandName)\n\t.description('export deployments to consume elswhere')\n\t.version(pkg.version)\n\t.option('-d, --deployments <value>', 'folder where deployments are saved')\n\t.option('--ts <value>', 'list of filepath where the typescript export will be written, separated by commas')\n\t.option('--js <value>', 'list of filepath where the javascript export will be written, separated by commas')\n\t.option('--json <value>', 'list of filepath where the json export will be written, separated by commas')\n\t.option(\n\t\t'--tsm <value>',\n\t\t'list of filepath where the typescript export with individual export will be written, separated by commas'\n\t)\n\t.option(\n\t\t'--jsm <value>',\n\t\t'list of filepath where the javascript export with individual exportwill be written, separated by commas'\n\t)\n\t.option('-b, --bytecode', 'if set, the bytecode will also be part of the output')\n\t.requiredOption('-n, --network <value>', 'network context to use')\n\t.parse(process.argv);\n\nconst options = program.opts();\nconst resolvedConfig = readAndResolveConfig({...(options as ConfigOptions), ignoreMissingRPC: true});\nrun(resolvedConfig, {\n\ttots: options.ts ? options.ts.split(',') : undefined,\n\ttojson: options.json ? options.json.split(',') : undefined,\n\ttojs: options.js ? options.js.split(',') : undefined,\n\ttotsm: options.tsm ? options.tsm.split(',') : undefined,\n\ttojsm: options.jsm ? options.jsm.split(',') : undefined,\n\tincludeBytecode: options.bytecode,\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC;AAC7B,MAAA,OAAA,GAAA,IAAA,OAAA,EAAA,CAAA;AACA,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,WAAG,CAAA,wCAAA,CAAA,CAAA,OAAA,CAAA,GAAA,CAAA,OAAA,CAAA,CAAA,MAAA,CAAA,2BAAA,EAAA,oCAAA,CAAA,CAAA,MAAA,CAAA,cAAA,EAAA,mFAAA,CAAA,CAAA,MAAA,CAAA,cAAA,EAAA,mFAAA,CAAA,CAAA,MAAA,CAAA,gBAAA,EAAA,6EAAA,CAAA,CAAA,MAAA;AAC7B,EAAA,eAAA;AACA,EAAE,0GAA4B;AAC9B,CAAC,CAAC,MAAK;AACP,EAAE,eAAe;AACjB,EAAE,0GAAqD;AACvD,CAAC,CAAC,MAAM,CAAC,gBAAa,EAAA,sDAAA,CAAA,CAAA,cAAA,CAAA,uBAAA,EAAA,wBAAA,CAAA,CAAA,KAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA;AACtB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;AAC/B,MAAM,cAAc,GAAG,oBAAoB,CAAC,EAAE,GAAG,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;AACpF,GAAG,CAAC,cAAc,EAAE;AACpB,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACnD,EAAE,MAAM,EAAC,OAAA,CAAA,IAAA,GAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA,KAAA,CAAA;AACT,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,GAAA,OAAA,CAAA,EAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA,KAAA,CAAA;AAClB,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACtD,EAAE,KAAA,EAAA,OAAA,CAAA,GAAA,GAAA,OAAA,CAAA,GAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA,KAAA,CAAA;AACF,EAAE,eAAO,EAAA,OAAA,CAAA,QAAA;AACT,CAAC,CAAC"}
|
package/dist/index.cjs
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fs = require('node:fs');
|
|
4
|
-
var path = require('node:path');
|
|
5
|
-
var rocketh = require('rocketh');
|
|
6
|
-
|
|
7
|
-
function objectMap(object, mapFn) {
|
|
8
|
-
return Object.keys(object).reduce((result, key) => {
|
|
9
|
-
result[key] = mapFn(object[key]);
|
|
10
|
-
return result;
|
|
11
|
-
}, {});
|
|
12
|
-
}
|
|
13
|
-
async function run(config, options) {
|
|
14
|
-
if (!options.tots && !options.tojs && !options.tojson && !options.tojsm && !options.totsm) {
|
|
15
|
-
console.log(`no filepath to export to are specified`);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const { deployments, chainId, genesisHash } = rocketh.loadDeployments(config.deployments, config.network.name);
|
|
19
|
-
if (!deployments || Object.keys(deployments).length === 0) {
|
|
20
|
-
console.log(`no deployments to export`);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (!chainId) {
|
|
24
|
-
throw new Error(`no chainId found for ${config.network.name}`);
|
|
25
|
-
}
|
|
26
|
-
const chain = rocketh.getChain(chainId);
|
|
27
|
-
const chainInfo = {
|
|
28
|
-
id: chain.id,
|
|
29
|
-
name: chain.name,
|
|
30
|
-
nativeCurrency: chain.nativeCurrency,
|
|
31
|
-
rpcUrls: chain.rpcUrls,
|
|
32
|
-
blockExplorers: chain.blockExplorers,
|
|
33
|
-
chainType: rocketh.chainTypes[chainId] || "default",
|
|
34
|
-
contracts: chain.contracts,
|
|
35
|
-
sourceId: chain.sourceId,
|
|
36
|
-
testnet: chain.testnet
|
|
37
|
-
};
|
|
38
|
-
const exportData = {
|
|
39
|
-
chainId,
|
|
40
|
-
genesisHash,
|
|
41
|
-
chainInfo,
|
|
42
|
-
contracts: objectMap(deployments, (d) => ({
|
|
43
|
-
abi: d.abi,
|
|
44
|
-
address: d.address,
|
|
45
|
-
linkedData: d.linkedData,
|
|
46
|
-
bytecode: options.includeBytecode ? d.bytecode : void 0,
|
|
47
|
-
argsData: options.includeBytecode ? d.argsData : void 0,
|
|
48
|
-
startBlock: d.receipt?.blockNumber ? parseInt(d.receipt.blockNumber.slice(2), 16) : void 0
|
|
49
|
-
})),
|
|
50
|
-
name: config.network.name
|
|
51
|
-
};
|
|
52
|
-
const js = typeof options.tojs === "string" ? [options.tojs] : options.tojs || [];
|
|
53
|
-
const ts = typeof options.tots === "string" ? [options.tots] : options.tots || [];
|
|
54
|
-
const json = typeof options.tojson === "string" ? [options.tojson] : options.tojson || [];
|
|
55
|
-
const tsmodule = typeof options.totsm === "string" ? [options.totsm] : options.totsm || [];
|
|
56
|
-
const jsmodule = typeof options.tojsm === "string" ? [options.tojsm] : options.tojsm || [];
|
|
57
|
-
if (ts.length > 0) {
|
|
58
|
-
const newContent = `export default ${JSON.stringify(exportData, null, 2)} as const;`;
|
|
59
|
-
for (const tsFile of ts) {
|
|
60
|
-
const folderPath = path.dirname(tsFile);
|
|
61
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
62
|
-
fs.writeFileSync(tsFile, newContent);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (js.length > 0) {
|
|
66
|
-
const newContent = `export default /** @type {const} **/ (${JSON.stringify(exportData, null, 2)});`;
|
|
67
|
-
const dtsContent = `export = ${JSON.stringify(exportData, null, 2)} as const;`;
|
|
68
|
-
for (const jsFile of js) {
|
|
69
|
-
const folderPath = path.dirname(jsFile);
|
|
70
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
71
|
-
fs.writeFileSync(jsFile, newContent);
|
|
72
|
-
fs.writeFileSync(jsFile.replace(".js", ".d.ts"), dtsContent);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (json.length > 0) {
|
|
76
|
-
const newContent = JSON.stringify(exportData, null, 2);
|
|
77
|
-
for (const jsonFile of json) {
|
|
78
|
-
const folderPath = path.dirname(jsonFile);
|
|
79
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
80
|
-
fs.writeFileSync(jsonFile, newContent);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (tsmodule.length > 0) {
|
|
84
|
-
let newContent = `export const chain = ${JSON.stringify(
|
|
85
|
-
{
|
|
86
|
-
chainId: exportData.chainId,
|
|
87
|
-
genesisHash: exportData.genesisHash,
|
|
88
|
-
chainInfo: exportData.chainInfo,
|
|
89
|
-
name: exportData.name
|
|
90
|
-
},
|
|
91
|
-
null,
|
|
92
|
-
2
|
|
93
|
-
)} as const;
|
|
94
|
-
`;
|
|
95
|
-
for (const contractName of Object.keys(exportData.contracts)) {
|
|
96
|
-
newContent += `export const ${contractName} = ${JSON.stringify(
|
|
97
|
-
exportData.contracts[contractName],
|
|
98
|
-
null,
|
|
99
|
-
2
|
|
100
|
-
)} as const;`;
|
|
101
|
-
}
|
|
102
|
-
for (const tsFile of tsmodule) {
|
|
103
|
-
const folderPath = path.dirname(tsFile);
|
|
104
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
105
|
-
fs.writeFileSync(tsFile, newContent);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (jsmodule.length > 0) {
|
|
109
|
-
let newContent = `export const chain = /** @type {const} **/ (${JSON.stringify(
|
|
110
|
-
{
|
|
111
|
-
chainId: exportData.chainId,
|
|
112
|
-
genesisHash: exportData.genesisHash,
|
|
113
|
-
chainInfo: exportData.chainInfo,
|
|
114
|
-
name: exportData.name
|
|
115
|
-
},
|
|
116
|
-
null,
|
|
117
|
-
2
|
|
118
|
-
)});
|
|
119
|
-
`;
|
|
120
|
-
for (const contractName of Object.keys(exportData.contracts)) {
|
|
121
|
-
newContent += `export const ${contractName} = /** @type {const} **/ (${JSON.stringify(
|
|
122
|
-
exportData.contracts[contractName],
|
|
123
|
-
null,
|
|
124
|
-
2
|
|
125
|
-
)});`;
|
|
126
|
-
}
|
|
127
|
-
for (const jsFile of jsmodule) {
|
|
128
|
-
const folderPath = path.dirname(jsFile);
|
|
129
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
130
|
-
fs.writeFileSync(jsFile, newContent);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
exports.run = run;
|
|
136
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import {Abi, Address} from 'abitype';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport {Deployment, ResolvedConfig, chainTypes, getChain, loadDeployments} from 'rocketh';\n\nexport interface ContractExport {\n\taddress: `0x${string}`;\n\tabi: Abi;\n\targsData?: string;\n\tbytecode?: `0x${string}`;\n\t// linkedData?: any; TODO\n}\n\ntype ChainBlockExplorer = {\n\tname: string;\n\turl: string;\n\tapiUrl?: string | undefined;\n};\ntype ChainContract = {\n\taddress: Address;\n\tblockCreated?: number | undefined;\n};\n\ntype ChainNativeCurrency = {\n\tname: string;\n\t/** 2-6 characters long */\n\tsymbol: string;\n\tdecimals: number;\n};\n\ntype ChainRpcUrls = {\n\thttp: readonly string[];\n\twebSocket?: readonly string[] | undefined;\n};\n\n/**\n * @description Combines members of an intersection into a readable type.\n *\n * @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}\n * @example\n * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>\n * => { a: string, b: string, c: number, d: bigint }\n */\ntype Prettify<T> = {\n\t[K in keyof T]: T[K];\n} & {};\n\nexport type ChainInfo = {\n\t/** ID in number form */\n\tid: number;\n\t/** Human-readable name */\n\tname: string;\n\t/** Collection of block explorers */\n\tblockExplorers?:\n\t\t| {\n\t\t\t\t[key: string]: ChainBlockExplorer;\n\t\t\t\tdefault: ChainBlockExplorer;\n\t\t }\n\t\t| undefined;\n\t/** Collection of contracts */\n\tcontracts?:\n\t\t| Prettify<\n\t\t\t\t{\n\t\t\t\t\t[key: string]: ChainContract | {[sourceId: number]: ChainContract | undefined} | undefined;\n\t\t\t\t} & {\n\t\t\t\t\tensRegistry?: ChainContract | undefined;\n\t\t\t\t\tensUniversalResolver?: ChainContract | undefined;\n\t\t\t\t\tmulticall3?: ChainContract | undefined;\n\t\t\t\t}\n\t\t >\n\t\t| undefined;\n\t/** Currency used by chain */\n\tnativeCurrency: ChainNativeCurrency;\n\t/** Collection of RPC endpoints */\n\trpcUrls: {\n\t\t[key: string]: ChainRpcUrls;\n\t\tdefault: ChainRpcUrls;\n\t};\n\t/** Source Chain ID (ie. the L1 chain) */\n\tsourceId?: number | undefined;\n\t/** Flag for test networks */\n\ttestnet?: boolean | undefined;\n\n\tchainType: 'zksync' | 'op-stack' | 'celo' | 'default';\n\n\t// this will bring in the following when reconstructed from the data above\n\n\t// /** Custom chain data. */\n\t// custom?: any;\n\n\t// /**\n\t// * Modifies how chain data structures (ie. Blocks, Transactions, etc)\n\t// * are formatted & typed.\n\t// */\n\t// formatters?: any | undefined;\n\t// /** Modifies how data (ie. Transactions) is serialized. */\n\t// serializers?: any | undefined;\n\t// /** Modifies how fees are derived. */\n\t// fees?: any | undefined;\n};\n\nexport type ExportedDeployments = {\n\tchainId: string;\n\tgenesisHash?: string;\n\tchainInfo: ChainInfo;\n\tname: string;\n\tcontracts: {[name: string]: ContractExport};\n};\n\ntype Trandformed<O, Value> = {\n\t[Property in keyof O]: Value;\n};\n\nfunction objectMap<V, N, O extends Trandformed<{}, V> = Trandformed<{}, V>>(\n\tobject: O,\n\tmapFn: (v: V) => N\n): Trandformed<O, N> {\n\treturn Object.keys(object).reduce((result, key) => {\n\t\t(result as any)[key] = mapFn((object as any)[key]);\n\t\treturn result;\n\t}, {} as Trandformed<O, N>);\n}\n\nexport async function run(\n\tconfig: ResolvedConfig,\n\toptions: {\n\t\ttojs?: string[];\n\t\ttots?: string[];\n\t\ttojson?: string[];\n\t\ttotsm?: string[];\n\t\ttojsm?: string[];\n\t\tincludeBytecode?: boolean;\n\t}\n) {\n\tif (!options.tots && !options.tojs && !options.tojson && !options.tojsm && !options.totsm) {\n\t\tconsole.log(`no filepath to export to are specified`);\n\t\treturn;\n\t}\n\n\tconst {deployments, chainId, genesisHash} = loadDeployments(config.deployments, config.network.name);\n\n\tif (!deployments || Object.keys(deployments).length === 0) {\n\t\tconsole.log(`no deployments to export`);\n\t\treturn;\n\t}\n\n\tif (!chainId) {\n\t\tthrow new Error(`no chainId found for ${config.network.name}`);\n\t}\n\n\tconst chain = getChain(chainId);\n\n\tconst chainInfo: ChainInfo = {\n\t\tid: chain.id,\n\t\tname: chain.name,\n\t\tnativeCurrency: chain.nativeCurrency,\n\t\trpcUrls: chain.rpcUrls,\n\t\tblockExplorers: chain.blockExplorers,\n\t\tchainType: chainTypes[chainId] || 'default',\n\t\tcontracts: chain.contracts,\n\t\tsourceId: chain.sourceId,\n\t\ttestnet: chain.testnet,\n\t};\n\n\tconst exportData: ExportedDeployments = {\n\t\tchainId,\n\t\tgenesisHash,\n\t\tchainInfo,\n\t\tcontracts: objectMap<Deployment<Abi>, ContractExport>(deployments, (d) => ({\n\t\t\tabi: d.abi,\n\t\t\taddress: d.address,\n\t\t\tlinkedData: d.linkedData,\n\t\t\tbytecode: options.includeBytecode ? d.bytecode : undefined,\n\t\t\targsData: options.includeBytecode ? d.argsData : undefined,\n\t\t\tstartBlock: d.receipt?.blockNumber ? parseInt(d.receipt.blockNumber.slice(2), 16) : undefined,\n\t\t})),\n\t\tname: config.network.name,\n\t};\n\n\tconst js = typeof options.tojs === 'string' ? [options.tojs] : options.tojs || [];\n\tconst ts = typeof options.tots === 'string' ? [options.tots] : options.tots || [];\n\tconst json = typeof options.tojson === 'string' ? [options.tojson] : options.tojson || [];\n\n\tconst tsmodule = typeof options.totsm === 'string' ? [options.totsm] : options.totsm || [];\n\tconst jsmodule = typeof options.tojsm === 'string' ? [options.tojsm] : options.tojsm || [];\n\n\tif (ts.length > 0) {\n\t\tconst newContent = `export default ${JSON.stringify(exportData, null, 2)} as const;`;\n\t\tfor (const tsFile of ts) {\n\t\t\tconst folderPath = path.dirname(tsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(tsFile, newContent);\n\t\t}\n\t}\n\n\tif (js.length > 0) {\n\t\tconst newContent = `export default /** @type {const} **/ (${JSON.stringify(exportData, null, 2)});`;\n\t\tconst dtsContent = `export = ${JSON.stringify(exportData, null, 2)} as const;`;\n\t\tfor (const jsFile of js) {\n\t\t\tconst folderPath = path.dirname(jsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(jsFile, newContent);\n\t\t\tfs.writeFileSync(jsFile.replace('.js', '.d.ts'), dtsContent);\n\t\t}\n\t}\n\n\tif (json.length > 0) {\n\t\tconst newContent = JSON.stringify(exportData, null, 2);\n\t\tfor (const jsonFile of json) {\n\t\t\tconst folderPath = path.dirname(jsonFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(jsonFile, newContent);\n\t\t}\n\t}\n\n\tif (tsmodule.length > 0) {\n\t\tlet newContent = `export const chain = ${JSON.stringify(\n\t\t\t{\n\t\t\t\tchainId: exportData.chainId,\n\t\t\t\tgenesisHash: exportData.genesisHash,\n\t\t\t\tchainInfo: exportData.chainInfo,\n\t\t\t\tname: exportData.name,\n\t\t\t},\n\t\t\tnull,\n\t\t\t2\n\t\t)} as const;\\n`;\n\n\t\tfor (const contractName of Object.keys(exportData.contracts)) {\n\t\t\tnewContent += `export const ${contractName} = ${JSON.stringify(\n\t\t\t\t(exportData.contracts as any)[contractName],\n\t\t\t\tnull,\n\t\t\t\t2\n\t\t\t)} as const;`;\n\t\t}\n\n\t\tfor (const tsFile of tsmodule) {\n\t\t\tconst folderPath = path.dirname(tsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(tsFile, newContent);\n\t\t}\n\t}\n\n\tif (jsmodule.length > 0) {\n\t\t// TODO test\n\t\tlet newContent = `export const chain = /** @type {const} **/ (${JSON.stringify(\n\t\t\t{\n\t\t\t\tchainId: exportData.chainId,\n\t\t\t\tgenesisHash: exportData.genesisHash,\n\t\t\t\tchainInfo: exportData.chainInfo,\n\t\t\t\tname: exportData.name,\n\t\t\t},\n\t\t\tnull,\n\t\t\t2\n\t\t)});\\n`;\n\n\t\tfor (const contractName of Object.keys(exportData.contracts)) {\n\t\t\tnewContent += `export const ${contractName} = /** @type {const} **/ (${JSON.stringify(\n\t\t\t\t(exportData.contracts as any)[contractName],\n\t\t\t\tnull,\n\t\t\t\t2\n\t\t\t)});`;\n\t\t}\n\n\t\tfor (const jsFile of jsmodule) {\n\t\t\tconst folderPath = path.dirname(jsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(jsFile, newContent);\n\t\t}\n\t}\n}\n"],"names":["loadDeployments","getChain","chainTypes"],"mappings":";;;;;;AAIA,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE;AAClC,EAAE,O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C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;AAClE,MAAM,UAAU,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,0BAA0B,EAAE,IAAI,CAAC,SAAS;AAC3F,QAAQ,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC;AAC1C,QAAQ,IAAI;AACZ,QAAQ,CAAC;AACT,OAAO,CAAC,EAAE,CAAC,CAAC;AACZ,KAAK;AACL,IAAI,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE;AACnC,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,MAAM,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC3C,KAAK;AACL,GAAG;AACH;;;;"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import { ResolvedConfig } from 'rocketh';
|
|
2
|
-
|
|
3
|
-
interface Register {
|
|
4
|
-
}
|
|
5
|
-
type ResolvedRegister = {
|
|
6
|
-
/**
|
|
7
|
-
* TypeScript type to use for `address` values
|
|
8
|
-
* @default `0x${string}`
|
|
9
|
-
*/
|
|
10
|
-
addressType: Register extends {
|
|
11
|
-
addressType: infer type;
|
|
12
|
-
} ? type : Register extends {
|
|
13
|
-
AddressType: infer type;
|
|
14
|
-
} ? type : DefaultRegister['addressType'];
|
|
15
|
-
/**
|
|
16
|
-
* TypeScript type to use for `int<M>` and `uint<M>` values, where `M > 48`
|
|
17
|
-
* @default bigint
|
|
18
|
-
*/
|
|
19
|
-
bigIntType: Register extends {
|
|
20
|
-
bigIntType: infer type;
|
|
21
|
-
} ? type : Register extends {
|
|
22
|
-
BigIntType: infer type;
|
|
23
|
-
} ? type : DefaultRegister['bigIntType'];
|
|
24
|
-
/**
|
|
25
|
-
* TypeScript type to use for `bytes` values
|
|
26
|
-
* @default { inputs: `0x${string}`; outputs: `0x${string}`; }
|
|
27
|
-
*/
|
|
28
|
-
bytesType: Register extends {
|
|
29
|
-
bytesType: infer type extends {
|
|
30
|
-
inputs: unknown;
|
|
31
|
-
outputs: unknown;
|
|
32
|
-
};
|
|
33
|
-
} ? type : Register extends {
|
|
34
|
-
BytesType: infer type extends {
|
|
35
|
-
inputs: unknown;
|
|
36
|
-
outputs: unknown;
|
|
37
|
-
};
|
|
38
|
-
} ? type : DefaultRegister['bytesType'];
|
|
39
|
-
/**
|
|
40
|
-
* TypeScript type to use for `int<M>` and `uint<M>` values, where `M <= 48`
|
|
41
|
-
* @default number
|
|
42
|
-
*/
|
|
43
|
-
intType: Register extends {
|
|
44
|
-
intType: infer type;
|
|
45
|
-
} ? type : Register extends {
|
|
46
|
-
IntType: infer type;
|
|
47
|
-
} ? type : DefaultRegister['intType'];
|
|
48
|
-
/**
|
|
49
|
-
* Maximum depth for nested array types (e.g. string[][])
|
|
50
|
-
*
|
|
51
|
-
* Note: You probably only want to set this to a specific number if parsed types are returning as `unknown`
|
|
52
|
-
* and you want to figure out why. If you set this, you should probably also reduce `FixedArrayMaxLength`.
|
|
53
|
-
*
|
|
54
|
-
* @default false
|
|
55
|
-
*/
|
|
56
|
-
arrayMaxDepth: Register extends {
|
|
57
|
-
arrayMaxDepth: infer type extends number | false;
|
|
58
|
-
} ? type : Register extends {
|
|
59
|
-
ArrayMaxDepth: infer type extends number | false;
|
|
60
|
-
} ? type : DefaultRegister['arrayMaxDepth'];
|
|
61
|
-
/**
|
|
62
|
-
* Lower bound for fixed array length
|
|
63
|
-
* @default 1
|
|
64
|
-
*/
|
|
65
|
-
fixedArrayMinLength: Register extends {
|
|
66
|
-
fixedArrayMinLength: infer type extends number;
|
|
67
|
-
} ? type : Register extends {
|
|
68
|
-
FixedArrayMinLength: infer type extends number;
|
|
69
|
-
} ? type : DefaultRegister['fixedArrayMinLength'];
|
|
70
|
-
/**
|
|
71
|
-
* Upper bound for fixed array length
|
|
72
|
-
* @default 99
|
|
73
|
-
*/
|
|
74
|
-
fixedArrayMaxLength: Register extends {
|
|
75
|
-
fixedArrayMaxLength: infer type extends number;
|
|
76
|
-
} ? type : Register extends {
|
|
77
|
-
FixedArrayMaxLength: infer type extends number;
|
|
78
|
-
} ? type : DefaultRegister['fixedArrayMaxLength'];
|
|
79
|
-
/**
|
|
80
|
-
* When set, validates {@link AbiParameter}'s `type` against {@link AbiType}
|
|
81
|
-
*
|
|
82
|
-
* Note: You probably only want to set this to `true` if parsed types are returning as `unknown`
|
|
83
|
-
* and you want to figure out why.
|
|
84
|
-
*
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
strictAbiType: Register extends {
|
|
88
|
-
strictAbiType: infer type extends boolean;
|
|
89
|
-
} ? type : Register extends {
|
|
90
|
-
StrictAbiType: infer type extends boolean;
|
|
91
|
-
} ? type : DefaultRegister['strictAbiType'];
|
|
92
|
-
/** @deprecated Use `addressType` instead */
|
|
93
|
-
AddressType: ResolvedRegister['addressType'];
|
|
94
|
-
/** @deprecated Use `addressType` instead */
|
|
95
|
-
BigIntType: ResolvedRegister['bigIntType'];
|
|
96
|
-
/** @deprecated Use `bytesType` instead */
|
|
97
|
-
BytesType: ResolvedRegister['bytesType'];
|
|
98
|
-
/** @deprecated Use `intType` instead */
|
|
99
|
-
IntType: ResolvedRegister['intType'];
|
|
100
|
-
/** @deprecated Use `arrayMaxDepth` instead */
|
|
101
|
-
ArrayMaxDepth: ResolvedRegister['arrayMaxDepth'];
|
|
102
|
-
/** @deprecated Use `fixedArrayMinLength` instead */
|
|
103
|
-
FixedArrayMinLength: ResolvedRegister['fixedArrayMinLength'];
|
|
104
|
-
/** @deprecated Use `fixedArrayMaxLength` instead */
|
|
105
|
-
FixedArrayMaxLength: ResolvedRegister['fixedArrayMaxLength'];
|
|
106
|
-
/** @deprecated Use `strictAbiType` instead */
|
|
107
|
-
StrictAbiType: ResolvedRegister['strictAbiType'];
|
|
108
|
-
};
|
|
109
|
-
type DefaultRegister = {
|
|
110
|
-
/** Maximum depth for nested array types (e.g. string[][]) */
|
|
111
|
-
arrayMaxDepth: false;
|
|
112
|
-
/** Lower bound for fixed array length */
|
|
113
|
-
fixedArrayMinLength: 1;
|
|
114
|
-
/** Upper bound for fixed array length */
|
|
115
|
-
fixedArrayMaxLength: 99;
|
|
116
|
-
/** TypeScript type to use for `address` values */
|
|
117
|
-
addressType: `0x${string}`;
|
|
118
|
-
/** TypeScript type to use for `bytes` values */
|
|
119
|
-
bytesType: {
|
|
120
|
-
/** TypeScript type to use for `bytes` input values */
|
|
121
|
-
inputs: `0x${string}`;
|
|
122
|
-
/** TypeScript type to use for `bytes` output values */
|
|
123
|
-
outputs: `0x${string}`;
|
|
124
|
-
};
|
|
125
|
-
/** TypeScript type to use for `int<M>` and `uint<M>` values, where `M > 48` */
|
|
126
|
-
bigIntType: bigint;
|
|
127
|
-
/** TypeScript type to use for `int<M>` and `uint<M>` values, where `M <= 48` */
|
|
128
|
-
intType: number;
|
|
129
|
-
/** When set, validates {@link AbiParameter}'s `type` against {@link AbiType} */
|
|
130
|
-
strictAbiType: false;
|
|
131
|
-
/** @deprecated Use `arrayMaxDepth` instead */
|
|
132
|
-
ArrayMaxDepth: DefaultRegister['arrayMaxDepth'];
|
|
133
|
-
/** @deprecated Use `fixedArrayMinLength` instead */
|
|
134
|
-
FixedArrayMinLength: DefaultRegister['fixedArrayMinLength'];
|
|
135
|
-
/** @deprecated Use `fixedArrayMaxLength` instead */
|
|
136
|
-
FixedArrayMaxLength: DefaultRegister['fixedArrayMaxLength'];
|
|
137
|
-
/** @deprecated Use `addressType` instead */
|
|
138
|
-
AddressType: DefaultRegister['addressType'];
|
|
139
|
-
/** @deprecated Use `bytesType` instead */
|
|
140
|
-
BytesType: {
|
|
141
|
-
inputs: DefaultRegister['bytesType']['inputs'];
|
|
142
|
-
outputs: DefaultRegister['bytesType']['outputs'];
|
|
143
|
-
};
|
|
144
|
-
/** @deprecated Use `bigIntType` instead */
|
|
145
|
-
BigIntType: DefaultRegister['bigIntType'];
|
|
146
|
-
/** @deprecated Use `intType` instead */
|
|
147
|
-
IntType: DefaultRegister['intType'];
|
|
148
|
-
/** @deprecated Use `strictAbiType` instead */
|
|
149
|
-
StrictAbiType: DefaultRegister['strictAbiType'];
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Combines members of an intersection into a readable type.
|
|
154
|
-
*
|
|
155
|
-
* @link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
156
|
-
* @example
|
|
157
|
-
* type Result = Pretty<{ a: string } | { b: string } | { c: number, d: bigint }>
|
|
158
|
-
* // ^? type Result = { a: string; b: string; c: number; d: bigint }
|
|
159
|
-
*/
|
|
160
|
-
type Pretty<type> = {
|
|
161
|
-
[key in keyof type]: type[key];
|
|
162
|
-
} & unknown;
|
|
163
|
-
/**
|
|
164
|
-
* Creates range between two positive numbers using [tail recursion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types).
|
|
165
|
-
*
|
|
166
|
-
* @param start - Number to start range
|
|
167
|
-
* @param stop - Number to end range
|
|
168
|
-
* @returns Array with inclusive range from {@link start} to {@link stop}
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* type Result = Range<1, 3>
|
|
172
|
-
* // ^? type Result = [1, 2, 3]
|
|
173
|
-
*/
|
|
174
|
-
type Range<start extends number, stop extends number, result extends number[] = [], padding extends 0[] = [], current extends number = [...padding, ...result]['length'] & number> = current extends stop ? current extends start ? [current] : result extends [] ? [] : [...result, current] : current extends start ? Range<start, stop, [current], padding> : result extends [] ? Range<start, stop, [], [...padding, 0]> : Range<start, stop, [...result, current], padding>;
|
|
175
|
-
|
|
176
|
-
type Address = ResolvedRegister['addressType'];
|
|
177
|
-
type MBytes = '' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32;
|
|
178
|
-
type MBits = '' | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | 208 | 216 | 224 | 232 | 240 | 248 | 256;
|
|
179
|
-
type SolidityAddress = 'address';
|
|
180
|
-
type SolidityBool = 'bool';
|
|
181
|
-
type SolidityBytes = `bytes${MBytes}`;
|
|
182
|
-
type SolidityFunction = 'function';
|
|
183
|
-
type SolidityString = 'string';
|
|
184
|
-
type SolidityTuple = 'tuple';
|
|
185
|
-
type SolidityInt = `${'u' | ''}int${MBits}`;
|
|
186
|
-
type SolidityFixedArrayRange = Range<ResolvedRegister['fixedArrayMinLength'], ResolvedRegister['fixedArrayMaxLength']>[number];
|
|
187
|
-
/**
|
|
188
|
-
* Recursively build arrays up to maximum depth
|
|
189
|
-
* or use a more broad type when maximum depth is switched "off"
|
|
190
|
-
*/
|
|
191
|
-
type _BuildArrayTypes<T extends string, Depth extends readonly number[] = []> = ResolvedRegister['arrayMaxDepth'] extends false ? `${T}[${string}]` : Depth['length'] extends ResolvedRegister['arrayMaxDepth'] ? T : T extends `${any}[${SolidityFixedArrayRange | ''}]` ? _BuildArrayTypes<T | `${T}[${SolidityFixedArrayRange | ''}]`, [
|
|
192
|
-
...Depth,
|
|
193
|
-
1
|
|
194
|
-
]> : _BuildArrayTypes<`${T}[${SolidityFixedArrayRange | ''}]`, [...Depth, 1]>;
|
|
195
|
-
type SolidityArrayWithoutTuple = _BuildArrayTypes<SolidityAddress | SolidityBool | SolidityBytes | SolidityFunction | SolidityInt | SolidityString>;
|
|
196
|
-
type SolidityArrayWithTuple = _BuildArrayTypes<SolidityTuple>;
|
|
197
|
-
type SolidityArray = SolidityArrayWithoutTuple | SolidityArrayWithTuple;
|
|
198
|
-
type AbiType = SolidityArray | SolidityAddress | SolidityBool | SolidityBytes | SolidityFunction | SolidityInt | SolidityString | SolidityTuple;
|
|
199
|
-
type ResolvedAbiType = ResolvedRegister['strictAbiType'] extends true ? AbiType : string;
|
|
200
|
-
type AbiInternalType = ResolvedAbiType | `address ${string}` | `contract ${string}` | `enum ${string}` | `struct ${string}`;
|
|
201
|
-
type AbiParameter = Pretty<{
|
|
202
|
-
type: ResolvedAbiType;
|
|
203
|
-
name?: string | undefined;
|
|
204
|
-
/** Representation used by Solidity compiler */
|
|
205
|
-
internalType?: AbiInternalType | undefined;
|
|
206
|
-
} & ({
|
|
207
|
-
type: Exclude<ResolvedAbiType, SolidityTuple | SolidityArrayWithTuple>;
|
|
208
|
-
} | {
|
|
209
|
-
type: SolidityTuple | SolidityArrayWithTuple;
|
|
210
|
-
components: readonly AbiParameter[];
|
|
211
|
-
})>;
|
|
212
|
-
type AbiEventParameter = AbiParameter & {
|
|
213
|
-
indexed?: boolean | undefined;
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* State mutability for {@link AbiFunction}
|
|
217
|
-
*
|
|
218
|
-
* @see https://docs.soliditylang.org/en/latest/contracts.html#state-mutability
|
|
219
|
-
*/
|
|
220
|
-
type AbiStateMutability = 'pure' | 'view' | 'nonpayable' | 'payable';
|
|
221
|
-
/** ABI ["function"](https://docs.soliditylang.org/en/latest/abi-spec.html#json) type */
|
|
222
|
-
type AbiFunction = {
|
|
223
|
-
type: 'function';
|
|
224
|
-
/**
|
|
225
|
-
* @deprecated use `pure` or `view` from {@link AbiStateMutability} instead
|
|
226
|
-
* @see https://github.com/ethereum/solidity/issues/992
|
|
227
|
-
*/
|
|
228
|
-
constant?: boolean | undefined;
|
|
229
|
-
/**
|
|
230
|
-
* @deprecated Vyper used to provide gas estimates
|
|
231
|
-
* @see https://github.com/vyperlang/vyper/issues/2151
|
|
232
|
-
*/
|
|
233
|
-
gas?: number | undefined;
|
|
234
|
-
inputs: readonly AbiParameter[];
|
|
235
|
-
name: string;
|
|
236
|
-
outputs: readonly AbiParameter[];
|
|
237
|
-
/**
|
|
238
|
-
* @deprecated use `payable` or `nonpayable` from {@link AbiStateMutability} instead
|
|
239
|
-
* @see https://github.com/ethereum/solidity/issues/992
|
|
240
|
-
*/
|
|
241
|
-
payable?: boolean | undefined;
|
|
242
|
-
stateMutability: AbiStateMutability;
|
|
243
|
-
};
|
|
244
|
-
/** ABI ["constructor"](https://docs.soliditylang.org/en/latest/abi-spec.html#json) type */
|
|
245
|
-
type AbiConstructor = {
|
|
246
|
-
type: 'constructor';
|
|
247
|
-
inputs: readonly AbiParameter[];
|
|
248
|
-
/**
|
|
249
|
-
* @deprecated use `payable` or `nonpayable` from {@link AbiStateMutability} instead
|
|
250
|
-
* @see https://github.com/ethereum/solidity/issues/992
|
|
251
|
-
*/
|
|
252
|
-
payable?: boolean | undefined;
|
|
253
|
-
stateMutability: Extract<AbiStateMutability, 'payable' | 'nonpayable'>;
|
|
254
|
-
};
|
|
255
|
-
/** ABI ["fallback"](https://docs.soliditylang.org/en/latest/abi-spec.html#json) type */
|
|
256
|
-
type AbiFallback = {
|
|
257
|
-
type: 'fallback';
|
|
258
|
-
inputs?: readonly [] | undefined;
|
|
259
|
-
/**
|
|
260
|
-
* @deprecated use `payable` or `nonpayable` from {@link AbiStateMutability} instead
|
|
261
|
-
* @see https://github.com/ethereum/solidity/issues/992
|
|
262
|
-
*/
|
|
263
|
-
payable?: boolean | undefined;
|
|
264
|
-
stateMutability: Extract<AbiStateMutability, 'payable' | 'nonpayable'>;
|
|
265
|
-
};
|
|
266
|
-
/** ABI ["receive"](https://docs.soliditylang.org/en/latest/contracts.html#receive-ether-function) type */
|
|
267
|
-
type AbiReceive = {
|
|
268
|
-
type: 'receive';
|
|
269
|
-
stateMutability: Extract<AbiStateMutability, 'payable'>;
|
|
270
|
-
};
|
|
271
|
-
/** ABI ["event"](https://docs.soliditylang.org/en/latest/abi-spec.html#events) type */
|
|
272
|
-
type AbiEvent = {
|
|
273
|
-
type: 'event';
|
|
274
|
-
anonymous?: boolean | undefined;
|
|
275
|
-
inputs: readonly AbiEventParameter[];
|
|
276
|
-
name: string;
|
|
277
|
-
};
|
|
278
|
-
/** ABI ["error"](https://docs.soliditylang.org/en/latest/abi-spec.html#errors) type */
|
|
279
|
-
type AbiError = {
|
|
280
|
-
type: 'error';
|
|
281
|
-
inputs: readonly AbiParameter[];
|
|
282
|
-
name: string;
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* Contract [ABI Specification](https://docs.soliditylang.org/en/latest/abi-spec.html#json)
|
|
286
|
-
*/
|
|
287
|
-
type Abi = readonly (AbiConstructor | AbiError | AbiEvent | AbiFallback | AbiFunction | AbiReceive)[];
|
|
288
|
-
|
|
289
|
-
interface ContractExport {
|
|
290
|
-
address: `0x${string}`;
|
|
291
|
-
abi: Abi;
|
|
292
|
-
argsData?: string;
|
|
293
|
-
bytecode?: `0x${string}`;
|
|
294
|
-
}
|
|
295
|
-
type ChainBlockExplorer = {
|
|
296
|
-
name: string;
|
|
297
|
-
url: string;
|
|
298
|
-
apiUrl?: string | undefined;
|
|
299
|
-
};
|
|
300
|
-
type ChainContract = {
|
|
301
|
-
address: Address;
|
|
302
|
-
blockCreated?: number | undefined;
|
|
303
|
-
};
|
|
304
|
-
type ChainNativeCurrency = {
|
|
305
|
-
name: string;
|
|
306
|
-
/** 2-6 characters long */
|
|
307
|
-
symbol: string;
|
|
308
|
-
decimals: number;
|
|
309
|
-
};
|
|
310
|
-
type ChainRpcUrls = {
|
|
311
|
-
http: readonly string[];
|
|
312
|
-
webSocket?: readonly string[] | undefined;
|
|
313
|
-
};
|
|
314
|
-
/**
|
|
315
|
-
* @description Combines members of an intersection into a readable type.
|
|
316
|
-
*
|
|
317
|
-
* @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}
|
|
318
|
-
* @example
|
|
319
|
-
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
|
|
320
|
-
* => { a: string, b: string, c: number, d: bigint }
|
|
321
|
-
*/
|
|
322
|
-
type Prettify<T> = {
|
|
323
|
-
[K in keyof T]: T[K];
|
|
324
|
-
} & {};
|
|
325
|
-
type ChainInfo = {
|
|
326
|
-
/** ID in number form */
|
|
327
|
-
id: number;
|
|
328
|
-
/** Human-readable name */
|
|
329
|
-
name: string;
|
|
330
|
-
/** Collection of block explorers */
|
|
331
|
-
blockExplorers?: {
|
|
332
|
-
[key: string]: ChainBlockExplorer;
|
|
333
|
-
default: ChainBlockExplorer;
|
|
334
|
-
} | undefined;
|
|
335
|
-
/** Collection of contracts */
|
|
336
|
-
contracts?: Prettify<{
|
|
337
|
-
[key: string]: ChainContract | {
|
|
338
|
-
[sourceId: number]: ChainContract | undefined;
|
|
339
|
-
} | undefined;
|
|
340
|
-
} & {
|
|
341
|
-
ensRegistry?: ChainContract | undefined;
|
|
342
|
-
ensUniversalResolver?: ChainContract | undefined;
|
|
343
|
-
multicall3?: ChainContract | undefined;
|
|
344
|
-
}> | undefined;
|
|
345
|
-
/** Currency used by chain */
|
|
346
|
-
nativeCurrency: ChainNativeCurrency;
|
|
347
|
-
/** Collection of RPC endpoints */
|
|
348
|
-
rpcUrls: {
|
|
349
|
-
[key: string]: ChainRpcUrls;
|
|
350
|
-
default: ChainRpcUrls;
|
|
351
|
-
};
|
|
352
|
-
/** Source Chain ID (ie. the L1 chain) */
|
|
353
|
-
sourceId?: number | undefined;
|
|
354
|
-
/** Flag for test networks */
|
|
355
|
-
testnet?: boolean | undefined;
|
|
356
|
-
chainType: 'zksync' | 'op-stack' | 'celo' | 'default';
|
|
357
|
-
};
|
|
358
|
-
type ExportedDeployments = {
|
|
359
|
-
chainId: string;
|
|
360
|
-
genesisHash?: string;
|
|
361
|
-
chainInfo: ChainInfo;
|
|
362
|
-
name: string;
|
|
363
|
-
contracts: {
|
|
364
|
-
[name: string]: ContractExport;
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
|
-
declare function run(config: ResolvedConfig, options: {
|
|
368
|
-
tojs?: string[];
|
|
369
|
-
tots?: string[];
|
|
370
|
-
tojson?: string[];
|
|
371
|
-
totsm?: string[];
|
|
372
|
-
tojsm?: string[];
|
|
373
|
-
includeBytecode?: boolean;
|
|
374
|
-
}): Promise<void>;
|
|
375
|
-
|
|
376
|
-
export { type ChainInfo, type ContractExport, type ExportedDeployments, run };
|
package/dist/index.mjs
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { loadDeployments, getChain, chainTypes } from 'rocketh';
|
|
4
|
-
|
|
5
|
-
function objectMap(object, mapFn) {
|
|
6
|
-
return Object.keys(object).reduce((result, key) => {
|
|
7
|
-
result[key] = mapFn(object[key]);
|
|
8
|
-
return result;
|
|
9
|
-
}, {});
|
|
10
|
-
}
|
|
11
|
-
async function run(config, options) {
|
|
12
|
-
if (!options.tots && !options.tojs && !options.tojson && !options.tojsm && !options.totsm) {
|
|
13
|
-
console.log(`no filepath to export to are specified`);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const { deployments, chainId, genesisHash } = loadDeployments(config.deployments, config.network.name);
|
|
17
|
-
if (!deployments || Object.keys(deployments).length === 0) {
|
|
18
|
-
console.log(`no deployments to export`);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (!chainId) {
|
|
22
|
-
throw new Error(`no chainId found for ${config.network.name}`);
|
|
23
|
-
}
|
|
24
|
-
const chain = getChain(chainId);
|
|
25
|
-
const chainInfo = {
|
|
26
|
-
id: chain.id,
|
|
27
|
-
name: chain.name,
|
|
28
|
-
nativeCurrency: chain.nativeCurrency,
|
|
29
|
-
rpcUrls: chain.rpcUrls,
|
|
30
|
-
blockExplorers: chain.blockExplorers,
|
|
31
|
-
chainType: chainTypes[chainId] || "default",
|
|
32
|
-
contracts: chain.contracts,
|
|
33
|
-
sourceId: chain.sourceId,
|
|
34
|
-
testnet: chain.testnet
|
|
35
|
-
};
|
|
36
|
-
const exportData = {
|
|
37
|
-
chainId,
|
|
38
|
-
genesisHash,
|
|
39
|
-
chainInfo,
|
|
40
|
-
contracts: objectMap(deployments, (d) => ({
|
|
41
|
-
abi: d.abi,
|
|
42
|
-
address: d.address,
|
|
43
|
-
linkedData: d.linkedData,
|
|
44
|
-
bytecode: options.includeBytecode ? d.bytecode : void 0,
|
|
45
|
-
argsData: options.includeBytecode ? d.argsData : void 0,
|
|
46
|
-
startBlock: d.receipt?.blockNumber ? parseInt(d.receipt.blockNumber.slice(2), 16) : void 0
|
|
47
|
-
})),
|
|
48
|
-
name: config.network.name
|
|
49
|
-
};
|
|
50
|
-
const js = typeof options.tojs === "string" ? [options.tojs] : options.tojs || [];
|
|
51
|
-
const ts = typeof options.tots === "string" ? [options.tots] : options.tots || [];
|
|
52
|
-
const json = typeof options.tojson === "string" ? [options.tojson] : options.tojson || [];
|
|
53
|
-
const tsmodule = typeof options.totsm === "string" ? [options.totsm] : options.totsm || [];
|
|
54
|
-
const jsmodule = typeof options.tojsm === "string" ? [options.tojsm] : options.tojsm || [];
|
|
55
|
-
if (ts.length > 0) {
|
|
56
|
-
const newContent = `export default ${JSON.stringify(exportData, null, 2)} as const;`;
|
|
57
|
-
for (const tsFile of ts) {
|
|
58
|
-
const folderPath = path.dirname(tsFile);
|
|
59
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
60
|
-
fs.writeFileSync(tsFile, newContent);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (js.length > 0) {
|
|
64
|
-
const newContent = `export default /** @type {const} **/ (${JSON.stringify(exportData, null, 2)});`;
|
|
65
|
-
const dtsContent = `export = ${JSON.stringify(exportData, null, 2)} as const;`;
|
|
66
|
-
for (const jsFile of js) {
|
|
67
|
-
const folderPath = path.dirname(jsFile);
|
|
68
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
69
|
-
fs.writeFileSync(jsFile, newContent);
|
|
70
|
-
fs.writeFileSync(jsFile.replace(".js", ".d.ts"), dtsContent);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (json.length > 0) {
|
|
74
|
-
const newContent = JSON.stringify(exportData, null, 2);
|
|
75
|
-
for (const jsonFile of json) {
|
|
76
|
-
const folderPath = path.dirname(jsonFile);
|
|
77
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
78
|
-
fs.writeFileSync(jsonFile, newContent);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (tsmodule.length > 0) {
|
|
82
|
-
let newContent = `export const chain = ${JSON.stringify(
|
|
83
|
-
{
|
|
84
|
-
chainId: exportData.chainId,
|
|
85
|
-
genesisHash: exportData.genesisHash,
|
|
86
|
-
chainInfo: exportData.chainInfo,
|
|
87
|
-
name: exportData.name
|
|
88
|
-
},
|
|
89
|
-
null,
|
|
90
|
-
2
|
|
91
|
-
)} as const;
|
|
92
|
-
`;
|
|
93
|
-
for (const contractName of Object.keys(exportData.contracts)) {
|
|
94
|
-
newContent += `export const ${contractName} = ${JSON.stringify(
|
|
95
|
-
exportData.contracts[contractName],
|
|
96
|
-
null,
|
|
97
|
-
2
|
|
98
|
-
)} as const;`;
|
|
99
|
-
}
|
|
100
|
-
for (const tsFile of tsmodule) {
|
|
101
|
-
const folderPath = path.dirname(tsFile);
|
|
102
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
103
|
-
fs.writeFileSync(tsFile, newContent);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (jsmodule.length > 0) {
|
|
107
|
-
let newContent = `export const chain = /** @type {const} **/ (${JSON.stringify(
|
|
108
|
-
{
|
|
109
|
-
chainId: exportData.chainId,
|
|
110
|
-
genesisHash: exportData.genesisHash,
|
|
111
|
-
chainInfo: exportData.chainInfo,
|
|
112
|
-
name: exportData.name
|
|
113
|
-
},
|
|
114
|
-
null,
|
|
115
|
-
2
|
|
116
|
-
)});
|
|
117
|
-
`;
|
|
118
|
-
for (const contractName of Object.keys(exportData.contracts)) {
|
|
119
|
-
newContent += `export const ${contractName} = /** @type {const} **/ (${JSON.stringify(
|
|
120
|
-
exportData.contracts[contractName],
|
|
121
|
-
null,
|
|
122
|
-
2
|
|
123
|
-
)});`;
|
|
124
|
-
}
|
|
125
|
-
for (const jsFile of jsmodule) {
|
|
126
|
-
const folderPath = path.dirname(jsFile);
|
|
127
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
128
|
-
fs.writeFileSync(jsFile, newContent);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { run };
|
|
134
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import {Abi, Address} from 'abitype';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport {Deployment, ResolvedConfig, chainTypes, getChain, loadDeployments} from 'rocketh';\n\nexport interface ContractExport {\n\taddress: `0x${string}`;\n\tabi: Abi;\n\targsData?: string;\n\tbytecode?: `0x${string}`;\n\t// linkedData?: any; TODO\n}\n\ntype ChainBlockExplorer = {\n\tname: string;\n\turl: string;\n\tapiUrl?: string | undefined;\n};\ntype ChainContract = {\n\taddress: Address;\n\tblockCreated?: number | undefined;\n};\n\ntype ChainNativeCurrency = {\n\tname: string;\n\t/** 2-6 characters long */\n\tsymbol: string;\n\tdecimals: number;\n};\n\ntype ChainRpcUrls = {\n\thttp: readonly string[];\n\twebSocket?: readonly string[] | undefined;\n};\n\n/**\n * @description Combines members of an intersection into a readable type.\n *\n * @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}\n * @example\n * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>\n * => { a: string, b: string, c: number, d: bigint }\n */\ntype Prettify<T> = {\n\t[K in keyof T]: T[K];\n} & {};\n\nexport type ChainInfo = {\n\t/** ID in number form */\n\tid: number;\n\t/** Human-readable name */\n\tname: string;\n\t/** Collection of block explorers */\n\tblockExplorers?:\n\t\t| {\n\t\t\t\t[key: string]: ChainBlockExplorer;\n\t\t\t\tdefault: ChainBlockExplorer;\n\t\t }\n\t\t| undefined;\n\t/** Collection of contracts */\n\tcontracts?:\n\t\t| Prettify<\n\t\t\t\t{\n\t\t\t\t\t[key: string]: ChainContract | {[sourceId: number]: ChainContract | undefined} | undefined;\n\t\t\t\t} & {\n\t\t\t\t\tensRegistry?: ChainContract | undefined;\n\t\t\t\t\tensUniversalResolver?: ChainContract | undefined;\n\t\t\t\t\tmulticall3?: ChainContract | undefined;\n\t\t\t\t}\n\t\t >\n\t\t| undefined;\n\t/** Currency used by chain */\n\tnativeCurrency: ChainNativeCurrency;\n\t/** Collection of RPC endpoints */\n\trpcUrls: {\n\t\t[key: string]: ChainRpcUrls;\n\t\tdefault: ChainRpcUrls;\n\t};\n\t/** Source Chain ID (ie. the L1 chain) */\n\tsourceId?: number | undefined;\n\t/** Flag for test networks */\n\ttestnet?: boolean | undefined;\n\n\tchainType: 'zksync' | 'op-stack' | 'celo' | 'default';\n\n\t// this will bring in the following when reconstructed from the data above\n\n\t// /** Custom chain data. */\n\t// custom?: any;\n\n\t// /**\n\t// * Modifies how chain data structures (ie. Blocks, Transactions, etc)\n\t// * are formatted & typed.\n\t// */\n\t// formatters?: any | undefined;\n\t// /** Modifies how data (ie. Transactions) is serialized. */\n\t// serializers?: any | undefined;\n\t// /** Modifies how fees are derived. */\n\t// fees?: any | undefined;\n};\n\nexport type ExportedDeployments = {\n\tchainId: string;\n\tgenesisHash?: string;\n\tchainInfo: ChainInfo;\n\tname: string;\n\tcontracts: {[name: string]: ContractExport};\n};\n\ntype Trandformed<O, Value> = {\n\t[Property in keyof O]: Value;\n};\n\nfunction objectMap<V, N, O extends Trandformed<{}, V> = Trandformed<{}, V>>(\n\tobject: O,\n\tmapFn: (v: V) => N\n): Trandformed<O, N> {\n\treturn Object.keys(object).reduce((result, key) => {\n\t\t(result as any)[key] = mapFn((object as any)[key]);\n\t\treturn result;\n\t}, {} as Trandformed<O, N>);\n}\n\nexport async function run(\n\tconfig: ResolvedConfig,\n\toptions: {\n\t\ttojs?: string[];\n\t\ttots?: string[];\n\t\ttojson?: string[];\n\t\ttotsm?: string[];\n\t\ttojsm?: string[];\n\t\tincludeBytecode?: boolean;\n\t}\n) {\n\tif (!options.tots && !options.tojs && !options.tojson && !options.tojsm && !options.totsm) {\n\t\tconsole.log(`no filepath to export to are specified`);\n\t\treturn;\n\t}\n\n\tconst {deployments, chainId, genesisHash} = loadDeployments(config.deployments, config.network.name);\n\n\tif (!deployments || Object.keys(deployments).length === 0) {\n\t\tconsole.log(`no deployments to export`);\n\t\treturn;\n\t}\n\n\tif (!chainId) {\n\t\tthrow new Error(`no chainId found for ${config.network.name}`);\n\t}\n\n\tconst chain = getChain(chainId);\n\n\tconst chainInfo: ChainInfo = {\n\t\tid: chain.id,\n\t\tname: chain.name,\n\t\tnativeCurrency: chain.nativeCurrency,\n\t\trpcUrls: chain.rpcUrls,\n\t\tblockExplorers: chain.blockExplorers,\n\t\tchainType: chainTypes[chainId] || 'default',\n\t\tcontracts: chain.contracts,\n\t\tsourceId: chain.sourceId,\n\t\ttestnet: chain.testnet,\n\t};\n\n\tconst exportData: ExportedDeployments = {\n\t\tchainId,\n\t\tgenesisHash,\n\t\tchainInfo,\n\t\tcontracts: objectMap<Deployment<Abi>, ContractExport>(deployments, (d) => ({\n\t\t\tabi: d.abi,\n\t\t\taddress: d.address,\n\t\t\tlinkedData: d.linkedData,\n\t\t\tbytecode: options.includeBytecode ? d.bytecode : undefined,\n\t\t\targsData: options.includeBytecode ? d.argsData : undefined,\n\t\t\tstartBlock: d.receipt?.blockNumber ? parseInt(d.receipt.blockNumber.slice(2), 16) : undefined,\n\t\t})),\n\t\tname: config.network.name,\n\t};\n\n\tconst js = typeof options.tojs === 'string' ? [options.tojs] : options.tojs || [];\n\tconst ts = typeof options.tots === 'string' ? [options.tots] : options.tots || [];\n\tconst json = typeof options.tojson === 'string' ? [options.tojson] : options.tojson || [];\n\n\tconst tsmodule = typeof options.totsm === 'string' ? [options.totsm] : options.totsm || [];\n\tconst jsmodule = typeof options.tojsm === 'string' ? [options.tojsm] : options.tojsm || [];\n\n\tif (ts.length > 0) {\n\t\tconst newContent = `export default ${JSON.stringify(exportData, null, 2)} as const;`;\n\t\tfor (const tsFile of ts) {\n\t\t\tconst folderPath = path.dirname(tsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(tsFile, newContent);\n\t\t}\n\t}\n\n\tif (js.length > 0) {\n\t\tconst newContent = `export default /** @type {const} **/ (${JSON.stringify(exportData, null, 2)});`;\n\t\tconst dtsContent = `export = ${JSON.stringify(exportData, null, 2)} as const;`;\n\t\tfor (const jsFile of js) {\n\t\t\tconst folderPath = path.dirname(jsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(jsFile, newContent);\n\t\t\tfs.writeFileSync(jsFile.replace('.js', '.d.ts'), dtsContent);\n\t\t}\n\t}\n\n\tif (json.length > 0) {\n\t\tconst newContent = JSON.stringify(exportData, null, 2);\n\t\tfor (const jsonFile of json) {\n\t\t\tconst folderPath = path.dirname(jsonFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(jsonFile, newContent);\n\t\t}\n\t}\n\n\tif (tsmodule.length > 0) {\n\t\tlet newContent = `export const chain = ${JSON.stringify(\n\t\t\t{\n\t\t\t\tchainId: exportData.chainId,\n\t\t\t\tgenesisHash: exportData.genesisHash,\n\t\t\t\tchainInfo: exportData.chainInfo,\n\t\t\t\tname: exportData.name,\n\t\t\t},\n\t\t\tnull,\n\t\t\t2\n\t\t)} as const;\\n`;\n\n\t\tfor (const contractName of Object.keys(exportData.contracts)) {\n\t\t\tnewContent += `export const ${contractName} = ${JSON.stringify(\n\t\t\t\t(exportData.contracts as any)[contractName],\n\t\t\t\tnull,\n\t\t\t\t2\n\t\t\t)} as const;`;\n\t\t}\n\n\t\tfor (const tsFile of tsmodule) {\n\t\t\tconst folderPath = path.dirname(tsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(tsFile, newContent);\n\t\t}\n\t}\n\n\tif (jsmodule.length > 0) {\n\t\t// TODO test\n\t\tlet newContent = `export const chain = /** @type {const} **/ (${JSON.stringify(\n\t\t\t{\n\t\t\t\tchainId: exportData.chainId,\n\t\t\t\tgenesisHash: exportData.genesisHash,\n\t\t\t\tchainInfo: exportData.chainInfo,\n\t\t\t\tname: exportData.name,\n\t\t\t},\n\t\t\tnull,\n\t\t\t2\n\t\t)});\\n`;\n\n\t\tfor (const contractName of Object.keys(exportData.contracts)) {\n\t\t\tnewContent += `export const ${contractName} = /** @type {const} **/ (${JSON.stringify(\n\t\t\t\t(exportData.contracts as any)[contractName],\n\t\t\t\tnull,\n\t\t\t\t2\n\t\t\t)});`;\n\t\t}\n\n\t\tfor (const jsFile of jsmodule) {\n\t\t\tconst folderPath = path.dirname(jsFile);\n\t\t\tfs.mkdirSync(folderPath, {recursive: true});\n\t\t\tfs.writeFileSync(jsFile, newContent);\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAIA,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE;AAClC,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;AACrD,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACrC,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AACM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE;AAC3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