Class ERC1155

Basic representation of an ERC1155 compatible contract. If additional functionality is required, this contract can be extended via inheritance

Hierarchy

Constructors

  • Constructs a new instance of the contract

    Parameters

    • _contract: IContract
    • IPFSGateway: string = 'https://cloudflare-ipfs.com/ipfs/'
    • Optional maximumId: BigNumberish

    Returns ERC1155

Accessors

  • get IPFSGateway(): string
  • Returns string

  • get address(): string
  • Returns the contract address

    Returns string

  • get contract(): Contract
  • Returns the underlying contract interface

    Returns Contract

Methods

  • Get the balance of an account's tokens.

    Parameters

    • owner: string
    • id: BigNumberish

    Returns Promise<BigNumber>

  • Get the balance of multiple account/token pairs

    Parameters

    • owners: string[]
    • ids: BigNumberish[]

    Returns Promise<BigNumberish[]>

  • Attempts to determine the balance of the owner across all IDs

    Parameters

    • owner: string

    Returns Promise<BigNumber>

  • Returns an interface allowing for us with the multicall method of a provider

    Parameters

    • name: string
    • Rest ...params: any[]

    Returns ContractCall

  • Attempt to discover the maximum ID through brute forcing.

    Note: This method is very slow upon first run if maximumID() is not supported and the results are cached internally to make subsequent calls faster; however, subsequent calls will check to see if the maximum id has increased.

    Note: We loop in here until we get a revert... thus we cannot reasonably account for any burn mechanics if the URI for a burned ID is destroyed by the contract

    Returns Promise<BigNumber>

  • Indicates whether any token exist with a given id, or not.

    Parameters

    • id: BigNumberish

    Returns Promise<boolean>

  • Queries the approval status of an operator for a given owner.

    Parameters

    • owner: string
    • operator: string

    Returns Promise<boolean>

  • Retrieves the maximum ID if the contract supports this call

    Returns Promise<BigNumber>

  • A descriptive name for a collection of NFTs in this contract

    Returns Promise<string>

  • Returns the metadata for all NFTs owned by the specified account by scanning through the range of IDs provided

    Parameters

    • owner: string

    Returns Promise<ERC1155Metadata[]>

  • Returns an array of token IDs owned by the specified account by scanning through the range of IDs provided

    Parameters

    • owner: string

    Returns Promise<BigNumber[]>

  • Protected

    Automatically keeps trying the call unless we get a revert exception

    Type Parameters

    • T

    Parameters

    • func: ((...args) => Promise<T>)
        • (...args): Promise<T>
        • Parameters

          • Rest ...args: any[]

          Returns Promise<T>

    • Rest ...params: any[]

    Returns Promise<T>

  • Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be payed in that same unit of exchange.

    Parameters

    • tokenId: BigNumberish
    • salePrice: BigNumberish

    Returns Promise<{
        receiver: string;
        royaltyAmount: BigNumber;
    }>

  • Transfers values amount(s) of ids from the from address to the to address specified (with safety call).

    Parameters

    • from: string
    • to: string
    • ids: BigNumberish[]
    • values: BigNumberish[]
    • data: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Transfers value amount of an id from the from address to the to address specified (with safety call).

    Parameters

    • from: string
    • to: string
    • id: BigNumberish
    • value: BigNumberish
    • data: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.

    Parameters

    • operator: string
    • approved: boolean = true
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Returns whether the specified interface is supported by the contract

    Parameters

    • interfaceId: string

    Returns Promise<boolean>

  • A distinct Uniform Resource Identifier (URI) for a given asset.

    Parameters

    • tokenId: BigNumberish

    Returns Promise<string>

    Alias

    uri

  • Returns the total amount of tokens stored by the contract.

    Parameters

    • id: BigNumberish

    Returns Promise<BigNumber>

  • A distinct Uniform Resource Identifier (URI) for a given token.

    Parameters

    • id: BigNumberish

    Returns Promise<string>