Comment on page
Common Types
Defining recurring structs used by our ADOs.
This section contains the definitions of structures used by many of our ADOs. To avoid redefining them every time, they will be placed in this section and referenced.
A struct used to store the denom and amount of funds.
Rust
JSON
pub struct Coin {
pub denom: String,
pub amount: Uint128,
}
{
"denom":"uandr",
"amount":"1000000"
}
Name | Type | Description |
denom | String | The denomination of the funds. |
amount | Uint128 | The amount of funds. |
Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future).
Rust
pub enum Expiration {
AtHeight(u64),
AtTime(Timestamp),
Never {},
}
AtHeight: AtHeight will expire when
env.block.height
>= height.AtTime: AtTime will expire when
env.block.time
>= time.Never: Never will never expire. Used to express the empty variant.
A point in time in nanosecond precision.
pub struct Timestamp(Uint64)
{
"expiration":{
"at_height": 500
}
or
{
"expiration":{
"at_time":"1246593483949835832"
}
A simple struct used for inter-contract communication:
pub struct Recipient {
pub address: AndrAddr,
pub msg: Option<Binary>,
}
The struct can be used in two ways:
1. Simply just providing an
AndrAddr
which will treat the communication as a transfer of any related funds. 2. Providing an
AndrAddr
and a Binary
message which will be sent to the contract at the resolved address. The Binary
message can be any message that the contract at the resolved address can handle.An address that can be used within the Andromeda ecosystem.
pub struct AndrAddr(String);
The address can be one of two things:
- A valid human readable address e.g. "andr1..."
VFS paths can be local in the case of an app and can be done by referencing
./component
.They can also contain protocols for cross chain communication and are structured in the following way:
The chain is required if IBC is to be used.
VFS paths are required in specifying the recipients in IBC messages.
<protocol>://<chain>/<path>
e.g. ibc://stargaze/home/user/app/component