@effectstream/frontend-sdk 0.100.27 → 0.101.0
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/mod.js +491 -6
- package/package.json +2 -2
package/dist/mod.js
CHANGED
|
@@ -18740,6 +18740,12 @@ function getRuntime() {
|
|
|
18740
18740
|
}
|
|
18741
18741
|
return { runtime: "unknown", environment: "unknown" };
|
|
18742
18742
|
}
|
|
18743
|
+
function getEnv(key) {
|
|
18744
|
+
return process.env[key];
|
|
18745
|
+
}
|
|
18746
|
+
function setEnv(key, value) {
|
|
18747
|
+
process.env[key] = value;
|
|
18748
|
+
}
|
|
18743
18749
|
// ../effectstream-sdk/crypto/src/chains/algorand.ts
|
|
18744
18750
|
init_buffer();
|
|
18745
18751
|
import { Value as Value2 } from "@sinclair/typebox/value";
|
|
@@ -21400,6 +21406,491 @@ async function setupInitialListeners(_broker) {
|
|
|
21400
21406
|
|
|
21401
21407
|
// ../effectstream-sdk/events/src/event-connect.ts
|
|
21402
21408
|
import { extract, matches } from "mqtt-pattern";
|
|
21409
|
+
|
|
21410
|
+
// ../effectstream-sdk/utils/src/config.ts
|
|
21411
|
+
import dotenv from "dotenv";
|
|
21412
|
+
var MIDNIGHT_STORAGE_PASSWORD_DEFAULT = "YourPasswordMy1!";
|
|
21413
|
+
var EFFECTSTREAM_ENV = getEnv("EFFECTSTREAM_ENV");
|
|
21414
|
+
if (EFFECTSTREAM_ENV) {
|
|
21415
|
+
dotenv.config({
|
|
21416
|
+
path: `.env.${EFFECTSTREAM_ENV}`,
|
|
21417
|
+
override: true
|
|
21418
|
+
});
|
|
21419
|
+
}
|
|
21420
|
+
var definitions = {
|
|
21421
|
+
EFFECTSTREAM_ENV: {
|
|
21422
|
+
key: "EFFECTSTREAM_ENV",
|
|
21423
|
+
type: "string",
|
|
21424
|
+
defaultValue: undefined,
|
|
21425
|
+
description: "Effectstream Environment. Example: 'local' or 'testnet'"
|
|
21426
|
+
},
|
|
21427
|
+
DB_HOST: {
|
|
21428
|
+
key: "DB_HOST",
|
|
21429
|
+
type: "string",
|
|
21430
|
+
defaultValue: "localhost",
|
|
21431
|
+
description: "Paima Engine Postgres Host URL. Example: 'localhost'"
|
|
21432
|
+
},
|
|
21433
|
+
DB_NAME: {
|
|
21434
|
+
key: "DB_NAME",
|
|
21435
|
+
type: "string",
|
|
21436
|
+
defaultValue: "postgres",
|
|
21437
|
+
description: "Paima Engine Postgres Database Name. Example: 'postgres'"
|
|
21438
|
+
},
|
|
21439
|
+
DB_PORT: {
|
|
21440
|
+
key: "DB_PORT",
|
|
21441
|
+
type: "number",
|
|
21442
|
+
defaultValue: 5432,
|
|
21443
|
+
description: "Paima Engine Postgres Port. Example: '5432'"
|
|
21444
|
+
},
|
|
21445
|
+
DB_PW: {
|
|
21446
|
+
key: "DB_PW",
|
|
21447
|
+
isSecret: true,
|
|
21448
|
+
type: "string",
|
|
21449
|
+
defaultValue: "postgres",
|
|
21450
|
+
description: "Paima Engine Postgres Password. Example: 'password'"
|
|
21451
|
+
},
|
|
21452
|
+
DB_USER: {
|
|
21453
|
+
key: "DB_USER",
|
|
21454
|
+
type: "string",
|
|
21455
|
+
defaultValue: "postgres",
|
|
21456
|
+
description: "Paima Engine Postgres User. Example: 'postgres'"
|
|
21457
|
+
},
|
|
21458
|
+
NODE_ENV: {
|
|
21459
|
+
key: "NODE_ENV",
|
|
21460
|
+
type: "string",
|
|
21461
|
+
defaultValue: undefined,
|
|
21462
|
+
description: "Node Environment. Example: 'development' or 'production'"
|
|
21463
|
+
},
|
|
21464
|
+
ORCHESTRATOR_URL: {
|
|
21465
|
+
key: "ORCHESTRATOR_URL",
|
|
21466
|
+
type: "string",
|
|
21467
|
+
defaultValue: "http://localhost",
|
|
21468
|
+
description: "Paima Engine Orchestrator URL. Example: 'http://localhost'"
|
|
21469
|
+
},
|
|
21470
|
+
ORCHESTRATOR_PORT: {
|
|
21471
|
+
key: "ORCHESTRATOR_PORT",
|
|
21472
|
+
type: "number",
|
|
21473
|
+
defaultValue: 0,
|
|
21474
|
+
description: "Paima Engine Orchestrator Port. Used by the TUI to monitor processes. Example: '3000'"
|
|
21475
|
+
},
|
|
21476
|
+
TUI_LOG_URL: {
|
|
21477
|
+
key: "TUI_LOG_URL",
|
|
21478
|
+
type: "string",
|
|
21479
|
+
defaultValue: "http://localhost",
|
|
21480
|
+
description: "TUI Log URL. Example: 'http://localhost'"
|
|
21481
|
+
},
|
|
21482
|
+
TUI_LOG_PORT: {
|
|
21483
|
+
key: "TUI_LOG_PORT",
|
|
21484
|
+
type: "number",
|
|
21485
|
+
defaultValue: 11033,
|
|
21486
|
+
description: "TUI Log Port. Example: '11033'"
|
|
21487
|
+
},
|
|
21488
|
+
SHELL: {
|
|
21489
|
+
isSystem: true,
|
|
21490
|
+
key: "SHELL",
|
|
21491
|
+
type: "string",
|
|
21492
|
+
defaultValue: undefined,
|
|
21493
|
+
description: "System shell path. This is set by the OS. Used to run TUI/tmux commands"
|
|
21494
|
+
},
|
|
21495
|
+
TMUX: {
|
|
21496
|
+
isSystem: true,
|
|
21497
|
+
key: "TMUX",
|
|
21498
|
+
type: "string",
|
|
21499
|
+
defaultValue: undefined,
|
|
21500
|
+
description: "System tmux path. This is set by Tmux itself. Used to check if the process is running in a tmux session"
|
|
21501
|
+
},
|
|
21502
|
+
RECAPTCHA_V3_FRONTEND: {
|
|
21503
|
+
key: "RECAPTCHA_V3_FRONTEND",
|
|
21504
|
+
type: "string",
|
|
21505
|
+
defaultValue: undefined,
|
|
21506
|
+
description: "ReCaptcha V3 Frontend Key. Used by the Batcher to verify requests. Leave empty to disable. Example: '6Lc123456789012345678901234567890'"
|
|
21507
|
+
},
|
|
21508
|
+
BATCHER_PORT: {
|
|
21509
|
+
key: "BATCHER_PORT",
|
|
21510
|
+
type: "number",
|
|
21511
|
+
defaultValue: 3334,
|
|
21512
|
+
description: "Batcher Port. Example: '3334'"
|
|
21513
|
+
},
|
|
21514
|
+
STORE_HISTORICAL_GAME_INPUTS: {
|
|
21515
|
+
key: "STORE_HISTORICAL_GAME_INPUTS",
|
|
21516
|
+
type: "boolean",
|
|
21517
|
+
defaultValue: true,
|
|
21518
|
+
description: "Store Historical Game Inputs. Example: 'true' or 'false'"
|
|
21519
|
+
},
|
|
21520
|
+
MQTT_BROKER: {
|
|
21521
|
+
key: "MQTT_BROKER",
|
|
21522
|
+
type: "boolean",
|
|
21523
|
+
defaultValue: true,
|
|
21524
|
+
description: "MQTT Broker. Example: 'true' or 'false'"
|
|
21525
|
+
},
|
|
21526
|
+
MQTT_ENGINE_BROKER_URL: {
|
|
21527
|
+
key: "MQTT_ENGINE_BROKER_URL",
|
|
21528
|
+
type: "string",
|
|
21529
|
+
defaultValue: "mqtt://127.0.0.1:8883",
|
|
21530
|
+
description: "MQTT Engine Broker TCP URL. Example: 'mqtt://127.0.0.1:8883'"
|
|
21531
|
+
},
|
|
21532
|
+
MQTT_ENGINE_BROKER_PORT: {
|
|
21533
|
+
key: "MQTT_ENGINE_BROKER_PORT",
|
|
21534
|
+
type: "number",
|
|
21535
|
+
defaultValue: 8883,
|
|
21536
|
+
description: "MQTT Engine Broker TCP Port. Example: '8883'"
|
|
21537
|
+
},
|
|
21538
|
+
MQTT_ENGINE_BROKER_WS_URL: {
|
|
21539
|
+
key: "MQTT_ENGINE_BROKER_WS_URL",
|
|
21540
|
+
type: "string",
|
|
21541
|
+
defaultValue: "ws://127.0.0.1:9883",
|
|
21542
|
+
description: "MQTT Engine Broker WebSocket URL (for browser clients). Example: 'ws://127.0.0.1:9883'"
|
|
21543
|
+
},
|
|
21544
|
+
MQTT_ENGINE_BROKER_WS_PORT: {
|
|
21545
|
+
key: "MQTT_ENGINE_BROKER_WS_PORT",
|
|
21546
|
+
type: "number",
|
|
21547
|
+
defaultValue: 9883,
|
|
21548
|
+
description: "MQTT Engine Broker WebSocket Port. Example: '9883'"
|
|
21549
|
+
},
|
|
21550
|
+
MQTT_BATCHER_BROKER_URL: {
|
|
21551
|
+
key: "MQTT_BATCHER_BROKER_URL",
|
|
21552
|
+
type: "string",
|
|
21553
|
+
defaultValue: "mqtt://127.0.0.1:8884",
|
|
21554
|
+
description: "MQTT Batcher Broker TCP URL. Example: 'mqtt://127.0.0.1:8884'"
|
|
21555
|
+
},
|
|
21556
|
+
MQTT_BATCHER_BROKER_PORT: {
|
|
21557
|
+
key: "MQTT_BATCHER_BROKER_PORT",
|
|
21558
|
+
type: "number",
|
|
21559
|
+
defaultValue: 8884,
|
|
21560
|
+
description: "MQTT Batcher Broker TCP Port. Example: '8884'"
|
|
21561
|
+
},
|
|
21562
|
+
MQTT_BATCHER_BROKER_WS_URL: {
|
|
21563
|
+
key: "MQTT_BATCHER_BROKER_WS_URL",
|
|
21564
|
+
type: "string",
|
|
21565
|
+
defaultValue: "ws://127.0.0.1:9884",
|
|
21566
|
+
description: "MQTT Batcher Broker WebSocket URL (for browser clients). Example: 'ws://127.0.0.1:9884'"
|
|
21567
|
+
},
|
|
21568
|
+
MQTT_BATCHER_BROKER_WS_PORT: {
|
|
21569
|
+
key: "MQTT_BATCHER_BROKER_WS_PORT",
|
|
21570
|
+
type: "number",
|
|
21571
|
+
defaultValue: 9884,
|
|
21572
|
+
description: "MQTT Batcher Broker WebSocket Port. Example: '9884'"
|
|
21573
|
+
},
|
|
21574
|
+
EFFECTSTREAM_API_PORT: {
|
|
21575
|
+
key: "EFFECTSTREAM_API_PORT",
|
|
21576
|
+
type: "number",
|
|
21577
|
+
defaultValue: 9999,
|
|
21578
|
+
description: "Main Paima API Port. Used by developers custom endpoints and RPC endpoints. Example: '9999'"
|
|
21579
|
+
},
|
|
21580
|
+
EFFECTSTREAM_EXPLORER_PORT: {
|
|
21581
|
+
key: "EFFECTSTREAM_EXPLORER_PORT",
|
|
21582
|
+
type: "number",
|
|
21583
|
+
defaultValue: 10590,
|
|
21584
|
+
description: "Explorer Port. Example: '10590'"
|
|
21585
|
+
},
|
|
21586
|
+
EFFECTSTREAM_CHAIN_ID: {
|
|
21587
|
+
key: "EFFECTSTREAM_CHAIN_ID",
|
|
21588
|
+
type: "number",
|
|
21589
|
+
defaultValue: 87401284021,
|
|
21590
|
+
description: "Paima Chain ID. Example: '87401284021'"
|
|
21591
|
+
},
|
|
21592
|
+
PGLITE: {
|
|
21593
|
+
key: "PGLITE",
|
|
21594
|
+
type: "boolean",
|
|
21595
|
+
defaultValue: true,
|
|
21596
|
+
description: "Enable single connection mode and other specific PGLite features. IMPORTANT enable only for development. ('true' or 'false')"
|
|
21597
|
+
},
|
|
21598
|
+
PGLITE_DATA_DIR: {
|
|
21599
|
+
key: "PGLITE_DATA_DIR",
|
|
21600
|
+
type: "string",
|
|
21601
|
+
defaultValue: "memory://",
|
|
21602
|
+
description: "PGLite data directory. Use 'memory://' for in-memory (default) or a file path for persistent storage. Example: './pglite-data'"
|
|
21603
|
+
},
|
|
21604
|
+
DEBUG_PGLITE: {
|
|
21605
|
+
key: "DEBUG_PGLITE",
|
|
21606
|
+
type: "number",
|
|
21607
|
+
defaultValue: undefined,
|
|
21608
|
+
description: "Enable PGLite Debug/Verbose mode. Example: '1'"
|
|
21609
|
+
},
|
|
21610
|
+
ALLOW_NO_PG_IVM: {
|
|
21611
|
+
key: "ALLOW_NO_PG_IVM",
|
|
21612
|
+
type: "boolean",
|
|
21613
|
+
defaultValue: false,
|
|
21614
|
+
description: "Permits the engine to start when the pg_ivm extension is not installed, falling back to plain SQL views over the trigger-maintained intermediate tables. Intended for dev/test and low-volume apps only — the fallback degrades sharply on high-cardinality data. Production deployments should install pg_ivm. ('true' or 'false')"
|
|
21615
|
+
},
|
|
21616
|
+
OTEL_COLLECTOR_PORT: {
|
|
21617
|
+
key: "OTEL_COLLECTOR_PORT",
|
|
21618
|
+
type: "number",
|
|
21619
|
+
defaultValue: 4318,
|
|
21620
|
+
description: "OTEL Collector Port. Example: '4318'"
|
|
21621
|
+
},
|
|
21622
|
+
DOCS_PORT: {
|
|
21623
|
+
key: "DOCS_PORT",
|
|
21624
|
+
type: "number",
|
|
21625
|
+
defaultValue: 10600,
|
|
21626
|
+
description: "Docs Port. Example: '10600'"
|
|
21627
|
+
},
|
|
21628
|
+
MIDNIGHT_STORAGE_PASSWORD: {
|
|
21629
|
+
key: "MIDNIGHT_STORAGE_PASSWORD",
|
|
21630
|
+
isSecret: true,
|
|
21631
|
+
type: "string",
|
|
21632
|
+
defaultValue: MIDNIGHT_STORAGE_PASSWORD_DEFAULT,
|
|
21633
|
+
description: "Midnight Storage Password. Used to run the new node version or deploy contracts on Midnight. A random 16-character hex string is generated if not provided."
|
|
21634
|
+
},
|
|
21635
|
+
API_KEY_OPEN_ENDPOINTS_EXPLORER: {
|
|
21636
|
+
key: "API_KEY_OPEN_ENDPOINTS_EXPLORER",
|
|
21637
|
+
isSecret: true,
|
|
21638
|
+
type: "string",
|
|
21639
|
+
defaultValue: "effectstream_api_explorer_endpoints_password",
|
|
21640
|
+
description: "API key to access open explorer endpoints (tables, primitives, addresses, scheduled-data)."
|
|
21641
|
+
},
|
|
21642
|
+
ENABLE_DEV_AND_DEBUG_ENDPOINTS: {
|
|
21643
|
+
key: "ENABLE_DEV_AND_DEBUG_ENDPOINTS",
|
|
21644
|
+
type: "boolean",
|
|
21645
|
+
defaultValue: false,
|
|
21646
|
+
description: "Enable developer and debug endpoints (/debug/sync-protocols, /config, /db_acquire_lock, /db_release_lock, /force-batch, /clear-inputs). Should be disabled in production."
|
|
21647
|
+
},
|
|
21648
|
+
EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS: {
|
|
21649
|
+
key: "EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS",
|
|
21650
|
+
type: "number",
|
|
21651
|
+
defaultValue: undefined,
|
|
21652
|
+
description: "Wall-clock seconds between automated pg_dump snapshots. Leaving this unset disables snapshots entirely. Example: '3600' (1 hour)."
|
|
21653
|
+
},
|
|
21654
|
+
EFFECTSTREAM_SNAPSHOT_PATH: {
|
|
21655
|
+
key: "EFFECTSTREAM_SNAPSHOT_PATH",
|
|
21656
|
+
type: "string",
|
|
21657
|
+
defaultValue: "./snapshots",
|
|
21658
|
+
description: "Output directory for snapshot .dump files. Example: './backups'"
|
|
21659
|
+
},
|
|
21660
|
+
EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY: {
|
|
21661
|
+
key: "EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY",
|
|
21662
|
+
type: "boolean",
|
|
21663
|
+
defaultValue: true,
|
|
21664
|
+
description: "Snapshot retention: keep one snapshot per hour for the last 24 hours. Set to 'false' to disable this tier."
|
|
21665
|
+
},
|
|
21666
|
+
EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY: {
|
|
21667
|
+
key: "EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY",
|
|
21668
|
+
type: "boolean",
|
|
21669
|
+
defaultValue: true,
|
|
21670
|
+
description: "Snapshot retention: keep one snapshot per 6-hour window for the last 3 days. Set to 'false' to disable this tier."
|
|
21671
|
+
},
|
|
21672
|
+
EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS: {
|
|
21673
|
+
key: "EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS",
|
|
21674
|
+
type: "number",
|
|
21675
|
+
defaultValue: 7,
|
|
21676
|
+
description: "Snapshot retention: keep one snapshot per day for this many days. Snapshots older than this are deleted. Default: 7."
|
|
21677
|
+
},
|
|
21678
|
+
EFFECTSTREAM_COALESCE_EMPTY_BLOCKS: {
|
|
21679
|
+
key: "EFFECTSTREAM_COALESCE_EMPTY_BLOCKS",
|
|
21680
|
+
type: "boolean",
|
|
21681
|
+
defaultValue: false,
|
|
21682
|
+
description: "Fold consecutive empty catch-up blocks into one DB transaction when behind the chain tip. Default: false."
|
|
21683
|
+
},
|
|
21684
|
+
EFFECTSTREAM_LAG_THRESHOLD_MS: {
|
|
21685
|
+
key: "EFFECTSTREAM_LAG_THRESHOLD_MS",
|
|
21686
|
+
type: "number",
|
|
21687
|
+
defaultValue: undefined,
|
|
21688
|
+
description: "Override the lag threshold (ms) that gates empty-block coalescing and lag logging. When unset, defaults to 20× the main clock's block time, falling back to 60 s when no blockTimeMS is exposed."
|
|
21689
|
+
},
|
|
21690
|
+
EFFECTSTREAM_FINALIZED_STREAM_CAP: {
|
|
21691
|
+
key: "EFFECTSTREAM_FINALIZED_STREAM_CAP",
|
|
21692
|
+
type: "number",
|
|
21693
|
+
defaultValue: 2048,
|
|
21694
|
+
description: "Backpressure cap on the in-memory finalized-block queue between the merge and the runtime apply loop. The merge blocks once this many produced blocks are unconsumed, bounding memory during deep catch-up. Default: 2048."
|
|
21695
|
+
}
|
|
21696
|
+
};
|
|
21697
|
+
|
|
21698
|
+
class ENV {
|
|
21699
|
+
static get EFFECTSTREAM_ENV() {
|
|
21700
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_ENV);
|
|
21701
|
+
}
|
|
21702
|
+
static get MQTT_BROKER() {
|
|
21703
|
+
return ENV.getConfig(definitions.MQTT_BROKER);
|
|
21704
|
+
}
|
|
21705
|
+
static get MQTT_ENGINE_BROKER_PORT() {
|
|
21706
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_PORT);
|
|
21707
|
+
}
|
|
21708
|
+
static get MQTT_ENGINE_BROKER_WS_PORT() {
|
|
21709
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_WS_PORT);
|
|
21710
|
+
}
|
|
21711
|
+
static get MQTT_BATCHER_BROKER_PORT() {
|
|
21712
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_PORT);
|
|
21713
|
+
}
|
|
21714
|
+
static get MQTT_BATCHER_BROKER_WS_PORT() {
|
|
21715
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_WS_PORT);
|
|
21716
|
+
}
|
|
21717
|
+
static get MQTT_ENGINE_BROKER_URL() {
|
|
21718
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_URL);
|
|
21719
|
+
}
|
|
21720
|
+
static get MQTT_ENGINE_BROKER_WS_URL() {
|
|
21721
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_WS_URL);
|
|
21722
|
+
}
|
|
21723
|
+
static get MQTT_BATCHER_BROKER_URL() {
|
|
21724
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_URL);
|
|
21725
|
+
}
|
|
21726
|
+
static get MQTT_BATCHER_BROKER_WS_URL() {
|
|
21727
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_WS_URL);
|
|
21728
|
+
}
|
|
21729
|
+
static get DB_HOST() {
|
|
21730
|
+
return ENV.getConfig(definitions.DB_HOST);
|
|
21731
|
+
}
|
|
21732
|
+
static get DB_NAME() {
|
|
21733
|
+
return ENV.getConfig(definitions.DB_NAME);
|
|
21734
|
+
}
|
|
21735
|
+
static get DB_PORT() {
|
|
21736
|
+
return ENV.getConfig(definitions.DB_PORT);
|
|
21737
|
+
}
|
|
21738
|
+
static get DB_PW() {
|
|
21739
|
+
return ENV.getConfig(definitions.DB_PW);
|
|
21740
|
+
}
|
|
21741
|
+
static get DB_USER() {
|
|
21742
|
+
return ENV.getConfig(definitions.DB_USER);
|
|
21743
|
+
}
|
|
21744
|
+
static get NODE_ENV() {
|
|
21745
|
+
return ENV.getConfig(definitions.NODE_ENV);
|
|
21746
|
+
}
|
|
21747
|
+
static get ORCHESTRATOR_URL() {
|
|
21748
|
+
return ENV.getConfig(definitions.ORCHESTRATOR_URL);
|
|
21749
|
+
}
|
|
21750
|
+
static get ORCHESTRATOR_PORT() {
|
|
21751
|
+
return ENV.getConfig(definitions.ORCHESTRATOR_PORT);
|
|
21752
|
+
}
|
|
21753
|
+
static set ORCHESTRATOR_PORT(port) {
|
|
21754
|
+
setEnv(definitions.ORCHESTRATOR_PORT.key, String(port));
|
|
21755
|
+
}
|
|
21756
|
+
static get TUI_LOG_URL() {
|
|
21757
|
+
return ENV.getConfig(definitions.TUI_LOG_URL);
|
|
21758
|
+
}
|
|
21759
|
+
static get TUI_LOG_PORT() {
|
|
21760
|
+
return ENV.getConfig(definitions.TUI_LOG_PORT);
|
|
21761
|
+
}
|
|
21762
|
+
static get SHELL() {
|
|
21763
|
+
return ENV.getConfig(definitions.SHELL);
|
|
21764
|
+
}
|
|
21765
|
+
static get TMUX() {
|
|
21766
|
+
return ENV.getConfig(definitions.TMUX);
|
|
21767
|
+
}
|
|
21768
|
+
static get EFFECTSTREAM_API_PORT() {
|
|
21769
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_API_PORT);
|
|
21770
|
+
}
|
|
21771
|
+
static get RECAPTCHA_V3_FRONTEND() {
|
|
21772
|
+
return ENV.getConfig(definitions.RECAPTCHA_V3_FRONTEND);
|
|
21773
|
+
}
|
|
21774
|
+
static get BATCHER_PORT() {
|
|
21775
|
+
return ENV.getConfig(definitions.BATCHER_PORT);
|
|
21776
|
+
}
|
|
21777
|
+
static get EFFECTSTREAM_EXPLORER_PORT() {
|
|
21778
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_EXPLORER_PORT);
|
|
21779
|
+
}
|
|
21780
|
+
static get EFFECTSTREAM_CHAIN_ID() {
|
|
21781
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_CHAIN_ID);
|
|
21782
|
+
}
|
|
21783
|
+
static get PGLITE() {
|
|
21784
|
+
return ENV.getConfig(definitions.PGLITE);
|
|
21785
|
+
}
|
|
21786
|
+
static get PGLITE_DATA_DIR() {
|
|
21787
|
+
return ENV.getConfig(definitions.PGLITE_DATA_DIR);
|
|
21788
|
+
}
|
|
21789
|
+
static get DEBUG_PGLITE() {
|
|
21790
|
+
return ENV.getConfig(definitions.DEBUG_PGLITE);
|
|
21791
|
+
}
|
|
21792
|
+
static get ALLOW_NO_PG_IVM() {
|
|
21793
|
+
return ENV.getConfig(definitions.ALLOW_NO_PG_IVM);
|
|
21794
|
+
}
|
|
21795
|
+
static get OTEL_COLLECTOR_PORT() {
|
|
21796
|
+
return ENV.getConfig(definitions.OTEL_COLLECTOR_PORT);
|
|
21797
|
+
}
|
|
21798
|
+
static get DOCS_PORT() {
|
|
21799
|
+
return ENV.getConfig(definitions.DOCS_PORT);
|
|
21800
|
+
}
|
|
21801
|
+
static get MIDNIGHT_STORAGE_PASSWORD() {
|
|
21802
|
+
return ENV.getConfig(definitions.MIDNIGHT_STORAGE_PASSWORD);
|
|
21803
|
+
}
|
|
21804
|
+
static get API_KEY_OPEN_ENDPOINTS_EXPLORER() {
|
|
21805
|
+
return ENV.getConfig(definitions.API_KEY_OPEN_ENDPOINTS_EXPLORER);
|
|
21806
|
+
}
|
|
21807
|
+
static get ENABLE_DEV_AND_DEBUG_ENDPOINTS() {
|
|
21808
|
+
return ENV.getConfig(definitions.ENABLE_DEV_AND_DEBUG_ENDPOINTS);
|
|
21809
|
+
}
|
|
21810
|
+
static get EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS() {
|
|
21811
|
+
const raw = getEnv(definitions.EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS.key);
|
|
21812
|
+
if (raw == null || raw === "")
|
|
21813
|
+
return;
|
|
21814
|
+
return parseInt(raw, 10);
|
|
21815
|
+
}
|
|
21816
|
+
static get EFFECTSTREAM_SNAPSHOT_PATH() {
|
|
21817
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_PATH);
|
|
21818
|
+
}
|
|
21819
|
+
static get EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY() {
|
|
21820
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY);
|
|
21821
|
+
}
|
|
21822
|
+
static get EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY() {
|
|
21823
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY);
|
|
21824
|
+
}
|
|
21825
|
+
static get EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS() {
|
|
21826
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS);
|
|
21827
|
+
}
|
|
21828
|
+
static get EFFECTSTREAM_COALESCE_EMPTY_BLOCKS() {
|
|
21829
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_COALESCE_EMPTY_BLOCKS);
|
|
21830
|
+
}
|
|
21831
|
+
static get EFFECTSTREAM_FINALIZED_STREAM_CAP() {
|
|
21832
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_FINALIZED_STREAM_CAP);
|
|
21833
|
+
}
|
|
21834
|
+
static get EFFECTSTREAM_LAG_THRESHOLD_MS() {
|
|
21835
|
+
const raw = getEnv(definitions.EFFECTSTREAM_LAG_THRESHOLD_MS.key);
|
|
21836
|
+
if (raw == null || raw === "")
|
|
21837
|
+
return;
|
|
21838
|
+
return parseInt(raw, 10);
|
|
21839
|
+
}
|
|
21840
|
+
static getConfig(config) {
|
|
21841
|
+
switch (config.type) {
|
|
21842
|
+
case "string":
|
|
21843
|
+
return ENV.getString(config.key, config.defaultValue);
|
|
21844
|
+
case "number":
|
|
21845
|
+
return ENV.getNumber(config.key, config.defaultValue);
|
|
21846
|
+
case "boolean":
|
|
21847
|
+
return ENV.getBoolean(config.key, config.defaultValue);
|
|
21848
|
+
default:
|
|
21849
|
+
throw new Error(`Invalid config type: ${config}`);
|
|
21850
|
+
}
|
|
21851
|
+
}
|
|
21852
|
+
static getCurrentConfig(showSecrets = false) {
|
|
21853
|
+
const secretPlaceholder = "********";
|
|
21854
|
+
const values = {};
|
|
21855
|
+
Object.entries(definitions).forEach(([key, config]) => {
|
|
21856
|
+
if (config.isSecret) {
|
|
21857
|
+
values[key] = showSecrets ? ENV[key] : secretPlaceholder;
|
|
21858
|
+
} else {
|
|
21859
|
+
values[key] = ENV[key];
|
|
21860
|
+
}
|
|
21861
|
+
});
|
|
21862
|
+
return values;
|
|
21863
|
+
}
|
|
21864
|
+
static getDocumentation() {
|
|
21865
|
+
return Object.fromEntries(Object.entries(definitions).map(([key, config]) => {
|
|
21866
|
+
return [key, {
|
|
21867
|
+
defaultValue: config.defaultValue,
|
|
21868
|
+
description: config.description
|
|
21869
|
+
}];
|
|
21870
|
+
}));
|
|
21871
|
+
}
|
|
21872
|
+
static getBoolean(key, defaultValue = false) {
|
|
21873
|
+
const value = ENV.getEnv(key);
|
|
21874
|
+
if (value == null || value === "")
|
|
21875
|
+
return defaultValue;
|
|
21876
|
+
return ["true", "t", "1", "yes", "y"].includes(value.toLowerCase());
|
|
21877
|
+
}
|
|
21878
|
+
static getNumber(key, defaultValue = 0) {
|
|
21879
|
+
const value = ENV.getEnv(key);
|
|
21880
|
+
if (value == null || value === "")
|
|
21881
|
+
return defaultValue;
|
|
21882
|
+
return parseInt(value, 10);
|
|
21883
|
+
}
|
|
21884
|
+
static getString(key, defaultValue = "") {
|
|
21885
|
+
const value = ENV.getEnv(key);
|
|
21886
|
+
return value ?? defaultValue;
|
|
21887
|
+
}
|
|
21888
|
+
static getEnv(key) {
|
|
21889
|
+
return getEnv(key);
|
|
21890
|
+
}
|
|
21891
|
+
}
|
|
21892
|
+
|
|
21893
|
+
// ../effectstream-sdk/events/src/event-connect.ts
|
|
21403
21894
|
var utf8Encoder = new TextEncoder;
|
|
21404
21895
|
var utf8Decoder = new TextDecoder;
|
|
21405
21896
|
function dispatchMessage(topic, payload) {
|
|
@@ -21470,12 +21961,6 @@ async function createMqttJsClient(url) {
|
|
|
21470
21961
|
}
|
|
21471
21962
|
};
|
|
21472
21963
|
}
|
|
21473
|
-
var ENV = {
|
|
21474
|
-
MQTT_ENGINE_BROKER_URL: "mqtt://localhost:8883",
|
|
21475
|
-
MQTT_BATCHER_BROKER_URL: "mqtt://localhost:8884",
|
|
21476
|
-
MQTT_ENGINE_BROKER_WS_URL: "ws://localhost:9883",
|
|
21477
|
-
MQTT_BATCHER_BROKER_WS_URL: "ws://localhost:9884"
|
|
21478
|
-
};
|
|
21479
21964
|
|
|
21480
21965
|
class EventConnect {
|
|
21481
21966
|
static clients = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effectstream/frontend-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.101.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://effectstream.github.io/docs/",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"build": "bun run build.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@effectstream/wallets": "0.
|
|
30
|
+
"@effectstream/wallets": "0.101.0"
|
|
31
31
|
},
|
|
32
32
|
"description": "React frontend SDK for EffectStream"
|
|
33
33
|
}
|