{ "contract_name": "cw-token-swap", "contract_version": "2.6.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", "type": "object", "required": [ "counterparty_one", "counterparty_two" ], "properties": { "counterparty_one": { "$ref": "#/definitions/Counterparty" }, "counterparty_two": { "$ref": "#/definitions/Counterparty" } }, "additionalProperties": false, "definitions": { "Counterparty": { "description": "Information about a counterparty in this escrow transaction and their promised funds.", "type": "object", "required": [ "address", "promise" ], "properties": { "address": { "description": "The address of the counterparty.", "type": "string" }, "promise": { "description": "The funds they have promised to provide.", "allOf": [ { "$ref": "#/definitions/TokenInfo" } ] } }, "additionalProperties": false }, "TokenInfo": { "description": "Information about the token being used on one side of the escrow.", "oneOf": [ { "description": "A native token.", "type": "object", "required": [ "native" ], "properties": { "native": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "A cw20 token.", "type": "object", "required": [ "cw20" ], "properties": { "cw20": { "type": "object", "required": [ "amount", "contract_addr" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "contract_addr": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "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" } } }, "execute": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ExecuteMsg", "oneOf": [ { "description": "Used to provide cw20 tokens to satisfy a funds promise.", "type": "object", "required": [ "receive" ], "properties": { "receive": { "$ref": "#/definitions/Cw20ReceiveMsg" } }, "additionalProperties": false }, { "description": "Provides native tokens to satisfy a funds promise.", "type": "object", "required": [ "fund" ], "properties": { "fund": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Withdraws provided funds. Only allowed if the other counterparty has yet to provide their promised funds.", "type": "object", "required": [ "withdraw" ], "properties": { "withdraw": { "type": "object", "additionalProperties": false } }, "additionalProperties": false } ], "definitions": { "Binary": { "description": "Binary is a wrapper around Vec 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. See also .", "type": "string" }, "Cw20ReceiveMsg": { "description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", "type": "object", "required": [ "amount", "msg", "sender" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "msg": { "$ref": "#/definitions/Binary" }, "sender": { "type": "string" } }, "additionalProperties": false }, "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" } } }, "query": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", "oneOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "object", "additionalProperties": false } }, "additionalProperties": false } ] }, "migrate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", "type": "object", "additionalProperties": false }, "sudo": null, "responses": { "status": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "StatusResponse", "type": "object", "required": [ "counterparty_one", "counterparty_two" ], "properties": { "counterparty_one": { "$ref": "#/definitions/CheckedCounterparty" }, "counterparty_two": { "$ref": "#/definitions/CheckedCounterparty" } }, "additionalProperties": false, "definitions": { "Addr": { "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" }, "CheckedCounterparty": { "type": "object", "required": [ "address", "promise", "provided" ], "properties": { "address": { "$ref": "#/definitions/Addr" }, "promise": { "$ref": "#/definitions/CheckedTokenInfo" }, "provided": { "type": "boolean" } }, "additionalProperties": false }, "CheckedTokenInfo": { "oneOf": [ { "type": "object", "required": [ "native" ], "properties": { "native": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "cw20" ], "properties": { "cw20": { "type": "object", "required": [ "amount", "contract_addr" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "contract_addr": { "$ref": "#/definitions/Addr" } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "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" } } } } }