View Source Ethers.Contract.ERC1155 (Ethers v0.0.1-dev)
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.
Executes balanceOfBatch(address[] accounts, uint256[] ids)
on the contract.
Executes isApprovedForAll(address account, address operator)
on the contract.
Executes safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)
on the contract.
Executes safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
on the contract.
Executes setApprovalForAll(address operator, bool approved)
on the contract.
Executes supportsInterface(bytes4 interfaceId)
on the contract.
Executes uri(uint256 id)
on the contract.
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_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes balanceOf(address account, uint256 id)
on the contract.
parameters
Parameters
- account:
:address
- id:
{:uint, 256}
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::call
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
{:uint, 256}
@spec balance_of_batch([Ethers.Types.t_address()], [non_neg_integer()], Keyword.t()) :: {:ok, [[non_neg_integer()]]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes balanceOfBatch(address[] accounts, uint256[] ids)
on the contract.
parameters
Parameters
- accounts:
{:array, :address}
- ids:
{:array, {:uint, 256}}
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::call
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
{:array, {:uint, 256}}
@spec is_approved_for_all( Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t() ) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes isApprovedForAll(address account, address operator)
on the contract.
parameters
Parameters
- account:
:address
- operator:
:address
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::call
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
:bool
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_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)
on the contract.
parameters
Parameters
- from:
:address
- to:
:address
- ids:
{:array, {:uint, 256}}
- amounts:
{:array, {:uint, 256}}
- data:
:bytes
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::send
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
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() ) :: {:ok, []} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
on the contract.
parameters
Parameters
- from:
:address
- to:
:address
- id:
{:uint, 256}
- amount:
{:uint, 256}
- data:
:bytes
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::send
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
@spec set_approval_for_all(Ethers.Types.t_address(), boolean(), Keyword.t()) :: {:ok, []} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes setApprovalForAll(address operator, bool approved)
on the contract.
parameters
Parameters
- operator:
:address
- approved:
:bool
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::send
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
@spec supports_interface(<<_::32>>, Keyword.t()) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes supportsInterface(bytes4 interfaceId)
on the contract.
parameters
Parameters
- interfaceId:
{:bytes, 4}
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::call
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
:bool
@spec uri(non_neg_integer(), Keyword.t()) :: {:ok, [String.t()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes uri(uint256 id)
on the contract.
parameters
Parameters
- id:
{:uint, 256}
- overrides: Overrides and options for the call.
:to
: The address of the recipient contract. (Required):action
: Type of action for this function (:call
,:send
or:prepare
) Default::call
.:rpc_opts
: Options to pass to the RCP client e.g.:url
.
return-types
Return Types
:string