pub use erc1155_supply::*;
/// This module was auto-generated with ethers-rs Abigen.
/// More information at: <https://github.com/gakonst/ethers-rs>
#[allow(
clippy::enum_variant_names,
clippy::too_many_arguments,
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types,
)]
pub mod erc1155_supply {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"ApprovalForAll\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"TransferBatch\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"TransferSingle\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"URI\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"exists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"safeBatchTransferFrom\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"safeTransferFrom\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"setApprovalForAll\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]}]";
///The parsed JSON ABI of the contract.
pub static ERC1155SUPPLY_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
pub struct ERC1155Supply<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for ERC1155Supply<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for ERC1155Supply<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for ERC1155Supply<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for ERC1155Supply<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(ERC1155Supply)).field(&self.address()).finish()
}
}
impl<M: ::ethers_providers::Middleware> ERC1155Supply<M> {
/// Creates a new contract instance with the specified `ethers` client at
/// `address`. The contract derefs to a `ethers::Contract` object.
pub fn new<T: Into<::ethers_core::types::Address>>(
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(
::ethers_contract::Contract::new(
address.into(),
ERC1155SUPPLY_ABI.clone(),
client,
),
)
}
///Calls the contract's `balanceOf` (0x00fdd58e) function
pub fn balance_of(
&self,
account: ::ethers_core::types::Address,
id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([0, 253, 213, 142], (account, id))
.expect("method not found (this should never happen)")
}
///Calls the contract's `balanceOfBatch` (0x4e1273f4) function
pub fn balance_of_batch(
&self,
accounts: ::std::vec::Vec<::ethers_core::types::Address>,
ids: ::std::vec::Vec<::ethers_core::types::U256>,
) -> ::ethers_contract::builders::ContractCall<
M,
::std::vec::Vec<::ethers_core::types::U256>,
> {
self.0
.method_hash([78, 18, 115, 244], (accounts, ids))
.expect("method not found (this should never happen)")
}
///Calls the contract's `exists` (0x4f558e79) function
pub fn exists(
&self,
id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([79, 85, 142, 121], id)
.expect("method not found (this should never happen)")
}
///Calls the contract's `isApprovedForAll` (0xe985e9c5) function
pub fn is_approved_for_all(
&self,
account: ::ethers_core::types::Address,
operator: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([233, 133, 233, 197], (account, operator))
.expect("method not found (this should never happen)")
}
///Calls the contract's `safeBatchTransferFrom` (0x2eb2c2d6) function
pub fn safe_batch_transfer_from(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
ids: ::std::vec::Vec<::ethers_core::types::U256>,
amounts: ::std::vec::Vec<::ethers_core::types::U256>,
data: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([46, 178, 194, 214], (from, to, ids, amounts, data))
.expect("method not found (this should never happen)")
}
///Calls the contract's `safeTransferFrom` (0xf242432a) function
pub fn safe_transfer_from(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
id: ::ethers_core::types::U256,
amount: ::ethers_core::types::U256,
data: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([242, 66, 67, 42], (from, to, id, amount, data))
.expect("method not found (this should never happen)")
}
///Calls the contract's `setApprovalForAll` (0xa22cb465) function
pub fn set_approval_for_all(
&self,
operator: ::ethers_core::types::Address,
approved: bool,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([162, 44, 180, 101], (operator, approved))
.expect("method not found (this should never happen)")
}
///Calls the contract's `supportsInterface` (0x01ffc9a7) function
pub fn supports_interface(
&self,
interface_id: [u8; 4],
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([1, 255, 201, 167], interface_id)
.expect("method not found (this should never happen)")
}
///Calls the contract's `totalSupply` (0xbd85b039) function
pub fn total_supply(
&self,
id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([189, 133, 176, 57], id)
.expect("method not found (this should never happen)")
}
///Calls the contract's `uri` (0x0e89341c) function
pub fn uri(
&self,
p0: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
self.0
.method_hash([14, 137, 52, 28], p0)
.expect("method not found (this should never happen)")
}
///Gets the contract's `ApprovalForAll` event
pub fn approval_for_all_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
ApprovalForAllFilter,
> {
self.0.event()
}
///Gets the contract's `TransferBatch` event
pub fn transfer_batch_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
TransferBatchFilter,
> {
self.0.event()
}
///Gets the contract's `TransferSingle` event
pub fn transfer_single_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
TransferSingleFilter,
> {
self.0.event()
}
///Gets the contract's `URI` event
pub fn uri_filter(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, UriFilter> {
self.0.event()
}
/// Returns an `Event` builder for all the events of this contract.
pub fn events(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
ERC1155SupplyEvents,
> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for ERC1155Supply<M> {
fn from(contract: ::ethers_contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "ApprovalForAll", abi = "ApprovalForAll(address,address,bool)")]
pub struct ApprovalForAllFilter {
#[ethevent(indexed)]
pub account: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub operator: ::ethers_core::types::Address,
pub approved: bool,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(
name = "TransferBatch",
abi = "TransferBatch(address,address,address,uint256[],uint256[])"
)]
pub struct TransferBatchFilter {
#[ethevent(indexed)]
pub operator: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub from: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub to: ::ethers_core::types::Address,
pub ids: ::std::vec::Vec<::ethers_core::types::U256>,
pub values: ::std::vec::Vec<::ethers_core::types::U256>,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(
name = "TransferSingle",
abi = "TransferSingle(address,address,address,uint256,uint256)"
)]
pub struct TransferSingleFilter {
#[ethevent(indexed)]
pub operator: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub from: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub to: ::ethers_core::types::Address,
pub id: ::ethers_core::types::U256,
pub value: ::ethers_core::types::U256,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "URI", abi = "URI(string,uint256)")]
pub struct UriFilter {
pub value: ::std::string::String,
#[ethevent(indexed)]
pub id: ::ethers_core::types::U256,
}
///Container type for all of the contract's events
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ERC1155SupplyEvents {
ApprovalForAllFilter(ApprovalForAllFilter),
TransferBatchFilter(TransferBatchFilter),
TransferSingleFilter(TransferSingleFilter),
UriFilter(UriFilter),
}
impl ::ethers_contract::EthLogDecode for ERC1155SupplyEvents {
fn decode_log(
log: &::ethers_core::abi::RawLog,
) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
if let Ok(decoded) = ApprovalForAllFilter::decode_log(log) {
return Ok(ERC1155SupplyEvents::ApprovalForAllFilter(decoded));
}
if let Ok(decoded) = TransferBatchFilter::decode_log(log) {
return Ok(ERC1155SupplyEvents::TransferBatchFilter(decoded));
}
if let Ok(decoded) = TransferSingleFilter::decode_log(log) {
return Ok(ERC1155SupplyEvents::TransferSingleFilter(decoded));
}
if let Ok(decoded) = UriFilter::decode_log(log) {
return Ok(ERC1155SupplyEvents::UriFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for ERC1155SupplyEvents {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::ApprovalForAllFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::TransferBatchFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::TransferSingleFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::UriFilter(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<ApprovalForAllFilter> for ERC1155SupplyEvents {
fn from(value: ApprovalForAllFilter) -> Self {
Self::ApprovalForAllFilter(value)
}
}
impl ::core::convert::From<TransferBatchFilter> for ERC1155SupplyEvents {
fn from(value: TransferBatchFilter) -> Self {
Self::TransferBatchFilter(value)
}
}
impl ::core::convert::From<TransferSingleFilter> for ERC1155SupplyEvents {
fn from(value: TransferSingleFilter) -> Self {
Self::TransferSingleFilter(value)
}
}
impl ::core::convert::From<UriFilter> for ERC1155SupplyEvents {
fn from(value: UriFilter) -> Self {
Self::UriFilter(value)
}
}
///Container type for all input parameters for the `balanceOf` function with signature `balanceOf(address,uint256)` and selector `0x00fdd58e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "balanceOf", abi = "balanceOf(address,uint256)")]
pub struct BalanceOfCall {
pub account: ::ethers_core::types::Address,
pub id: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `balanceOfBatch` function with signature `balanceOfBatch(address[],uint256[])` and selector `0x4e1273f4`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "balanceOfBatch", abi = "balanceOfBatch(address[],uint256[])")]
pub struct BalanceOfBatchCall {
pub accounts: ::std::vec::Vec<::ethers_core::types::Address>,
pub ids: ::std::vec::Vec<::ethers_core::types::U256>,
}
///Container type for all input parameters for the `exists` function with signature `exists(uint256)` and selector `0x4f558e79`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "exists", abi = "exists(uint256)")]
pub struct ExistsCall {
pub id: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `isApprovedForAll` function with signature `isApprovedForAll(address,address)` and selector `0xe985e9c5`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "isApprovedForAll", abi = "isApprovedForAll(address,address)")]
pub struct IsApprovedForAllCall {
pub account: ::ethers_core::types::Address,
pub operator: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `safeBatchTransferFrom` function with signature `safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)` and selector `0x2eb2c2d6`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "safeBatchTransferFrom",
abi = "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)"
)]
pub struct SafeBatchTransferFromCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub ids: ::std::vec::Vec<::ethers_core::types::U256>,
pub amounts: ::std::vec::Vec<::ethers_core::types::U256>,
pub data: ::ethers_core::types::Bytes,
}
///Container type for all input parameters for the `safeTransferFrom` function with signature `safeTransferFrom(address,address,uint256,uint256,bytes)` and selector `0xf242432a`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "safeTransferFrom",
abi = "safeTransferFrom(address,address,uint256,uint256,bytes)"
)]
pub struct SafeTransferFromCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub id: ::ethers_core::types::U256,
pub amount: ::ethers_core::types::U256,
pub data: ::ethers_core::types::Bytes,
}
///Container type for all input parameters for the `setApprovalForAll` function with signature `setApprovalForAll(address,bool)` and selector `0xa22cb465`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "setApprovalForAll", abi = "setApprovalForAll(address,bool)")]
pub struct SetApprovalForAllCall {
pub operator: ::ethers_core::types::Address,
pub approved: bool,
}
///Container type for all input parameters for the `supportsInterface` function with signature `supportsInterface(bytes4)` and selector `0x01ffc9a7`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "supportsInterface", abi = "supportsInterface(bytes4)")]
pub struct SupportsInterfaceCall {
pub interface_id: [u8; 4],
}
///Container type for all input parameters for the `totalSupply` function with signature `totalSupply(uint256)` and selector `0xbd85b039`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "totalSupply", abi = "totalSupply(uint256)")]
pub struct TotalSupplyCall {
pub id: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `uri` function with signature `uri(uint256)` and selector `0x0e89341c`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "uri", abi = "uri(uint256)")]
pub struct UriCall(pub ::ethers_core::types::U256);
///Container type for all of the contract's call
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ERC1155SupplyCalls {
BalanceOf(BalanceOfCall),
BalanceOfBatch(BalanceOfBatchCall),
Exists(ExistsCall),
IsApprovedForAll(IsApprovedForAllCall),
SafeBatchTransferFrom(SafeBatchTransferFromCall),
SafeTransferFrom(SafeTransferFromCall),
SetApprovalForAll(SetApprovalForAllCall),
SupportsInterface(SupportsInterfaceCall),
TotalSupply(TotalSupplyCall),
Uri(UriCall),
}
impl ::ethers_core::abi::AbiDecode for ERC1155SupplyCalls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::BalanceOf(decoded));
}
if let Ok(decoded)
= <BalanceOfBatchCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::BalanceOfBatch(decoded));
}
if let Ok(decoded)
= <ExistsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Exists(decoded));
}
if let Ok(decoded)
= <IsApprovedForAllCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::IsApprovedForAll(decoded));
}
if let Ok(decoded)
= <SafeBatchTransferFromCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SafeBatchTransferFrom(decoded));
}
if let Ok(decoded)
= <SafeTransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::SafeTransferFrom(decoded));
}
if let Ok(decoded)
= <SetApprovalForAllCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SetApprovalForAll(decoded));
}
if let Ok(decoded)
= <SupportsInterfaceCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SupportsInterface(decoded));
}
if let Ok(decoded)
= <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TotalSupply(decoded));
}
if let Ok(decoded)
= <UriCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Uri(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for ERC1155SupplyCalls {
fn encode(self) -> Vec<u8> {
match self {
Self::BalanceOf(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::BalanceOfBatch(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Exists(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::IsApprovedForAll(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SafeBatchTransferFrom(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SafeTransferFrom(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SetApprovalForAll(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SupportsInterface(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TotalSupply(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Uri(element) => ::ethers_core::abi::AbiEncode::encode(element),
}
}
}
impl ::core::fmt::Display for ERC1155SupplyCalls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
Self::BalanceOfBatch(element) => ::core::fmt::Display::fmt(element, f),
Self::Exists(element) => ::core::fmt::Display::fmt(element, f),
Self::IsApprovedForAll(element) => ::core::fmt::Display::fmt(element, f),
Self::SafeBatchTransferFrom(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::SafeTransferFrom(element) => ::core::fmt::Display::fmt(element, f),
Self::SetApprovalForAll(element) => ::core::fmt::Display::fmt(element, f),
Self::SupportsInterface(element) => ::core::fmt::Display::fmt(element, f),
Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
Self::Uri(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<BalanceOfCall> for ERC1155SupplyCalls {
fn from(value: BalanceOfCall) -> Self {
Self::BalanceOf(value)
}
}
impl ::core::convert::From<BalanceOfBatchCall> for ERC1155SupplyCalls {
fn from(value: BalanceOfBatchCall) -> Self {
Self::BalanceOfBatch(value)
}
}
impl ::core::convert::From<ExistsCall> for ERC1155SupplyCalls {
fn from(value: ExistsCall) -> Self {
Self::Exists(value)
}
}
impl ::core::convert::From<IsApprovedForAllCall> for ERC1155SupplyCalls {
fn from(value: IsApprovedForAllCall) -> Self {
Self::IsApprovedForAll(value)
}
}
impl ::core::convert::From<SafeBatchTransferFromCall> for ERC1155SupplyCalls {
fn from(value: SafeBatchTransferFromCall) -> Self {
Self::SafeBatchTransferFrom(value)
}
}
impl ::core::convert::From<SafeTransferFromCall> for ERC1155SupplyCalls {
fn from(value: SafeTransferFromCall) -> Self {
Self::SafeTransferFrom(value)
}
}
impl ::core::convert::From<SetApprovalForAllCall> for ERC1155SupplyCalls {
fn from(value: SetApprovalForAllCall) -> Self {
Self::SetApprovalForAll(value)
}
}
impl ::core::convert::From<SupportsInterfaceCall> for ERC1155SupplyCalls {
fn from(value: SupportsInterfaceCall) -> Self {
Self::SupportsInterface(value)
}
}
impl ::core::convert::From<TotalSupplyCall> for ERC1155SupplyCalls {
fn from(value: TotalSupplyCall) -> Self {
Self::TotalSupply(value)
}
}
impl ::core::convert::From<UriCall> for ERC1155SupplyCalls {
fn from(value: UriCall) -> Self {
Self::Uri(value)
}
}
///Container type for all return fields from the `balanceOf` function with signature `balanceOf(address,uint256)` and selector `0x00fdd58e`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `balanceOfBatch` function with signature `balanceOfBatch(address[],uint256[])` and selector `0x4e1273f4`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct BalanceOfBatchReturn(pub ::std::vec::Vec<::ethers_core::types::U256>);
///Container type for all return fields from the `exists` function with signature `exists(uint256)` and selector `0x4f558e79`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ExistsReturn(pub bool);
///Container type for all return fields from the `isApprovedForAll` function with signature `isApprovedForAll(address,address)` and selector `0xe985e9c5`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct IsApprovedForAllReturn(pub bool);
///Container type for all return fields from the `supportsInterface` function with signature `supportsInterface(bytes4)` and selector `0x01ffc9a7`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct SupportsInterfaceReturn(pub bool);
///Container type for all return fields from the `totalSupply` function with signature `totalSupply(uint256)` and selector `0xbd85b039`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `uri` function with signature `uri(uint256)` and selector `0x0e89341c`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct UriReturn(pub ::std::string::String);
}