@effectstream/frontend-sdk 0.100.28 → 0.101.1
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 +534 -38
- package/package.json +2 -2
package/dist/mod.js
CHANGED
|
@@ -6135,15 +6135,26 @@ __export(exports_crypto, {
|
|
|
6135
6135
|
Cipheriv: () => Cipheriv2,
|
|
6136
6136
|
Cipher: () => Cipher2
|
|
6137
6137
|
});
|
|
6138
|
+
function __accessProp2(key) {
|
|
6139
|
+
return this[key];
|
|
6140
|
+
}
|
|
6138
6141
|
function getCurves() {
|
|
6139
6142
|
return hardcoded_curves;
|
|
6140
6143
|
}
|
|
6141
|
-
var __create, __getProtoOf, __defProp2, __getOwnPropNames2, __hasOwnProp2, __toESM = (mod5, isNodeMode, target) => {
|
|
6144
|
+
var __create, __getProtoOf, __defProp2, __getOwnPropNames2, __hasOwnProp2, __toESMCache_node, __toESMCache_esm, __toESM = (mod5, isNodeMode, target) => {
|
|
6145
|
+
var canCache = mod5 != null && typeof mod5 === "object";
|
|
6146
|
+
if (canCache) {
|
|
6147
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap, cached = cache.get(mod5);
|
|
6148
|
+
if (cached)
|
|
6149
|
+
return cached;
|
|
6150
|
+
}
|
|
6142
6151
|
target = mod5 != null ? __create(__getProtoOf(mod5)) : {};
|
|
6143
6152
|
let to = isNodeMode || !mod5 || !mod5.__esModule ? __defProp2(target, "default", { value: mod5, enumerable: true }) : target;
|
|
6144
6153
|
for (let key of __getOwnPropNames2(mod5))
|
|
6145
6154
|
if (!__hasOwnProp2.call(to, key))
|
|
6146
|
-
__defProp2(to, key, { get: (
|
|
6155
|
+
__defProp2(to, key, { get: __accessProp2.bind(mod5, key), enumerable: true });
|
|
6156
|
+
if (canCache)
|
|
6157
|
+
cache.set(mod5, to);
|
|
6147
6158
|
return to;
|
|
6148
6159
|
}, __commonJS2 = (cb, mod5) => () => (mod5 || cb((mod5 = { exports: {} }).exports, mod5), mod5.exports), require_randombytes, require_create_hash, require_create_hmac, require_algorithms, require_precondition, require_default_encoding, require_safe_buffer, require_isarray, require_type, require_es_object_atoms, require_es_errors, require_eval, require_range, require_ref, require_syntax, require_uri, require_abs, require_floor, require_max, require_min, require_pow, require_round, require_isNaN, require_sign, require_gOPD, require_gopd, require_es_define_property, require_shams, require_has_symbols, require_Reflect_getPrototypeOf, require_Object_getPrototypeOf, require_implementation, require_function_bind, require_functionCall, require_functionApply, require_reflectApply, require_actualApply, require_call_bind_apply_helpers, require_get, require_get_proto, require_hasown, require_get_intrinsic, require_call_bound, require_is_callable, require_for_each, require_possible_typed_array_names, require_available_typed_arrays, require_define_data_property, require_has_property_descriptors, require_set_function_length, require_applyBind, require_call_bind, require_shams2, require_which_typed_array, require_is_typed_array, require_typed_array_buffer, require_to_buffer, require_to_buffer2, require_sync, require_async, require_pbkdf2, require_browserify_cipher, require_diffie_hellman, require_browserify_sign, require_package, require_bn, require_minimalistic_assert, require_utils, require_utils2, require_brorand, require_base, require_inherits_browser, require_inherits, require_short, require_mont, require_edwards, require_curve, require_utils3, require_common, require_common2, require_1, require_256, require_224, require_512, require_384, require_sha, require_ripemd, require_hmac, require_hash, require_secp256k1, require_curves, require_hmac_drbg, require_key, require_signature, require_ec, require_key2, require_signature2, require_eddsa, require_elliptic, require_bn2, require_browser, require_create_ecdh, require_bn3, require_api, require_reporter, require_buffer, require_node, require_base2, require_der, require_constants, require_der2, require_pem, require_decoders, require_der3, require_pem2, require_encoders, require_asn1, require_certificate, require_asn12, require_aesid, require_hash_base, require_md5, require_evp_bytestokey, require_browserify_aes, require_fixProc, require_parse_asn1, require_mgf, require_xor, require_bn4, require_withPublic, require_bn5, require_browserify_rsa, require_publicEncrypt, require_privateDecrypt, require_browser2, require_public_encrypt, require_browser3, require_randomfill, require_crypto_browserify, cryptoBrowserify, prng2, pseudoRandomBytes2, rng2, randomBytes2, Hash2, createHash2, Hmac2, createHmac2, getHashes2, pbkdf22, pbkdf2Sync2, Cipher2, createCipher2, Cipheriv2, createCipheriv2, Decipher2, createDecipher2, Decipheriv2, createDecipheriv2, getCiphers2, listCiphers2, DiffieHellmanGroup2, createDiffieHellmanGroup2, getDiffieHellman2, createDiffieHellman2, DiffieHellman2, createSign2, Sign2, createVerify2, Verify2, createECDH2, publicEncrypt2, privateEncrypt2, publicDecrypt2, privateDecrypt2, randomFill2, randomFillSync2, createCredentials2, constants22, DEFAULT_ENCODING = "buffer", getRandomValues = (array) => {
|
|
6149
6160
|
return crypto.getRandomValues(array);
|
|
@@ -8289,18 +8300,18 @@ var init_crypto = __esm(() => {
|
|
|
8289
8300
|
}, BN._prime = function(name) {
|
|
8290
8301
|
if (primes[name])
|
|
8291
8302
|
return primes[name];
|
|
8292
|
-
var
|
|
8303
|
+
var prime2;
|
|
8293
8304
|
if (name === "k256")
|
|
8294
|
-
|
|
8305
|
+
prime2 = new K256;
|
|
8295
8306
|
else if (name === "p224")
|
|
8296
|
-
|
|
8307
|
+
prime2 = new P224;
|
|
8297
8308
|
else if (name === "p192")
|
|
8298
|
-
|
|
8309
|
+
prime2 = new P192;
|
|
8299
8310
|
else if (name === "p25519")
|
|
8300
|
-
|
|
8311
|
+
prime2 = new P25519;
|
|
8301
8312
|
else
|
|
8302
8313
|
throw Error("Unknown prime " + name);
|
|
8303
|
-
return primes[name] =
|
|
8314
|
+
return primes[name] = prime2, prime2;
|
|
8304
8315
|
};
|
|
8305
8316
|
function Red(m) {
|
|
8306
8317
|
if (typeof m === "string") {
|
|
@@ -11964,18 +11975,18 @@ var init_crypto = __esm(() => {
|
|
|
11964
11975
|
}, BN._prime = function(name) {
|
|
11965
11976
|
if (primes[name])
|
|
11966
11977
|
return primes[name];
|
|
11967
|
-
var
|
|
11978
|
+
var prime2;
|
|
11968
11979
|
if (name === "k256")
|
|
11969
|
-
|
|
11980
|
+
prime2 = new K256;
|
|
11970
11981
|
else if (name === "p224")
|
|
11971
|
-
|
|
11982
|
+
prime2 = new P224;
|
|
11972
11983
|
else if (name === "p192")
|
|
11973
|
-
|
|
11984
|
+
prime2 = new P192;
|
|
11974
11985
|
else if (name === "p25519")
|
|
11975
|
-
|
|
11986
|
+
prime2 = new P25519;
|
|
11976
11987
|
else
|
|
11977
11988
|
throw Error("Unknown prime " + name);
|
|
11978
|
-
return primes[name] =
|
|
11989
|
+
return primes[name] = prime2, prime2;
|
|
11979
11990
|
};
|
|
11980
11991
|
function Red(m) {
|
|
11981
11992
|
if (typeof m === "string") {
|
|
@@ -13427,18 +13438,18 @@ var init_crypto = __esm(() => {
|
|
|
13427
13438
|
}, BN._prime = function(name) {
|
|
13428
13439
|
if (primes[name])
|
|
13429
13440
|
return primes[name];
|
|
13430
|
-
var
|
|
13441
|
+
var prime2;
|
|
13431
13442
|
if (name === "k256")
|
|
13432
|
-
|
|
13443
|
+
prime2 = new K256;
|
|
13433
13444
|
else if (name === "p224")
|
|
13434
|
-
|
|
13445
|
+
prime2 = new P224;
|
|
13435
13446
|
else if (name === "p192")
|
|
13436
|
-
|
|
13447
|
+
prime2 = new P192;
|
|
13437
13448
|
else if (name === "p25519")
|
|
13438
|
-
|
|
13449
|
+
prime2 = new P25519;
|
|
13439
13450
|
else
|
|
13440
13451
|
throw Error("Unknown prime " + name);
|
|
13441
|
-
return primes[name] =
|
|
13452
|
+
return primes[name] = prime2, prime2;
|
|
13442
13453
|
};
|
|
13443
13454
|
function Red(m) {
|
|
13444
13455
|
if (typeof m === "string") {
|
|
@@ -16168,18 +16179,18 @@ var init_crypto = __esm(() => {
|
|
|
16168
16179
|
}, BN._prime = function(name) {
|
|
16169
16180
|
if (primes[name])
|
|
16170
16181
|
return primes[name];
|
|
16171
|
-
var
|
|
16182
|
+
var prime2;
|
|
16172
16183
|
if (name === "k256")
|
|
16173
|
-
|
|
16184
|
+
prime2 = new K256;
|
|
16174
16185
|
else if (name === "p224")
|
|
16175
|
-
|
|
16186
|
+
prime2 = new P224;
|
|
16176
16187
|
else if (name === "p192")
|
|
16177
|
-
|
|
16188
|
+
prime2 = new P192;
|
|
16178
16189
|
else if (name === "p25519")
|
|
16179
|
-
|
|
16190
|
+
prime2 = new P25519;
|
|
16180
16191
|
else
|
|
16181
16192
|
throw Error("Unknown prime " + name);
|
|
16182
|
-
return primes[name] =
|
|
16193
|
+
return primes[name] = prime2, prime2;
|
|
16183
16194
|
};
|
|
16184
16195
|
function Red(m) {
|
|
16185
16196
|
if (typeof m === "string") {
|
|
@@ -17637,18 +17648,18 @@ var init_crypto = __esm(() => {
|
|
|
17637
17648
|
}, BN._prime = function(name) {
|
|
17638
17649
|
if (primes[name])
|
|
17639
17650
|
return primes[name];
|
|
17640
|
-
var
|
|
17651
|
+
var prime2;
|
|
17641
17652
|
if (name === "k256")
|
|
17642
|
-
|
|
17653
|
+
prime2 = new K256;
|
|
17643
17654
|
else if (name === "p224")
|
|
17644
|
-
|
|
17655
|
+
prime2 = new P224;
|
|
17645
17656
|
else if (name === "p192")
|
|
17646
|
-
|
|
17657
|
+
prime2 = new P192;
|
|
17647
17658
|
else if (name === "p25519")
|
|
17648
|
-
|
|
17659
|
+
prime2 = new P25519;
|
|
17649
17660
|
else
|
|
17650
17661
|
throw Error("Unknown prime " + name);
|
|
17651
|
-
return primes[name] =
|
|
17662
|
+
return primes[name] = prime2, prime2;
|
|
17652
17663
|
};
|
|
17653
17664
|
function Red(m) {
|
|
17654
17665
|
if (typeof m === "string") {
|
|
@@ -18740,6 +18751,12 @@ function getRuntime() {
|
|
|
18740
18751
|
}
|
|
18741
18752
|
return { runtime: "unknown", environment: "unknown" };
|
|
18742
18753
|
}
|
|
18754
|
+
function getEnv(key) {
|
|
18755
|
+
return process.env[key];
|
|
18756
|
+
}
|
|
18757
|
+
function setEnv(key, value) {
|
|
18758
|
+
process.env[key] = value;
|
|
18759
|
+
}
|
|
18743
18760
|
// ../effectstream-sdk/crypto/src/chains/algorand.ts
|
|
18744
18761
|
init_buffer();
|
|
18745
18762
|
import { Value as Value2 } from "@sinclair/typebox/value";
|
|
@@ -21400,6 +21417,491 @@ async function setupInitialListeners(_broker) {
|
|
|
21400
21417
|
|
|
21401
21418
|
// ../effectstream-sdk/events/src/event-connect.ts
|
|
21402
21419
|
import { extract, matches } from "mqtt-pattern";
|
|
21420
|
+
|
|
21421
|
+
// ../effectstream-sdk/utils/src/config.ts
|
|
21422
|
+
import dotenv from "dotenv";
|
|
21423
|
+
var MIDNIGHT_STORAGE_PASSWORD_DEFAULT = "YourPasswordMy1!";
|
|
21424
|
+
var EFFECTSTREAM_ENV = getEnv("EFFECTSTREAM_ENV");
|
|
21425
|
+
if (EFFECTSTREAM_ENV) {
|
|
21426
|
+
dotenv.config({
|
|
21427
|
+
path: `.env.${EFFECTSTREAM_ENV}`,
|
|
21428
|
+
override: true
|
|
21429
|
+
});
|
|
21430
|
+
}
|
|
21431
|
+
var definitions = {
|
|
21432
|
+
EFFECTSTREAM_ENV: {
|
|
21433
|
+
key: "EFFECTSTREAM_ENV",
|
|
21434
|
+
type: "string",
|
|
21435
|
+
defaultValue: undefined,
|
|
21436
|
+
description: "Effectstream Environment. Example: 'local' or 'testnet'"
|
|
21437
|
+
},
|
|
21438
|
+
DB_HOST: {
|
|
21439
|
+
key: "DB_HOST",
|
|
21440
|
+
type: "string",
|
|
21441
|
+
defaultValue: "localhost",
|
|
21442
|
+
description: "Paima Engine Postgres Host URL. Example: 'localhost'"
|
|
21443
|
+
},
|
|
21444
|
+
DB_NAME: {
|
|
21445
|
+
key: "DB_NAME",
|
|
21446
|
+
type: "string",
|
|
21447
|
+
defaultValue: "postgres",
|
|
21448
|
+
description: "Paima Engine Postgres Database Name. Example: 'postgres'"
|
|
21449
|
+
},
|
|
21450
|
+
DB_PORT: {
|
|
21451
|
+
key: "DB_PORT",
|
|
21452
|
+
type: "number",
|
|
21453
|
+
defaultValue: 5432,
|
|
21454
|
+
description: "Paima Engine Postgres Port. Example: '5432'"
|
|
21455
|
+
},
|
|
21456
|
+
DB_PW: {
|
|
21457
|
+
key: "DB_PW",
|
|
21458
|
+
isSecret: true,
|
|
21459
|
+
type: "string",
|
|
21460
|
+
defaultValue: "postgres",
|
|
21461
|
+
description: "Paima Engine Postgres Password. Example: 'password'"
|
|
21462
|
+
},
|
|
21463
|
+
DB_USER: {
|
|
21464
|
+
key: "DB_USER",
|
|
21465
|
+
type: "string",
|
|
21466
|
+
defaultValue: "postgres",
|
|
21467
|
+
description: "Paima Engine Postgres User. Example: 'postgres'"
|
|
21468
|
+
},
|
|
21469
|
+
NODE_ENV: {
|
|
21470
|
+
key: "NODE_ENV",
|
|
21471
|
+
type: "string",
|
|
21472
|
+
defaultValue: undefined,
|
|
21473
|
+
description: "Node Environment. Example: 'development' or 'production'"
|
|
21474
|
+
},
|
|
21475
|
+
ORCHESTRATOR_URL: {
|
|
21476
|
+
key: "ORCHESTRATOR_URL",
|
|
21477
|
+
type: "string",
|
|
21478
|
+
defaultValue: "http://localhost",
|
|
21479
|
+
description: "Paima Engine Orchestrator URL. Example: 'http://localhost'"
|
|
21480
|
+
},
|
|
21481
|
+
ORCHESTRATOR_PORT: {
|
|
21482
|
+
key: "ORCHESTRATOR_PORT",
|
|
21483
|
+
type: "number",
|
|
21484
|
+
defaultValue: 0,
|
|
21485
|
+
description: "Paima Engine Orchestrator Port. Used by the TUI to monitor processes. Example: '3000'"
|
|
21486
|
+
},
|
|
21487
|
+
TUI_LOG_URL: {
|
|
21488
|
+
key: "TUI_LOG_URL",
|
|
21489
|
+
type: "string",
|
|
21490
|
+
defaultValue: "http://localhost",
|
|
21491
|
+
description: "TUI Log URL. Example: 'http://localhost'"
|
|
21492
|
+
},
|
|
21493
|
+
TUI_LOG_PORT: {
|
|
21494
|
+
key: "TUI_LOG_PORT",
|
|
21495
|
+
type: "number",
|
|
21496
|
+
defaultValue: 11033,
|
|
21497
|
+
description: "TUI Log Port. Example: '11033'"
|
|
21498
|
+
},
|
|
21499
|
+
SHELL: {
|
|
21500
|
+
isSystem: true,
|
|
21501
|
+
key: "SHELL",
|
|
21502
|
+
type: "string",
|
|
21503
|
+
defaultValue: undefined,
|
|
21504
|
+
description: "System shell path. This is set by the OS. Used to run TUI/tmux commands"
|
|
21505
|
+
},
|
|
21506
|
+
TMUX: {
|
|
21507
|
+
isSystem: true,
|
|
21508
|
+
key: "TMUX",
|
|
21509
|
+
type: "string",
|
|
21510
|
+
defaultValue: undefined,
|
|
21511
|
+
description: "System tmux path. This is set by Tmux itself. Used to check if the process is running in a tmux session"
|
|
21512
|
+
},
|
|
21513
|
+
RECAPTCHA_V3_FRONTEND: {
|
|
21514
|
+
key: "RECAPTCHA_V3_FRONTEND",
|
|
21515
|
+
type: "string",
|
|
21516
|
+
defaultValue: undefined,
|
|
21517
|
+
description: "ReCaptcha V3 Frontend Key. Used by the Batcher to verify requests. Leave empty to disable. Example: '6Lc123456789012345678901234567890'"
|
|
21518
|
+
},
|
|
21519
|
+
BATCHER_PORT: {
|
|
21520
|
+
key: "BATCHER_PORT",
|
|
21521
|
+
type: "number",
|
|
21522
|
+
defaultValue: 3334,
|
|
21523
|
+
description: "Batcher Port. Example: '3334'"
|
|
21524
|
+
},
|
|
21525
|
+
STORE_HISTORICAL_GAME_INPUTS: {
|
|
21526
|
+
key: "STORE_HISTORICAL_GAME_INPUTS",
|
|
21527
|
+
type: "boolean",
|
|
21528
|
+
defaultValue: true,
|
|
21529
|
+
description: "Store Historical Game Inputs. Example: 'true' or 'false'"
|
|
21530
|
+
},
|
|
21531
|
+
MQTT_BROKER: {
|
|
21532
|
+
key: "MQTT_BROKER",
|
|
21533
|
+
type: "boolean",
|
|
21534
|
+
defaultValue: true,
|
|
21535
|
+
description: "MQTT Broker. Example: 'true' or 'false'"
|
|
21536
|
+
},
|
|
21537
|
+
MQTT_ENGINE_BROKER_URL: {
|
|
21538
|
+
key: "MQTT_ENGINE_BROKER_URL",
|
|
21539
|
+
type: "string",
|
|
21540
|
+
defaultValue: "mqtt://127.0.0.1:8883",
|
|
21541
|
+
description: "MQTT Engine Broker TCP URL. Example: 'mqtt://127.0.0.1:8883'"
|
|
21542
|
+
},
|
|
21543
|
+
MQTT_ENGINE_BROKER_PORT: {
|
|
21544
|
+
key: "MQTT_ENGINE_BROKER_PORT",
|
|
21545
|
+
type: "number",
|
|
21546
|
+
defaultValue: 8883,
|
|
21547
|
+
description: "MQTT Engine Broker TCP Port. Example: '8883'"
|
|
21548
|
+
},
|
|
21549
|
+
MQTT_ENGINE_BROKER_WS_URL: {
|
|
21550
|
+
key: "MQTT_ENGINE_BROKER_WS_URL",
|
|
21551
|
+
type: "string",
|
|
21552
|
+
defaultValue: "ws://127.0.0.1:9883",
|
|
21553
|
+
description: "MQTT Engine Broker WebSocket URL (for browser clients). Example: 'ws://127.0.0.1:9883'"
|
|
21554
|
+
},
|
|
21555
|
+
MQTT_ENGINE_BROKER_WS_PORT: {
|
|
21556
|
+
key: "MQTT_ENGINE_BROKER_WS_PORT",
|
|
21557
|
+
type: "number",
|
|
21558
|
+
defaultValue: 9883,
|
|
21559
|
+
description: "MQTT Engine Broker WebSocket Port. Example: '9883'"
|
|
21560
|
+
},
|
|
21561
|
+
MQTT_BATCHER_BROKER_URL: {
|
|
21562
|
+
key: "MQTT_BATCHER_BROKER_URL",
|
|
21563
|
+
type: "string",
|
|
21564
|
+
defaultValue: "mqtt://127.0.0.1:8884",
|
|
21565
|
+
description: "MQTT Batcher Broker TCP URL. Example: 'mqtt://127.0.0.1:8884'"
|
|
21566
|
+
},
|
|
21567
|
+
MQTT_BATCHER_BROKER_PORT: {
|
|
21568
|
+
key: "MQTT_BATCHER_BROKER_PORT",
|
|
21569
|
+
type: "number",
|
|
21570
|
+
defaultValue: 8884,
|
|
21571
|
+
description: "MQTT Batcher Broker TCP Port. Example: '8884'"
|
|
21572
|
+
},
|
|
21573
|
+
MQTT_BATCHER_BROKER_WS_URL: {
|
|
21574
|
+
key: "MQTT_BATCHER_BROKER_WS_URL",
|
|
21575
|
+
type: "string",
|
|
21576
|
+
defaultValue: "ws://127.0.0.1:9884",
|
|
21577
|
+
description: "MQTT Batcher Broker WebSocket URL (for browser clients). Example: 'ws://127.0.0.1:9884'"
|
|
21578
|
+
},
|
|
21579
|
+
MQTT_BATCHER_BROKER_WS_PORT: {
|
|
21580
|
+
key: "MQTT_BATCHER_BROKER_WS_PORT",
|
|
21581
|
+
type: "number",
|
|
21582
|
+
defaultValue: 9884,
|
|
21583
|
+
description: "MQTT Batcher Broker WebSocket Port. Example: '9884'"
|
|
21584
|
+
},
|
|
21585
|
+
EFFECTSTREAM_API_PORT: {
|
|
21586
|
+
key: "EFFECTSTREAM_API_PORT",
|
|
21587
|
+
type: "number",
|
|
21588
|
+
defaultValue: 9999,
|
|
21589
|
+
description: "Main Paima API Port. Used by developers custom endpoints and RPC endpoints. Example: '9999'"
|
|
21590
|
+
},
|
|
21591
|
+
EFFECTSTREAM_EXPLORER_PORT: {
|
|
21592
|
+
key: "EFFECTSTREAM_EXPLORER_PORT",
|
|
21593
|
+
type: "number",
|
|
21594
|
+
defaultValue: 10590,
|
|
21595
|
+
description: "Explorer Port. Example: '10590'"
|
|
21596
|
+
},
|
|
21597
|
+
EFFECTSTREAM_CHAIN_ID: {
|
|
21598
|
+
key: "EFFECTSTREAM_CHAIN_ID",
|
|
21599
|
+
type: "number",
|
|
21600
|
+
defaultValue: 87401284021,
|
|
21601
|
+
description: "Paima Chain ID. Example: '87401284021'"
|
|
21602
|
+
},
|
|
21603
|
+
PGLITE: {
|
|
21604
|
+
key: "PGLITE",
|
|
21605
|
+
type: "boolean",
|
|
21606
|
+
defaultValue: true,
|
|
21607
|
+
description: "Enable single connection mode and other specific PGLite features. IMPORTANT enable only for development. ('true' or 'false')"
|
|
21608
|
+
},
|
|
21609
|
+
PGLITE_DATA_DIR: {
|
|
21610
|
+
key: "PGLITE_DATA_DIR",
|
|
21611
|
+
type: "string",
|
|
21612
|
+
defaultValue: "memory://",
|
|
21613
|
+
description: "PGLite data directory. Use 'memory://' for in-memory (default) or a file path for persistent storage. Example: './pglite-data'"
|
|
21614
|
+
},
|
|
21615
|
+
DEBUG_PGLITE: {
|
|
21616
|
+
key: "DEBUG_PGLITE",
|
|
21617
|
+
type: "number",
|
|
21618
|
+
defaultValue: undefined,
|
|
21619
|
+
description: "Enable PGLite Debug/Verbose mode. Example: '1'"
|
|
21620
|
+
},
|
|
21621
|
+
ALLOW_NO_PG_IVM: {
|
|
21622
|
+
key: "ALLOW_NO_PG_IVM",
|
|
21623
|
+
type: "boolean",
|
|
21624
|
+
defaultValue: false,
|
|
21625
|
+
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')"
|
|
21626
|
+
},
|
|
21627
|
+
OTEL_COLLECTOR_PORT: {
|
|
21628
|
+
key: "OTEL_COLLECTOR_PORT",
|
|
21629
|
+
type: "number",
|
|
21630
|
+
defaultValue: 4318,
|
|
21631
|
+
description: "OTEL Collector Port. Example: '4318'"
|
|
21632
|
+
},
|
|
21633
|
+
DOCS_PORT: {
|
|
21634
|
+
key: "DOCS_PORT",
|
|
21635
|
+
type: "number",
|
|
21636
|
+
defaultValue: 10600,
|
|
21637
|
+
description: "Docs Port. Example: '10600'"
|
|
21638
|
+
},
|
|
21639
|
+
MIDNIGHT_STORAGE_PASSWORD: {
|
|
21640
|
+
key: "MIDNIGHT_STORAGE_PASSWORD",
|
|
21641
|
+
isSecret: true,
|
|
21642
|
+
type: "string",
|
|
21643
|
+
defaultValue: MIDNIGHT_STORAGE_PASSWORD_DEFAULT,
|
|
21644
|
+
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."
|
|
21645
|
+
},
|
|
21646
|
+
API_KEY_OPEN_ENDPOINTS_EXPLORER: {
|
|
21647
|
+
key: "API_KEY_OPEN_ENDPOINTS_EXPLORER",
|
|
21648
|
+
isSecret: true,
|
|
21649
|
+
type: "string",
|
|
21650
|
+
defaultValue: "effectstream_api_explorer_endpoints_password",
|
|
21651
|
+
description: "API key to access open explorer endpoints (tables, primitives, addresses, scheduled-data)."
|
|
21652
|
+
},
|
|
21653
|
+
ENABLE_DEV_AND_DEBUG_ENDPOINTS: {
|
|
21654
|
+
key: "ENABLE_DEV_AND_DEBUG_ENDPOINTS",
|
|
21655
|
+
type: "boolean",
|
|
21656
|
+
defaultValue: false,
|
|
21657
|
+
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."
|
|
21658
|
+
},
|
|
21659
|
+
EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS: {
|
|
21660
|
+
key: "EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS",
|
|
21661
|
+
type: "number",
|
|
21662
|
+
defaultValue: undefined,
|
|
21663
|
+
description: "Wall-clock seconds between automated pg_dump snapshots. Leaving this unset disables snapshots entirely. Example: '3600' (1 hour)."
|
|
21664
|
+
},
|
|
21665
|
+
EFFECTSTREAM_SNAPSHOT_PATH: {
|
|
21666
|
+
key: "EFFECTSTREAM_SNAPSHOT_PATH",
|
|
21667
|
+
type: "string",
|
|
21668
|
+
defaultValue: "./snapshots",
|
|
21669
|
+
description: "Output directory for snapshot .dump files. Example: './backups'"
|
|
21670
|
+
},
|
|
21671
|
+
EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY: {
|
|
21672
|
+
key: "EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY",
|
|
21673
|
+
type: "boolean",
|
|
21674
|
+
defaultValue: true,
|
|
21675
|
+
description: "Snapshot retention: keep one snapshot per hour for the last 24 hours. Set to 'false' to disable this tier."
|
|
21676
|
+
},
|
|
21677
|
+
EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY: {
|
|
21678
|
+
key: "EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY",
|
|
21679
|
+
type: "boolean",
|
|
21680
|
+
defaultValue: true,
|
|
21681
|
+
description: "Snapshot retention: keep one snapshot per 6-hour window for the last 3 days. Set to 'false' to disable this tier."
|
|
21682
|
+
},
|
|
21683
|
+
EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS: {
|
|
21684
|
+
key: "EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS",
|
|
21685
|
+
type: "number",
|
|
21686
|
+
defaultValue: 7,
|
|
21687
|
+
description: "Snapshot retention: keep one snapshot per day for this many days. Snapshots older than this are deleted. Default: 7."
|
|
21688
|
+
},
|
|
21689
|
+
EFFECTSTREAM_COALESCE_EMPTY_BLOCKS: {
|
|
21690
|
+
key: "EFFECTSTREAM_COALESCE_EMPTY_BLOCKS",
|
|
21691
|
+
type: "boolean",
|
|
21692
|
+
defaultValue: false,
|
|
21693
|
+
description: "Fold consecutive empty catch-up blocks into one DB transaction when behind the chain tip. Default: false."
|
|
21694
|
+
},
|
|
21695
|
+
EFFECTSTREAM_LAG_THRESHOLD_MS: {
|
|
21696
|
+
key: "EFFECTSTREAM_LAG_THRESHOLD_MS",
|
|
21697
|
+
type: "number",
|
|
21698
|
+
defaultValue: undefined,
|
|
21699
|
+
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."
|
|
21700
|
+
},
|
|
21701
|
+
EFFECTSTREAM_FINALIZED_STREAM_CAP: {
|
|
21702
|
+
key: "EFFECTSTREAM_FINALIZED_STREAM_CAP",
|
|
21703
|
+
type: "number",
|
|
21704
|
+
defaultValue: 2048,
|
|
21705
|
+
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."
|
|
21706
|
+
}
|
|
21707
|
+
};
|
|
21708
|
+
|
|
21709
|
+
class ENV {
|
|
21710
|
+
static get EFFECTSTREAM_ENV() {
|
|
21711
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_ENV);
|
|
21712
|
+
}
|
|
21713
|
+
static get MQTT_BROKER() {
|
|
21714
|
+
return ENV.getConfig(definitions.MQTT_BROKER);
|
|
21715
|
+
}
|
|
21716
|
+
static get MQTT_ENGINE_BROKER_PORT() {
|
|
21717
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_PORT);
|
|
21718
|
+
}
|
|
21719
|
+
static get MQTT_ENGINE_BROKER_WS_PORT() {
|
|
21720
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_WS_PORT);
|
|
21721
|
+
}
|
|
21722
|
+
static get MQTT_BATCHER_BROKER_PORT() {
|
|
21723
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_PORT);
|
|
21724
|
+
}
|
|
21725
|
+
static get MQTT_BATCHER_BROKER_WS_PORT() {
|
|
21726
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_WS_PORT);
|
|
21727
|
+
}
|
|
21728
|
+
static get MQTT_ENGINE_BROKER_URL() {
|
|
21729
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_URL);
|
|
21730
|
+
}
|
|
21731
|
+
static get MQTT_ENGINE_BROKER_WS_URL() {
|
|
21732
|
+
return ENV.getConfig(definitions.MQTT_ENGINE_BROKER_WS_URL);
|
|
21733
|
+
}
|
|
21734
|
+
static get MQTT_BATCHER_BROKER_URL() {
|
|
21735
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_URL);
|
|
21736
|
+
}
|
|
21737
|
+
static get MQTT_BATCHER_BROKER_WS_URL() {
|
|
21738
|
+
return ENV.getConfig(definitions.MQTT_BATCHER_BROKER_WS_URL);
|
|
21739
|
+
}
|
|
21740
|
+
static get DB_HOST() {
|
|
21741
|
+
return ENV.getConfig(definitions.DB_HOST);
|
|
21742
|
+
}
|
|
21743
|
+
static get DB_NAME() {
|
|
21744
|
+
return ENV.getConfig(definitions.DB_NAME);
|
|
21745
|
+
}
|
|
21746
|
+
static get DB_PORT() {
|
|
21747
|
+
return ENV.getConfig(definitions.DB_PORT);
|
|
21748
|
+
}
|
|
21749
|
+
static get DB_PW() {
|
|
21750
|
+
return ENV.getConfig(definitions.DB_PW);
|
|
21751
|
+
}
|
|
21752
|
+
static get DB_USER() {
|
|
21753
|
+
return ENV.getConfig(definitions.DB_USER);
|
|
21754
|
+
}
|
|
21755
|
+
static get NODE_ENV() {
|
|
21756
|
+
return ENV.getConfig(definitions.NODE_ENV);
|
|
21757
|
+
}
|
|
21758
|
+
static get ORCHESTRATOR_URL() {
|
|
21759
|
+
return ENV.getConfig(definitions.ORCHESTRATOR_URL);
|
|
21760
|
+
}
|
|
21761
|
+
static get ORCHESTRATOR_PORT() {
|
|
21762
|
+
return ENV.getConfig(definitions.ORCHESTRATOR_PORT);
|
|
21763
|
+
}
|
|
21764
|
+
static set ORCHESTRATOR_PORT(port) {
|
|
21765
|
+
setEnv(definitions.ORCHESTRATOR_PORT.key, String(port));
|
|
21766
|
+
}
|
|
21767
|
+
static get TUI_LOG_URL() {
|
|
21768
|
+
return ENV.getConfig(definitions.TUI_LOG_URL);
|
|
21769
|
+
}
|
|
21770
|
+
static get TUI_LOG_PORT() {
|
|
21771
|
+
return ENV.getConfig(definitions.TUI_LOG_PORT);
|
|
21772
|
+
}
|
|
21773
|
+
static get SHELL() {
|
|
21774
|
+
return ENV.getConfig(definitions.SHELL);
|
|
21775
|
+
}
|
|
21776
|
+
static get TMUX() {
|
|
21777
|
+
return ENV.getConfig(definitions.TMUX);
|
|
21778
|
+
}
|
|
21779
|
+
static get EFFECTSTREAM_API_PORT() {
|
|
21780
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_API_PORT);
|
|
21781
|
+
}
|
|
21782
|
+
static get RECAPTCHA_V3_FRONTEND() {
|
|
21783
|
+
return ENV.getConfig(definitions.RECAPTCHA_V3_FRONTEND);
|
|
21784
|
+
}
|
|
21785
|
+
static get BATCHER_PORT() {
|
|
21786
|
+
return ENV.getConfig(definitions.BATCHER_PORT);
|
|
21787
|
+
}
|
|
21788
|
+
static get EFFECTSTREAM_EXPLORER_PORT() {
|
|
21789
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_EXPLORER_PORT);
|
|
21790
|
+
}
|
|
21791
|
+
static get EFFECTSTREAM_CHAIN_ID() {
|
|
21792
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_CHAIN_ID);
|
|
21793
|
+
}
|
|
21794
|
+
static get PGLITE() {
|
|
21795
|
+
return ENV.getConfig(definitions.PGLITE);
|
|
21796
|
+
}
|
|
21797
|
+
static get PGLITE_DATA_DIR() {
|
|
21798
|
+
return ENV.getConfig(definitions.PGLITE_DATA_DIR);
|
|
21799
|
+
}
|
|
21800
|
+
static get DEBUG_PGLITE() {
|
|
21801
|
+
return ENV.getConfig(definitions.DEBUG_PGLITE);
|
|
21802
|
+
}
|
|
21803
|
+
static get ALLOW_NO_PG_IVM() {
|
|
21804
|
+
return ENV.getConfig(definitions.ALLOW_NO_PG_IVM);
|
|
21805
|
+
}
|
|
21806
|
+
static get OTEL_COLLECTOR_PORT() {
|
|
21807
|
+
return ENV.getConfig(definitions.OTEL_COLLECTOR_PORT);
|
|
21808
|
+
}
|
|
21809
|
+
static get DOCS_PORT() {
|
|
21810
|
+
return ENV.getConfig(definitions.DOCS_PORT);
|
|
21811
|
+
}
|
|
21812
|
+
static get MIDNIGHT_STORAGE_PASSWORD() {
|
|
21813
|
+
return ENV.getConfig(definitions.MIDNIGHT_STORAGE_PASSWORD);
|
|
21814
|
+
}
|
|
21815
|
+
static get API_KEY_OPEN_ENDPOINTS_EXPLORER() {
|
|
21816
|
+
return ENV.getConfig(definitions.API_KEY_OPEN_ENDPOINTS_EXPLORER);
|
|
21817
|
+
}
|
|
21818
|
+
static get ENABLE_DEV_AND_DEBUG_ENDPOINTS() {
|
|
21819
|
+
return ENV.getConfig(definitions.ENABLE_DEV_AND_DEBUG_ENDPOINTS);
|
|
21820
|
+
}
|
|
21821
|
+
static get EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS() {
|
|
21822
|
+
const raw = getEnv(definitions.EFFECTSTREAM_SNAPSHOT_INTERVAL_SECONDS.key);
|
|
21823
|
+
if (raw == null || raw === "")
|
|
21824
|
+
return;
|
|
21825
|
+
return parseInt(raw, 10);
|
|
21826
|
+
}
|
|
21827
|
+
static get EFFECTSTREAM_SNAPSHOT_PATH() {
|
|
21828
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_PATH);
|
|
21829
|
+
}
|
|
21830
|
+
static get EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY() {
|
|
21831
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_DAY_HOURLY);
|
|
21832
|
+
}
|
|
21833
|
+
static get EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY() {
|
|
21834
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_3_DAYS_SIX_HOURLY);
|
|
21835
|
+
}
|
|
21836
|
+
static get EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS() {
|
|
21837
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS);
|
|
21838
|
+
}
|
|
21839
|
+
static get EFFECTSTREAM_COALESCE_EMPTY_BLOCKS() {
|
|
21840
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_COALESCE_EMPTY_BLOCKS);
|
|
21841
|
+
}
|
|
21842
|
+
static get EFFECTSTREAM_FINALIZED_STREAM_CAP() {
|
|
21843
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_FINALIZED_STREAM_CAP);
|
|
21844
|
+
}
|
|
21845
|
+
static get EFFECTSTREAM_LAG_THRESHOLD_MS() {
|
|
21846
|
+
const raw = getEnv(definitions.EFFECTSTREAM_LAG_THRESHOLD_MS.key);
|
|
21847
|
+
if (raw == null || raw === "")
|
|
21848
|
+
return;
|
|
21849
|
+
return parseInt(raw, 10);
|
|
21850
|
+
}
|
|
21851
|
+
static getConfig(config) {
|
|
21852
|
+
switch (config.type) {
|
|
21853
|
+
case "string":
|
|
21854
|
+
return ENV.getString(config.key, config.defaultValue);
|
|
21855
|
+
case "number":
|
|
21856
|
+
return ENV.getNumber(config.key, config.defaultValue);
|
|
21857
|
+
case "boolean":
|
|
21858
|
+
return ENV.getBoolean(config.key, config.defaultValue);
|
|
21859
|
+
default:
|
|
21860
|
+
throw new Error(`Invalid config type: ${config}`);
|
|
21861
|
+
}
|
|
21862
|
+
}
|
|
21863
|
+
static getCurrentConfig(showSecrets = false) {
|
|
21864
|
+
const secretPlaceholder = "********";
|
|
21865
|
+
const values = {};
|
|
21866
|
+
Object.entries(definitions).forEach(([key, config]) => {
|
|
21867
|
+
if (config.isSecret) {
|
|
21868
|
+
values[key] = showSecrets ? ENV[key] : secretPlaceholder;
|
|
21869
|
+
} else {
|
|
21870
|
+
values[key] = ENV[key];
|
|
21871
|
+
}
|
|
21872
|
+
});
|
|
21873
|
+
return values;
|
|
21874
|
+
}
|
|
21875
|
+
static getDocumentation() {
|
|
21876
|
+
return Object.fromEntries(Object.entries(definitions).map(([key, config]) => {
|
|
21877
|
+
return [key, {
|
|
21878
|
+
defaultValue: config.defaultValue,
|
|
21879
|
+
description: config.description
|
|
21880
|
+
}];
|
|
21881
|
+
}));
|
|
21882
|
+
}
|
|
21883
|
+
static getBoolean(key, defaultValue = false) {
|
|
21884
|
+
const value = ENV.getEnv(key);
|
|
21885
|
+
if (value == null || value === "")
|
|
21886
|
+
return defaultValue;
|
|
21887
|
+
return ["true", "t", "1", "yes", "y"].includes(value.toLowerCase());
|
|
21888
|
+
}
|
|
21889
|
+
static getNumber(key, defaultValue = 0) {
|
|
21890
|
+
const value = ENV.getEnv(key);
|
|
21891
|
+
if (value == null || value === "")
|
|
21892
|
+
return defaultValue;
|
|
21893
|
+
return parseInt(value, 10);
|
|
21894
|
+
}
|
|
21895
|
+
static getString(key, defaultValue = "") {
|
|
21896
|
+
const value = ENV.getEnv(key);
|
|
21897
|
+
return value ?? defaultValue;
|
|
21898
|
+
}
|
|
21899
|
+
static getEnv(key) {
|
|
21900
|
+
return getEnv(key);
|
|
21901
|
+
}
|
|
21902
|
+
}
|
|
21903
|
+
|
|
21904
|
+
// ../effectstream-sdk/events/src/event-connect.ts
|
|
21403
21905
|
var utf8Encoder = new TextEncoder;
|
|
21404
21906
|
var utf8Decoder = new TextDecoder;
|
|
21405
21907
|
function dispatchMessage(topic, payload) {
|
|
@@ -21470,12 +21972,6 @@ async function createMqttJsClient(url) {
|
|
|
21470
21972
|
}
|
|
21471
21973
|
};
|
|
21472
21974
|
}
|
|
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
21975
|
|
|
21480
21976
|
class EventConnect {
|
|
21481
21977
|
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.1",
|
|
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.1"
|
|
31
31
|
},
|
|
32
32
|
"description": "React frontend SDK for EffectStream"
|
|
33
33
|
}
|