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

Was this helpful?

  1. API References
  2. ScriptCli APIs
  3. Tx APIs

Send

This API sends the Script tokens Note the API call can send Script tokens in one shot.

RPC Method: scriptcli.Send

Query Parameters

chain_id: ID of the chain

from: The address of the account to send tokens from

to: The address of the receipient account

SCPTWei: The amount of Theta tokens to be sent (in SCPTWei, 1 Scpt = 10^18 SCPTWei)

SPAYWei: The amount of TFuel tokens to be sent (in SPAYWei, 1 Spay = 10^18 SPAYWei)

fee: The transaction fee in SPAYWei

sequence: The expected sequence number of the from account

async: A boolean flag. If async is set to false, the RPC call will wait until the transaction has been included in a block, or a timeout reached. Otherwise, the RPC call will return immediately with the transaction hash.

Returns

hash: the hash of the transaction

block: the details of the block that has included the transaction

// Async Request

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"scriptcli.Send","params":[{"chain_id":"scriptnet", "from":"0x2E833968E5bB786Ae419c4d13189fB081Cc43bab", "to":"0xA47B89c94a50C32CEACE9cF64340C4Dce6E5EcC6", "SCPTWei":"0", "SPAYWei":"88000000000000000000", "fee":"1000000000000", "sequence":"6", "async":true}],"id":1}' http://localhost:16889/rpc

// Async Result

{

"jsonrpc": "2.0",

"id": 1,

"result": {

"hash": "0xe3e82ae1e08ca49f85842729bd3c70ba0874d59cca3812fe0807506463851d22",

"block": null

}

}

// Sync Request

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"scriptcli.Send","params":[{"chain_id":"scriptnet", "from":"0x2E833968E5bB786Ae419c4d13189fB081Cc43bab", "to":"0xA47B89c94a50C32CEACE9cF64340C4Dce6E5EcC6", "SCPTWei":"0", "SPAYWei":"88000000000000000000", "fee":"1000000000000", "sequence":"7", "async":false}],"id":1}' http://localhost:16889/rpc

// Sync Result

{

"jsonrpc": "2.0",

"id": 1,

"result": {

"hash": "0xd4dfa1b763cac0c18c816e31ff585c01f2c4f2604dfff01cb6638d6d19e1bd1e",

"block": {

"ChainID": "scriptnet",

"Epoch": 170511,

"Height": 170472,

"Parent": "0xe36483c52eeee44634038252bb33dfe6b70c439c94c89236c6f18c1a4a676e01",

"HCC": {

"Votes": {},

"BlockHash": "0xe36483c52eeee44634038252bb33dfe6b70c439c94c89236c6f18c1a4a676e01"

},

"TxHash": "0xff0d7f1bd6aa699369a935de46c287b30917958c6dbd2d542d31548eaf279525",

"ReceiptHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",

"Bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",

"StateHash": "0x49374ccea64633a51358816d29a55f372d0fbe7e2f9cb1447ddd2c7519fc17e5",

"Timestamp": 1550129583,

"Proposer": "0x2e833968e5bb786ae419c4d13189fb081cc43bab",

"Signature": "0x96dad1ff2ccc4eb2e18ca99f488cb9d6e6f3333c53a3347d7f8ded5f7301b613763bf0301a85b8f8e7342858c29dd1b262b1b6bdb9552fa5c9b6b61a9b4f6d5c01"

}

}

}

PreviousTx APIsNextConfiguration for the Script Blockchain Node

Last updated 2 years ago

Was this helpful?

πŸ“”