This is long demonstration of checking account balance, with the backend usage of JavaScript SDK.
Note: we used extra steps to avoid silent failure that can happen in CasperClient.balanceOfByPublicKey()
.
- Create project directory
#!/usr/bin/env sh | |
set -e | |
CONTRACT_HASH_RAW="$1" | |
echo "> Calling 'batch' entrypoint." | |
DEPLOY_HASH=$(casper-client put-deploy \ | |
--node-address http://127.0.0.1:11101/rpc \ | |
--chain-name casper-net-1 \ | |
--payment-amount 9991000000000 \ |
{ | |
"particles":{ | |
"number":{ | |
"value":80, | |
"density":{ | |
"enable":true, | |
"value_area":800 | |
} | |
}, | |
"color":{ |