@latticexyz/common 2.2.17-d5210ce502a781b858a575a715d97dfd3a91c29d → 2.2.17-dead80e682bfa1bd23f4d3b9bac338aee38c281e

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/dist/chains.d.ts CHANGED
@@ -665,7 +665,7 @@ declare const rhodolite: {
665
665
  readonly name: "Rhodolite Devnet";
666
666
  readonly testnet: true;
667
667
  readonly id: 17420;
668
- readonly sourceId: 17000;
668
+ readonly sourceId: 17001;
669
669
  readonly nativeCurrency: {
670
670
  readonly name: "Ether";
671
671
  readonly symbol: "ETH";
@@ -690,13 +690,9 @@ declare const rhodolite: {
690
690
  };
691
691
  };
692
692
  readonly contracts: {
693
- readonly l1StandardBridge: {
694
- readonly 17000: {
695
- readonly address: "0x6487446e0B9FAEa90F6a9772A6448cFa780E30F9";
696
- };
697
- };
698
693
  readonly quarryPaymaster: {
699
- readonly address: "0x7ca1b85aca23fccf2fbac14c02b5e8a6432639b9";
694
+ readonly address: "0x61f22c3827d90c390e0e2aaf220971524ac0a68d";
695
+ readonly blockCreated: 11262;
700
696
  };
701
697
  readonly gasPriceOracle: {
702
698
  readonly address: "0x420000000000000000000000000000000000000F";
package/dist/chains.js CHANGED
@@ -1,2 +1,2 @@
1
- import{foundry as t}from"viem/chains";var s={...t,fees:{defaultPriorityFee:0n}};import{redstone as n}from"viem/chains";var i={...n,iconUrls:["https://redstone.xyz/chain-icons/redstone.png"],indexerUrl:"https://indexer.mud.redstonechain.com"};import{garnet as a}from"viem/chains";var c={...a,iconUrls:["https://redstone.xyz/chain-icons/garnet.png"],indexerUrl:"https://indexer.mud.garnetchain.com"};import{chainConfig as e}from"viem/op-stack";var o=17e3,r={http:["https://rpc.rhodolitechain.com"],webSocket:["wss://rpc.rhodolitechain.com"]},d={...e,name:"Rhodolite Devnet",testnet:!0,id:17420,sourceId:o,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:r,bundler:r,quarryPassIssuer:r,wiresaw:r},contracts:{...e.contracts,l1StandardBridge:{[o]:{address:"0x6487446e0B9FAEa90F6a9772A6448cFa780E30F9"}},quarryPaymaster:{address:"0x7ca1b85aca23fccf2fbac14c02b5e8a6432639b9"}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.rhodolitechain.com"},worldsExplorer:{name:"MUD Worlds Explorer",url:"https://explorer.mud.dev/rhodolite/worlds"}},iconUrls:["https://redstone.xyz/chain-icons/rhodolite.png"],indexerUrl:"https://indexer.mud.rhodolitechain.com"};export{c as garnet,s as mudFoundry,i as redstone,d as rhodolite};
1
+ import{foundry as o}from"viem/chains";var t={...o,fees:{defaultPriorityFee:0n}};import{redstone as s}from"viem/chains";var n={...s,iconUrls:["https://redstone.xyz/chain-icons/redstone.png"],indexerUrl:"https://indexer.mud.redstonechain.com"};import{garnet as i}from"viem/chains";var a={...i,iconUrls:["https://redstone.xyz/chain-icons/garnet.png"],indexerUrl:"https://indexer.mud.garnetchain.com"};import{chainConfig as e}from"viem/op-stack";var c=17001,r={http:["https://rpc.rhodolitechain.com"],webSocket:["wss://rpc.rhodolitechain.com"]},d={...e,name:"Rhodolite Devnet",testnet:!0,id:17420,sourceId:c,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:r,bundler:r,quarryPassIssuer:r,wiresaw:r},contracts:{...e.contracts,quarryPaymaster:{address:"0x61f22c3827d90c390e0e2aaf220971524ac0a68d",blockCreated:11262}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.rhodolitechain.com"},worldsExplorer:{name:"MUD Worlds Explorer",url:"https://explorer.mud.dev/rhodolite/worlds"}},iconUrls:["https://redstone.xyz/chain-icons/rhodolite.png"],indexerUrl:"https://indexer.mud.rhodolitechain.com"};export{a as garnet,t as mudFoundry,n as redstone,d as rhodolite};
2
2
  //# sourceMappingURL=chains.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chains/mudFoundry.ts","../src/chains/redstone.ts","../src/chains/garnet.ts","../src/chains/rhodolite.ts"],"sourcesContent":["import { foundry } from \"viem/chains\";\nimport { MUDChain } from \"./types\";\n\nexport const mudFoundry = {\n ...foundry,\n fees: {\n defaultPriorityFee: 0n,\n },\n} as const satisfies MUDChain;\n","import { redstone as redstoneConfig } from \"viem/chains\";\nimport type { MUDChain } from \"./types\";\n\nexport const redstone = {\n ...redstoneConfig,\n iconUrls: [\"https://redstone.xyz/chain-icons/redstone.png\"],\n indexerUrl: \"https://indexer.mud.redstonechain.com\",\n} as const satisfies MUDChain;\n","import { garnet as garnetConfig } from \"viem/chains\";\nimport type { MUDChain } from \"./types\";\n\nexport const garnet = {\n ...garnetConfig,\n iconUrls: [\"https://redstone.xyz/chain-icons/garnet.png\"],\n indexerUrl: \"https://indexer.mud.garnetchain.com\",\n} as const satisfies MUDChain;\n","import { chainConfig } from \"viem/op-stack\";\nimport { MUDChain } from \"./types\";\nimport { Chain } from \"viem\";\n\nconst sourceId = 17000;\n\nconst defaultRpcUrls = {\n http: [\"https://rpc.rhodolitechain.com\"],\n webSocket: [\"wss://rpc.rhodolitechain.com\"],\n} as const satisfies Chain[\"rpcUrls\"][\"default\"];\n\nexport const rhodolite = {\n ...chainConfig,\n name: \"Rhodolite Devnet\",\n testnet: true,\n id: 17420,\n sourceId,\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: defaultRpcUrls,\n bundler: defaultRpcUrls,\n quarryPassIssuer: defaultRpcUrls,\n wiresaw: defaultRpcUrls,\n },\n contracts: {\n ...chainConfig.contracts,\n l1StandardBridge: {\n [sourceId]: {\n address: \"0x6487446e0B9FAEa90F6a9772A6448cFa780E30F9\",\n },\n },\n quarryPaymaster: {\n address: \"0x7ca1b85aca23fccf2fbac14c02b5e8a6432639b9\",\n },\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://explorer.rhodolitechain.com\",\n },\n worldsExplorer: {\n name: \"MUD Worlds Explorer\",\n url: \"https://explorer.mud.dev/rhodolite/worlds\",\n },\n },\n iconUrls: [\"https://redstone.xyz/chain-icons/rhodolite.png\"],\n indexerUrl: \"https://indexer.mud.rhodolitechain.com\",\n} as const satisfies MUDChain;\n"],"mappings":"AAAA,OAAS,WAAAA,MAAe,cAGjB,IAAMC,EAAa,CACxB,GAAGD,EACH,KAAM,CACJ,mBAAoB,EACtB,CACF,ECRA,OAAS,YAAYE,MAAsB,cAGpC,IAAMC,EAAW,CACtB,GAAGD,EACH,SAAU,CAAC,+CAA+C,EAC1D,WAAY,uCACd,ECPA,OAAS,UAAUE,MAAoB,cAGhC,IAAMC,EAAS,CACpB,GAAGD,EACH,SAAU,CAAC,6CAA6C,EACxD,WAAY,qCACd,ECPA,OAAS,eAAAE,MAAmB,gBAI5B,IAAMC,EAAW,KAEXC,EAAiB,CACrB,KAAM,CAAC,gCAAgC,EACvC,UAAW,CAAC,8BAA8B,CAC5C,EAEaC,EAAY,CACvB,GAAGH,EACH,KAAM,mBACN,QAAS,GACT,GAAI,MACJ,SAAAC,EACA,eAAgB,CAAE,KAAM,QAAS,OAAQ,MAAO,SAAU,EAAG,EAC7D,QAAS,CACP,QAASC,EACT,QAASA,EACT,iBAAkBA,EAClB,QAASA,CACX,EACA,UAAW,CACT,GAAGF,EAAY,UACf,iBAAkB,CAChB,CAACC,CAAQ,EAAG,CACV,QAAS,4CACX,CACF,EACA,gBAAiB,CACf,QAAS,4CACX,CACF,EACA,eAAgB,CACd,QAAS,CACP,KAAM,aACN,IAAK,qCACP,EACA,eAAgB,CACd,KAAM,sBACN,IAAK,2CACP,CACF,EACA,SAAU,CAAC,gDAAgD,EAC3D,WAAY,wCACd","names":["foundry","mudFoundry","redstoneConfig","redstone","garnetConfig","garnet","chainConfig","sourceId","defaultRpcUrls","rhodolite"]}
1
+ {"version":3,"sources":["../src/chains/mudFoundry.ts","../src/chains/redstone.ts","../src/chains/garnet.ts","../src/chains/rhodolite.ts"],"sourcesContent":["import { foundry } from \"viem/chains\";\nimport { MUDChain } from \"./types\";\n\nexport const mudFoundry = {\n ...foundry,\n fees: {\n defaultPriorityFee: 0n,\n },\n} as const satisfies MUDChain;\n","import { redstone as redstoneConfig } from \"viem/chains\";\nimport type { MUDChain } from \"./types\";\n\nexport const redstone = {\n ...redstoneConfig,\n iconUrls: [\"https://redstone.xyz/chain-icons/redstone.png\"],\n indexerUrl: \"https://indexer.mud.redstonechain.com\",\n} as const satisfies MUDChain;\n","import { garnet as garnetConfig } from \"viem/chains\";\nimport type { MUDChain } from \"./types\";\n\nexport const garnet = {\n ...garnetConfig,\n iconUrls: [\"https://redstone.xyz/chain-icons/garnet.png\"],\n indexerUrl: \"https://indexer.mud.garnetchain.com\",\n} as const satisfies MUDChain;\n","import { chainConfig } from \"viem/op-stack\";\nimport { MUDChain } from \"./types\";\nimport { Chain } from \"viem\";\n\nconst sourceId = 17001;\n\nconst defaultRpcUrls = {\n http: [\"https://rpc.rhodolitechain.com\"],\n webSocket: [\"wss://rpc.rhodolitechain.com\"],\n} as const satisfies Chain[\"rpcUrls\"][\"default\"];\n\nexport const rhodolite = {\n ...chainConfig,\n name: \"Rhodolite Devnet\",\n testnet: true,\n id: 17420,\n sourceId,\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: defaultRpcUrls,\n bundler: defaultRpcUrls,\n quarryPassIssuer: defaultRpcUrls,\n wiresaw: defaultRpcUrls,\n },\n contracts: {\n ...chainConfig.contracts,\n quarryPaymaster: {\n address: \"0x61f22c3827d90c390e0e2aaf220971524ac0a68d\",\n blockCreated: 11262,\n },\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://explorer.rhodolitechain.com\",\n },\n worldsExplorer: {\n name: \"MUD Worlds Explorer\",\n url: \"https://explorer.mud.dev/rhodolite/worlds\",\n },\n },\n iconUrls: [\"https://redstone.xyz/chain-icons/rhodolite.png\"],\n indexerUrl: \"https://indexer.mud.rhodolitechain.com\",\n} as const satisfies MUDChain;\n"],"mappings":"AAAA,OAAS,WAAAA,MAAe,cAGjB,IAAMC,EAAa,CACxB,GAAGD,EACH,KAAM,CACJ,mBAAoB,EACtB,CACF,ECRA,OAAS,YAAYE,MAAsB,cAGpC,IAAMC,EAAW,CACtB,GAAGD,EACH,SAAU,CAAC,+CAA+C,EAC1D,WAAY,uCACd,ECPA,OAAS,UAAUE,MAAoB,cAGhC,IAAMC,EAAS,CACpB,GAAGD,EACH,SAAU,CAAC,6CAA6C,EACxD,WAAY,qCACd,ECPA,OAAS,eAAAE,MAAmB,gBAI5B,IAAMC,EAAW,MAEXC,EAAiB,CACrB,KAAM,CAAC,gCAAgC,EACvC,UAAW,CAAC,8BAA8B,CAC5C,EAEaC,EAAY,CACvB,GAAGH,EACH,KAAM,mBACN,QAAS,GACT,GAAI,MACJ,SAAAC,EACA,eAAgB,CAAE,KAAM,QAAS,OAAQ,MAAO,SAAU,EAAG,EAC7D,QAAS,CACP,QAASC,EACT,QAASA,EACT,iBAAkBA,EAClB,QAASA,CACX,EACA,UAAW,CACT,GAAGF,EAAY,UACf,gBAAiB,CACf,QAAS,6CACT,aAAc,KAChB,CACF,EACA,eAAgB,CACd,QAAS,CACP,KAAM,aACN,IAAK,qCACP,EACA,eAAgB,CACd,KAAM,sBACN,IAAK,2CACP,CACF,EACA,SAAU,CAAC,gDAAgD,EAC3D,WAAY,wCACd","names":["foundry","mudFoundry","redstoneConfig","redstone","garnetConfig","garnet","chainConfig","sourceId","defaultRpcUrls","rhodolite"]}
package/dist/foundry.js CHANGED
@@ -1,3 +1,3 @@
1
- import{execa as s}from"execa";async function n(r){let{stdout:t}=await s("forge",["config","--json"],{stdio:["inherit","pipe","pipe"],env:{FOUNDRY_PROFILE:r}});return JSON.parse(t)}async function u(r){return(await n(r)).src}async function f(r){return(await n(r)).script}async function l(r){return(await n(r)).test}async function P(r){return(await n(r)).out}async function y(r){return process.env.FOUNDRY_ETH_RPC_URL||process.env.RPC_HTTP_URL||process.env.RPC_URL||(await n(r)).eth_rpc_url||"http://127.0.0.1:8545"}async function m(r,t){let e={env:{FOUNDRY_PROFILE:t?.profile,...t?.env},stdout:"inherit",stderr:"pipe",cwd:t?.cwd};await(t?.silent?s("forge",r,e):o("forge",r,e))}async function w(r,t){return o("cast",r,{env:{FOUNDRY_PROFILE:t?.profile}})}async function R(r){return o("anvil",r)}async function o(r,t,e){let c=`${r} ${t.join(" ")}`;try{console.log(`running "${c}"`);let{stdout:i}=await s(r,t,{stdout:"pipe",stderr:"pipe",...e});return i}catch(i){let g=i?.stderr||i?.message||"";throw g+=`
2
- Error running "${c}"`,new Error(g)}}export{R as anvil,w as cast,m as forge,n as getForgeConfig,P as getOutDirectory,y as getRpcUrl,f as getScriptDirectory,u as getSrcDirectory,l as getTestDirectory};
1
+ import{execa as s}from"execa";async function n(r){let{stdout:t}=await s("forge",["config","--json"],{stdio:["inherit","pipe","pipe"],env:{FOUNDRY_PROFILE:r}});return JSON.parse(t)}async function u(r){return(await n(r)).src}async function f(r){return(await n(r)).script}async function l(r){return(await n(r)).test}async function y(r){return(await n(r)).out}async function m(r){return(await n(r)).eth_rpc_url||"http://127.0.0.1:8545"}async function w(r,t){let i={env:{FOUNDRY_PROFILE:t?.profile,...t?.env},stdout:"inherit",stderr:"pipe",cwd:t?.cwd};await(t?.silent?s("forge",r,i):o("forge",r,i))}async function P(r,t){return o("cast",r,{env:{FOUNDRY_PROFILE:t?.profile}})}async function d(r){return o("anvil",r)}async function o(r,t,i){let g=`${r} ${t.join(" ")}`;try{console.log(`running "${g}"`);let{stdout:e}=await s(r,t,{stdout:"pipe",stderr:"pipe",...i});return e}catch(e){let c=e?.stderr||e?.message||"";throw c+=`
2
+ Error running "${g}"`,new Error(c)}}export{d as anvil,P as cast,w as forge,n as getForgeConfig,y as getOutDirectory,m as getRpcUrl,f as getScriptDirectory,u as getSrcDirectory,l as getTestDirectory};
3
3
  //# sourceMappingURL=foundry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/foundry/index.ts"],"sourcesContent":["import { execa, Options } from \"execa\";\n\nexport interface ForgeConfig {\n // project\n src: string;\n test: string;\n script: string;\n out: string;\n libs: string[];\n cache: boolean;\n cache_path: string;\n eth_rpc_url: string | null;\n\n // compiler\n remappings: string[];\n\n // all unspecified keys (this interface is far from comprehensive)\n [key: string]: unknown;\n}\n\n/**\n * Get forge config as a parsed json object.\n */\nexport async function getForgeConfig(profile?: string): Promise<ForgeConfig> {\n const { stdout } = await execa(\"forge\", [\"config\", \"--json\"], {\n stdio: [\"inherit\", \"pipe\", \"pipe\"],\n env: { FOUNDRY_PROFILE: profile },\n });\n\n return JSON.parse(stdout) as ForgeConfig;\n}\n\n/**\n * Get the value of \"src\" from forge config.\n * The path to the contract sources relative to the root of the project.\n */\nexport async function getSrcDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).src;\n}\n\n/**\n * Get the value of \"script\" from forge config.\n * The path to the contract sources relative to the root of the project.\n */\nexport async function getScriptDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).script;\n}\n\n/**\n * Get the value of \"test\" from forge config.\n * The path to the test contract sources relative to the root of the project.\n */\nexport async function getTestDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).test;\n}\n\n/**\n * Get the value of \"out\" from forge config.\n * The path to put contract artifacts in, relative to the root of the project.\n */\nexport async function getOutDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).out;\n}\n\n/**\n * Get the value of \"eth_rpc_url\" from forge config, default to \"http://127.0.0.1:8545\"\n * @param profile The foundry profile to use\n * @returns The rpc url\n */\nexport async function getRpcUrl(profile?: string): Promise<string> {\n return (\n process.env.FOUNDRY_ETH_RPC_URL ||\n process.env.RPC_HTTP_URL ||\n process.env.RPC_URL ||\n (await getForgeConfig(profile)).eth_rpc_url ||\n \"http://127.0.0.1:8545\"\n );\n}\n\n/**\n * Execute a forge command\n * @param args The arguments to pass to forge\n * @param options { profile?: The foundry profile to use; silent?: If true, nothing will be logged to the console }\n */\nexport async function forge(\n args: string[],\n options?: { profile?: string; silent?: boolean; env?: NodeJS.ProcessEnv; cwd?: string },\n): Promise<void> {\n const execOptions: Options<string> = {\n env: { FOUNDRY_PROFILE: options?.profile, ...options?.env },\n stdout: \"inherit\",\n stderr: \"pipe\",\n cwd: options?.cwd,\n };\n\n await (options?.silent ? execa(\"forge\", args, execOptions) : execLog(\"forge\", args, execOptions));\n}\n\n/**\n * Execute a cast command\n * @param args The arguments to pass to cast\n * @returns Stdout of the command\n */\nexport async function cast(args: string[], options?: { profile?: string }): Promise<string> {\n return execLog(\"cast\", args, {\n env: { FOUNDRY_PROFILE: options?.profile },\n });\n}\n\n/**\n * Start an anvil chain\n * @param args The arguments to pass to anvil\n * @returns Stdout of the command\n */\nexport async function anvil(args: string[]): Promise<string> {\n return execLog(\"anvil\", args);\n}\n\n/**\n * Executes the given command, returns the stdout, and logs the command to the console.\n * Throws an error if the command fails.\n * @param command The command to execute\n * @param args The arguments to pass to the command\n * @returns The stdout of the command\n */\nasync function execLog(command: string, args: string[], options?: Options<string>): Promise<string> {\n const commandString = `${command} ${args.join(\" \")}`;\n try {\n console.log(`running \"${commandString}\"`);\n const { stdout } = await execa(command, args, { stdout: \"pipe\", stderr: \"pipe\", ...options });\n return stdout;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n let errorMessage = error?.stderr || error?.message || \"\";\n errorMessage += `\\nError running \"${commandString}\"`;\n throw new Error(errorMessage);\n }\n}\n"],"mappings":"AAAA,OAAS,SAAAA,MAAsB,QAuB/B,eAAsBC,EAAeC,EAAwC,CAC3E,GAAM,CAAE,OAAAC,CAAO,EAAI,MAAMH,EAAM,QAAS,CAAC,SAAU,QAAQ,EAAG,CAC5D,MAAO,CAAC,UAAW,OAAQ,MAAM,EACjC,IAAK,CAAE,gBAAiBE,CAAQ,CAClC,CAAC,EAED,OAAO,KAAK,MAAMC,CAAM,CAC1B,CAMA,eAAsBC,EAAgBF,EAAmC,CACvE,OAAQ,M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iBAAoBF,CAAa,IAC3C,IAAI,MAAME,CAAY,CAC9B,CACF","names":["execa","getForgeConfig","profile","stdout","getSrcDirectory","getScriptDirectory","getTestDirectory","getOutDirectory","getRpcUrl","forge","args","options","execOptions","execLog","cast","anvil","command","commandString","error","errorMessage"]}
1
+ {"version":3,"sources":["../src/foundry/index.ts"],"sourcesContent":["import { execa, Options } from \"execa\";\n\nexport interface ForgeConfig {\n // project\n src: string;\n test: string;\n script: string;\n out: string;\n libs: string[];\n cache: boolean;\n cache_path: string;\n eth_rpc_url: string | null;\n\n // compiler\n remappings: string[];\n\n // all unspecified keys (this interface is far from comprehensive)\n [key: string]: unknown;\n}\n\n/**\n * Get forge config as a parsed json object.\n */\nexport async function getForgeConfig(profile?: string): Promise<ForgeConfig> {\n const { stdout } = await execa(\"forge\", [\"config\", \"--json\"], {\n stdio: [\"inherit\", \"pipe\", \"pipe\"],\n env: { FOUNDRY_PROFILE: profile },\n });\n\n return JSON.parse(stdout) as ForgeConfig;\n}\n\n/**\n * Get the value of \"src\" from forge config.\n * The path to the contract sources relative to the root of the project.\n */\nexport async function getSrcDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).src;\n}\n\n/**\n * Get the value of \"script\" from forge config.\n * The path to the contract sources relative to the root of the project.\n */\nexport async function getScriptDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).script;\n}\n\n/**\n * Get the value of \"test\" from forge config.\n * The path to the test contract sources relative to the root of the project.\n */\nexport async function getTestDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).test;\n}\n\n/**\n * Get the value of \"out\" from forge config.\n * The path to put contract artifacts in, relative to the root of the project.\n */\nexport async function getOutDirectory(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).out;\n}\n\n/**\n * Get the value of \"eth_rpc_url\" from forge config, default to \"http://127.0.0.1:8545\"\n * @param profile The foundry profile to use\n * @returns The rpc url\n */\nexport async function getRpcUrl(profile?: string): Promise<string> {\n return (await getForgeConfig(profile)).eth_rpc_url || \"http://127.0.0.1:8545\";\n}\n\n/**\n * Execute a forge command\n * @param args The arguments to pass to forge\n * @param options { profile?: The foundry profile to use; silent?: If true, nothing will be logged to the console }\n */\nexport async function forge(\n args: string[],\n options?: { profile?: string; silent?: boolean; env?: NodeJS.ProcessEnv; cwd?: string },\n): Promise<void> {\n const execOptions: Options<string> = {\n env: { FOUNDRY_PROFILE: options?.profile, ...options?.env },\n stdout: \"inherit\",\n stderr: \"pipe\",\n cwd: options?.cwd,\n };\n\n await (options?.silent ? execa(\"forge\", args, execOptions) : execLog(\"forge\", args, execOptions));\n}\n\n/**\n * Execute a cast command\n * @param args The arguments to pass to cast\n * @returns Stdout of the command\n */\nexport async function cast(args: string[], options?: { profile?: string }): Promise<string> {\n return execLog(\"cast\", args, {\n env: { FOUNDRY_PROFILE: options?.profile },\n });\n}\n\n/**\n * Start an anvil chain\n * @param args The arguments to pass to anvil\n * @returns Stdout of the command\n */\nexport async function anvil(args: string[]): Promise<string> {\n return execLog(\"anvil\", args);\n}\n\n/**\n * Executes the given command, returns the stdout, and logs the command to the console.\n * Throws an error if the command fails.\n * @param command The command to execute\n * @param args The arguments to pass to the command\n * @returns The stdout of the command\n */\nasync function execLog(command: string, args: string[], options?: Options<string>): Promise<string> {\n const commandString = `${command} ${args.join(\" \")}`;\n try {\n console.log(`running \"${commandString}\"`);\n const { stdout } = await execa(command, args, { stdout: \"pipe\", stderr: \"pipe\", ...options });\n return stdout;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n let errorMessage = error?.stderr || error?.message || \"\";\n errorMessage += `\\nError running \"${commandString}\"`;\n throw new Error(errorMessage);\n }\n}\n"],"mappings":"AAAA,OAAS,SAAAA,MAAsB,QAuB/B,eAAsBC,EAAeC,EAAwC,CAC3E,GAAM,CAAE,OAAAC,CAAO,EAAI,MAAMH,EAAM,QAAS,CAAC,SAAU,QAAQ,EAAG,CAC5D,MAAO,CAAC,UAAW,OAAQ,MAAM,EAC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nB,IAAIC,EAAeD,GAAO,QAAUA,GAAO,SAAW,GACtD,MAAAC,GAAgB;AAAA,iBAAoBF,CAAa,IAC3C,IAAI,MAAME,CAAY,CAC9B,CACF","names":["execa","getForgeConfig","profile","stdout","getSrcDirectory","getScriptDirectory","getTestDirectory","getOutDirectory","getRpcUrl","forge","args","options","execOptions","execLog","cast","anvil","command","commandString","error","errorMessage"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/common",
3
- "version": "2.2.17-d5210ce502a781b858a575a715d97dfd3a91c29d",
3
+ "version": "2.2.17-dead80e682bfa1bd23f4d3b9bac338aee38c281e",
4
4
  "description": "Common low level logic shared between packages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -69,7 +69,7 @@
69
69
  "p-retry": "^5.1.2",
70
70
  "prettier": "3.2.5",
71
71
  "prettier-plugin-solidity": "1.3.1",
72
- "@latticexyz/schema-type": "2.2.17-d5210ce502a781b858a575a715d97dfd3a91c29d"
72
+ "@latticexyz/schema-type": "2.2.17-dead80e682bfa1bd23f4d3b9bac338aee38c281e"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/debug": "^4.1.7",