jaelis-node 1.3.2 → 1.4.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/README.md +62 -1
- package/lib/JAELIS-VM/lib/adapters/evm-adapter.js +454 -0
- package/lib/JAELIS-VM/lib/adapters/index.js +411 -0
- package/lib/JAELIS-VM/lib/adapters/svm-adapter.js +457 -0
- package/lib/JAELIS-VM/lib/compiler/jir-compiler.js +1097 -0
- package/lib/JAELIS-VM/lib/execution/engine.js +1183 -0
- package/lib/JAELIS-VM/lib/index.js +440 -0
- package/lib/JAELIS-VM/lib/integration/jaelis-integration.js +543 -0
- package/lib/JAELIS-VM/lib/serialization/serializer.js +819 -0
- package/lib/JAELIS-VM/lib/state/state-manager.js +1116 -0
- package/lib/JAELIS-VM/lib/translator/bytecode-translator.js +1222 -0
- package/lib/JAELIS-VM/lib/unified/cross-chain-state.js +836 -0
- package/lib/JAELIS-VM/lib/unified/dynamic-contracts.js +1127 -0
- package/lib/JAELIS-VM/lib/unified/index.js +378 -0
- package/lib/JAELIS-VM/lib/unified/jaelis-abi.js +1150 -0
- package/lib/JAELIS-VM/lib/unified/unified-compiler.js +1350 -0
- package/lib/JAELIS-VM/node_modules/.bin/download-cbor-prebuilds +12 -0
- package/lib/JAELIS-VM/node_modules/.bin/download-cbor-prebuilds.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/.bin/download-cbor-prebuilds.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/.bin/download-msgpackr-prebuilds +12 -0
- package/lib/JAELIS-VM/node_modules/.bin/download-msgpackr-prebuilds.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/.bin/download-msgpackr-prebuilds.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages +12 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-optional +12 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-optional.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-optional.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-test +12 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-test.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-test.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/.package-lock.json +127 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/README.md +1 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/index.js +0 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/node.abi115.node +0 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/node.napi.node +0 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/package.json +17 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/README.md +1 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/index.js +0 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/node.abi115.node +0 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/node.napi.node +0 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/package.json +17 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/LICENSE +21 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/README.md +5 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/bin/download-prebuilds.js +11 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/binding.gyp +60 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/index.js +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/package.json +50 -0
- package/lib/JAELIS-VM/node_modules/cbor-extract/src/extract.cpp +198 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/LICENSE +21 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/README.md +380 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/SECURITY.md +11 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/benchmark.md +73 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/browser.js +11 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/decode.d.ts +2 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/decode.js +1300 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/decode-no-eval.cjs +1244 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/decode-no-eval.cjs.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.cjs +2509 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.cjs.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.min.js +2 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.min.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.js +2508 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.min.js +2 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.min.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/node.cjs +2629 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/node.cjs.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/test.js +3343 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/test.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/encode.d.ts +1 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/encode.js +1231 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/index.d.ts +79 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/index.js +3 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/iterators.js +85 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/node-index.js +24 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/package.json +94 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/rollup.config.js +88 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/stream.js +61 -0
- package/lib/JAELIS-VM/node_modules/cbor-x/webpack.config.js +19 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/LICENSE +201 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/README.md +163 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/index.d.ts +14 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/elf.js +39 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/process.js +24 -0
- package/lib/JAELIS-VM/node_modules/detect-libc/package.json +44 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/LICENSE +21 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/README.md +372 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/SECURITY.md +11 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/benchmark.md +67 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.cjs +2407 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.cjs.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.min.js +2 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.min.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.js +2406 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.min.js +2 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.min.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/node.cjs +3320 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/node.cjs.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/test.js +4540 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/test.js.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/unpack-no-eval.cjs +1250 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/unpack-no-eval.cjs.map +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/index.d.cts +91 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/index.d.ts +91 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/index.js +5 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/iterators.js +87 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/node-index.js +25 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/pack.d.cts +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/pack.d.ts +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/pack.js +1141 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/package.json +104 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/rollup.config.js +88 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/stream.js +57 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/struct.js +815 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/test-worker.js +3 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/unpack.d.cts +2 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/unpack.d.ts +2 -0
- package/lib/JAELIS-VM/node_modules/msgpackr/unpack.js +1221 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/LICENSE +21 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/README.md +5 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/bin/download-prebuilds.js +13 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/binding.gyp +63 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/index.js +1 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages +12 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-optional +12 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-optional.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-optional.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-test +12 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-test.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-test.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages.cmd +17 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages.ps1 +28 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/LICENSE +21 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/README.md +58 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/bin.js +82 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/build-test.js +19 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/index.js +6 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/node-gyp-build.js +236 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/optional.js +7 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/package.json +32 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/package.json +50 -0
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/src/extract.cpp +274 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/LICENSE +21 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/README.md +58 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/bin.js +77 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/build-test.js +19 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/index.js +224 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/optional.js +7 -0
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/package.json +32 -0
- package/lib/JAELIS-VM/package-lock.json +284 -0
- package/lib/JAELIS-VM/package.json +38 -0
- package/lib/JAELIS-VM/test/comprehensive.test.js +267 -0
- package/lib/JAELIS-VM/test/cross-chain-test.js +470 -0
- package/lib/JAELIS-VM/test/unified-vm-test.js +459 -0
- package/lib/JAELIS-VM/test/unified.test.js +166 -0
- package/lib/JAELIS-VM/test/vm.test.js +599 -0
- package/lib/index.js +240 -4
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -5,7 +5,24 @@
|
|
|
5
5
|
* This module provides the JaelisNode class which wraps the core blockchain
|
|
6
6
|
* implementation for easy deployment as a standalone node.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
* RPC ARCHITECTURE (v1.4.0+)
|
|
10
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
11
|
+
*
|
|
12
|
+
* LAYER 1 - NATIVE JAELIS (PRIMARY):
|
|
13
|
+
* jaelis_* Native JAELIS methods - rich responses, zero-gas semantics
|
|
14
|
+
*
|
|
15
|
+
* LAYER 2 - COMPATIBILITY (PROXIES):
|
|
16
|
+
* eth_* Ethereum JSON-RPC compat (MetaMask, ethers.js, web3.js)
|
|
17
|
+
* solana_* Solana-compatible methods (Rust/SPL developers)
|
|
18
|
+
* move_* Move-compatible methods (Aptos/Sui developers)
|
|
19
|
+
* ton_* TON-compatible methods (FunC/Telegram developers)
|
|
20
|
+
*
|
|
21
|
+
* All compatibility methods PROXY to native jaelis_* implementations.
|
|
22
|
+
* This follows Solana/Cosmos/Polkadot patterns for multi-ecosystem support.
|
|
23
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
24
|
+
*
|
|
25
|
+
* @version 1.4.0
|
|
9
26
|
* @author JAELIS Foundation
|
|
10
27
|
*/
|
|
11
28
|
|
|
@@ -1217,15 +1234,23 @@ class EmbeddedRpcServer {
|
|
|
1217
1234
|
async _handleMethod(method, params) {
|
|
1218
1235
|
switch (method) {
|
|
1219
1236
|
// ═══════════════════════════════════════════════════════════════
|
|
1220
|
-
//
|
|
1237
|
+
// LAYER 1: NATIVE JAELIS METHODS (PRIMARY)
|
|
1221
1238
|
// ═══════════════════════════════════════════════════════════════
|
|
1222
|
-
case '
|
|
1239
|
+
case 'jaelis_chainId':
|
|
1223
1240
|
return '0x' + (this.blockchain?.chainId || 4545).toString(16);
|
|
1224
1241
|
|
|
1225
|
-
case 'eth_blockNumber':
|
|
1226
1242
|
case 'jaelis_blockNumber':
|
|
1227
1243
|
return '0x' + (this.blockchain?.getHeight?.() || 0).toString(16);
|
|
1228
1244
|
|
|
1245
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1246
|
+
// LAYER 2: ETHEREUM COMPATIBILITY (PROXIES → jaelis_*)
|
|
1247
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1248
|
+
case 'eth_chainId':
|
|
1249
|
+
return this._handleMethod('jaelis_chainId', params);
|
|
1250
|
+
|
|
1251
|
+
case 'eth_blockNumber':
|
|
1252
|
+
return this._handleMethod('jaelis_blockNumber', params);
|
|
1253
|
+
|
|
1229
1254
|
case 'eth_getBlockByNumber':
|
|
1230
1255
|
const blockNum = parseInt(params[0], 16);
|
|
1231
1256
|
return this.blockchain?.getBlock?.(blockNum) || null;
|
|
@@ -1320,6 +1345,217 @@ class EmbeddedRpcServer {
|
|
|
1320
1345
|
// Get cross-chain stats
|
|
1321
1346
|
return this._getCrossChainStats();
|
|
1322
1347
|
|
|
1348
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1349
|
+
// LAYER 2: SOLANA COMPATIBILITY (PROXIES → jaelis_*)
|
|
1350
|
+
// For Rust/SPL developers familiar with Solana RPC
|
|
1351
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1352
|
+
case 'solana_getBalance':
|
|
1353
|
+
// Convert to JAELIS format then back to Solana format
|
|
1354
|
+
const jaelisBalance = await this._handleMethod('jaelis_getBalance', params);
|
|
1355
|
+
return { value: BigInt(jaelisBalance || '0').toString() };
|
|
1356
|
+
|
|
1357
|
+
case 'solana_getHealth':
|
|
1358
|
+
return this._handleMethod('jaelis_getHealth', params);
|
|
1359
|
+
|
|
1360
|
+
case 'solana_getSlot':
|
|
1361
|
+
return this.blockchain?.getHeight?.() || 0;
|
|
1362
|
+
|
|
1363
|
+
case 'solana_getBlockHeight':
|
|
1364
|
+
return this.blockchain?.getHeight?.() || 0;
|
|
1365
|
+
|
|
1366
|
+
case 'solana_getVersion':
|
|
1367
|
+
return { 'solana-core': '1.17.0', 'feature-set': 4545 };
|
|
1368
|
+
|
|
1369
|
+
case 'solana_getLatestBlockhash':
|
|
1370
|
+
const block = this.blockchain?.getLatestBlock?.();
|
|
1371
|
+
return { blockhash: block?.hash || '0x0', lastValidBlockHeight: block?.number || 0 };
|
|
1372
|
+
|
|
1373
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1374
|
+
// LAYER 2: MOVE COMPATIBILITY (PROXIES → jaelis_*)
|
|
1375
|
+
// For Aptos/Sui developers familiar with Move
|
|
1376
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1377
|
+
case 'move_getLedgerInfo':
|
|
1378
|
+
const height = this.blockchain?.getHeight?.() || 0;
|
|
1379
|
+
return {
|
|
1380
|
+
chain_id: this.blockchain?.chainId || 4545,
|
|
1381
|
+
ledger_version: height.toString(),
|
|
1382
|
+
block_height: height.toString()
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
case 'move_getAccountResource':
|
|
1386
|
+
return this._handleMethod('jaelis_getMoveResource', params);
|
|
1387
|
+
|
|
1388
|
+
case 'move_getAccountModule':
|
|
1389
|
+
return this._handleMethod('jaelis_getMoveModule', params);
|
|
1390
|
+
|
|
1391
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1392
|
+
// LAYER 2: TON COMPATIBILITY (PROXIES → jaelis_*)
|
|
1393
|
+
// For FunC/Telegram developers (900M+ users!)
|
|
1394
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1395
|
+
case 'ton_getAddressBalance':
|
|
1396
|
+
const tonBalance = await this._handleMethod('jaelis_getBalance', params);
|
|
1397
|
+
return { balance: tonBalance || '0' };
|
|
1398
|
+
|
|
1399
|
+
case 'ton_getMasterchainInfo':
|
|
1400
|
+
const tonBlock = this.blockchain?.getLatestBlock?.();
|
|
1401
|
+
return {
|
|
1402
|
+
last: {
|
|
1403
|
+
workchain: 0,
|
|
1404
|
+
seqno: tonBlock?.number || 0,
|
|
1405
|
+
root_hash: tonBlock?.hash || '0x0'
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
case 'ton_getAccountState':
|
|
1410
|
+
return this._handleMethod('jaelis_getTonAccount', params);
|
|
1411
|
+
|
|
1412
|
+
case 'ton_runGetMethod':
|
|
1413
|
+
return this._handleMethod('jaelis_callTonMethod', params);
|
|
1414
|
+
|
|
1415
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1416
|
+
// LAYER 2: BITCOIN COMPATIBILITY (PROXIES → jaelis_*)
|
|
1417
|
+
// For Bitcoin developers - familiar Bitcoin Core RPC methods
|
|
1418
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1419
|
+
case 'btc_getbalance':
|
|
1420
|
+
const btcBal = await this._handleMethod('jaelis_getBalance', params);
|
|
1421
|
+
const satoshis = BigInt(btcBal?.jaelis || '0') / BigInt(10 ** 10);
|
|
1422
|
+
return Number(satoshis) / 100000000;
|
|
1423
|
+
|
|
1424
|
+
case 'btc_getblockcount':
|
|
1425
|
+
return this.blockchain?.getHeight?.() || 0;
|
|
1426
|
+
|
|
1427
|
+
case 'btc_getblockhash':
|
|
1428
|
+
const btcBlock = this.blockchain?.getBlock?.(params[0]);
|
|
1429
|
+
return btcBlock?.hash || null;
|
|
1430
|
+
|
|
1431
|
+
case 'btc_getblock':
|
|
1432
|
+
const blk = this.blockchain?.getBlockByHash?.(params[0]);
|
|
1433
|
+
if (!blk) return null;
|
|
1434
|
+
return {
|
|
1435
|
+
hash: blk.hash,
|
|
1436
|
+
confirmations: 1,
|
|
1437
|
+
height: blk.number,
|
|
1438
|
+
version: 1,
|
|
1439
|
+
time: blk.timestamp,
|
|
1440
|
+
tx: blk.transactions?.map(t => t.hash || t) || [],
|
|
1441
|
+
previousblockhash: blk.parentHash
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
case 'btc_gettransaction':
|
|
1445
|
+
return this._handleMethod('jaelis_getTransactionByHash', params);
|
|
1446
|
+
|
|
1447
|
+
case 'btc_sendrawtransaction':
|
|
1448
|
+
return this._handleMethod('jaelis_sendRawTransaction', params);
|
|
1449
|
+
|
|
1450
|
+
case 'btc_getblockchaininfo':
|
|
1451
|
+
const btcHeight = this.blockchain?.getHeight?.() || 0;
|
|
1452
|
+
return {
|
|
1453
|
+
chain: (this.blockchain?.chainId || 4545) === 4545 ? 'test' : 'main',
|
|
1454
|
+
blocks: btcHeight,
|
|
1455
|
+
headers: btcHeight,
|
|
1456
|
+
bestblockhash: this.blockchain?.getLatestBlock?.()?.hash,
|
|
1457
|
+
difficulty: 1,
|
|
1458
|
+
warnings: 'JAELIS Bitcoin compatibility - zero gas fees!'
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
case 'btc_getnetworkinfo':
|
|
1462
|
+
return {
|
|
1463
|
+
version: 250000,
|
|
1464
|
+
subversion: '/JAELIS:1.0.0/',
|
|
1465
|
+
protocolversion: 70016,
|
|
1466
|
+
warnings: 'JAELIS Bitcoin compatibility layer'
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
case 'btc_getmempoolinfo':
|
|
1470
|
+
return { loaded: true, size: 0, mempoolminfee: 0 };
|
|
1471
|
+
|
|
1472
|
+
case 'btc_estimatesmartfee':
|
|
1473
|
+
return { feerate: 0, blocks: params[0] || 1 }; // Zero fees!
|
|
1474
|
+
|
|
1475
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1476
|
+
// LAYER 2: WASM COMPATIBILITY (PROXIES → jaelis_*)
|
|
1477
|
+
// For CosmWasm/NEAR/Polkadot WASM developers
|
|
1478
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1479
|
+
case 'wasm_call':
|
|
1480
|
+
return this._handleMethod('jaelis_call', [{ to: params[0], data: JSON.stringify({ method: params[1], args: params[2] }) }]);
|
|
1481
|
+
|
|
1482
|
+
case 'wasm_query':
|
|
1483
|
+
return this._handleMethod('jaelis_call', [{ to: params[0], data: JSON.stringify(params[1]) }]);
|
|
1484
|
+
|
|
1485
|
+
case 'wasm_deploy':
|
|
1486
|
+
return this._handleMethod('jaelis_deployWasmContract', params);
|
|
1487
|
+
|
|
1488
|
+
case 'wasm_instantiate':
|
|
1489
|
+
return this._handleMethod('jaelis_deployWasmContract', [{ codeId: params[0], initMsg: params[1], label: params[2] }]);
|
|
1490
|
+
|
|
1491
|
+
case 'wasm_execute':
|
|
1492
|
+
return this._handleMethod('jaelis_sendTransaction', [{ to: params[0], data: JSON.stringify(params[1]), value: params[2] || '0x0' }]);
|
|
1493
|
+
|
|
1494
|
+
case 'wasm_getCode':
|
|
1495
|
+
return this._handleMethod('jaelis_getCode', params);
|
|
1496
|
+
|
|
1497
|
+
case 'wasm_getContractInfo':
|
|
1498
|
+
const wasmCode = await this._handleMethod('jaelis_getCode', params);
|
|
1499
|
+
return { address: params[0], has_code: wasmCode && wasmCode !== '0x' };
|
|
1500
|
+
|
|
1501
|
+
case 'wasm_getContractState':
|
|
1502
|
+
return this._handleMethod('jaelis_getStorageAt', [params[0], params[1] || '0x0', 'latest']);
|
|
1503
|
+
|
|
1504
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1505
|
+
// LAYER 2: STARKNET/CAIRO COMPATIBILITY (PROXIES → jaelis_*)
|
|
1506
|
+
// For StarkNet/Cairo developers
|
|
1507
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1508
|
+
case 'starknet_chainId':
|
|
1509
|
+
return this._handleMethod('jaelis_chainId', params);
|
|
1510
|
+
|
|
1511
|
+
case 'starknet_blockNumber':
|
|
1512
|
+
return this.blockchain?.getHeight?.() || 0;
|
|
1513
|
+
|
|
1514
|
+
case 'starknet_getBlockWithTxHashes':
|
|
1515
|
+
const snBlock = this.blockchain?.getBlock?.(params[0]?.block_number || 'latest');
|
|
1516
|
+
if (!snBlock) return null;
|
|
1517
|
+
return {
|
|
1518
|
+
block_hash: snBlock.hash,
|
|
1519
|
+
parent_hash: snBlock.parentHash,
|
|
1520
|
+
block_number: snBlock.number,
|
|
1521
|
+
transactions: snBlock.transactions || [],
|
|
1522
|
+
status: 'ACCEPTED_ON_L1'
|
|
1523
|
+
};
|
|
1524
|
+
|
|
1525
|
+
case 'starknet_getBlockWithTxs':
|
|
1526
|
+
return this._handleMethod('starknet_getBlockWithTxHashes', params);
|
|
1527
|
+
|
|
1528
|
+
case 'starknet_getTransactionByHash':
|
|
1529
|
+
const snTx = await this._handleMethod('jaelis_getTransactionByHash', params);
|
|
1530
|
+
if (!snTx) return null;
|
|
1531
|
+
return { transaction_hash: snTx.hash, type: 'INVOKE', sender_address: snTx.from };
|
|
1532
|
+
|
|
1533
|
+
case 'starknet_getTransactionReceipt':
|
|
1534
|
+
const snReceipt = await this._handleMethod('jaelis_getTransactionReceipt', params);
|
|
1535
|
+
if (!snReceipt) return null;
|
|
1536
|
+
return {
|
|
1537
|
+
transaction_hash: snReceipt.transactionHash,
|
|
1538
|
+
actual_fee: '0x0',
|
|
1539
|
+
status: snReceipt.status === '0x1' ? 'ACCEPTED_ON_L1' : 'REJECTED'
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
case 'starknet_call':
|
|
1543
|
+
return this._handleMethod('jaelis_call', [{ to: params[0]?.contract_address, data: '0x' }]);
|
|
1544
|
+
|
|
1545
|
+
case 'starknet_estimateFee':
|
|
1546
|
+
return { gas_consumed: '0x0', gas_price: '0x0', overall_fee: '0x0' }; // Zero fees!
|
|
1547
|
+
|
|
1548
|
+
case 'starknet_addInvokeTransaction':
|
|
1549
|
+
return this._handleMethod('jaelis_sendTransaction', [{ from: params[0]?.sender_address, to: params[0]?.calldata?.[0], data: '0x' }]);
|
|
1550
|
+
|
|
1551
|
+
case 'starknet_addDeclareTransaction':
|
|
1552
|
+
return this._handleMethod('jaelis_deploy', [{ data: params[0]?.contract_class, from: params[0]?.sender_address }]);
|
|
1553
|
+
|
|
1554
|
+
case 'starknet_getClass':
|
|
1555
|
+
case 'starknet_getClassAt':
|
|
1556
|
+
const cairoCode = await this._handleMethod('jaelis_getCode', [params[1] || params[0]]);
|
|
1557
|
+
return { program: cairoCode, entry_points_by_type: { CONSTRUCTOR: [], EXTERNAL: [], L1_HANDLER: [] } };
|
|
1558
|
+
|
|
1323
1559
|
default:
|
|
1324
1560
|
throw new Error(`Method not found: ${method}`);
|
|
1325
1561
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jaelis-node",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Official JAELIS Blockchain Node -
|
|
3
|
+
"version": "1.4.1",
|
|
4
|
+
"description": "Official JAELIS Blockchain Node - Universal VM (6 languages), LevelDB state persistence, native jaelis_* RPC, multi-ecosystem compatibility (eth/solana/move/ton/btc/wasm/starknet), Cross-Chain Settlement (30+ chains!)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"jaelis-node": "./bin/jaelis-node.js"
|