Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IDO

Hierarchy

  • Tx
    • IDO

Index

Constructors

constructor

  • new IDO(idoProgramAddress?: string, spltProgramAddress?: string, splataProgramAddress?: string, nodeUrl: string): IDO
  • Parameters

    • idoProgramAddress: string = ...
    • spltProgramAddress: string = ...
    • splataProgramAddress: string = ...
    • nodeUrl: string

    Returns IDO

Properties

connection

connection: Connection

idoProgramId

idoProgramId: PublicKey

nodeUrl

nodeUrl: string

splataProgramId

splataProgramId: PublicKey

spltProgramId

spltProgramId: PublicKey

Methods

collect

  • collect(amount: bigint, idoAddress: string, wallet: WalletInterface): Promise<{ dstAddress: string; txId: string }>
  • Collect being-raised tokens from the pool (The action must be done after the IDO ends)

    remarks

    IDO owner only

    Parameters

    Returns Promise<{ dstAddress: string; txId: string }>

    Transaction hash txId and the associated address dstAddress that receives the being-sold tokens

deriveTicketAddress

  • deriveTicketAddress(ownerAddress: string, idoAddress: string): Promise<string>
  • Derive ticket address

    Parameters

    • ownerAddress: string

      Owner address of the ticket account

    • idoAddress: string

      Corresponding ido address to the ticket account

    Returns Promise<string>

    Ticket account address

getIDOData

  • getIDOData(idoAddress: string): Promise<IDOData>
  • Get ido data

    Parameters

    • idoAddress: string

      IDO account address

    Returns Promise<IDOData>

    Readable json data respect to FARM_SCHEMA

getTicketData

  • getTicketData(ticketAddress: string): Promise<TicketData>
  • Get ticket data

    Parameters

    • ticketAddress: string

      Ticket account address

    Returns Promise<TicketData>

    Readable json data respect to FARM_SCHEMA

initializeIDO

  • initializeIDO(amount: bigint, startdate: bigint, middledate: bigint, enddate: bigint, redeemdate: bigint, soldMintAddress: string, raisedMintAddress: string, wallet: WalletInterface): Promise<{ idoAddress: string; txId: string }>
  • Initialize an IDO

    Parameters

    • amount: bigint

      The number of being-sold tokens in the IDO

    • startdate: bigint

      Start date of IDO

    • middledate: bigint

      The end of phase #1 and start of phase #2

    • enddate: bigint

      -End of the IDO

    • redeemdate: bigint

      The unlock date that users can redeem the being-sold tokens

    • soldMintAddress: string

      Mint address for selling

    • raisedMintAddress: string

      Mint address for raising

    • wallet: WalletInterface

    Returns Promise<{ idoAddress: string; txId: string }>

    Transaction hash txId and IDO address idoAddress

initializeTicket

  • initializeTicket(idoAddress: string, wallet: WalletInterface): Promise<{ ticketAddress: string; txId: string }>
  • Initialize a ticket

    Parameters

    Returns Promise<{ ticketAddress: string; txId: string }>

    Transaction hash txId and ticket address ticketAddress

parseIDOData

  • parseIDOData(data: Buffer): IDOData

parseTicketData

redeem

  • redeem(idoAddress: string, wallet: WalletInterface): Promise<{ dstAddress: string; txId: string }>
  • Redeem being-sold tokens from the pool (The action must be done after the IDO ends)

    Parameters

    Returns Promise<{ dstAddress: string; txId: string }>

    Transaction hash txId and the associated address dstAddress that receives the being-sold tokens

seed

  • seed(amount: bigint, idoAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Seed more being-sold tokens into the pool (The action must be done before the IDO starts)

    remarks

    IDO owner only

    Parameters

    Returns Promise<{ txId: string }>

    Transaction hash txId

stake

  • stake(amount: bigint, idoAddress: string, wallet: WalletInterface): Promise<{ ticketAddress: string; txId: string }>
  • Stake being-raised tokens into the pool (The action must be done during the phase #1 of the IDO only)

    Parameters

    Returns Promise<{ ticketAddress: string; txId: string }>

    Transaction hash txId and ticket address ticketAddress

transferIDOOwnership

  • transferIDOOwnership(idoAddress: string, newOwnerAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Transfer ido's ownership

    remarks

    IDO owner only

    Parameters

    Returns Promise<{ txId: string }>

    Transaction hash txId

unseed

  • unseed(amount: bigint, idoAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Unseed less being-sold tokens from the pool (The action must be done before the IDO starts)

    remarks

    IDO owner only

    Parameters

    Returns Promise<{ txId: string }>

    Transaction hash txId

unstake

  • unstake(amount: bigint, idoAddress: string, wallet: WalletInterface): Promise<{ ticketAddress: string; txId: string }>
  • Unstake being-raised tokens from the pool (The action must be done during both the phase #1 and #2 of the IDO)

    Parameters

    Returns Promise<{ ticketAddress: string; txId: string }>

    Transaction hash txId and ticket address ticketAddress

unwatch

  • unwatch(watchId: number): Promise<void>
  • Unwatch a watcher by watch id

    Parameters

    • watchId: number

      The watchId was returned by watch function.

    Returns Promise<void>

watch

Generated using TypeDoc