Skip to content

@props-labs/fuelsDocs


@props-labs/fuels / Edition

Class: Edition

Represents an edition within the Props SDK.

Extends

  • PropsContract

Constructors

new Edition()

new Edition(id, contract?, account?, metadata?): Edition

Creates a new instance of the Edition class.

Parameters

id: string

The ID of the edition.

contract?: Props721EditionContract

Optional contract associated with the edition.

account?: Account

Optional account associated with the edition.

metadata?: NFTMetadata

Metadata associated with the edition.

Returns

Edition

Overrides

PropsContract.constructor

Defined in

edition/edition.ts:27

Properties

account?

optional account: Account

Optional account associated with the contract.

Inherited from

PropsContract.account

Defined in

contract/contract.ts:24


contract?

optional contract: Props721EditionContract | Props721CollectionContract

Optional contract associated with the contract.

Inherited from

PropsContract.contract

Defined in

contract/contract.ts:19


id

id: string

The ID of the contract.

Inherited from

PropsContract.id

Defined in

contract/contract.ts:14


metadata?

optional metadata: NFTMetadata

Metadata associated with the edition.

Defined in

edition/edition.ts:18

Methods

airdrop()

airdrop(to, amount): Promise<Error | MintResult>

Airdrops tokens to multiple addresses.

Parameters

to: string

The address to mint tokens to.

amount: number

The amount of tokens to mint.

Returns

Promise<Error | MintResult>

A promise that resolves with the airdrop result.

Throws

If the airdrop process fails.

Inherited from

PropsContract.airdrop

Defined in

contract/contract.ts:179


connect()

connect(account): void

Connects an account to the edition, replacing the current account.

Parameters

account: Account

The account to connect.

Returns

void

Defined in

edition/edition.ts:41


emit()

emit(event, ...args): void

Parameters

event: string

• ...args: any[]

Returns

void

Inherited from

PropsContract.emit

Defined in

core/events.ts:102


getAllowlistAllocationByAddress()

getAllowlistAllocationByAddress(address): Promise<number>

Represents the allowlist allocation for an address.

Parameters

address: string

The address to get the allocation for.

Returns

Promise<number>

A promise that resolves to the allocation amount for the address.

Throws

If the contract or account is not connected, or if the fetch or JSON parsing fails.

Inherited from

PropsContract.getAllowlistAllocationByAddress

Defined in

contract/contract.ts:128


getMaxSupply()

getMaxSupply(): Promise<number>

Get the maximum supply of the collection.

Returns

Promise<number>

A promise that resolves to the maximum supply.

Inherited from

PropsContract.getMaxSupply

Defined in

contract/contract.ts:227


getTotalAssets()

getTotalAssets(): Promise<number>

Get the total number of assets in the collection.

Returns

Promise<number>

A promise that resolves to the total number of assets.

Inherited from

PropsContract.getTotalAssets

Defined in

contract/contract.ts:211


mint()

mint(to, amount, affiliate?, price?, fees?): Promise<Error | MintResult>

Mints a specified amount of tokens to a given address.

Parameters

to: string

The address to mint tokens to.

amount: number

The amount of tokens to mint.

affiliate?: string

price?: BN

fees?: BN[]

Returns

Promise<Error | MintResult>

A promise that resolves when the tokens have been minted.

Throws

If the minting process fails.

Defined in

edition/edition.ts:52


on()

on(event, listener): void

Parameters

event: string

listener

Returns

void

Inherited from

PropsContract.on

Defined in

core/events.ts:95


removeAllListeners()

removeAllListeners(event?): void

Parameters

event?: string

Returns

void

Inherited from

PropsContract.removeAllListeners

Defined in

core/events.ts:116


removeListener()

removeListener(event, listener): void

Parameters

event: string

listener

Returns

void

Inherited from

PropsContract.removeListener

Defined in

core/events.ts:108


setAllowlist()

setAllowlist(root, uri): Promise<void>

Sets the allowlist for the contract by setting the Merkle root and URI.

Parameters

root: string

The Merkle root to set.

uri: string

The Merkle URI to set.

Returns

Promise<void>

A promise that resolves when the allowlist has been set.

Throws

If the contract or account is not connected, or if the set_merkle function fails.

Inherited from

PropsContract.setAllowlist

Defined in

contract/contract.ts:62


setDates()

setDates(startDate, endDate): Promise<void>

Sets the start and end dates for the contract.

Parameters

startDate: number

The start date for the contract as a Unix timestamp in milliseconds.

endDate: number

The end date for the contract as a Unix timestamp in milliseconds.

Returns

Promise<void>

A promise that resolves when the dates are set.

Throws

If the contract or account is not connected, or if the transaction fails.

Inherited from

PropsContract.setDates

Defined in

contract/contract.ts:142


createAllowlist()

static createAllowlist(entries): object

Creates an allowlist for a given set of addresses and amounts.

Parameters

entries: AllowListInput

The entries to include in the allowlist.

Returns

object

An object containing the Merkle root and the allowlist with proofs.

allowlist

allowlist: Allowlist

root

root: string

Inherited from

PropsContract.createAllowlist

Defined in

contract/contract.ts:48


fromContractIdAndWallet()

static fromContractIdAndWallet(contractId, wallet, loadMetadata): Promise<Edition>

Static method to create an Edition instance based on a contractId and a wallet.

Parameters

contractId: string

The ID of the contract.

wallet: Account

The wallet to connect.

loadMetadata: boolean = true

Returns

Promise<Edition>

A promise that resolves to an Edition instance.

Defined in

edition/edition.ts:176