Documentation
  • INTRODUCTION
  • USERS
    • White Paper
    • Main features of CyberWay
    • Bandwidth differences between EOS and CyberWay
    • Bandwidth implementation
    • How to Launch EOS dApps on CyberWay
    • Glossary
  • DEVELOPMENT ENVIRONMENT
    • Core Concepts
    • 1 Before You Begin
    • 2 Install the CDT
    • 3 Create Development Wallet
    • 4 Start keosd and nodeos
    • 5 Create Test Accounts
  • SOFTWARE MANUALS
    • Core
      • nodeos
      • cleos
      • keosd
      • cyberway.cdt
    • How To Guides
      • How To Ban An Unwanted Account
      • How To Calculate Reward For An Author
      • How To Calculate Reward For A Beneficiary
      • How To Calculate Reward For A Curator
      • How To Create A Wallet
      • How To Create An Account
      • How To Create A Proxy Account
      • How To Create Key Pair
      • How To Delegate Resources
      • How To Deploy A Node Using A Snapshot
      • How To Deploy A Smart Contract
      • How To Get Account Information
      • How To Get Block Information
      • How To Get Transaction Information
      • How To Import A Key
      • How To Link Permission
      • How To List All Key Pair
      • How To Stake Tokens
      • How To Stop A Node Using Docker
      • How To Submit A Proposal For HardFork
      • How To Transfer Tokens To A Worker
      • How To Undelegate Resources
      • How To Unlink Permission
      • How To Unstake Tokens
      • How To Vote
    • API Reference
      • Nodeos Chain API
      • Nodeos Producer API
      • Nodeos Net API
    • Cleos Command Reference
      • Convert
      • Create
      • Get
      • Multisig
      • Net
      • Push
      • Set
      • Sign
      • System
      • Transfer
      • Version
      • Wallet
    • Explorer Command Reference
      • How To Check Your Balance
      • How To Find Out Account ID
      • How To Convert Golos To Golos Power And Vice Versa
      • How To Stake Tokens CYBER
      • How To Transfer Funds From One Account To Another
      • How To Transfer Funds From Pending to Liquid
      • How To Bay Stake
      • How To Withdraw Stake
      • How To Vote For A Validator
      • How To Revoke Your Vote For A Validator
      • How To Bay Vesting Using Explorer
      • How To Vote For A Witness
      • How To Revoke Your Vote For A Witness
  • DEVPORTAL
    • System Contracts
      • BIOS
      • Domain names
      • Govern
      • Multi-Signature
      • Stake
      • Tokens
    • Application Contracts
      • Golos Contracts
        • Charge
        • Control
        • Emission
        • Publication
        • Referral program
        • Social
        • Vesting
        • Memo-keys
        • Determining Rewards for a Post
    • Guide to Creating and Deploying an Application on CyberWay
      • 1 Preliminary Work
      • 2 Creating a Simple Contract
      • 3 Creating Tokens
      • 4 Understanding ABI Files
      • 5 Data Persistence
      • 6 Secondary Indexes
      • 7 Adding Inline Actions
      • 8 Inline Action to External Contract
      • 9 Conclusion
    • The cyberway_wallet designed for the Bittrex market
    • The Event Model
  • VALIDATORS
    • Testnet Installation Guide
      • 1 General
      • 2 Configuring the Docker Image
      • 3 Create Container
      • 4 Connecting to a Node
      • 5 List of Commands Applicable to Any Kind of Container
    • Mainnet Connection Guide
      • Docker-Compose Start-up Instructions
      • APPENDIX A
      • APPENDIX B
    • Golos Blockchain Transit
    • How to join CyberWay for those who are interested in being validators ?
    • Stake Usage Guide
    • Regulations for CyberWay validators. Voting for Validators
Powered by GitBook
On this page
  • Pack Action Data
  • Description
  • Positional Parameters
  • Options
  • Command
  • Examples
  • Pack Transaction
  • Description
  • Positional Parameters
  • Options
  • Command
  • Examples
  • Unpack Action Data
  • Description
  • Positional Parameters
  • Options
  • Command
  • Examples
  • Unpack Transaction
  • Description
  • Positional Parameters
  • Options
  • Command
  • Examples
  1. SOFTWARE MANUALS
  2. Cleos Command Reference

Convert

PreviousCleos Command ReferenceNextCreate

Last updated 5 years ago

Description The subcommands can be required to pack and unpack transactions as well as to convert data from JSON format to digital code and vice versa.

Subcommands

  • — From JSON action data to packed form.

  • — From plain signed JSON to packed form.

  • — From packed to JSON action data form.

  • — From packed to plain signed JSON form.

Pack Action Data

Description

The subcommand converts action data from JSON format to packed form.

Positional Parameters

  • (string) account — The name of the account that hosts the contract (required).

  • (string) name — The name of the function that's called by this action (required).

  • (string) unpacked_action_data — The action data expressed as JSON (required).

Options

No options required for this subcommand.

Command

$ cleos convert pack_action_data <account> <name> <unpacked_action_data>

Examples

$ cleos convert pack_action_data c.gallery unlinkauth '{"account":"test1", "code":"test2", "type":"cybertype"}'
000000003500b1be00000000008fa1ca0000a47deaea2903

Pack Transaction

Description

The subcommand converts a transaction from plain signed JSON to packed form.

Positional Parameters

  • (string) transaction — The plain signed JSON (required).

Options

  • --pack-action-data — Pack all action data within transaction, needs interaction with nodeos.

Command

$ cleos convert pack_transaction [OPTIONS] <transaction>

Examples

$ cleos convert pack_transaction '{
  "expiration": "2020-02-02T18:01:32",
  "ref_block_num": 22654,
  "ref_block_prefix": 4107128227,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "max_ram_kbytes": 0,
  "max_storage_kbytes": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "c.gallery",
      "name": "create",
      "authorization": [{
          "actor": "cmnwrtlcdzcl",
          "permission": "active"
        }
      ],
      "data": "0000000000fe...3d8ab000000"
    }
  ],
  "transaction_extensions": []
}'
{
  "signatures": [],
  "compression": "none",
  "packed_context_free_data": "",
  "packed_trx": "7429ab7f379...00000"
}

Unpack Action Data

Description

The subcommand converts action data from packed to JSON format.

Positional Parameters

  • (string) account — The name of the account that hosts the contract (required).

  • (string) name — The name of the function that's called by this action (required).

  • (string) packed_action_data — The action data expressed as packed hex string (required).

Options

No options required for this subcommand.

Command

$ cleos convert pack_action_data <account> <name> <unpacked_action_data>

Examples

$ cleos convert unpack_action_data c.gallery unlinkauth 000000003500b1be00000000008fa1ca0000a47deaea2903
{
  "account": "test1",
  "code": "test2",
  "type": "cybertype"
}

Unpack Transaction

Description

The subcommand converts a transaction from packed to plain signed JSON form.

Positional Parameters

  • (string) transaction — The packed transaction JSON (string containing packed_trx and optionally compression fields) (required).

Options

  • --unpack-action-data — Unpack all action data within transaction, needs interaction with nodeos.

Command

$ cleos convert unpack_transaction [OPTIONS] <transaction>

Examples

$ cleos convert unpack_transaction '{
  "signatures": [
    "SIG_K1_K6gS7...YE596eh"
  ],
  "compression": "none",
  "packed_context_free_data": "",
  "packed_trx": "7429ab7f379...00000"
}'
{
  "expiration": "2020-02-02T18:01:32",
  "ref_block_num": 22654,
  "ref_block_prefix": 4107128227,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "max_ram_kbytes": 0,
  "max_storage_kbytes": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "c.gallery",
      "name": "create",
      "authorization": [{
          "actor": "cmnwrtlcdzcl",
          "permission": "active"
        }
      ],
      "data": "0000000000fe...3d8ab000000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [
    "SIG_K1_K6gS7...YE596eh"
  ],
  "context_free_data": []
}
Pack Action Data
Pack Transaction
Unpack Action Data
Unpack Transaction