Hierarchy (view full)

Constructors

  • Creates a new instance of the DataNftMarket which can be used to interact with the marketplace smart contract

    Parameters

    • env: string

      'devnet' | 'mainnet' | 'testnet'

    • timeout: number = 10000

      Timeout for the network provider (DEFAULT = 10000ms)

    Returns BondContract

Properties

chainID: string
contract: SmartContract
env: string
networkProvider: ApiNetworkProvider

Methods

  • Builds a addPeriodsBonds transaction to set the periods and bonds

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • lockPeriodsWithBonds: {
          amount: Value;
          lockPeriod: number;
      }[]

    Returns Transaction

  • Builds a bond transaction with EGLD transfer

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • originalCaller: IAddress

      the address of the original caller

    • tokenIdentifier: string

      the token identifier of the NFT/SFT

    • nonce: number

      the token identifier nonce

    • lockPeriod: number

      the lock period for the bond

    • payment: Value

      the payment for the bond (tokenIdentifier, nonce and amount)

    Returns Transaction

  • Builds a bond transaction with ESDT transfer

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • originalCaller: IAddress

      the address of the original caller

    • tokenIdentifier: string

      the token identifier of the NFT/SFT

    • nonce: number

      the token identifier nonce

    • lockPeriod: number

      the lock period for the bond

    • payment: {
          amount: Value;
          tokenIdentifier: string;
      }

      the payment for the bond (tokenIdentifier and amount)

      • amount: Value
      • tokenIdentifier: string

    Returns Transaction

  • Builds a bond transaction with NFT/SFT transfer

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • originalCaller: IAddress

      the address of the original caller

    • tokenIdentifier: string

      the token identifier of the NFT/SFT

    • nonce: number

      the token identifier nonce

    • lockPeriod: number

      the lock period for the bond

    • payment: {
          amount: Value;
          nonce: number;
          tokenIdentifier: string;
      }

      the payment for the bond (tokenIdentifier, nonce and amount)

      • amount: Value
      • nonce: number
      • tokenIdentifier: string

    Returns Transaction

  • Builds a bond transaction with no payment

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • originalCaller: IAddress

      the address of the original caller

    • tokenIdentifier: string

      the token identifier of the NFT/SFT

    • nonce: number

      the token identifier nonce

    • lockPeriod: number

      the lock period for the bond

    Returns Transaction

  • Builds a claimRefund transaction

    Parameters

    • senderAddress: IAddress

      address of the sender

    • tokenIdentifier: string

      token identifier of the proven ownership NFT/SFT

    • nonce: number

      nonce of the proven ownership NFT/SFT

    Returns Transaction

  • Returns the contract address

    Returns IAddress

  • Builds a initiateBond transaction to "whitelist" an address for being able to bond for a specific Data NFT

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • address: IAddress

      the address to be whitelisted

    • tokenIdentifier: string

      the token identifier

    • nonce: number

      the token identifier nonce

    Returns Transaction

  • Builds a refund transaction

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • tokenIdentifier: string

      the identifier of the NFT/SFT

    • nonce: number

      the token identifier nonce

    • timestamp: number

      the end timestamp for the proof period for a refund

    Returns Transaction

  • Builds a modifyBond transaction

    Parameters

    • senderAddress: IAddress

      address of the sender (must be the owner of the contract or the administrator)

    • tokenIdentifier: string

      token identifier to modify the bond for

    • nonce: number

      nonce to modify the bond for

    Returns Transaction

  • Builds a proof transaction

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • payment: {
          amount: Value;
          nonce: number;
          tokenIdentifier: string;
      }

      the payment (NFT/SFT) to prove

      • amount: Value
      • nonce: number
      • tokenIdentifier: string

    Returns Transaction

  • Builds a removeAcceptedCallers transaction to remove the accepted callers

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • addresses: IAddress[]

      the addresses to be removed

    Returns Transaction

  • Builds a removeBlacklist transaction to remove addresses from the blacklist

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • compensationId: number

      the compensation id to remove the blacklist from

    • addresses: IAddress[]

      an array of addresses to be removed from the blacklist

    Returns Transaction

  • Builds a removePeriodsBonds transaction to remove the bonds for each of the specified periods

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • periods: number[]

      an array of periods for which the bonds should be removed

    Returns Transaction

  • Builds a renew transaction

    Parameters

    • senderAddress: IAddress

      address of the sender

    • tokenIdentifier: string

      token identifier for the bond to renew

    • nonce: number

      nonce for the bond to renew

    Returns Transaction

  • Builds a sanction transaction

    Parameters

    • senderAddress: IAddress

      address of the sender (must be the owner of the contract or the administrator)

    • tokenIdentifier: string

      token identifier to sanction

    • nonce: number

      nonce to sanction

    • penalty: PenaltyType

      penalty type

    • Optional customPenalty: number

      custom penalty amount (required if penalty is Custom)

    Returns Transaction

  • Builds a setAcceptedCallers transaction to add accepted callers for the bond endpoint

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • addresses: IAddress[]

      an array of addresses to be added as accepted callers for bond endpoint

    Returns Transaction

  • Builds a setAdministrator transaction

    Parameters

    • senderAddress: IAddress

      address of the sender (must be the owner of the contract)

    • newAdministrator: IAddress

      new administrator address

    Returns Transaction

  • Builds a setBlacklist transaction to blacklist addresses

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • compensationId: number
    • addresses: IAddress[]

      an array of addresses to be added to the blacklist

    Returns Transaction

  • Builds a setBondToken transaction to set the bond token

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • tokenIdentifier: string = ...

      the token identifier. If not provided, the default token identifier based on the EnvironmentsEnum

    Returns Transaction

  • Builds a setContractState transaction

    Parameters

    • senderAddress: IAddress

      address of the sender (must be the owner of the contract or the administrator)

    • state: State

      state to set the contract to

    Returns Transaction

  • Builds a setMaximumPenalty transaction to set the maximum penalty

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • penalty: number

      the maximum penalty value to be set

    Returns Transaction

  • Builds a setMinimumPenalty transaction to set the minimum penalty *

    Parameters

    • senderAddress: IAddress

      the address of the sender *

    • penalty: number

      the minimum penalty value to be set

    Returns Transaction

  • Builds a setWithdrawPenalty transaction to set the withdraw penalty

    Parameters

    • senderAddress: IAddress

      the address of the sender

    • penalty: number

      the withdraw penalty value to be set

    Returns Transaction

  • Returns the accepted callers that can bond

    Returns Promise<string[]>

  • Returns a Bond object array for the given address

    Parameters

    • address: IAddress

      address to query

    Returns Promise<Bond[]>

  • Returns an Refund object for the given address

    Parameters

    • address: IAddress

      address to query

    • tokenIdentifier: string

      token identifier to query

    • nonce: number

      nonce to query

    Returns Promise<Refund>

  • Returns an Refund object array for the given address

    Parameters

    • address: IAddress

      address to query

    • compensation_ids: number[]

      compensation ids to query

    Returns Promise<Refund[]>

  • Returns the contract owner address

    Returns Promise<string>

  • Returns a Bond object array

    Returns Promise<Bond[]>

  • Returns a Bond object for the given bondId

    Parameters

    • bondId: number

      bond id to query

    Returns Promise<Bond>

  • Returns the contract bond payment token

    Returns Promise<string>

  • Returns a Bond object array for the given bondIds

    Parameters

    • bondIds: number[]

      Bond ids to query

    Returns Promise<Bond[]>

  • Returns a Bond object array for the given full tokenIdentifier

    Parameters

    • fullTokenIdentifiers: string[]

    Returns Promise<Bond[]>

  • Returns a Bond object array for the given tokenIdentifiers and nonces

    Parameters

    • tokenIdentifiers: string[]
    • nonces: number[]

    Returns Promise<Bond[]>

  • Returns a Compensation object for the given compensation id

    Parameters

    • compensationId: number

      compensation id to query

    Returns Promise<Compensation>

  • Returns a list of addresses that are blacklisted from claiming compensations

    Parameters

    • compensationId: number

      compensaton id to query

    Returns Promise<string[]>

  • Returns a Compensation object array for the given tokens

    Parameters

    • tokens: {
          nonce: number;
          tokenIdentifier: string;
      }[]

      tokens to query

    Returns Promise<Compensation[]>

  • Returns the contract state as a State enum

    Returns Promise<State>

  • Returns the contract lock periods and bond amounts

    Returns Promise<{
        amount: Value;
        lockPeriod: number;
    }[]>

  • Returns a Bond object array for the given indexes

    Parameters

    • startIndex: number
    • endIndex: number

    Returns Promise<Bond[]>

  • Returns a Compensation object array for the given indexes

    Parameters

    • startIndex: number
    • endIndex: number

    Returns Promise<Compensation[]>

  • Returns the total number of bonds

    Returns Promise<number>

  • Returns the total number of compensations

    Returns Promise<number>

  • Builds a withdraw transaction

    Parameters

    • senderAddress: IAddress

      address of the sender

    • tokenIdentifier: string

      token identifier to withdraw the bond for

    • nonce: number

      nonce to withdraw the bond for

    Returns Transaction

Generated using TypeDoc