@cartesi/cli 2.0.0-alpha.2 → 2.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/base.d.ts +28 -0
  2. package/dist/base.d.ts.map +1 -0
  3. package/dist/base.js +109 -0
  4. package/dist/builder/directory.d.ts +2 -2
  5. package/dist/builder/directory.d.ts.map +1 -1
  6. package/dist/builder/directory.js +5 -3
  7. package/dist/builder/docker.d.ts +2 -2
  8. package/dist/builder/docker.d.ts.map +1 -1
  9. package/dist/builder/docker.js +39 -37
  10. package/dist/builder/empty.d.ts +1 -1
  11. package/dist/builder/empty.d.ts.map +1 -1
  12. package/dist/builder/empty.js +1 -1
  13. package/dist/builder/none.d.ts +1 -1
  14. package/dist/builder/none.d.ts.map +1 -1
  15. package/dist/builder/none.js +1 -1
  16. package/dist/builder/tar.d.ts +1 -1
  17. package/dist/builder/tar.d.ts.map +1 -1
  18. package/dist/builder/tar.js +1 -1
  19. package/dist/commands/address-book.d.ts +5 -8
  20. package/dist/commands/address-book.d.ts.map +1 -1
  21. package/dist/commands/address-book.js +18 -14
  22. package/dist/commands/build.d.ts +7 -11
  23. package/dist/commands/build.d.ts.map +1 -1
  24. package/dist/commands/build.js +82 -58
  25. package/dist/commands/clean.d.ts +2 -7
  26. package/dist/commands/clean.d.ts.map +1 -1
  27. package/dist/commands/clean.js +9 -10
  28. package/dist/commands/create.d.ts +6 -15
  29. package/dist/commands/create.d.ts.map +1 -1
  30. package/dist/commands/create.js +25 -54
  31. package/dist/commands/deploy/build.d.ts +2 -14
  32. package/dist/commands/deploy/build.d.ts.map +1 -1
  33. package/dist/commands/deploy/build.js +8 -61
  34. package/dist/commands/deploy.d.ts +3 -0
  35. package/dist/commands/deploy.d.ts.map +1 -0
  36. package/dist/commands/deploy.js +12 -0
  37. package/dist/commands/deposit/erc1155.d.ts +18 -0
  38. package/dist/commands/deposit/erc1155.d.ts.map +1 -0
  39. package/dist/commands/deposit/erc1155.js +254 -0
  40. package/dist/commands/deposit/erc20.d.ts +10 -0
  41. package/dist/commands/deposit/erc20.d.ts.map +1 -0
  42. package/dist/commands/deposit/erc20.js +125 -0
  43. package/dist/commands/deposit/erc721.d.ts +10 -0
  44. package/dist/commands/deposit/erc721.d.ts.map +1 -0
  45. package/dist/commands/deposit/erc721.js +143 -0
  46. package/dist/commands/deposit/ether.d.ts +10 -0
  47. package/dist/commands/deposit/ether.d.ts.map +1 -0
  48. package/dist/commands/deposit/ether.js +65 -0
  49. package/dist/commands/deposit.d.ts +9 -0
  50. package/dist/commands/deposit.d.ts.map +1 -0
  51. package/dist/commands/deposit.js +37 -0
  52. package/dist/commands/doctor.d.ts +2 -12
  53. package/dist/commands/doctor.d.ts.map +1 -1
  54. package/dist/commands/doctor.js +90 -91
  55. package/dist/commands/hash.d.ts +4 -9
  56. package/dist/commands/hash.d.ts.map +1 -1
  57. package/dist/commands/hash.js +14 -14
  58. package/dist/commands/logs.d.ts +9 -0
  59. package/dist/commands/logs.d.ts.map +1 -0
  60. package/dist/commands/logs.js +34 -0
  61. package/dist/commands/run.d.ts +14 -20
  62. package/dist/commands/run.d.ts.map +1 -1
  63. package/dist/commands/run.js +193 -182
  64. package/dist/commands/send.d.ts +10 -0
  65. package/dist/commands/send.d.ts.map +1 -0
  66. package/dist/commands/send.js +130 -0
  67. package/dist/commands/shell.d.ts +6 -14
  68. package/dist/commands/shell.d.ts.map +1 -1
  69. package/dist/commands/shell.js +34 -51
  70. package/dist/commands/status.d.ts +6 -0
  71. package/dist/commands/status.d.ts.map +1 -0
  72. package/dist/commands/status.js +50 -0
  73. package/dist/compose/default.env +36 -0
  74. package/dist/compose/docker-compose-anvil.yaml +39 -0
  75. package/dist/compose/docker-compose-bundler.yaml +71 -0
  76. package/dist/{node → compose}/docker-compose-database.yaml +4 -2
  77. package/dist/compose/docker-compose-explorer.yaml +96 -0
  78. package/dist/compose/docker-compose-node-cpus.yaml +6 -0
  79. package/dist/compose/docker-compose-node-memory.yaml +6 -0
  80. package/dist/compose/docker-compose-node.yaml +50 -0
  81. package/dist/compose/docker-compose-passkey-server.yaml +37 -0
  82. package/dist/compose/docker-compose-paymaster.yaml +40 -0
  83. package/dist/compose/docker-compose-proxy.yaml +24 -0
  84. package/dist/config.d.ts +30 -9
  85. package/dist/config.d.ts.map +1 -1
  86. package/dist/config.js +93 -53
  87. package/dist/contracts.d.ts +1695 -1636
  88. package/dist/contracts.d.ts.map +1 -1
  89. package/dist/contracts.js +632 -592
  90. package/dist/exec/cartesi-machine.d.ts +2 -2
  91. package/dist/exec/cartesi-machine.d.ts.map +1 -1
  92. package/dist/exec/cartesi-machine.js +3 -5
  93. package/dist/exec/genext2fs.d.ts +6 -3
  94. package/dist/exec/genext2fs.d.ts.map +1 -1
  95. package/dist/exec/genext2fs.js +5 -5
  96. package/dist/exec/index.d.ts +0 -1
  97. package/dist/exec/index.d.ts.map +1 -1
  98. package/dist/exec/index.js +0 -1
  99. package/dist/exec/mksquashfs.d.ts +2 -2
  100. package/dist/exec/mksquashfs.d.ts.map +1 -1
  101. package/dist/exec/mksquashfs.js +4 -2
  102. package/dist/exec/rollups.d.ts +105 -0
  103. package/dist/exec/rollups.d.ts.map +1 -0
  104. package/dist/exec/rollups.js +375 -0
  105. package/dist/exec/util.d.ts +1 -16
  106. package/dist/exec/util.d.ts.map +1 -1
  107. package/dist/exec/util.js +3 -50
  108. package/dist/index.d.ts +2 -1
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +57 -1
  111. package/dist/machine.d.ts +8 -2
  112. package/dist/machine.d.ts.map +1 -1
  113. package/dist/machine.js +26 -16
  114. package/dist/prompts.d.ts +13 -2
  115. package/dist/prompts.d.ts.map +1 -1
  116. package/dist/prompts.js +60 -26
  117. package/dist/template.d.ts +3 -0
  118. package/dist/template.d.ts.map +1 -0
  119. package/dist/template.js +16 -0
  120. package/dist/wallet.d.ts +9222 -21
  121. package/dist/wallet.d.ts.map +1 -1
  122. package/dist/wallet.js +35 -198
  123. package/package.json +39 -57
  124. package/bin/dev.cmd +0 -3
  125. package/bin/dev.js +0 -25
  126. package/bin/run.cmd +0 -3
  127. package/bin/run.js +0 -8
  128. package/dist/baseCommand.d.ts +0 -22
  129. package/dist/baseCommand.d.ts.map +0 -1
  130. package/dist/baseCommand.js +0 -92
  131. package/dist/commands/deploy/index.d.ts +0 -12
  132. package/dist/commands/deploy/index.d.ts.map +0 -1
  133. package/dist/commands/deploy/index.js +0 -78
  134. package/dist/commands/send/erc20.d.ts +0 -14
  135. package/dist/commands/send/erc20.d.ts.map +0 -1
  136. package/dist/commands/send/erc20.js +0 -70
  137. package/dist/commands/send/erc721.d.ts +0 -14
  138. package/dist/commands/send/erc721.d.ts.map +0 -1
  139. package/dist/commands/send/erc721.js +0 -73
  140. package/dist/commands/send/ether.d.ts +0 -13
  141. package/dist/commands/send/ether.d.ts.map +0 -1
  142. package/dist/commands/send/ether.js +0 -32
  143. package/dist/commands/send/generic.d.ts +0 -15
  144. package/dist/commands/send/generic.d.ts.map +0 -1
  145. package/dist/commands/send/generic.js +0 -119
  146. package/dist/commands/send/index.d.ts +0 -28
  147. package/dist/commands/send/index.d.ts.map +0 -1
  148. package/dist/commands/send/index.js +0 -102
  149. package/dist/exec/crane.d.ts +0 -15
  150. package/dist/exec/crane.d.ts.map +0 -1
  151. package/dist/exec/crane.js +0 -17
  152. package/dist/flags.d.ts +0 -17
  153. package/dist/flags.d.ts.map +0 -1
  154. package/dist/flags.js +0 -28
  155. package/dist/node/DockerfileDeploy.txt +0 -4
  156. package/dist/node/default.env +0 -27
  157. package/dist/node/docker-compose-anvil.yaml +0 -50
  158. package/dist/node/docker-compose-bundler.yaml +0 -57
  159. package/dist/node/docker-compose-envfile.yaml +0 -4
  160. package/dist/node/docker-compose-explorer.yaml +0 -88
  161. package/dist/node/docker-compose-host.yaml +0 -30
  162. package/dist/node/docker-compose-paymaster.yaml +0 -33
  163. package/dist/node/docker-compose-prompt.yaml +0 -17
  164. package/dist/node/docker-compose-proxy.yaml +0 -48
  165. package/dist/node/docker-compose-snapshot-volume.yaml +0 -8
  166. package/dist/node/docker-compose-validator-cpus.yaml +0 -6
  167. package/dist/node/docker-compose-validator-memory.yaml +0 -6
  168. package/dist/node/docker-compose-validator.yaml +0 -59
  169. package/oclif.manifest.json +0 -876
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../src/wallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,OAAO,EACP,KAAK,EACL,GAAG,EAEH,YAAY,EAEZ,YAAY,EAKf,MAAM,MAAM,CAAC;AAiBd,MAAM,MAAM,sBAAsB,GAAG;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,sBAAsB,KAAG,KAAK,EAoBvE,CAAC;AAEF,eAAO,MAAM,uBAAuB,gEAC6B,CAAC;AAElE,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAepD,MAAM,WAAW,qBAAqB;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG,CAC5B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,KACzB,OAAO,CAAC,OAAO,CAAC,CAAC;AAkLtB,QAAA,MAAM,aAAa,YACN,qBAAqB,KAC/B,OAAO,CAAC;IACP,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC9B,CAuBA,CAAC;AAEF,eAAe,aAAa,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA6CxC,CAAC"}
package/dist/wallet.js CHANGED
@@ -1,204 +1,41 @@
1
1
  import input from "@inquirer/input";
2
- import chalk from "chalk";
3
- import { formatUnits, http, createPublicClient as viemCreatePublicClient, createWalletClient as viemCreateWalletClient, } from "viem";
4
- import { mnemonicToAccount, privateKeyToAccount } from "viem/accounts";
5
- import { arbitrum, arbitrumSepolia, base, baseSepolia, foundry, mainnet, optimism, optimismSepolia, sepolia, } from "viem/chains";
6
- import { hexInput, selectAuto } from "./prompts.js";
7
- export const supportedChains = (options) => {
8
- options = options || {
9
- includeDevnet: false, // default is not to show devnet
10
- includeMainnets: true,
11
- includeTestnets: true,
12
- };
13
- options.includeTestnets = options.includeTestnets ?? true; // default is true if not specified
14
- options.includeMainnets = options.includeMainnets ?? true; // default is true if not specified
15
- const chains = [];
16
- if (options.includeDevnet) {
17
- chains.push(foundry);
18
- }
19
- if (options.includeTestnets) {
20
- chains.push(arbitrumSepolia, baseSepolia, optimismSepolia, sepolia);
21
- }
22
- if (options.includeMainnets) {
23
- chains.push(arbitrum, base, mainnet, optimism);
24
- }
25
- return chains;
26
- };
27
- export const DEFAULT_DEVNET_MNEMONIC = "test test test test test test test test test test test junk";
28
- const walletChoices = (chain) => {
29
- const dev = chain.id === foundry.id;
30
- return [
31
- {
32
- name: `Mnemonic${dev ? "" : chalk.red(" (UNSAFE)")}`,
33
- value: "mnemonic",
34
- },
35
- {
36
- name: `Private Key${dev ? "" : chalk.red(" (UNSAFE)")}`,
37
- value: "private-key",
38
- },
39
- ];
40
- };
41
- const selectChain = async (options) => {
42
- // if development mode, include foundry as an option
43
- const chains = supportedChains({ includeDevnet: true });
44
- if (options.chain) {
45
- const chain = options.chain;
46
- if (chains.findIndex((c) => c.id === chain.id) >= 0) {
47
- return options.chain;
48
- }
49
- throw new Error(`Unsupported chainId ${options.chain.id}`);
50
- }
51
- else {
52
- // allow user to select from list
53
- const choices = chains.map((chain) => ({
54
- name: chain.name,
55
- value: chain,
56
- }));
57
- return await selectAuto({
58
- message: "Chain",
59
- choices,
60
- pageSize: choices.length,
61
- discardDisabled: true,
62
- });
63
- }
64
- };
65
- const selectTransport = async (options, chain) => {
66
- // use user provided url (in args) or try to use default one from chain, or ask for one
67
- if (options.rpcUrl) {
68
- return http(options.rpcUrl);
69
- }
70
- else {
71
- const url = await input({
2
+ import { createTestClient, defineChain, http, publicActions, walletActions, } from "viem";
3
+ import { cannon } from "viem/chains";
4
+ import { getProjectName } from "./base.js";
5
+ import { PREFERRED_PORT } from "./config.js";
6
+ import { getProjectPort } from "./exec/rollups.js";
7
+ export const cartesi = defineChain({
8
+ ...cannon,
9
+ name: "Cartesi Devnet",
10
+ testnet: true,
11
+ });
12
+ const getRpcUrl = async (options) => {
13
+ // if rpcUrl is provided, use it
14
+ if (options.rpcUrl)
15
+ return options.rpcUrl;
16
+ // otherwise, try to resolve host:port of the docker project
17
+ try {
18
+ const projectName = getProjectName(options);
19
+ const host = await getProjectPort({ projectName });
20
+ return `http://${host}/anvil`;
21
+ }
22
+ catch {
23
+ return await input({
72
24
  message: "RPC URL",
73
- default: chain.rpcUrls.default.http[0],
74
- });
75
- return http(url);
76
- }
77
- };
78
- const createPublicClient = async (chain, transport) => {
79
- const publicClient = viemCreatePublicClient({ transport, chain });
80
- // check if chainId matches
81
- const chainId = await publicClient.getChainId();
82
- if (chainId !== chain.id) {
83
- throw new Error(`Chain of provided RPC URL (${chainId}) does not match selected chain (${chain.id}))`);
84
- }
85
- return publicClient;
86
- };
87
- /**
88
- * Format the balance of an account for display
89
- * @param account account to format the balance for
90
- * @param publicClient client to query the balance
91
- * @returns formatted balance string
92
- */
93
- const addressBalanceLabel = async (address, publicClient) => {
94
- const chain = publicClient.chain;
95
- if (chain) {
96
- // query balance using provider
97
- const balance = await publicClient.getBalance({ address });
98
- // format balance
99
- const symbol = chain.nativeCurrency.symbol;
100
- const balanceStr = formatUnits(balance, chain.nativeCurrency.decimals);
101
- let balanceLabel = chalk.bold(`${balanceStr} ${symbol}`);
102
- // display in red if balance is zero
103
- if (balance === 0n) {
104
- balanceLabel = chalk.red(balanceLabel);
105
- }
106
- return `${address} ${balanceLabel}`;
107
- }
108
- else {
109
- return address;
110
- }
111
- };
112
- const createWalletClient = async (options, chain, publicClient, publicTransport) => {
113
- if (options.privateKey) {
114
- // private key specified
115
- const account = privateKeyToAccount(options.privateKey);
116
- return viemCreateWalletClient({
117
- account,
118
- transport: publicTransport,
119
- chain,
120
- });
121
- }
122
- else if (options.mnemonicPassphrase) {
123
- // mnemonic specified
124
- const account = mnemonicToAccount(options.mnemonicPassphrase, {
125
- addressIndex: options.mnemonicIndex,
126
- });
127
- // create wallet client
128
- return viemCreateWalletClient({
129
- account,
130
- transport: publicTransport,
131
- chain,
132
- });
133
- }
134
- else {
135
- const wallets = walletChoices(chain);
136
- const wallet = await selectAuto({
137
- message: "Wallet",
138
- choices: wallets,
139
- discardDisabled: true,
25
+ default: `http://127.0.0.1:${PREFERRED_PORT}/anvil`,
140
26
  });
141
- if (wallet === "mnemonic") {
142
- // use the publicClient transport
143
- const mnemonic = await input({
144
- message: "Mnemonic",
145
- default: chain.id === 31337 ? DEFAULT_DEVNET_MNEMONIC : undefined,
146
- });
147
- // select account from mnemonic
148
- if (options.mnemonicIndex) {
149
- return viemCreateWalletClient({
150
- transport: publicTransport,
151
- chain,
152
- account: mnemonicToAccount(mnemonic, {
153
- addressIndex: options.mnemonicIndex,
154
- }),
155
- });
156
- }
157
- else {
158
- const choices = await Promise.all([...Array(10)].map(async (_, addressIndex) => {
159
- const account = mnemonicToAccount(mnemonic, {
160
- addressIndex,
161
- });
162
- const name = await addressBalanceLabel(account.address, publicClient);
163
- return { name, value: account };
164
- }));
165
- const account = await selectAuto({
166
- message: "Account",
167
- choices,
168
- pageSize: choices.length,
169
- });
170
- return viemCreateWalletClient({
171
- transport: publicTransport,
172
- chain,
173
- account,
174
- });
175
- }
176
- }
177
- else if (wallet === "private-key") {
178
- const privateKey = await hexInput({ message: "Private Key" });
179
- const account = privateKeyToAccount(privateKey);
180
- return viemCreateWalletClient({
181
- transport: publicTransport,
182
- chain,
183
- account,
184
- });
185
- }
186
- throw new Error(`Unsupported wallet ${wallet}`);
187
27
  }
188
28
  };
189
- const createClients = async (options) => {
190
- // select chain
191
- const chain = await selectChain(options);
192
- // select RPC URL
193
- const transport = await selectTransport(options, chain);
194
- // create public client
195
- const publicClient = await createPublicClient(chain, transport);
196
- // create wallet client
197
- const walletClient = await createWalletClient(options, chain, publicClient, transport);
198
- return {
199
- chain,
200
- publicClient,
201
- walletClient,
202
- };
29
+ export const connect = async (options) => {
30
+ // resolve rpc url
31
+ const rpcUrl = await getRpcUrl(options);
32
+ // create test client
33
+ const client = createTestClient({
34
+ chain: cartesi,
35
+ mode: "anvil",
36
+ transport: http(rpcUrl),
37
+ })
38
+ .extend(publicActions)
39
+ .extend(walletActions);
40
+ return client;
203
41
  };
204
- export default createClients;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@cartesi/cli",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.21",
4
4
  "description": "Cartesi CLI",
5
5
  "author": "Danilo Tuler <tuler@pobox.com>",
6
6
  "bin": {
7
- "cartesi": "./bin/run.js"
7
+ "cartesi": "./dist/index.js"
8
8
  },
9
9
  "type": "module",
10
10
  "homepage": "https://github.com/cartesi/cli",
@@ -14,80 +14,61 @@
14
14
  "files": [
15
15
  "/bin",
16
16
  "/dist",
17
- "/npm-shrinkwrap.json",
18
- "/oclif.manifest.json"
17
+ "/npm-shrinkwrap.json"
19
18
  ],
20
19
  "dependencies": {
21
- "@inquirer/confirm": "^5.0.0",
22
- "@inquirer/core": "^10.0.0",
23
- "@inquirer/input": "^4.0.0",
24
- "@inquirer/select": "^4.0.0",
25
- "@inquirer/type": "^3.0.0",
26
- "@oclif/core": "^4.0.29",
27
- "@oclif/plugin-help": "^6.2.15",
28
- "@oclif/plugin-plugins": "^5.4.15",
20
+ "@commander-js/extra-typings": "^14.0.0",
21
+ "@inquirer/confirm": "^5.1.18",
22
+ "@inquirer/core": "^10.2.2",
23
+ "@inquirer/input": "^4.2.4",
24
+ "@inquirer/select": "^4.3.4",
25
+ "@inquirer/type": "^3.0.8",
29
26
  "bytes": "^3.1.2",
30
- "chalk": "^5.3.0",
27
+ "chalk": "^5.6.2",
31
28
  "cli-table3": "^0.6.5",
32
- "execa": "^9.4.1",
33
- "fs-extra": "^11.2.0",
34
- "giget": "^1.2.3",
35
- "lookpath": "^1.2.2",
36
- "open": "^10.1.0",
37
- "ora": "^8.1.0",
29
+ "commander": "^14.0.1",
30
+ "execa": "^9.6.0",
31
+ "fs-extra": "^11.3.2",
32
+ "get-port": "^7.1.0",
33
+ "giget": "^2.0.0",
34
+ "listr2": "^9.0.4",
35
+ "lookpath": "^1.2.3",
36
+ "ora": "^9.0.0",
37
+ "p-retry": "^7.0.0",
38
38
  "progress-stream": "^2.0.0",
39
- "semver": "^7.6.3",
40
- "smol-toml": "^1.3.0",
41
- "tmp": "^0.2.3",
42
- "viem": "^2.21.27"
39
+ "semver": "^7.7.2",
40
+ "smol-toml": "^1.4.2",
41
+ "tmp": "^0.2.5",
42
+ "viem": "^2.37.6"
43
43
  },
44
44
  "devDependencies": {
45
- "@sunodo/wagmi-plugin-hardhat-deploy": "^0.3.0",
46
- "@types/bytes": "^3.1.4",
45
+ "@biomejs/biome": "^2.2.4",
46
+ "@cartesi/devnet": "2.0.0-alpha.7",
47
+ "@cartesi/rollups": "2.0.1",
48
+ "@types/bytes": "^3.1.5",
47
49
  "@types/fs-extra": "^11.0.4",
48
- "@types/inquirer": "^9.0.7",
49
- "@types/node": "^22.7.6",
50
- "@types/node-fetch": "^2.6.11",
50
+ "@types/inquirer": "^9.0.9",
51
+ "@types/node": "^24.5.1",
52
+ "@types/node-fetch": "^2.6.13",
51
53
  "@types/progress-stream": "^2.0.5",
52
54
  "@types/prompts": "^2.4.9",
53
- "@types/semver": "^7.5.8",
55
+ "@types/semver": "^7.7.1",
54
56
  "@types/tmp": "^0.2.6",
55
- "@vitest/coverage-istanbul": "^2.1.3",
56
- "@wagmi/cli": "^2.1.16",
57
+ "@vitest/coverage-istanbul": "^3.2.4",
58
+ "@wagmi/cli": "^2.5.1",
57
59
  "copyfiles": "^2.4.1",
58
- "eslint": "^8.57.0",
59
- "eslint-config-oclif": "^5.2.1",
60
- "eslint-config-oclif-typescript": "^3.1.12",
61
60
  "npm-run-all": "^4.1.5",
62
- "oclif": "^4.15.9",
63
61
  "rimraf": "^6.0.1",
64
62
  "ts-node": "^10.9.2",
65
- "tslib": "^2.8.0",
66
- "typescript": "^5.6.3",
67
- "vitest": "^2.1.3",
68
- "@cartesi/devnet": "2.0.0-alpha.1",
69
- "@cartesi/eslint-config": "0.0.0",
63
+ "tslib": "^2.8.1",
64
+ "typescript": "^5.9.2",
65
+ "vitest": "^3.2.4",
70
66
  "tsconfig": "0.0.0"
71
67
  },
72
- "oclif": {
73
- "bin": "cartesi",
74
- "dirname": "cartesi",
75
- "commands": "./dist/commands",
76
- "plugins": [
77
- "@oclif/plugin-help"
78
- ],
79
- "topicSeparator": " ",
80
- "macos": {
81
- "identifier": "io.cartesi.cli"
82
- }
83
- },
84
68
  "engines": {
85
- "node": ">=18.0.0"
69
+ "node": ">=20.0.0"
86
70
  },
87
71
  "bugs": "https://github.com/cartesi/cli/issues",
88
- "keywords": [
89
- "oclif"
90
- ],
91
72
  "types": "dist/index.d.ts",
92
73
  "scripts": {
93
74
  "build": "run-s clean codegen compile copy-files",
@@ -95,8 +76,9 @@
95
76
  "codegen": "run-p codegen:wagmi",
96
77
  "codegen:wagmi": "wagmi generate",
97
78
  "compile": "tsc -p tsconfig.build.json",
79
+ "postcompile": "chmod +x dist/index.js",
98
80
  "copy-files": "copyfiles -u 1 \"src/**/*.yaml\" \"src/**/*.env\" \"src/**/*.txt\" dist",
99
- "lint": "eslint \"src/**/*.ts*\"",
81
+ "lint": "biome lint",
100
82
  "posttest": "pnpm lint",
101
83
  "test": "vitest"
102
84
  }
package/bin/dev.cmd DELETED
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\dev" %*
package/bin/dev.js DELETED
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node --no-warnings=ExperimentalWarning --loader ts-node/esm
2
-
3
- import oclif from "@oclif/core";
4
- import path from "node:path";
5
- import url from "node:url";
6
- import { register } from "ts-node";
7
-
8
- // In dev mode -> use ts-node and dev plugins
9
- process.env.NODE_ENV = "development";
10
-
11
- const project = path.join(
12
- path.dirname(url.fileURLToPath(import.meta.url)),
13
- "..",
14
- "tsconfig.json"
15
- );
16
- register({ project });
17
-
18
- // In dev mode, always show stack traces
19
- oclif.settings.debug = true;
20
-
21
- // Start the CLI
22
- oclif
23
- .run(process.argv.slice(2), import.meta.url)
24
- .then(oclif.flush)
25
- .catch(oclif.Errors.handle);
package/bin/run.cmd DELETED
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
package/bin/run.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import oclif from "@oclif/core";
4
-
5
- oclif
6
- .run(process.argv.slice(2), import.meta.url)
7
- .then(oclif.flush)
8
- .catch(oclif.Errors.handle);
@@ -1,22 +0,0 @@
1
- import { Command, Interfaces } from "@oclif/core";
2
- import { Address, Hash } from "viem";
3
- import { Config } from "./config.js";
4
- export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
5
- export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
6
- export type AddressBook = Record<string, Address>;
7
- export declare abstract class BaseCommand<T extends typeof Command> extends Command {
8
- protected flags: Flags<T>;
9
- protected args: Args<T>;
10
- protected getServiceState(projectName: string, serviceName: string): Promise<string | undefined>;
11
- protected getContextPath(...paths: string[]): string;
12
- protected getApplicationConfig(configPath: string): Config;
13
- protected getMachineHash(): Hash | undefined;
14
- protected logPrompt({ title, value }: {
15
- title: string;
16
- value: string;
17
- }): void;
18
- protected getApplicationAddress(): Promise<Address>;
19
- protected getAddressBook(): Promise<AddressBook>;
20
- init(): Promise<void>;
21
- }
22
- //# sourceMappingURL=baseCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"baseCommand.d.ts","sourceRoot":"","sources":["../src/baseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAsB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAS,MAAM,aAAa,CAAC;AAiB5C,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAClE,CAAC,OAAO,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CACjD,CAAC;AACF,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,8BAAsB,WAAW,CAAC,CAAC,SAAS,OAAO,OAAO,CAAE,SAAQ,OAAO;IACvE,SAAS,CAAC,KAAK,EAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAG,IAAI,CAAC,CAAC,CAAC,CAAC;cAET,eAAe,CAC3B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAe9B,SAAS,CAAC,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAIpD,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAM1D,SAAS,CAAC,cAAc,IAAI,IAAI,GAAG,SAAS;IAY5C,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;cAItD,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;cAKzC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAiCzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAYrC"}
@@ -1,92 +0,0 @@
1
- import { Command } from "@oclif/core";
2
- import chalk from "chalk";
3
- import { execa } from "execa";
4
- import fs from "fs";
5
- import path from "path";
6
- import { getAddress, isHash } from "viem";
7
- import { parse } from "./config.js";
8
- import { applicationFactoryAddress, authorityFactoryAddress, erc1155BatchPortalAddress, erc1155SinglePortalAddress, erc20PortalAddress, erc721PortalAddress, etherPortalAddress, inputBoxAddress, selfHostedApplicationFactoryAddress, testMultiTokenAddress, testNftAddress, testTokenAddress, } from "./contracts.js";
9
- export class BaseCommand extends Command {
10
- async getServiceState(projectName, serviceName) {
11
- // get service information
12
- const { stdout } = await execa("docker", [
13
- "compose",
14
- "--project-name",
15
- projectName,
16
- "ps",
17
- serviceName,
18
- "--format",
19
- "json",
20
- ]);
21
- const ps = stdout ? JSON.parse(stdout) : undefined;
22
- return ps?.State;
23
- }
24
- getContextPath(...paths) {
25
- return path.join(".cartesi", ...paths);
26
- }
27
- getApplicationConfig(configPath) {
28
- return fs.existsSync(configPath)
29
- ? parse(fs.readFileSync(configPath).toString())
30
- : parse("");
31
- }
32
- getMachineHash() {
33
- // read hash of the cartesi machine snapshot, if one exists
34
- const hashPath = this.getContextPath("image", "hash");
35
- if (fs.existsSync(hashPath)) {
36
- const hash = fs.readFileSync(hashPath).toString("hex");
37
- if (isHash(`0x${hash}`)) {
38
- return `0x${hash}`;
39
- }
40
- }
41
- return undefined;
42
- }
43
- logPrompt({ title, value }) {
44
- this.log(`${chalk.green("?")} ${title} ${chalk.cyan(value)}`);
45
- }
46
- async getApplicationAddress() {
47
- // fixed value, as we do deterministic deployment with a zero hash
48
- return getAddress("0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e");
49
- }
50
- async getAddressBook() {
51
- const applicationAddress = await this.getApplicationAddress();
52
- // build rollups contracts address book
53
- const contracts = {
54
- Application: applicationAddress,
55
- ApplicationFactory: applicationFactoryAddress,
56
- AuthorityFactory: authorityFactoryAddress,
57
- EntryPointV06: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
58
- EntryPointV07: "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
59
- ERC1155BatchPortal: erc1155BatchPortalAddress,
60
- ERC1155SinglePortal: erc1155SinglePortalAddress,
61
- ERC20Portal: erc20PortalAddress,
62
- ERC721Portal: erc721PortalAddress,
63
- EtherPortal: etherPortalAddress,
64
- InputBox: inputBoxAddress,
65
- LightAccountFactory: "0x00004EC70002a32400f8ae005A26081065620D20",
66
- SelfHostedApplicationFactory: selfHostedApplicationFactoryAddress,
67
- SimpleAccountFactory: "0x9406Cc6185a346906296840746125a0E44976454",
68
- SmartAccountFactory: "0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5",
69
- KernelFactoryV2: "0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",
70
- KernelFactoryV3: "0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",
71
- KernelFactoryV3_1: "0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",
72
- TestToken: testTokenAddress,
73
- TestNFT: testNftAddress,
74
- TestMultiToken: testMultiTokenAddress,
75
- VerifyingPaymasterV06: "0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",
76
- VerifyingPaymasterV07: "0xc5c97885C67F7361aBAfD2B95067a5bBdA603608",
77
- };
78
- return contracts;
79
- }
80
- async init() {
81
- await super.init();
82
- const { args, flags } = await this.parse({
83
- flags: this.ctor.flags,
84
- baseFlags: super.ctor.baseFlags,
85
- args: this.ctor.args,
86
- enableJsonFlag: this.ctor.enableJsonFlag,
87
- strict: this.ctor.strict,
88
- });
89
- this.flags = flags;
90
- this.args = args;
91
- }
92
- }
@@ -1,12 +0,0 @@
1
- import { BaseCommand } from "../../baseCommand.js";
2
- export default class Deploy extends BaseCommand<typeof Deploy> {
3
- static summary: string;
4
- static description: string;
5
- static examples: string[];
6
- static flags: {
7
- hosting: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- webapp: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("url").URL, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- };
10
- run(): Promise<void>;
11
- }
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC1D,MAAM,CAAC,OAAO,SAA2C;IAEzD,MAAM,CAAC,WAAW,SACoD;IAEtE,MAAM,CAAC,QAAQ,WAA2C;IAE1D,MAAM,CAAC,KAAK;;;MAWV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiEpC"}