|
364 | 364 | "type": "object",
|
365 | 365 | "additionalProperties": false
|
366 | 366 | },
|
| 367 | + "Forwarding": { |
| 368 | + "type": "object", |
| 369 | + "required": [ |
| 370 | + "hops", |
| 371 | + "memo" |
| 372 | + ], |
| 373 | + "properties": { |
| 374 | + "hops": { |
| 375 | + "type": "array", |
| 376 | + "items": { |
| 377 | + "$ref": "#/definitions/Hop" |
| 378 | + } |
| 379 | + }, |
| 380 | + "memo": { |
| 381 | + "type": "string" |
| 382 | + } |
| 383 | + }, |
| 384 | + "additionalProperties": false |
| 385 | + }, |
367 | 386 | "GovMsg": {
|
368 | 387 | "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
|
369 | 388 | "oneOf": [
|
|
402 | 421 | }
|
403 | 422 | ]
|
404 | 423 | },
|
| 424 | + "Hop": { |
| 425 | + "type": "object", |
| 426 | + "required": [ |
| 427 | + "channel_id", |
| 428 | + "port_id" |
| 429 | + ], |
| 430 | + "properties": { |
| 431 | + "channel_id": { |
| 432 | + "type": "string" |
| 433 | + }, |
| 434 | + "port_id": { |
| 435 | + "type": "string" |
| 436 | + } |
| 437 | + }, |
| 438 | + "additionalProperties": false |
| 439 | + }, |
405 | 440 | "IbcMsg": {
|
406 |
| - "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", |
| 441 | + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 7 entry points)", |
407 | 442 | "oneOf": [
|
408 | 443 | {
|
409 | 444 | "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.",
|
|
458 | 493 | },
|
459 | 494 | "additionalProperties": false
|
460 | 495 | },
|
| 496 | + { |
| 497 | + "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.", |
| 498 | + "type": "object", |
| 499 | + "required": [ |
| 500 | + "transfer_v2" |
| 501 | + ], |
| 502 | + "properties": { |
| 503 | + "transfer_v2": { |
| 504 | + "type": "object", |
| 505 | + "required": [ |
| 506 | + "channel_id", |
| 507 | + "forwarding", |
| 508 | + "timeout", |
| 509 | + "to_address", |
| 510 | + "tokens" |
| 511 | + ], |
| 512 | + "properties": { |
| 513 | + "channel_id": { |
| 514 | + "description": "existing channel to send the tokens over", |
| 515 | + "type": "string" |
| 516 | + }, |
| 517 | + "forwarding": { |
| 518 | + "$ref": "#/definitions/Forwarding" |
| 519 | + }, |
| 520 | + "memo": { |
| 521 | + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", |
| 522 | + "type": [ |
| 523 | + "string", |
| 524 | + "null" |
| 525 | + ] |
| 526 | + }, |
| 527 | + "timeout": { |
| 528 | + "description": "when packet times out, measured on remote chain", |
| 529 | + "allOf": [ |
| 530 | + { |
| 531 | + "$ref": "#/definitions/IbcTimeout" |
| 532 | + } |
| 533 | + ] |
| 534 | + }, |
| 535 | + "to_address": { |
| 536 | + "description": "address on the remote chain to receive these tokens", |
| 537 | + "type": "string" |
| 538 | + }, |
| 539 | + "tokens": { |
| 540 | + "description": "packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", |
| 541 | + "type": "array", |
| 542 | + "items": { |
| 543 | + "$ref": "#/definitions/Token" |
| 544 | + } |
| 545 | + } |
| 546 | + }, |
| 547 | + "additionalProperties": false |
| 548 | + } |
| 549 | + }, |
| 550 | + "additionalProperties": false |
| 551 | + }, |
461 | 552 | {
|
462 | 553 | "description": "Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.",
|
463 | 554 | "type": "object",
|
|
662 | 753 | }
|
663 | 754 | ]
|
664 | 755 | },
|
| 756 | + "Token": { |
| 757 | + "type": "object", |
| 758 | + "required": [ |
| 759 | + "amount", |
| 760 | + "base", |
| 761 | + "trace" |
| 762 | + ], |
| 763 | + "properties": { |
| 764 | + "amount": { |
| 765 | + "$ref": "#/definitions/Uint256" |
| 766 | + }, |
| 767 | + "base": { |
| 768 | + "type": "string" |
| 769 | + }, |
| 770 | + "trace": { |
| 771 | + "type": "array", |
| 772 | + "items": { |
| 773 | + "$ref": "#/definitions/Hop" |
| 774 | + } |
| 775 | + } |
| 776 | + }, |
| 777 | + "additionalProperties": false |
| 778 | + }, |
665 | 779 | "Uint128": {
|
666 | 780 | "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); ```",
|
667 | 781 | "type": "string"
|
668 | 782 | },
|
| 783 | + "Uint256": { |
| 784 | + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 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 out of primitive uint types or `new` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::from(258u128); let b = Uint256::new([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); ```", |
| 785 | + "type": "string" |
| 786 | + }, |
669 | 787 | "Uint64": {
|
670 | 788 | "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
|
671 | 789 | "type": "string"
|
|
0 commit comments