Quick Start TVM SDK JavaScript
Last updated
Last updated
Rust v1.85+
Node.js v18.19.1
Python 3
Python 3 setuptools
This demo app implements the following scenario:
Creates and initializes an instance of the SDK client.
Deploys the helloWorld
contract:
2.1. Generates a key pair for the contract.
2.2. Calculates the future address of the contract.
2.3. Sends tokens to the future address of the contract, which are required for deployment.
2.4. Deploys the helloWorld
contract.
Retrieves account information and prints the balance of the helloWorld
contract.
Runs the account's get
method timestamp
.
Executes the touch
method for the newly deployed helloWorld
contract.
Calls the get
method again to ensure the timestamp has changed.
Sends tokens from the helloWorld
contract to a random account.
We will perform all the tasks in this quick start within a separate ~/test-sdk
folder. Let's create it:
Clone the repository into a separate directory:
Run build:
As a result, the built binding tvmsdk.node
will be placed in the folder ~/test-sdk/tvm-sdk-js/packages/lib-node
.
Clone the repository containing the demo application:
Configure the Multisig wallet for use in the demo app:
To do this, in the demo folder, edit the .env
file with the following content:
Install the @tvmsdk/core
and @tvmsdk/lib-node
packages for the demo application:
Replace the binary file in @tvmsdk/lib-node
with the Acki Nacki - compatible one that was built earlier:
Go to the folder containing the demo application and run it:
You will see a result similar to the following:
The source code of all the components used can be found