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
  • GetAllStakes
  • GetTotalStakedAmount
  • GetStakeByAddress

Was this helpful?

  1. Script Network Explorer

Stake APIs

GetAllStakes

This API returns all stake records.

REST Uri: /stake/all

Returns

stakes: json representation of the stakes

_id: the ID for the stake record

type: this stake is in the Validator candidate pool or the Lightning candidate pool

holder: the holder account's address

source: the source account's address

amount: the staked SPAYWei amount

withdrawn: true returns the stake is withdrawn, false returns the stake is not withdrawn

return_height: the expected height the tokens return to the staking wallet if a node withdraws its stake.

// Request
curl https://explorer.script.tv/api/stake/all
// Result
{
 "type": "stake",
 "body": [{
 "_id": "5eb9f45d38696f556cc3334d",
 "type": "vcp",
 "holder": "0x80eab22e27d4b94511f5906484369b868d6552d2",
 "source": "0x4aefa39caeadd662ae31ab0ce7c8c2c9c0a013e8",
 "amount": "20000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },{
 "_id": "5eb9f45d38696f556cc3334e",
 "type": "vcp",
 "holder": "0x80eab22e27d4b94511f5906484369b868d6552d2",
 "source": "0x747f15cac97b973290e106ef32d1b6fe65fef5a1",
 "amount": "40000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },{
 "_id": "5eb9f45d38696f556cc33351",
 "type": "vcp",
 "holder": "0xa61abd72cdc50d17a3cbdceb57d3d5e4d8839bce",
 "source": "0x0c9a45926a44a6fc9c8b6f9cb45c20483038698c",
 "amount": "32000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 }
 ...
 ]
}

GetTotalStakedAmount

This API returns the total amount of stakes.

REST Uri: /stake/totalAmount

Returns

totalAmount: the total amount of staked SPAYWei

totalNodes: the total amount of stake nodes

// Request
curl https://explorer.script.tv/api/stake/totalAmount
// Result
{
 "totalAmount": "317702156000000000000000000",
 "totalNodes": 12
}

GetStakeByAddress

This API returns the stakes being queried with address.

REST Uri: /stake/:address

Returns

For each stake it is similar to the returns of the GetAllStakes API.

// Request
curl https://explorer.script.tv/api/stake/totalAmount
// Result
{
 "type": "stake",
 "body": {
 "holderRecords": [],
 "sourceRecords": [
 {
 "_id": "5eb9f60638696f556cc33aa3",
 "type": "vcp",
 "holder": "0xe2408dff7a1f9bc247c803e43efa2f0a37b10ba6",
 "source": "0xc15149236229bd13f0aec783a9cc8e8059fb28da",
 "amount": "30000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },
 {
 "_id": "5eb9f60638696f556cc33aa5",
 "type": "vcp",
 "holder": "0x15cc4c3f21417c392119054c8fe5895146e1a493",
 "source": "0xc15149236229bd13f0aec783a9cc8e8059fb28da",
 "amount": "30000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },
 {
 "_id": "5eb9f60638696f556cc33aa4",
 "type": "vcp",
 "holder": "0xa144e6a98b967e585b214bfa7f6692af81987e5b",
 "source": "0xc15149236229bd13f0aec783a9cc8e8059fb28da",
 "amount": "30000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 }
 ]
 }
}
PreviousAccount APIsNextNodes

Last updated 2 years ago

Was this helpful?

🌐