Script Network Documentation
  • Getting Started Guides
    • How to Sign Up + Sign In to Script TV
    • Using the Live TV player
    • Navigating the Script TV Dashboard (Test Phase)
    • Testnet, Explorer + Creating a Wallet (Test Phase)
    • Reward System: Script Points, Zealy, Galxe + more
  • ScriptGLASS - How to mint
  • 🎬About Script Network
    • Introduction
    • Products
    • Why Script TV?
    • How it works
    • Understanding the Script Blockchain
    • Script TV + Web3
    • Market Strategy
    • Benefits
    • Comparison
  • πŸ—ΊοΈRoadmap
  • πŸͺ™Script Tokens
    • SCPT
      • Detailed SCPT Tokenomics
    • SPAY
      • πŸ’°SPAY Tokenomics
        • πŸ•ΆοΈScriptGLASS explained
          • Economics
        • Allowable/Earnable Watch Time
      • Mechanism Design of Glasses
        • Glass Types
        • Glass Payouts
          • Durability
        • Gems
        • Levels
        • Recharge Vouchers
        • Recharge Voucher Mechanism
        • Recharge Costs
        • Glass Minting
        • Game Theory
  • 🦸For Users
    • ⛓️Blockchain Integration
      • Installation guide for Script Node setup for Win , Mac and Linux
      • Build and Install
      • Run Unit Tests
      • Launch Script Node
      • Command Line Tool
      • Steps To Upgrade The Chain
      • Account/Wallet Management
      • Call Smart Contract
      • Turing-Complete Smart Contract Support
    • Basic Concept
    • Tokens
    • Script NFTs
    • Transactions
    • Script Wallet
    • Faucet (Technical)
    • Smart Contracts
  • 🌐Script Network Explorer
    • Block APIs
    • Transaction APIs
    • Account APIs
    • Stake APIs
  • πŸ”―Nodes
    • Node Token Emissions
    • Lightning Node Overview
      • Validator / Lightning Node Setup
        • Steps To Change Node Password
        • Stake to the Lightning node
    • Lightning Staking Process
      • Lightning Stake Withdrawal Process
        • Staking through Web Wallet
  • πŸ’ Validators
    • Block Settlement
    • Steps To Migrate Lightning/Validator
  • πŸ“’Edge Documentation
    • Introduction
    • What is Edge
    • How it works
    • Edge Uses
    • Possibilities with Edge
    • Edge Features
    • Benefits
    • Use Cases
  • πŸ”—Smart Contract Development
    • πŸ’» How to quickly deploy a smart contract on Script Blockchain
  • Smart Contract & App Development
    • Turing-Complete Smart Contract
    • Ethereum RPC API support
    • Setup the ETH RPC Adaptor for the Script Testnet
    • Metamask
    • Truffle
    • Hardhat
    • Remix
    • Web3.js
    • Explorer Tools for DApp Development
    • Script Blockchain SRC20 Token Integration Guide
  • πŸ“”API References
    • Metamask Script Network RPC Details (Testnet)
    • RPC API Reference
      • Examples
      • GetBlock
        • Transaction Types
        • Request
        • GetBlockByHeight
      • GetTransaction
        • GetPendingTransactions
    • Tx APIs
      • Broadcast Raw Transaction
      • BroadcastRawTransactionAsync
    • ScriptCli APIs
      • Account APIs
        • NewKey API
        • ListKeys
        • UnlockKey
        • LockKey
        • IsKeyUnlocked
      • Tx APIs
        • Send
        • Configuration for the Script Blockchain Node
  • 🀝Referrals/Network Effects
  • πŸ›‘οΈ Audits
  • πŸ“ŠScript Network Blockchain Summary
  • Disclaimer
  • Frequently Asked Question
    • To resolve the block height issue
    • Update seed peer to resolve connectivity issue
Powered by GitBook
On this page
  • GetVersion
  • GetAccount

Was this helpful?

  1. API References
  2. RPC API Reference

Examples

This document can be referred to view two examples, that is, GetVersion and GetAccount.

GetVersion

This API returns the version of the blockchain software.

RPC Method: script.GetVersion

Returns

version: the version number

git_hash: the git commit hash of the code base

timestamp: the build timestamp

// Request

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"script.GetVersion","params":[],"id":1}' http://localhost:16888/rpc

// Result

{

"jsonrpc": "2.0",

"id": 1,

"result": {

"version": "1.0",

"git_hash": "9d7669a735063a283ae8b6f0826183e3830c00a5",

"timestamp": "Tue Feb 19 23:31:32 UTC 2019"

}

}

GetAccount

This API returns the details of the account being queried in json format.

RPC Method: script.GetAccount

Query Parameters

address: the address of the account

Returns

code: the hash of the smart contract bytecode (for smart contract accounts)

coins: the native token balance

reserved_funds: fund reserved for micropayment through the off-chain resource-oriented payment pool

root: the root hash of the data Merkle-Patricia trie (for smart contract accounts)

sequence: the current sequence number of the account

// Request

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"script.GetAccount","params":[{"address":"0x2E833968E5bB786Ae419c4d13189fB081Cc43bab"}],"id":1}' http://localhost:16888/rpc

// Result

{

"jsonrpc": "2.0",

"id": 1,

"result": {

"sequence": "1",

"coins": {

"SCPTWei": "0",

"SPAYWei": "4999999979999999000000000000"

},

"reserved_funds": [],

"last_updated_block_height": "0",

"root": "0x0000000000000000000000000000000000000000000000000000000000000000",

"code": "0x0000000000000000000000000000000000000000000000000000000000000000"

}

}

PreviousRPC API ReferenceNextGetBlock

Last updated 7 months ago

Was this helpful?

πŸ“”