Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LegacyTurtleCoind

A class interface that allows for easy interaction with Legacy TurtleCoind THIS OBJECT IS DEPRECATED AND SUBJECT TO REMOVAL WITH LITTLE NOTICE

Hierarchy

  • HTTPClient
    • LegacyTurtleCoind

Implements

Index

Constructors

constructor

  • new LegacyTurtleCoind(host?: string, port?: number, timeout?: number, ssl?: boolean, userAgent?: string, keepAlive?: boolean, apiKey?: undefined | string, errorHandler?: undefined | ((statusCode: number, error: IError) => Error)): LegacyTurtleCoind
  • Parameters

    • Default value host: string = "127.0.0.1"
    • Default value port: number = 11898
    • Default value timeout: number = 30000
    • Default value ssl: boolean = false
    • Default value userAgent: string = format('%s/%s', packageInfo.name, packageInfo.version)
    • Default value keepAlive: boolean = true
    • Optional apiKey: undefined | string
    • Optional errorHandler: undefined | ((statusCode: number, error: IError) => Error)

    Returns LegacyTurtleCoind

Methods

block

  • block(block: string | number): Promise<IBlock>
  • Retrieves the block information for the specified block Requires the daemon to have the explorer enabled

    Parameters

    • block: string | number

      the block height or hash

    Returns Promise<IBlock>

blockCount

  • blockCount(): Promise<number>

blockHeaders

  • blockHeaders(height: number): Promise<IBlock[]>
  • Retrieves the block information for the last 30 blocks up to the current height Requires the daemon to have the explorer enabled

    Parameters

    • height: number

      the height to stop at

    Returns Promise<IBlock[]>

blockTemplate

  • blockTemplate(address: string, reserveSize?: number): Promise<IBlockTemplate>
  • Retrieves a mining block template using the specified address and reserve size

    Parameters

    • address: string

      the wallet address that will receive the coinbase outputs

    • Default value reserveSize: number = 8

      the amount of data to reserve in the miner transaction

    Returns Promise<IBlockTemplate>

fee

  • fee(): Promise<IFee>

height

indexes

  • Retrieves the global indexes for all transactions contained within the blocks heights specified (non-inclusive)

    Parameters

    • startHeight: number

      the starting block height

    • endHeight: number

      the ending block height

    Returns Promise<ITransactionIndexes[]>

info

lastBlock

  • lastBlock(): Promise<IBlock>

peers

randomIndexes

  • randomIndexes(amounts: number[], count: number): Promise<IRandomOutput[]>
  • Retrieves random global indexes typically used for mixing operations for the specified amounts and for the number requested (if available)

    Parameters

    • amounts: number[]

      an array of amounts for which we need random global indexes

    • count: number

      the number of global indexes to return for each amount

    Returns Promise<IRandomOutput[]>

rawBlock

  • rawBlock(block: string | number): Promise<IRawBlock>
  • Retrieves the RawBlock information from the node for the specified block Requires the daemon to have the explorer enabled

    Parameters

    • block: string | number

      the block height or hash

    Returns Promise<IRawBlock>

rawSync

  • rawSync(checkpoints?: string[], height?: number, timestamp?: number, skipCoinbaseTransactions?: boolean, count?: number): Promise<IRawSync>
  • Retrieves the RawBlocks & RawTransactions for syncing a wallet (or other utility) against the node

    Parameters

    • Default value checkpoints: string[] = []

      a list of block hashes that we know about in descending height order

    • Default value height: number = 0

      the height to start syncing from

    • Default value timestamp: number = 0

      the timestamp to start syncing from

    • Default value skipCoinbaseTransactions: boolean = false

      whether we should skip blocks that only include coinbase transactions

    • Default value count: number = 100

      the number of blocks to return

    Returns Promise<IRawSync>

rawTransaction

  • rawTransaction(hash: string): Promise<string>
  • Retrieves the RawTransaction from the node for the specified transaction Requires the daemon to have the explorer enabled

    Parameters

    • hash: string

      the transaction hash

    Returns Promise<string>

rawTransactionPool

  • rawTransactionPool(): Promise<string[]>
  • Retrieves the RawTransactions currently in the memory pool Requires the daemon to have the explorer enabled

    Returns Promise<string[]>

submitBlock

  • submitBlock(block: string): Promise<string>
  • Submits a block to the node for processing

    Parameters

    • block: string

      the hex representation of the block

    Returns Promise<string>

submitTransaction

  • submitTransaction(transaction: string): Promise<string>
  • Submits a transaction to the node for processing

    Parameters

    • transaction: string

      the hex representation of the transaction

    Returns Promise<string>

sync

  • sync(checkpoints?: string[], height?: number, timestamp?: number, skipCoinbaseTransactions?: boolean, count?: number): Promise<ISync>
  • Retrieves the information necessary for syncing a wallet (or other utility) against the node

    Parameters

    • Default value checkpoints: string[] = []

      a list of block hashes that we know about in descending height order

    • Default value height: number = 0

      the height to start syncing from

    • Default value timestamp: number = 0

      the timestamp to start syncing from

    • Default value skipCoinbaseTransactions: boolean = false

      whether we should skip blocks that only include coinbase transactions

    • Default value count: number = 100

      the number of blocks to return

    Returns Promise<ISync>

transaction

  • Retrieves the transaction information for the specified transaction Requires the daemon to have the explorer enabled

    Parameters

    • hash: string

      the transaction hash

    Returns Promise<ITransaction>

transactionPool

transactionPoolChanges

  • transactionPoolChanges(lastKnownBlock: string, transactions?: string[]): Promise<ITransactionPoolDelta>
  • Gets the transaction memory pool changes given the last known block hash and the transactions we last knew to be in the memory pool

    Parameters

    • lastKnownBlock: string

      the last known block hash

    • Default value transactions: string[] = []

      an array of transaction hashes we last saw in the memory pool

    Returns Promise<ITransactionPoolDelta>

transactionsStatus

Generated using TypeDoc