@wiimdy/openfunderse 1.1.3 → 1.1.4

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.
@@ -0,0 +1,17 @@
1
+ # OpenFunderse participant env scaffold
2
+ # Copy values from your PARTICIPANT_PK, ADDRESS
3
+
4
+ RELAYER_URL=https://openfunderse-relayer-liard.vercel.app/
5
+ BOT_ID=bot-participant-1
6
+ BOT_API_KEY=replace_me
7
+
8
+ CHAIN_ID=10143
9
+ CLAIM_ATTESTATION_VERIFIER_ADDRESS=0x76AB8571cED9F4A81b733969216F53C1e13BC835
10
+ # Temporary bootstrap key (public and unsafe). Replace via bot-init before real usage.
11
+ PARTICIPANT_PRIVATE_KEY=__TEMP_PRIVATE_KEY__
12
+ PARTICIPANT_ADDRESS=0x00
13
+
14
+ PARTICIPANT_REQUIRE_EXPLICIT_SUBMIT=true
15
+ PARTICIPANT_AUTO_SUBMIT=false
16
+ # PARTICIPANT_TRUSTED_RELAYER_HOSTS=openfunderse-relayer.example.com
17
+ # PARTICIPANT_ALLOW_HTTP_RELAYER=true
@@ -0,0 +1,31 @@
1
+ # OpenFunderse strategy env scaffold
2
+ # Copy values from your STRATEGY_PK, ADDRESS
3
+
4
+ RELAYER_URL=https://openfunderse-relayer-liard.vercel.app/
5
+ BOT_ID=bot-strategy-1
6
+ BOT_API_KEY=replace_me
7
+ CHAIN_ID=10143
8
+ RPC_URL=https://testnet-rpc.monad.xyz
9
+
10
+ # NadFun / protocol addresses
11
+ INTENT_BOOK_ADDRESS=0x76AB8571cED9F4A81b733969216F53C1e13BC835
12
+ NADFUN_EXECUTION_ADAPTER_ADDRESS=0x7949DBd0779Cd829D1B2491A33C8EcCc88669Aa4
13
+ ADAPTER_ADDRESS=0x7949DBd0779Cd829D1B2491A33C8EcCc88669Aa4
14
+ VAULT_ADDRESS=0x34FB76f115f4C4E461eB90eA9f92faEF8c4A5E0A
15
+ NADFUN_LENS_ADDRESS=0xB056d79CA5257589692699a46623F901a3BB76f1
16
+ NADFUN_BONDING_CURVE_ROUTER=0x865054F0F6A288adaAc30261731361EA7E908003
17
+ NADFUN_DEX_ROUTER=0x5D4a4f430cA3B1b2dB86B9cFE48a5316800F5fb2
18
+ NADFUN_WMON_ADDRESS=0xFb8bE43D65FBC1290D6178C6DbA6E58c6D18fA60
19
+
20
+ # Strategy signer (EOA)
21
+ # Temporary bootstrap key (public and unsafe). Replace via bot-init before real usage.
22
+ STRATEGY_PRIVATE_KEY=__TEMP_PRIVATE_KEY__
23
+ STRATEGY_ADDRESS=0x00
24
+
25
+ # STRATEGY_CREATE_MIN_SIGNER_BALANCE_WEI=10000000000000000
26
+
27
+ # Safety defaults
28
+ STRATEGY_REQUIRE_EXPLICIT_SUBMIT=true
29
+ STRATEGY_AUTO_SUBMIT=false
30
+ # STRATEGY_TRUSTED_RELAYER_HOSTS=openfunderse-relayer.example.com
31
+ # STRATEGY_ALLOW_HTTP_RELAYER=true
package/README.md CHANGED
@@ -15,8 +15,11 @@ npx @wiimdy/openfunderse@latest bot-init --skill-name strategy --yes
15
15
  # or
16
16
  npx @wiimdy/openfunderse@latest bot-init --skill-name participant --yes
17
17
 
18
- # 3) load env in current shell
19
- set -a; source .env; set +a
18
+ # 3) (optional) load env in current shell
19
+ # @wiimdy/openfunderse-agents auto-loads .env.strategy / .env.participant by command role.
20
+ set -a; source .env.strategy; set +a
21
+ # or
22
+ set -a; source .env.participant; set +a
20
23
  ```
21
24
 
22
25
  ## Where Files Are Stored
@@ -30,5 +33,7 @@ set -a; source .env; set +a
30
33
  - Use only:
31
34
  - `openfunderse-strategy`
32
35
  - `openfunderse-participant`
33
- - Default env scaffold path is `.env`.
34
- - If you run both bots in the same directory, use `--env-path` to split files (for example `.env.strategy`, `.env.participant`).
36
+ - Default env scaffold path is role-based:
37
+ - strategy: `.env.strategy`
38
+ - participant: `.env.participant`
39
+ - Use `--env-path` only when you want a custom filename/location.
@@ -12,6 +12,8 @@ import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
12
12
  const THIS_FILE = fileURLToPath(import.meta.url);
13
13
  const PACKAGE_ROOT = path.resolve(path.dirname(THIS_FILE), "..");
14
14
  const PACKS_ROOT = path.join(PACKAGE_ROOT, "packs");
15
+ const STRATEGY_ENV_TEMPLATE_PATH = path.join(PACKAGE_ROOT, ".env.strategy.example");
16
+ const PARTICIPANT_ENV_TEMPLATE_PATH = path.join(PACKAGE_ROOT, ".env.participant.example");
15
17
  const DEFAULT_RUNTIME_PACKAGE = "@wiimdy/openfunderse-agents";
16
18
  const SUPPORTED_ENV_PROFILES = new Set(["strategy", "participant", "all"]);
17
19
  const SUPPORTED_BOT_INIT_ROLES = new Set(["strategy", "participant"]);
@@ -315,12 +317,37 @@ function runtimeEnvExamplePath(runtimeDir, runtimePackage) {
315
317
  return path.join(runtimeDir, "node_modules", ...runtimePackage.split("/"), ".env.example");
316
318
  }
317
319
 
320
+ function defaultEnvFileNameForProfile(profile) {
321
+ if (profile === "strategy") {
322
+ return ".env.strategy";
323
+ }
324
+ if (profile === "participant") {
325
+ return ".env.participant";
326
+ }
327
+ return ".env";
328
+ }
329
+
330
+ function applyTemplateTokens(template) {
331
+ return template.replaceAll("__TEMP_PRIVATE_KEY__", TEMP_PRIVATE_KEY);
332
+ }
333
+
334
+ async function readProfileTemplate(profile) {
335
+ const templatePath =
336
+ profile === "strategy" ? STRATEGY_ENV_TEMPLATE_PATH : PARTICIPANT_ENV_TEMPLATE_PATH;
337
+ const fallback = profile === "strategy" ? STRATEGY_ENV_TEMPLATE : PARTICIPANT_ENV_TEMPLATE;
338
+ if (!existsSync(templatePath)) {
339
+ return fallback;
340
+ }
341
+ const template = await readFile(templatePath, "utf8");
342
+ return applyTemplateTokens(template);
343
+ }
344
+
318
345
  async function buildEnvScaffold(profile, runtimeDir, runtimePackage) {
319
346
  if (profile === "strategy") {
320
- return STRATEGY_ENV_TEMPLATE;
347
+ return readProfileTemplate("strategy");
321
348
  }
322
349
  if (profile === "participant") {
323
- return PARTICIPANT_ENV_TEMPLATE;
350
+ return readProfileTemplate("participant");
324
351
  }
325
352
 
326
353
  const runtimeTemplate = runtimeEnvExamplePath(runtimeDir, runtimePackage);
@@ -328,7 +355,9 @@ async function buildEnvScaffold(profile, runtimeDir, runtimePackage) {
328
355
  return readFile(runtimeTemplate, "utf8");
329
356
  }
330
357
 
331
- return `${STRATEGY_ENV_TEMPLATE}\n\n${PARTICIPANT_ENV_TEMPLATE}`;
358
+ const strategy = await readProfileTemplate("strategy");
359
+ const participant = await readProfileTemplate("participant");
360
+ return `${strategy}\n\n${participant}`;
332
361
  }
333
362
 
334
363
  async function writeEnvScaffold(options) {
@@ -341,7 +370,7 @@ async function writeEnvScaffold(options) {
341
370
  const profile = normalizeEnvProfile(rawProfile);
342
371
  const envTarget = options.envFile
343
372
  ? path.resolve(options.envFile)
344
- : path.join(runtimeDir, ".env");
373
+ : path.join(runtimeDir, defaultEnvFileNameForProfile(profile));
345
374
 
346
375
  const alreadyExists = existsSync(envTarget);
347
376
  if (alreadyExists && !options.force) {
@@ -368,7 +397,7 @@ async function writeEnvScaffold(options) {
368
397
  }
369
398
 
370
399
  function defaultEnvPathForRole(role) {
371
- return path.join(process.cwd(), ".env");
400
+ return path.join(process.cwd(), `.env.${role}`);
372
401
  }
373
402
 
374
403
  function readAssignedEnvValue(content, key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiimdy/openfunderse",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Install OpenFunderse skill packs into Codex",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,8 @@
9
9
  "files": [
10
10
  "bin",
11
11
  "packs",
12
+ ".env.strategy.example",
13
+ ".env.participant.example",
12
14
  "README.md"
13
15
  ],
14
16
  "dependencies": {
@@ -48,7 +48,7 @@ npx @wiimdy/openfunderse@latest bot-init \
48
48
  4) Load env for the current shell:
49
49
 
50
50
  ```bash
51
- set -a; source .env; set +a
51
+ set -a; source .env.participant; set +a
52
52
  ```
53
53
 
54
54
  Note:
@@ -70,7 +70,7 @@ npx @wiimdy/openfunderse@latest bot-init \
70
70
  4) Load env for the current shell:
71
71
 
72
72
  ```bash
73
- set -a; source .env; set +a
73
+ set -a; source .env.strategy; set +a
74
74
  ```
75
75
 
76
76
  Note: