pub use crate::traits::errors::{
PSP22Error,
PSP22ReceiverError,
};
use ink::prelude::vec::Vec;
use openbrush::traits::{
AccountId,
Balance,
};
#[openbrush::wrapper]
pub type PSP22Ref = dyn PSP22;
#[openbrush::trait_definition]
pub trait PSP22 {
#[ink(message)]
fn total_supply(&self) -> Balance;
#[ink(message)]
fn balance_of(&self, owner: AccountId) -> Balance;
#[ink(message)]
fn allowance(&self, owner: AccountId, spender: AccountId) -> Balance;
#[ink(message)]
fn transfer(&mut self, to: AccountId, value: Balance, data: Vec<u8>) -> Result<(), PSP22Error>;
#[ink(message)]
fn transfer_from(
&mut self,
from: AccountId,
to: AccountId,
value: Balance,
data: Vec<u8>,
) -> Result<(), PSP22Error>;
#[ink(message)]
fn approve(&mut self, spender: AccountId, value: Balance) -> Result<(), PSP22Error>;
#[ink(message)]
fn increase_allowance(&mut self, spender: AccountId, delta_value: Balance) -> Result<(), PSP22Error>;
#[ink(message)]
fn decrease_allowance(&mut self, spender: AccountId, delta_value: Balance) -> Result<(), PSP22Error>;
}