Transactional JSON-RPC Methods

account_put_deploy

This is the only means by which users can send their compiled Wasm (as part of a Deploy) to a node on a Casper network. The request takes in the Deploy as a parameter, prior to sending it to a node on a network for execution.

Method: POST

https://casper.nownodes.io/rpc

Example body (raw)

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "account_put_deploy",
  "params": [
    {
      "approvals": [
        {
          "signer": "01f8b29f39c38600ecb3bbb082951e04ab63a4ad4f7c9048a5057e461a5a8d58a5",
          "signature": "019d6ef5c62c80ad4e50df343fba6f0fced17dea4c65e7976f66335ffcfcde2a7f02e928c8507cef3c76c3151e0e9cc9c3f7838b9f7a99ac4be5522ca092841100"
        }
      ],
      "hash": "00a8677713222df88b6988926e0b14adeda6c663957f5075003395da4e5c6888",
      "header": {
        "account": "01f8b29f39c38600ecb3bbb082951e04ab63a4ad4f7c9048a5057e461a5a8d58a5",
        "body_hash": "145ae09d6da5bc290051db8cb7132a41a30473d5900eaaf409d92b666325ca00",
        "chain_name": "casper",
        "dependencies": [
          "0101010101010101010101010101010101010101010101010101010101010101"
        ],
        "gas_price": 1,
        "timestamp": "2024-04-13T11:46:10.863Z",
        "ttl": "1h"
      },
      "payment": {
        "StoredContractByName": {
          "args": [
            [
              "amount",
              {
                "bytes": "0400f90295",
                "cl_type": "U512"
              }
            ]
          ],
          "entry_point": "example-entry-point",
          "name": "casper-example"
        }
      },
      "session": {
        "Transfer": {
          "args": [
            [
              "amount",
              {
                "cl_type": "U512",
                "bytes": "0400f90295"
              }
            ],
            [
              "target",
              {
                "cl_type": "URef",
                "bytes": "09480c3248ef76b603d386f3f4f8a5f87f597d4eaffd475433f861af187ab5db07"
              }
            ]
          ]
        }
      }
    }
  ]
}

Example response: 200

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32008,
        "message": "Invalid Deploy",
        "data": "account with hash 127cd1b8f8a8aeb4bc083a125701c6ec84a67745de87b136b250508ae9620663 does not exist at state root hash 72bd4c143267e4d3f76e5ced08680224dfadfed9079a5be677269de258d44305 of block 23b802d15a28969e87ba7c6e2cccb5ab0bf9aaafea4a5856fb7fb9fbf91dec66 at height 2780120"
    }
}

Last updated