View Source Ethers.Contracts.ERC1155 (Ethers v0.0.3)
ERC1155 token interface
More info: https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/
Link to this section Summary
Functions
Executes balanceOf(address account, uint256 id)
on the contract.
Same as balance_of/3
but raises Ethers.ExecutionError
on errors.
Executes balanceOfBatch(address[] accounts, uint256[] ids)
on the contract.
Same as balance_of_batch/3
but raises Ethers.ExecutionError
on errors.
Prepares contract constructor values.
Default address of the contract. Returns nil
if not specified.
Executes isApprovedForAll(address account, address operator)
on the contract.
Same as is_approved_for_all/3
but raises Ethers.ExecutionError
on errors.
Executes safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)
on the contract.
Same as safe_batch_transfer_from/6
but raises Ethers.ExecutionError
on errors.
Executes safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
on the contract.
Same as safe_transfer_from/6
but raises Ethers.ExecutionError
on errors.
Executes setApprovalForAll(address operator, bool approved)
on the contract.
Same as set_approval_for_all/3
but raises Ethers.ExecutionError
on errors.
Executes supportsInterface(bytes4 interfaceId)
on the contract.
Same as supports_interface/2
but raises Ethers.ExecutionError
on errors.
Executes uri(uint256 id)
on the contract.
Same as uri/2
but raises Ethers.ExecutionError
on errors.
Link to this section Functions
@spec balance_of(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) :: {:ok, [non_neg_integer()]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes balanceOf(address account, uint256 id)
on the contract.
Default action for this function is :call
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- account:
:address
- id:
{:uint, 256}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:uint, 256}
@spec balance_of!(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) :: [non_neg_integer()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as balance_of/3
but raises Ethers.ExecutionError
on errors.
@spec balance_of_batch([Ethers.Types.t_address()], [non_neg_integer()], Keyword.t()) :: {:ok, [[non_neg_integer()]]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes balanceOfBatch(address[] accounts, uint256[] ids)
on the contract.
Default action for this function is :call
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- accounts:
{:array, :address}
- ids:
{:array, {:uint, 256}}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:array, {:uint, 256}}
@spec balance_of_batch!([Ethers.Types.t_address()], [non_neg_integer()], Keyword.t()) :: [[non_neg_integer()]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as balance_of_batch/3
but raises Ethers.ExecutionError
on errors.
@spec constructor() :: binary()
Prepares contract constructor values.
To deploy a contracts see Ethers.deploy/3
.
parameters
Parameters
@spec default_address() :: Ethers.Types.t_address() | nil
Default address of the contract. Returns nil
if not specified.
To specify a default address see Ethers.Contract
@spec is_approved_for_all( Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t() ) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes isApprovedForAll(address account, address operator)
on the contract.
Default action for this function is :call
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- account:
:address
- operator:
:address
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:bool
@spec is_approved_for_all!( Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t() ) :: [boolean()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as is_approved_for_all/3
but raises Ethers.ExecutionError
on errors.
safe_batch_transfer_from(from, to, ids, amounts, data, overrides \\ [])
View Source@spec safe_batch_transfer_from( Ethers.Types.t_address(), Ethers.Types.t_address(), [non_neg_integer()], [non_neg_integer()], binary(), Keyword.t() ) :: {:ok, [[]]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)
on the contract.
Default action for this function is :send
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- from:
:address
- to:
:address
- ids:
{:array, {:uint, 256}}
- amounts:
{:array, {:uint, 256}}
- data:
:bytes
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
safe_batch_transfer_from!(from, to, ids, amounts, data, overrides \\ [])
View Source@spec safe_batch_transfer_from!( Ethers.Types.t_address(), Ethers.Types.t_address(), [non_neg_integer()], [non_neg_integer()], binary(), Keyword.t() ) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as safe_batch_transfer_from/6
but raises Ethers.ExecutionError
on errors.
@spec safe_transfer_from( Ethers.Types.t_address(), Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), binary(), Keyword.t() ) :: {:ok, [[]]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
on the contract.
Default action for this function is :send
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- from:
:address
- to:
:address
- id:
{:uint, 256}
- amount:
{:uint, 256}
- data:
:bytes
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
@spec safe_transfer_from!( Ethers.Types.t_address(), Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), binary(), Keyword.t() ) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as safe_transfer_from/6
but raises Ethers.ExecutionError
on errors.
@spec set_approval_for_all(Ethers.Types.t_address(), boolean(), Keyword.t()) :: {:ok, [[]]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes setApprovalForAll(address operator, bool approved)
on the contract.
Default action for this function is :send
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- operator:
:address
- approved:
:bool
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
@spec set_approval_for_all!(Ethers.Types.t_address(), boolean(), Keyword.t()) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as set_approval_for_all/3
but raises Ethers.ExecutionError
on errors.
@spec supports_interface(<<_::32>> | <<_::80>>, Keyword.t()) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes supportsInterface(bytes4 interfaceId)
on the contract.
Default action for this function is :call
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- interfaceId:
{:bytes, 4}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:bool
@spec supports_interface!(<<_::32>> | <<_::80>>, Keyword.t()) :: [boolean()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as supports_interface/2
but raises Ethers.ExecutionError
on errors.
@spec uri(non_neg_integer(), Keyword.t()) :: {:ok, [String.t()]} | {:ok, Ethers.Types.t_hash()} | {:ok, Ethers.Contract.t_function_output()} | {:error, term()}
Executes uri(uint256 id)
on the contract.
Default action for this function is :call
.
To override default action see Execution Options in Ethers.Contract
.
parameters
Parameters
- id:
{:uint, 256}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:string
@spec uri!(non_neg_integer(), Keyword.t()) :: [String.t()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as uri/2
but raises Ethers.ExecutionError
on errors.