Last updated
cookbook
This project demonstrates common use cases for @kadena/client
and
@kadena/pact-cli
for smart contracts
In depth documentation for setting up and using @kadena/client can be found at @kadena/client
Overview
Name | Description |
---|---|
Accounts | |
Create Account | Create a KDA account. |
Create And Fund Account | Create and fund a KDA account. |
Get Balance | Check KDA account balance. |
Setup
- Install dependencies
- Load contracts from blockchain
- Generate Interfaces
- Execute commands
Example: Running the transfer-create script:
sh
ts-node src/accounts/transfer-create-with-chainweaver.ts senderAccount receiverAccount 1
sh
ts-node src/accounts/transfer-create-with-chainweaver.ts senderAccount receiverAccount 1
Notes
- These scripts assume that accounts follow the recommended convention:
k:publicKey
. If your account name does not follow this convention, you will need to manually update it in the script. - All scripts are integrated with sign requests to Chainweaver desktop (this
will not work on the web client). If you would like to manually paste the
sigData into the Chainweaver application, you can use the
printSigData
function provided in the utils directory. - If you would like to test a transaction without sending it to the blockchain
to be mined, you can use the
printLocal
function provided in the utils directory to print the response for a non-transactional command execution.