Enum NeutronMsg

Source
pub enum NeutronMsg {
Show 18 variants RegisterInterchainAccount { connection_id: String, interchain_account_id: String, register_fee: Option<Vec<Coin>>, }, SubmitTx { connection_id: String, interchain_account_id: String, msgs: Vec<ProtobufAny>, memo: String, timeout: u64, fee: IbcFee, }, RegisterInterchainQuery { query_type: String, keys: Vec<KVKey>, transactions_filter: String, connection_id: String, update_period: u64, }, UpdateInterchainQuery { query_id: u64, new_keys: Option<Vec<KVKey>>, new_update_period: Option<u64>, new_transactions_filter: Option<String>, }, RemoveInterchainQuery { query_id: u64, }, IbcTransfer { source_port: String, source_channel: String, token: Coin, sender: String, receiver: String, timeout_height: RequestPacketTimeoutHeight, timeout_timestamp: u64, memo: String, fee: IbcFee, }, SubmitAdminProposal { admin_proposal: AdminProposal, }, CreateDenom { subdenom: String, }, ChangeAdmin { denom: String, new_admin_address: String, }, MintTokens { denom: String, amount: Uint128, mint_to_address: String, }, BurnTokens { denom: String, amount: Uint128, burn_from_address: String, }, SetBeforeSendHook { denom: String, contract_addr: String, }, ForceTransfer { denom: String, amount: Uint128, transfer_from_address: String, transfer_to_address: String, }, SetDenomMetadata { description: String, denom_units: Vec<DenomUnit>, base: String, display: String, name: String, symbol: String, uri: String, uri_hash: String, }, AddSchedule { name: String, period: u64, msgs: Vec<MsgExecuteContract>, }, RemoveSchedule { name: String, }, ResubmitFailure { failure_id: u64, }, Dex(DexMsg),
}
Expand description

A number of Custom messages that can call into the Neutron bindings.

Variants§

§

RegisterInterchainAccount

RegisterInterchainAccount registers an interchain account on remote chain.

Fields

§connection_id: String

connection_id is an IBC connection identifier between Neutron and remote chain.

§interchain_account_id: String

interchain_account_id is an identifier of your new interchain account. Can be any string. This identifier allows contracts to have multiple interchain accounts on remote chains.

§register_fee: Option<Vec<Coin>>

register_fee is a fees required to be payed to register interchain account

§

SubmitTx

SubmitTx starts the process of executing any Cosmos-SDK msgs on remote chain.

Fields

§connection_id: String

connection_id is an IBC connection identifier between Neutron and remote chain.

§interchain_account_id: String

interchain_account_id is an identifier of your interchain account from which you want to execute msgs.

§msgs: Vec<ProtobufAny>

msgs is a list of protobuf encoded Cosmos-SDK messages you want to execute on remote chain.

§memo: String

memo is a memo you want to attach to your interchain transaction.It behaves like a memo in usual Cosmos transaction.

§timeout: u64

timeout is a timeout in seconds after which the packet times out.

§fee: IbcFee

*fee is an ibc fee for the transaction.

§

RegisterInterchainQuery

RegisterInterchainQuery registers an interchain query.

Fields

§query_type: String

query_type is a query type identifier (‘tx’ or ‘kv’ for now).

§keys: Vec<KVKey>

keys is the KV-storage keys for which we want to get values from remote chain.

§transactions_filter: String

transactions_filter is the filter for transaction search ICQ.

§connection_id: String

connection_id is an IBC connection identifier between Neutron and remote chain.

§update_period: u64

update_period is used to say how often the query must be updated.

§

UpdateInterchainQuery

RegisterInterchainQuery updates an interchain query.

Fields

§query_id: u64

query_id is the ID of the query we want to update.

§new_keys: Option<Vec<KVKey>>

new_keys is the new query keys to retrive.

§new_update_period: Option<u64>

new_update_period is a new update period of the query.

§new_transactions_filter: Option<String>

new_transactions_filter is a new transactions filter of the query.

§

RemoveInterchainQuery

RemoveInterchainQuery removes as interchain query.

Fields

§query_id: u64

query_id is ID of the query we want to remove.

§

IbcTransfer

IbcTransfer sends a fungible token packet over IBC.

Fields

§source_port: String
§source_channel: String
§token: Coin
§sender: String
§receiver: String
§timeout_timestamp: u64
§memo: String
§

SubmitAdminProposal

SubmitAdminProposal sends a proposal to neutron’s Admin module. This type of messages can be only executed by Neutron DAO.

Fields

§admin_proposal: AdminProposal
§

CreateDenom

TokenFactory message. Contracts can create denoms, namespaced under the contract’s address. A contract may create any number of independent sub-denoms.

Fields

§subdenom: String
§

ChangeAdmin

TokenFactory message. Contracts can change the admin of a denom that they are the admin of.

Fields

§denom: String
§new_admin_address: String
§

MintTokens

TokenFactory message. Contracts can mint native tokens for an existing factory denom that they are the admin of.

Fields

§denom: String
§amount: Uint128
§mint_to_address: String
§

BurnTokens

TokenFactory message. Contracts can burn native tokens for an existing factory denom that they are the admin of. Currently, the burn from address must be the admin contract.

Fields

§denom: String
§amount: Uint128
§burn_from_address: String

Must be set to "" for now

§

SetBeforeSendHook

TokenFactory message. Contracts can set before send hooks for denoms, namespaced under the contract’s address.

Fields

§denom: String
§contract_addr: String
§

ForceTransfer

TokenFactoryMessage Contracts can force specified amount of an existing factory denom that they are admin of to a transfer_to_address from a transfer_from_address.

Fields

§denom: String
§amount: Uint128
§transfer_from_address: String
§transfer_to_address: String
§

SetDenomMetadata

TokenFactoryMessage Contracts can set a metadata for of an existing factory denom that they are admin of.

Fields

§description: String

description description of a token

§denom_units: Vec<DenomUnit>

denom_units represents the list of DenomUnit’s for a given coin

§base: String

base represents the base denom (should be the DenomUnit with exponent = 0).

§display: String

display indicates the suggested denom that should be displayed in clients.

§name: String

name defines the name of the token (eg: Cosmos Atom)

§symbol: String

symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display.

§uri: String

uri to a document (on or off-chain) that contains additional information. Optional.

§uri_hash: String

uri_hash is a sha256 hash of a document pointed by URI. It’s used to verify that the document didn’t change. Optional.

§

AddSchedule

AddSchedule adds new schedule with a given name. Until schedule is removed it will execute all msgs every period blocks. First execution is at least on current_block + period block. [Permissioned - DAO Only]

Fields

§name: String

Name of a new schedule. Needed to be able to RemoveSchedule and to log information about it

§period: u64

period in blocks with which msgs will be executed

§msgs: Vec<MsgExecuteContract>

list of cosmwasm messages to be executed

§

RemoveSchedule

RemoveSchedule removes the schedule with a given name. [Permissioned - DAO or Security DAO only]

Fields

§name: String
§

ResubmitFailure

Contractmanager message Resubmits failed acknowledgement. Acknowledgement failure is created when contract returns error or acknowledgement is out of gas. [Permissioned - only from contract that is initial caller of IBC transaction]

Fields

§failure_id: u64
§

Dex(DexMsg)

Dex messages

Implementations§

Source§

impl NeutronMsg

Source

pub fn register_interchain_account( connection_id: String, interchain_account_id: String, register_fee: Option<Vec<Coin>>, ) -> Self

Basic helper to define a register interchain account message:

  • connection_id is an IBC connection identifier between Neutron and remote chain;
  • interchain_account_id is an identifier of your new interchain account. Can be any string.
Source

pub fn submit_tx( connection_id: String, interchain_account_id: String, msgs: Vec<ProtobufAny>, memo: String, timeout: u64, fee: IbcFee, ) -> Self

Basic helper to define a submit tx message:

  • connection_id is an IBC connection identifier between Neutron and remote chain;
  • interchain_account_id is an identifier of your interchain account from which you want to execute msgs;
  • msgs is a list of protobuf encoded Cosmos-SDK messages you want to execute on remote chain;
  • memo is a memo you want to attach to your interchain transaction. It behaves like a memo in usual Cosmos transaction;
  • timeout is a timeout in seconds after which the packet times out.
  • fee is a fee that is used for different kinds of callbacks. Unused fee types will be returned to msg sender.
Source

pub fn register_interchain_query( query: QueryPayload, connection_id: String, update_period: u64, ) -> NeutronResult<Self>

Basic helper to define a register interchain query message:

  • query is a query type identifier (‘tx’ or ‘kv’ for now) with a payload:
    • when the query enum is ‘kv’ then payload is the KV-storage keys for which we want to get values from remote chain;
    • when the query enum is ‘tx’ then payload is the filters for transaction search ICQ, maximum allowed number of filters is 32.
  • connection_id is an IBC connection identifier between Neutron and remote chain;
  • update_period is used to say how often (in neutron blocks) the query must be updated.
Source

pub fn update_interchain_query( query_id: u64, new_keys: Option<Vec<KVKey>>, new_update_period: Option<u64>, new_transactions_filter: Option<Vec<TransactionFilterItem>>, ) -> NeutronResult<Self>

Basic helper to define a update interchain query message:

  • query_id is ID of the query we want to update;
  • new_keys is encoded keys to query;
  • new_update_period is used to say how often (in neutron blocks) the query must be updated.
Source

pub fn remove_interchain_query(query_id: u64) -> Self

Basic helper to define a remove interchain query message:

  • query_id is ID of the query we want to remove.
Source

pub fn submit_param_change_proposal(proposal: ParamChangeProposal) -> Self

Basic helper to define a parameter change proposal passed to AdminModule:

  • proposal is struct which contains proposal that should change network parameter.
Source

pub fn submit_upgrade_proposal(proposal: UpgradeProposal) -> Self

👎Deprecated since 0.11.0: Used only for querying old proposals. Will fail if executed in a new proposal. Use submit_proposal_execute_message instead

Basic helper to define an ibc upgrade proposal passed to AdminModule:

  • proposal is struct which contains proposal that upgrades network.
Source

pub fn submit_client_update_proposal(proposal: ClientUpdateProposal) -> Self

👎Deprecated since 0.11.0: Used only for querying old proposals. Will fail if executed in a new proposal. Use submit_proposal_execute_message instead

Basic helper to define an ibc update client change proposal passed to AdminModule:

  • proposal is struct which contains proposal updates cliient.
Source

pub fn submit_proposal_execute_message(proposal: ProposalExecuteMessage) -> Self

Basic helper to define sdk47 compatible proposal passed to AdminModule:

  • proposal is struct which contains JSON encoded sdk message.
Source

pub fn submit_create_denom(subdenom: impl Into<String>) -> Self

Basic helper to build create denom message passed to TokenFactory module:

  • subdenom is a subdenom name for denom to be created.
Source

pub fn submit_change_admin( denom: impl Into<String>, new_admin_address: impl Into<String>, ) -> Self

Basic helper to define change of admin for a token passed to TokenFactory module:

  • denom is a name of the denom to change an admin for;
  • new_admin_address is a new admin address for a denom.
Source

pub fn submit_mint_tokens( denom: impl Into<String>, amount: Uint128, mint_to_address: impl Into<String>, ) -> Self

Basic helper to define mint tokens passed to TokenFactory module:

  • denom is a name of the denom;
  • amount is an amount of tokens to mint;
  • mint_to_address is an address that will receive minted tokens.
Source

pub fn submit_burn_tokens(denom: impl Into<String>, amount: Uint128) -> Self

Basic helper to define burn tokens passed to TokenFactory module:

  • denom is a name of the denom;
  • amount is an amount of tokens to burn.
Source

pub fn submit_set_before_send_hook( denom: impl Into<String>, contract_addr: impl Into<String>, ) -> Self

Basic helper to create set before send hook message passed to TokenFactory module:

  • denom is a name for denom for hook to be created.
Source

pub fn submit_force_transfer( denom: impl Into<String>, amount: Uint128, from_address: impl Into<String>, to_address: impl Into<String>, ) -> Self

Basic helper to create force transfer message passed to TokenFactory module:

  • denom is a name for a denom to transfer;
  • amount is an amount of denom tokens to transfer;
  • from_address is from which address to transfer tokens;
  • to_address is where to transfer tokens.
Source

pub fn submit_set_denom_metadata( description: String, denom_units: Vec<DenomUnit>, base: String, display: String, name: String, symbol: String, uri: String, uri_hash: String, ) -> Self

Basic helper to create a set denom metadata message passed to TokenFactory module:

  • description description of a token;
  • denom_units represents the list of DenomUnit’s for a given coin;
  • base represents the base denom (should be the DenomUnit with exponent = 0);
  • display indicates the suggested denom that should be displayed in clients;
  • name defines the name of the token (eg: Cosmos Atom);
  • symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display;
  • uri to a document (on or off-chain) that contains additional information. Optional;
  • uri_hash is a sha256 hash of a document pointed by URI. It’s used to verify that the document didn’t change. Optional.
Source

pub fn submit_add_schedule( name: String, period: u64, msgs: Vec<MsgExecuteContract>, ) -> Self

Basic helper to define add schedule passed to Cron module:

  • name is a name of the schedule;
  • period is a period of schedule execution in blocks;
  • msgs is the messages that will be executed.
Source

pub fn submit_remove_schedule(name: String) -> Self

Basic helper to define remove schedule passed to Cron module:

  • name is a name of the schedule to be removed.
Source

pub fn submit_resubmit_failure(failure_id: u64) -> Self

Basic helper to define resubmit failure passed to Contractmanager module:

  • failure_id is an id of the failure to be resubmitted.

Trait Implementations§

Source§

impl Clone for NeutronMsg

Source§

fn clone(&self) -> NeutronMsg

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NeutronMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NeutronMsg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<NeutronMsg> for CosmosMsg<NeutronMsg>

Source§

fn from(msg: NeutronMsg) -> CosmosMsg<NeutronMsg>

Converts to this type from the input type.
Source§

impl JsonSchema for NeutronMsg

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for NeutronMsg

Source§

fn eq(&self, other: &NeutronMsg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for NeutronMsg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl CustomMsg for NeutronMsg

Source§

impl Eq for NeutronMsg

Source§

impl StructuralPartialEq for NeutronMsg

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,