Andromeda
Search…
Receipt
An ADO contract to mint, edit and query receipts containing event data.

Introduction

The Receipt ADO is a smart contract that is used to print receipts for transactions done by our ADOs.
This contract is implemented as a module and added to ADOs that implement modules. When we have some transfer of funds, the receipt contract is automatically called and the events of the transaction are saved in the Receipt struct.
Ado_type: receipt

InstantiateMsg

Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub minter: String,
}
{
"minter": "juno1..."
}
Name
Type
Description
minter
String
The address authorized to mint new receipts

ExecuteMsg

StoreReceipt

Creates a new receipt. Generates a receipt ID.
Only executable by the assigned minter address.
Usually called automatically by the receipt module after generating the receipt.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum ExecuteMsg {
StoreReceipt {
receipt: Receipt,
}
}
{
"store_receipt": {
"receipt": {
"events": [
{
"type": "tax",
"attributes": [
{
"key": "payment",
"value": "juno1...<100uluna"
},
...
]
},
...
]
}
}
}
Name
Type
Description
receipt
Receipt
The receipt to store.

Receipt

The receipt structure contains a basic vector of CosmWasm events.
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
pub struct Receipt {
pub events: Vec<Event>,
}
Name
Type
Description
events
Vec<Event>
An array of events related to the receipt.

EditReceipt

Edit a receipt by ID. Only executable by the assigned minter address or a valid operator.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
EditReceipt {
receipt_id: Uint128,
receipt: Receipt,
},
}
{
"edit_receipt": {
"receipt_id": "1",
"receipt": {
"events": [
{
"type": "tax",
"attributes": [
{
"key": "payment",
"value": "juno1...<100uluna"
},
...
]
},
...
]
}
}
}
Name
Type
Description
receipt
Receipt
The receipt to edit.
receipt_id
Uint128
The ID of the receipt to edit.

AndrReceive

QueryMsg

Receipt

Queries a receipt by its ID.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Receipt {
receipt_id: Uint128
}
}
{
"receipt": {
"receipt_id": "1"
}
}
Name
Type
Description
receipt_id
Uint128
The ID of the receipt to query.

ReceiptResponse

Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ReceiptResponse {
pub receipt: Receipt,
}
{
"receipt": {
"events": [
{
"type": "tax",
"attributes": [
{
"key": "payment",
"value": "juno1...<100uluna"
},
...
]
},
...
]
}
}
Name
Type
Description
receipt
Receipt
The receipt data.

ContractInfo

Queries the contract's configuration.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
ContractInfo {},
}
{
"contract_info": {}
}

ContractInfoResponse

Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct Config {
pub minter: String,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct ContractInfoResponse {
pub config: Config,
}
{
"config": {
"minter": "juno1..."
}
}
Name
Type
Description
minter
String
The address authorized to mint new receipts.

AndrQuery

Copy link
Outline
Introduction
InstantiateMsg
ExecuteMsg
StoreReceipt
EditReceipt
AndrReceive
QueryMsg
Receipt
ContractInfo
ContractInfoResponse
AndrQuery