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.

This method will use 300 Compute Units.


Reference: Here

Parameters:

  1. deploy - object an item containing a smart contract along with the requester's signature(s)

    [Deploy Object Reference]

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "account_put_deploy",
  "params": [
    {
      "approvals": [
        {
          "signature": "014c1a89f92e29dd74fc648f741137d9caf4edba97c5f9799ce0c9aa6b0c9b58db368c64098603dbecef645774c05dff057cb1f91f2cf390bbacce78aa6f084007",
          "signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
        }
      ],
      "hash": "5c9b3b099c1378aa8e4a5f07f59ff1fcdc69a83179427c7e67ae0377d94d93fa",
      "header": {
        "account": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
        "body_hash": "d53cf72d17278fd47d399013ca389c50d589352f1a12593c0b8e01872a641b50",
        "chain_name": "casper-example",
        "dependencies": [
          "0101010101010101010101010101010101010101010101010101010101010101"
        ],
        "gas_price": 1,
        "timestamp": "2020-11-17T00:39:24.072Z",
        "ttl": "1h"
      },
      "payment": {
        "StoredContractByName": {
          "args": [
            [
              "amount",
              {
                "bytes": "e8030000",
                "cl_type": "I32",
                "parsed": 1000
              }
            ]
          ],
          "entry_point": "example-entry-point",
          "name": "casper-example"
        }
      },
      "session": {
        "Transfer": {
          "args": [
            [
              "amount",
              {
                "bytes": "e8030000",
                "cl_type": "I32",
                "parsed": 1000
              }
            ]
          ]
        }
      }
    }
  ]
}

Returned Value:

  • api_version - string RPC API version

  • deploy_hash - string hex-encoded Deploy hash

// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "api_version": "1.4.13",
    "deploy_hash": "5c9b3b099c1378aa8e4a5f07f59ff1fcdc69a83179427c7e67ae0377d94d93fa"
  }
}
curl https://mainnet.casper.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"id":1,"jsonrpc":"2.0","method":"account_put_deploy","params":[]}'

Last updated