cosmwasm-std 0.16.0-rc4

Standard library for Wasm based smart contracts on Cosmos blockchains
Documentation
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "CosmosMsg",
  "anyOf": [
    {
      "type": "object",
      "required": [
        "bank"
      ],
      "properties": {
        "bank": {
          "$ref": "#/definitions/BankMsg"
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "custom"
      ],
      "properties": {
        "custom": {
          "$ref": "#/definitions/Empty"
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "wasm"
      ],
      "properties": {
        "wasm": {
          "$ref": "#/definitions/WasmMsg"
        }
      },
      "additionalProperties": false
    }
  ],
  "definitions": {
    "BankMsg": {
      "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto",
      "anyOf": [
        {
          "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.",
          "type": "object",
          "required": [
            "send"
          ],
          "properties": {
            "send": {
              "type": "object",
              "required": [
                "amount",
                "to_address"
              ],
              "properties": {
                "amount": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Coin"
                  }
                },
                "to_address": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.",
          "type": "object",
          "required": [
            "burn"
          ],
          "properties": {
            "burn": {
              "type": "object",
              "required": [
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Coin"
                  }
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "Binary": {
      "description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
      "type": "string"
    },
    "Coin": {
      "type": "object",
      "required": [
        "amount",
        "denom"
      ],
      "properties": {
        "amount": {
          "$ref": "#/definitions/Uint128"
        },
        "denom": {
          "type": "string"
        }
      }
    },
    "Empty": {
      "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)",
      "type": "object"
    },
    "Uint128": {
      "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
      "type": "string"
    },
    "WasmMsg": {
      "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto",
      "anyOf": [
        {
          "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.",
          "type": "object",
          "required": [
            "execute"
          ],
          "properties": {
            "execute": {
              "type": "object",
              "required": [
                "contract_addr",
                "funds",
                "msg"
              ],
              "properties": {
                "contract_addr": {
                  "type": "string"
                },
                "funds": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Coin"
                  }
                },
                "msg": {
                  "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)",
                  "allOf": [
                    {
                      "$ref": "#/definitions/Binary"
                    }
                  ]
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.",
          "type": "object",
          "required": [
            "instantiate"
          ],
          "properties": {
            "instantiate": {
              "type": "object",
              "required": [
                "code_id",
                "funds",
                "label",
                "msg"
              ],
              "properties": {
                "admin": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "code_id": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "funds": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Coin"
                  }
                },
                "label": {
                  "description": "A human-readbale label for the contract",
                  "type": "string"
                },
                "msg": {
                  "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)",
                  "allOf": [
                    {
                      "$ref": "#/definitions/Binary"
                    }
                  ]
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.",
          "type": "object",
          "required": [
            "migrate"
          ],
          "properties": {
            "migrate": {
              "type": "object",
              "required": [
                "contract_addr",
                "msg",
                "new_code_id"
              ],
              "properties": {
                "contract_addr": {
                  "type": "string"
                },
                "msg": {
                  "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code",
                  "allOf": [
                    {
                      "$ref": "#/definitions/Binary"
                    }
                  ]
                },
                "new_code_id": {
                  "description": "the code_id of the new logic to place in the given contract",
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.",
          "type": "object",
          "required": [
            "update_admin"
          ],
          "properties": {
            "update_admin": {
              "type": "object",
              "required": [
                "admin",
                "contract_addr"
              ],
              "properties": {
                "admin": {
                  "type": "string"
                },
                "contract_addr": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.",
          "type": "object",
          "required": [
            "clear_admin"
          ],
          "properties": {
            "clear_admin": {
              "type": "object",
              "required": [
                "contract_addr"
              ],
              "properties": {
                "contract_addr": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    }
  }
}