Giter VIP home page Giter VIP logo

everx-labs / ever-sdk-js Goto Github PK

View Code? Open in Web Editor NEW
93.0 93.0 28.0 11.63 MB

Javascript SDK for TVM blockchains (Everscale, TON, Venom, etc)

Home Page: https://tonlabs.github.io/ever-sdk-js/

License: Apache License 2.0

JavaScript 9.69% Solidity 2.79% Rust 5.29% TypeScript 68.46% C++ 4.01% Python 0.14% C 0.44% Ruby 0.79% Java 4.19% Objective-C 2.67% Objective-C++ 0.58% Starlark 0.33% HTML 0.22% CMake 0.33% CSS 0.06%
blockchain client everscale everscale-blockchain javascript js sdk solidity ton venom venom-blockchain venom-developer-program web3

ever-sdk-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ever-sdk-js's Issues

Deno runtime support

Detail experiment can be found here: readme

I think it's pretty easy to add Deno support. Deno can work almost like web runtime with wasm.
We just need to fix some hardcoded assumptions like fetch('/evernode.wasm') because this is too browser-specific.

  1. Right now the naive approach doesn't work yet. Consider:
import { TonClient } from "npm:@eversdk/core";
import { libWeb } from "npm:@eversdk/lib-web"; // or lib-node

TonClient.useBinaryLibrary(libWeb);

const client = new TonClient();
const { phrase } = await client.crypto.mnemonic_from_random({});
console.log(phrase);
client.close();

Will give us:

error: Could not resolve 'npm:@eversdk/lib-web'
  1. lib-node approach also doesn't work.

In short:

error: Uncaught TypeError: /root/.tonlabs/binaries/1/eversdk.node: undefined symbol: SSL_CTX_free

Seems like something with dynamic linking made for nodejs runtime. It feels easily fixable since Deno is made on Rust and Eversdk too.

UPD
3. Workaround: https://github.com/awnion/example-ever-sdk-deno/blob/main/deno-custom-wasm-url.ts

import { TonClient } from "npm:@eversdk/core";
// require npm i @eversdk/lib-web
import { libWeb, libWebSetup } from "./node_modules/@eversdk/lib-web/index.js";

// require npm i @eversdk/lib-web
libWebSetup({
  disableSeparateWorker: true,
  binaryURL: new URL(
    "./node_modules/@eversdk/lib-web/eversdk.wasm",
    import.meta.url,
  ),
});

TonClient.useBinaryLibrary(libWeb);
// ------------------------^^^^^^
// here linter will complain but it's OK

const client = new TonClient();
const { phrase } = await client.crypto.mnemonic_from_random({});
console.log(phrase);
client.close();

Whilst it works it's not very convenient because we have to manually import index.js from node_modules. The main concern is that we use two different ways of distribution:

  1. TonClient comes from npm: and we can't easily vendor it from node_modules since its internals link to each other node-js (or rather CommonJS) way.
  2. And vice versa lib-web can be imported only via index.js directly and doesn't work with npm: deno-way.

The ideal solution would be to have libDeno (or rather libWasm / libWasi / etc) for server-side WASM + deno modules deployed on Deno

eversdk.wasm bandwidth consumption

I've placed eversdk.wasm in my next.js public folder which loads everytime my app renders which results in high bandwidth consumption. I've followed this step for setting up eversdk in next.js (https://github.com/tonlabs/sdk-samples/tree/master/core-examples/next-js/normal-transfer#2-handling-the-wasm-file).

Is is possible to host this eversdk.wasm file somewhere else and then pass it's link in the app or any other possible solution instead of saving the wasm file itself in public folder?

image

Add ability to install eversdk/lib-web package without running postinstall scripts

@eversdk/lib-web package includes post-install scripts. As a security best practice, it's generally a good idea to install npm modules with the --ignore-scripts flag to prevent any potentially malicious code from being executed. It would be great if the option to skip these scripts could be added to the package in the future. Just wanted to pass this suggestion along in case it's something that could be implemented.

lib-react-native невалидное название android пакета

android/src/main/AndroidManifest.xml
В манифесте андроида указано название пакета “ton”.
Он не может так называться и должен иметь хотя бы одну точку.
Согласно https://developer.android.com/guide/topics/manifest/manifest-element#package рекомендуется использовать обратное написание доменного имени разработчика.

В эмуляторе приложение собирается и работает. При попытке собрать apk релиз получаем ошибку:
AAPT: error: attribute 'package' in tag is not a valid Android package name: 'ton'.

Пробовал переименовать вручную во что-то вроде com.ton, переложить файлы. В этом случае приложение собирается, устанавливается, но не запускается 🙁

[TypeScript] AbiData: key type

Key in AbiData interface have to have bigint type, but this type isn't supported in JSON. This leads to problem in using JSON ABI. Is it possible to change this type to bigint | number?

image
image
image

Keypair derivation from secret key works wrong

Here's the sample code

  const secret = '59ad891197c4eee4ecf156470ecfd2ab42abc89e069f243874a88bcf74f002cb';
  const keyPair = await client.crypto.nacl_sign_keypair_from_secret_key({
    secret
  });
  
  console.log(keyPair);

The keypair in the output is wrong. Looks like the secret is actual secret concatenated with public:

{
  public: '88674ff490dab330f2dc1b09374bdf4e4366e707a78db810ac741383be35616e',
  secret: '59ad891197c4eee4ecf156470ecfd2ab42abc89e069f243874a88bcf74f002cb88674ff490dab330f2dc1b09374bdf4e4366e707a78db810ac741383be35616e'
}

node-gyp should be installed before cargo run (win32)

   Compiling ton_client_node_addon v1.2.0 (C:\Users\User\tonlabs\ton-client-js\packages\lib-node\lib)
    Finished release [optimized] target(s) in 6m 46s
Add package file: lib/tonclient.lib
"node-gyp" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "Системе не удается найти указанный путь." }', C:\Users\User\tonlabs\ton-client-js\build\src\lib.rs:98:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `C:\Users\User\tonlabs\ton-client-js\target\debug\ton_client_node_build.exe` (exit code: 101)

Error during call of client.contracts.run

Here is traceback of this error:
TypeError: Cannot read property 'startSpan' of undefined
at TONClient._callee11$ (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\ton-client-js\dist\TONClient.js:627:43)
at tryCatch (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\regenerator-runtime\runtime.js:63:40)
at Generator.invoke [as _invoke] (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\regenerator-runtime\runtime.js:293:22)
at Generator.next (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\regenerator-runtime\runtime.js:118:21)
at asyncGeneratorStep (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\ton-client-js\dist\TONClient.js:42:103)
at _next (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\ton-client-js\dist\TONClient.js:44:194)
at C:\Users\User\Documents\github\SmartContractsForTON\node_modules\ton-client-js\dist\TONClient.js:44:364
at new Promise ()
at TONClient. (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\ton-client-js\dist\TONClient.js:44:97)
at TONClient.trace (C:\Users\User\Documents\github\SmartContractsForTON\node_modules\ton-client-js\dist\TONClient.js:664:23)

Function call paramters:
{
address: validContractAddress,
abi: contractAbi,
functionName: contractFunctionName,
input: {contractFunctionInput},
keyPair: keysCreatedFromSeedPhrase
}

Client was created by:
let client = await new TONClient({servers: ['https://net.ton.dev']});

Used node version:
12.18.4

Call of `convertAddress` method with Cyrillic (also Chinese) symbols lead to a crash on mobile devices

Suppose following code:

Client.contracts.convertAddress({
  address: 'ылвоаиывлоиаыловиалоывиалоывиалоывиалоывиалоыиав', // Just a long random string with Cyrillic symbols
  convertTo: 'Hex', // Not sure if it only hex, but I tested with it
});

This call lead to a crash on mobile devices.

Right now I use a workaround, I just filter incoming address with a RegExp - /[^:0-9a-zA-Z\-_+/=]/ , but it would be great if the library did it, that could prevent a library users from unpredictable crashes.

Weird error (can't be represented as a JavaScript number) on tvm.run_executor

tvm.run_executor with this object as the argument:

{
    "message": "te6ccgEBBQEA2QABRYgAhWSMyfwSrUApdY7ejDsG0AonE45wNaQ3LaACiLkX/yIMAQHh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kb1MyIvhMI28ryCvPCz8qzwsfKc8LByjPCwcnzwv/Js8LByXPFiTPC38jzwsPIs8UIc8KAAtfC1mAQPRD+GziXwMhD18PAfT4I7U/gQ4QoYAgrPhMgED0ho4aAdM/0x/TB9MH0//TB/pA03/TD9TXCgBvC3+OL3BfYI0IYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABHBwyMlwbwtw4l8glDBTI7veILOSXwXg+ABwmVMRlTAggCi53j8B/o59pPhLJG8VIXF4I6isoTEx+Gsk+EyAQPRbMPhsJPhMgED0fI4aAdM/0x/TB9MH0//TB/pA03/TD9TXCgBvC3+OL3BfYI0IYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABHBwyMlwbwtw4gI3NTNTIpQwU0W73jJAAGLo+ELIy//4Q88LP/hGzwsA+Er4S/hO+E/4TPhNXlDL/8v/ywfLB/QA9ADJ7VT4D18GAgEgRUIB27a2aCO+EFujirtRNDT/9M/0wDT/9P/0wfTB/QE9AX4bfhs+G/4bvhr+Gp/+GH4Zvhj+GLe0z/RcF9QjQhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEcHDIyXBvCyH4TIBA9A4ggQwH+jhkB0z/TH9MH0wfT/9MH+kDTf9MP1NcKAG8LkW3iIfLgZiAzVQJfA8iCEArZoI6CEIAAAACxzwsfIW8rVQorzws/Ks8LHynPCwcozwsHJ88L/ybPCwclzxYkzwt/I88LDyLPFCHPCgALXwvIglhgAAAAAAAAAAAAAAAAzwtmIUQAns8xgQOYuZZxz0AhzxeVcc9BIc3iIMlx+wBbMMD/jiz4QsjL//hDzws/+EbPCwD4SvhL+E74T/hM+E1eUMv/y//LB8sH9AD0AMntVN5/+GcAattwIccAnSLQc9ch1wsAwAGQkOLgIdcNH5DhUxHAAJDgwQMighD////9vLGQ4AHwAfhHbpDe",
        "unlimited_balance": true
    },
    "abi": {
        "type": "Contract",
        "value": {
            "ABI version": 2,
            "header": [
                "pubkey",
                "time",
                "expire"
            ],
            "functions": [
                {
                    "name": "constructor",
                    "inputs": [
                        {
                            "name": "owners",
                            "type": "uint256[]"
                        },
                        {
                            "name": "reqConfirms",
                            "type": "uint8"
                        }
                    ],
                    "outputs": []
                },
                {
                    "name": "acceptTransfer",
                    "inputs": [
                        {
                            "name": "payload",
                            "type": "bytes"
                        }
                    ],
                    "outputs": []
                },
                {
                    "name": "sendTransaction",
                    "inputs": [
                        {
                            "name": "dest",
                            "type": "address"
                        },
                        {
                            "name": "value",
                            "type": "uint128"
                        },
                        {
                            "name": "bounce",
                            "type": "bool"
                        },
                        {
                            "name": "flags",
                            "type": "uint8"
                        },
                        {
                            "name": "payload",
                            "type": "cell"
                        }
                    ],
                    "outputs": []
                },
                {
                    "name": "submitTransaction",
                    "inputs": [
                        {
                            "name": "dest",
                            "type": "address"
                        },
                        {
                            "name": "value",
                            "type": "uint128"
                        },
                        {
                            "name": "bounce",
                            "type": "bool"
                        },
                        {
                            "name": "allBalance",
                            "type": "bool"
                        },
                        {
                            "name": "payload",
                            "type": "cell"
                        }
                    ],
                    "outputs": [
                        {
                            "name": "transId",
                            "type": "uint64"
                        }
                    ]
                },
                {
                    "name": "confirmTransaction",
                    "inputs": [
                        {
                            "name": "transactionId",
                            "type": "uint64"
                        }
                    ],
                    "outputs": []
                },
                {
                    "name": "isConfirmed",
                    "inputs": [
                        {
                            "name": "mask",
                            "type": "uint32"
                        },
                        {
                            "name": "index",
                            "type": "uint8"
                        }
                    ],
                    "outputs": [
                        {
                            "name": "confirmed",
                            "type": "bool"
                        }
                    ]
                },
                {
                    "name": "getParameters",
                    "inputs": [],
                    "outputs": [
                        {
                            "name": "maxQueuedTransactions",
                            "type": "uint8"
                        },
                        {
                            "name": "maxCustodianCount",
                            "type": "uint8"
                        },
                        {
                            "name": "expirationTime",
                            "type": "uint64"
                        },
                        {
                            "name": "minValue",
                            "type": "uint128"
                        },
                        {
                            "name": "requiredTxnConfirms",
                            "type": "uint8"
                        }
                    ]
                },
                {
                    "name": "getTransaction",
                    "inputs": [
                        {
                            "name": "transactionId",
                            "type": "uint64"
                        }
                    ],
                    "outputs": [
                        {
                            "components": [
                                {
                                    "name": "id",
                                    "type": "uint64"
                                },
                                {
                                    "name": "confirmationsMask",
                                    "type": "uint32"
                                },
                                {
                                    "name": "signsRequired",
                                    "type": "uint8"
                                },
                                {
                                    "name": "signsReceived",
                                    "type": "uint8"
                                },
                                {
                                    "name": "creator",
                                    "type": "uint256"
                                },
                                {
                                    "name": "index",
                                    "type": "uint8"
                                },
                                {
                                    "name": "dest",
                                    "type": "address"
                                },
                                {
                                    "name": "value",
                                    "type": "uint128"
                                },
                                {
                                    "name": "sendFlags",
                                    "type": "uint16"
                                },
                                {
                                    "name": "payload",
                                    "type": "cell"
                                },
                                {
                                    "name": "bounce",
                                    "type": "bool"
                                }
                            ],
                            "name": "trans",
                            "type": "tuple"
                        }
                    ]
                },
                {
                    "name": "getTransactions",
                    "inputs": [],
                    "outputs": [
                        {
                            "components": [
                                {
                                    "name": "id",
                                    "type": "uint64"
                                },
                                {
                                    "name": "confirmationsMask",
                                    "type": "uint32"
                                },
                                {
                                    "name": "signsRequired",
                                    "type": "uint8"
                                },
                                {
                                    "name": "signsReceived",
                                    "type": "uint8"
                                },
                                {
                                    "name": "creator",
                                    "type": "uint256"
                                },
                                {
                                    "name": "index",
                                    "type": "uint8"
                                },
                                {
                                    "name": "dest",
                                    "type": "address"
                                },
                                {
                                    "name": "value",
                                    "type": "uint128"
                                },
                                {
                                    "name": "sendFlags",
                                    "type": "uint16"
                                },
                                {
                                    "name": "payload",
                                    "type": "cell"
                                },
                                {
                                    "name": "bounce",
                                    "type": "bool"
                                }
                            ],
                            "name": "transactions",
                            "type": "tuple[]"
                        }
                    ]
                },
                {
                    "name": "getTransactionIds",
                    "inputs": [],
                    "outputs": [
                        {
                            "name": "ids",
                            "type": "uint64[]"
                        }
                    ]
                },
                {
                    "name": "getCustodians",
                    "inputs": [],
                    "outputs": [
                        {
                            "components": [
                                {
                                    "name": "index",
                                    "type": "uint8"
                                },
                                {
                                    "name": "pubkey",
                                    "type": "uint256"
                                }
                            ],
                            "name": "custodians",
                            "type": "tuple[]"
                        }
                    ]
                }
            ],
            "data": [],
            "events": [
                {
                    "name": "TransferAccepted",
                    "inputs": [
                        {
                            "name": "payload",
                            "type": "bytes"
                        }
                    ],
                    "outputs": []
                }
            ]
        }
    },
    "skip_transaction_check": false,
    "return_updated_account": false
}

gives this error -

"Error: 18446744073697658955 can't be represented as a JavaScript number"

Using @tonclient/core and @tonclient/lib-web in SSR application

Do you have plans to add support for SSR to @tonclient/core and @tonclient/lib-web? I'm using this library inside my Next.js app and getting a lot of errors related to using web-specific API inside node environment (ReferenceError for Blob, URL, etc.)

keyPair seems to be ignored

It looks like keyPair parameter doesn't affect anything while calling deploy or run.

Have two key pairs, deployed smart contract, msg.sender in constructor is 0x0, msg.sender on every run changing state is 0x0. both keyPairs can change state of deployed contract.

I suggest there's a default keyPair used or something like that.

symbol not found in flat namespace '_kSCDynamicStoreUseSessionKeys'

Trying to install core and node js on my backend server, and just adding the package and running it produces an error:

Error: dlopen(/Users/deveoloper/dev/repos/app1/node_modules/@eversdk/lib-node/eversdk.node, 0x0001): symbol not found in flat namespace '_kSCDynamicStoreUseSessionKeys'

On a Mac, Node version v20.9.0

Full error:

Error: dlopen(/Users/deveoloper/dev/repos/app1r/node_modules/@eversdk/lib-node/eversdk.node, 0x0001): symbol not found in flat namespace '_kSCDynamicStoreUseSessionKeys'
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1327:18)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Function.Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at loadAddon (/Users/deveoloper/dev/repos/app1/node_modules/@eversdk/lib-node/index.js:29:16)
at new BinaryBridge (/Users/deveoloper/dev/repos/app1/node_modules/@eversdk/core/dist/bin.js:58:34)
at useLibrary (/Users/deveoloper/dev/repos/app1/node_modules/@eversdk/core/dist/bin.js:32:14)
at Function.useBinaryLibrary (/Users/deveoloper/dev/repos/app1/node_modules/@eversdk/core/dist/client.js:61:30)
at Object. (/Users/deveoloper/dev/repos/app1/src/modules/ton/ton.service.ts:10:11)

[Help] how to decode transaction? i can not broadcast tx to blockchian.

when i post this transaction to rpc, i got response only hash, and i can not found it on blockchain or any error message. i want to know where my problem is ?

sdk is: wallet-core, like this

code:

Future<String> signTransaction(String toAddress, String privateKeyHex,
      BigInt amount, String? encodedContractData) async {
    var expire =
        (DateTime.now().microsecondsSinceEpoch / 1000000 + 300).toInt();
    Log.d("expire: $expire");
    var transfer = Everscale.Transfer(
        amount: $fixnum.Int64(amount.toInt()),
        expiredAt: expire,
        to: toAddress,
        behavior: Everscale.MessageBehavior.SimpleTransfer,
        bounce: false,
        encodedContractData: encodedContractData);
    var signingInput = Everscale.SigningInput(
        transfer: transfer, privateKey: privateKeyHex.toUint8List());
    var signed = AnySigner.sign(
        signingInput.writeToBuffer(), TWCoinType.TWCoinTypeEverscale);
    Everscale.SigningOutput output = Everscale.SigningOutput.fromBuffer(signed);
    return output.encoded;
  }

result:

   var data =
   "te6ccgICAAQAAQAAAUoAAAPhiAHTB1Uvjerh0Tw4uwZOfH3sWlUBz/l/PF6gz1UmjK+GRhGLPQae5CBpkmxN+YuMpdAiHwYVzS9XfWuSNnplma1Z9fVp8eQ/Fbs5iYsHEk7jx6OvCi/HamAqFJiQJ2v2J6EAaXUlsUy/VG7gAAAAAHAAAwACAAEAaEIAYCUduyOdc1Ge+0Ux+ghMmxAxYzRJ8AMiyXinOzK3tb4h3NZQAAAAAAAAAAAAAAAAAAAAUAAAAABLqS2KpIIs9RVh0XO9boobPTIgF0wzH20xTuYEsWsHcGnE6X4A3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVA==";
    var hash =
      "89b5f22912ce05f0cb33944e6ed5ae4c6536c58b3d7e649f30cdf03108fb51d4";
    var res = await client.sendTransaction(data, hash);

and i got graphql result:

89b5f22912ce05f0cb33944e6ed5ae4c6536c58b3d7e649f30cdf03108fb51d4

but i can not found it on blockchain. what is my problem?

how can i check my transaction right or wrong by myself?

Error: sendMessage: Keystore not found

this problem comes while trying to call mint function in the smart contract & this error gets thrown

const mint_nft = async (provider) => {
const json = {
type: "Basic NFT",
name: "Sample Name",
description: "Hello world!",
preview: {
source:
"https://venom.network/static/media/bg-main.6b6f0965e7c3b3d9833b.jpg",
mimetype: "image/png",
},
files: [
{
source:
"https://venom.network/static/media/bg-main.6b6f0965e7c3b3d9833b.jpg",
mimetype: "image/jpg",
},
],
external_url: "https://venom.network",
};

const contr = new provider.Contract(
  collectionAbi,
  collection_address_testnet
);

const res = await contr.methods
  .mintNft({ json: json })
  .send({ from: new Address(signer_address) });
  
console.log(res);

};

TestsRunner does not show progress of tests, shows broken result and freezes at the end (Windows)

os: Windows 10.0.19042.0
node: 15.11.0
npm: 7.6.3
tsc: 4.2.3

Steps to reproduce:

cd packages\tests-node 
$env:USE_NODE_SE="true";$env:TON_NETWORK_ADDRESS="http://localhost";node run

Expected result:

1.10.0
✓ Test versions compatibility (1 / 0)
✓ crypto (2 / 0)
✓ encode_message (3 / 0)
✓ net (4 / 0)
✓ Block signatures (5 / 0)
✓ All Accounts (6 / 0)
✓ Ranges (7 / 0)
✓ Wait For (8 / 0)
✓ Subscribe for transactions with addresses (ABIv1) (9 / 0)
✓ Subscribe for transactions with addresses (ABIv2) (10 / 0)
✓ Subscribe for messages (ABI v1) (11 / 0)
✓ Subscribe for messages (ABI v2) (12 / 0)
✓ Transactions with addresses (13 / 0)
✓ Check shard_hashes greater then 0 (14 / 0)
---
success: 14
failure: 0

Actual result:

1.10.0
{ version: '1.10.0', passed: 0, failed: 0, finished: false }

Run frozen, but I catch transactions in the blockchain of Node SE

PS: I've tried to add console.log there https://github.com/tonlabs/ton-client-js/blob/c00b42e6705dfd9f2499173905c58db102e9ee0e/packages/tests-node/run.js#L19

node run
[TEST_START] {"name":"Test versions compatibility"}

1.10.0
[TEST_START] {"name":"crypto"}

[TEST_START] {"name":"encode_message"}

[TEST_START] {"name":"net"}

[TEST_START] {"name":"Block signatures"}

[TEST_START] {"name":"All Accounts"}

[TEST_START] {"name":"Message"}

[TEST_START] {"name":"Ranges"}

[TEST_START] {"name":"Wait For"}

[TEST_START] {"name":"Subscribe for transactions with addresses (ABIv1)"}

[TEST_START] {"name":"Subscribe for transactions with addresses (ABIv2)"}

[TEST_START] {"name":"Subscribe for messages (ABI v1)"}

[TEST_START] {"name":"Subscribe for messages (ABI v2)"}

[TEST_START] {"name":"Transactions with addresses"}

[TEST_START] {"name":"Subscribe for failed server"}

[TEST_START] {"name":"Check shard_hashes greater then 0"}

[TEST_START] {"name":"Subscribe for accounts"}

[TEST_START] {"name":"Long time subscription"}

>>> TypeError: results.forEach is not a function

{ version: '1.10.0', passed: 0, failed: 0, finished: false }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.