Options
All
  • Public
  • Public/Protected
  • All
Menu

Class which can be used to interact with the PyroPets (PYRO) token contract

Hierarchy

  • PyroCore

Implements

Index

Constructors

Properties

Methods

  • approve(to: string, tokenId: string): Promise<Transaction>
  • Gives permission to to to transfer tokenId token to another account. The approval is cleared when the token is transferred.

    Only a single account can be approved at a time, so approving the zero address clears previous approvals.

    Requirements:

    • The caller must own the token or be an approved operator.
    • tokenId must exist.

    Emits an {Approval} event.

    Parameters

    • to: string
    • tokenId: string

    Returns Promise<Transaction>

  • approveStoking(addr: string, tokenId: string): Promise<Transaction>
  • Approve an address to stoke a specific pyro

    Parameters

    • addr: string

      approved stoker

    • tokenId: string

      the pyro tokenId

    Returns Promise<Transaction>

  • balanceOf(owner: string): Promise<bigint>
  • baseURI(): Promise<string>
  • canStoke(tokenId: string): Promise<boolean>
  • Returns if the pyro can stoke

    Parameters

    • tokenId: string

      the pyro tokenId

    Returns Promise<boolean>

  • canStokeWith(donorA: string, donorB: string): Promise<boolean>
  • Returns if the two donors can stoke

    Parameters

    • donorA: string

      pyro tokenId for donorA

    • donorB: string

      pyro tokenId for donorB

    Returns Promise<boolean>

  • emberRates(tokenId: string): Promise<bigint>
  • Returns the rate at which MBRS are created by playing with the pyro

    Parameters

    • tokenId: string

      the id of the pyro

    Returns Promise<bigint>

  • embers(): Promise<string>
  • feed(tokenId: string, amount: number): Promise<Transaction>
  • Feeds a pyro, must be between 1-255 units of hunger

    Parameters

    • tokenId: string

      the pyro tokenId

    • amount: number

      units of hunger to replenish

    Returns Promise<Transaction>

  • gen0Cap(): Promise<bigint>
  • gen0Count(): Promise<bigint>
  • generationCost(): Promise<bigint>
  • generationOfPyro(tokenId: string): Promise<bigint>
  • Returns the generation of a pyro

    Parameters

    • tokenId: string

      the pyro tokenId

    Returns Promise<bigint>

  • generationZeroForAddress(name: string, owner: string): Promise<Transaction>
  • Generate a new generation 0 pyro for an address

    Parameters

    • name: string

      the name of the new pyro

    • owner: string

      the owner of the pyro

    Returns Promise<Transaction>

  • getApproved(tokenId: string): Promise<string>
  • getPyro(tokenId: string): Promise<Pyro>
  • getSaleAuction(tokenId: string): Promise<Auction>
  • getStokingAuction(tokenId: string): Promise<Auction>
  • ignite(tokenId: string, name: string): Promise<Transaction>
  • isApprovedForAll(owner: string, operator: string): Promise<boolean>
  • isValidStokingPair(donorA: string, donorB: string): Promise<boolean>
  • Returns whether 2 pyros are a valid stoking pair

    Parameters

    • donorA: string

      pyro tokenId for donorA

    • donorB: string

      pyro tokenId for donorB

    Returns Promise<boolean>

  • lastAte(tokenId: string): Promise<bigint>
  • Returns the last time a pyro ate

    Parameters

    • tokenId: string

      the pyro tokenId

    Returns Promise<bigint>

  • lastGen0Mints(minter: string): Promise<bigint>
  • Returns the last time an address minted a generation 0 pyro

    Parameters

    • minter: string

      the address which minted

    Returns Promise<bigint>

  • lastPlayed(tokenId: string): Promise<bigint>
  • levelUp(tokenId: string, amount: bigint): Promise<Transaction>
  • Burn MBRS tokens in exchange for levels

    Parameters

    • tokenId: string

      the pyro tokenId

    • amount: bigint

      amount of levels to add

    Returns Promise<Transaction>

  • name(): Promise<string>
  • ownerOf(tokenId: string): Promise<string>
  • pyroGenesisCooldowns(tokenId: string): Promise<bigint>
  • pyroGenesisCosts(tokenId: string): Promise<bigint>
  • Returns the cost for pyrogenesis (stoking)

    Parameters

    • tokenId: string

      the pyro tokenId

    Returns Promise<bigint>

  • pyroLevel(tokenId: string): Promise<bigint>
  • Returns the level of a pyro

    Parameters

    • tokenId: string

      the pyro tokenId

    Returns Promise<bigint>

  • pyros(tokenId: string): Promise<Pyro>
  • safeTransferFrom(from: string, to: string, tokenId: string): Promise<Transaction>
  • Safely transfers tokenId token from from to to, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked.

    Requirements:

    • from cannot be the zero address.
    • to cannot be the zero address.
    • tokenId token must exist and be owned by from.
    • If the caller is not from, it must be have been allowed to move this token by either approve or setApprovalForAll.
    • If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.

    Emits a {Transfer} event.

    Parameters

    • from: string
    • to: string
    • tokenId: string

    Returns Promise<Transaction>

  • safeTransferFromData(from: string, to: string, tokenId: string, data: string): Promise<Transaction>
  • Safely transfers tokenId token from from to to.

    Requirements:

    • from cannot be the zero address.
    • to cannot be the zero address.
    • tokenId token must exist and be owned by from.
    • If the caller is not from, it must be approved to move this token by either approve or setApprovalForAll.
    • If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.

    Emits a {Transfer} event.

    Parameters

    • from: string
    • to: string
    • tokenId: string
    • data: string

    Returns Promise<Transaction>

  • saleAuction(): Promise<string>
  • setApprovalForAll(operator: string, approved: boolean): Promise<Transaction>
  • setName(tokenId: string, name: string): Promise<Transaction>
  • stokeWith(donorA: string, donorB: string): Promise<Transaction>
  • stokingAllowedToAddress(tokenId: string): Promise<string>
  • Returns the address which is allowed to stoke a pyro

    Parameters

    • tokenId: string

      the pyro tokenId

    Returns Promise<string>

  • stokingAuction(): Promise<string>
  • stokingBaseCost(): Promise<bigint>
  • supportsInterface(interfaceId: string): Promise<boolean>
  • symbol(): Promise<string>
  • tokenByIndex(index: bigint): Promise<string>
  • tokenOfOwnerByIndex(owner: string, index: bigint): Promise<string>
  • tokenURI(tokenId: string): Promise<string>
  • totalSupply(): Promise<bigint>
  • transferFrom(from: string, to: string, tokenId: string): Promise<Transaction>
  • Transfers tokenId token from from to to.

    WARNING: Usage of this method is discouraged, use safeTransferFrom whenever possible.

    Requirements:

    • from cannot be the zero address.
    • to cannot be the zero address.
    • tokenId token must be owned by from.
    • If the caller is not from, it must be approved to move this token by either approve or setApprovalForAll.

    Emits a {Transfer} event.

    Parameters

    • from: string
    • to: string
    • tokenId: string

    Returns Promise<Transaction>

Generated using TypeDoc