Home Reference Source Test
public class | source

HashedTimeLockedContract

Extends:

AccountContract → HashedTimeLockedContract

Static Method Summary

Static Public Methods
public static

create(balance: number, blockHeight: number, transaction: Transaction): *

public static

dataToPlain(data: Uint8Array): object

public static

fromPlain(plain: object): *

public static

proofToPlain(proof: Uint8Array): object

public static
public static

verifyIncomingTransaction(transaction: Transaction): boolean

public static

verifyOutgoingTransaction(transaction: Transaction): boolean

Constructor Summary

Public Constructor
public

constructor(balance: number, sender: Address, recipient: Address, hashRoot: Hash, hashCount: number, timeout: number, totalAmount: number)

Member Summary

Public Members
public get

hashCount: number

public get
public get
public get
public get

serializedSize: number: *

public get

timeout: number

public get

totalAmount: number

Method Summary

Public Methods
public

equals(o: Account): boolean

Check if two Accounts are the same.

public

Serialize this HTLC object into binary form.

public

toPlain(): object

public

toString(): string

public

withBalance(balance: number): Account | *

public

withIncomingTransaction(transaction: Transaction, blockHeight: number, revert: boolean): Account

public

withOutgoingTransaction(transaction: Transaction, blockHeight: number, transactionsCache: TransactionCache, revert: boolean): Account | *

Inherited Summary

From class Account
public static

dataToPlain(data: Uint8Array): object

public static

fromAny(o: Account | object): *

public static

fromPlain(plain: object): Account

public static

proofToPlain(proof: Uint8Array): object

public static

Create Account object from binary form.

public get

balance: number

public get

serializedSize: number: *

public get

type: Account.Type

public

equals(o: Account): boolean

Check if two Accounts are the same.

public

isInitial(): boolean

public

isToBePruned(): boolean

public

Serialize this Account object into binary form.

public

toPlain(): object

public

toString(): string

public

withBalance(balance: number): Account | *

public

withContractCommand(transaction: Transaction, blockHeight: number, revert: boolean): Account

public

withIncomingTransaction(transaction: Transaction, blockHeight: number, revert: boolean): Account

public

withOutgoingTransaction(transaction: Transaction, blockHeight: number, transactionsCache: TransactionCache, revert: boolean): Account

From class Contract
public static

verifyIncomingTransaction(transaction: Transaction): boolean

public

withContractCommand(transaction: Transaction, blockHeight: number, revert: boolean): Account

public

withIncomingTransaction(transaction: Transaction, blockHeight: number, revert: boolean): Account

Static Public Methods

public static create(balance: number, blockHeight: number, transaction: Transaction): * source

Params:

NameTypeAttributeDescription
balance number
blockHeight number
transaction Transaction

Return:

*

public static dataToPlain(data: Uint8Array): object source

Override:

Account#dataToPlain

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

object

public static fromPlain(plain: object): * source

Override:

Account#fromPlain

Params:

NameTypeAttributeDescription
plain object

Return:

*

public static proofToPlain(proof: Uint8Array): object source

Override:

Account#proofToPlain

Params:

NameTypeAttributeDescription
proof Uint8Array

Return:

object

public static unserialize(buf: SerialBuffer): HashedTimeLockedContract source

Create Account object from binary form.

Override:

Account#unserialize

Params:

NameTypeAttributeDescription
buf SerialBuffer

public static verifyIncomingTransaction(transaction: Transaction): boolean source

Override:

Contract#verifyIncomingTransaction

Params:

NameTypeAttributeDescription
transaction Transaction

Return:

boolean

public static verifyOutgoingTransaction(transaction: Transaction): boolean source

Params:

NameTypeAttributeDescription
transaction Transaction

Return:

boolean

Public Constructors

public constructor(balance: number, sender: Address, recipient: Address, hashRoot: Hash, hashCount: number, timeout: number, totalAmount: number) source

Override:

Contract#constructor

Params:

NameTypeAttributeDescription
balance number
sender Address
recipient Address
hashRoot Hash
hashCount number
timeout number
totalAmount number

Public Members

public get hashCount: number source

public get hashRoot: Hash source

public get recipient: Address source

public get sender: Address source

public get serializedSize: number: * source

Override:

Account#serializedSize

Return:

number

public get timeout: number source

public get totalAmount: number source

Public Methods

public equals(o: Account): boolean source

Check if two Accounts are the same.

Override:

Account#equals

Params:

NameTypeAttributeDescription
o Account

Object to compare with.

Return:

boolean

Set if both objects describe the same data.

public serialize(buf: SerialBuffer): SerialBuffer source

Serialize this HTLC object into binary form.

Override:

Account#serialize

Params:

NameTypeAttributeDescription
buf SerialBuffer
  • optional
  • nullable: true

Buffer to write to.

Return:

SerialBuffer

Buffer from buf or newly generated one.

public toPlain(): object source

Override:

Account#toPlain

Return:

object

public toString(): string source

Override:

Account#toString

Return:

string

public withBalance(balance: number): Account | * source

Override:

Account#withBalance

Params:

NameTypeAttributeDescription
balance number

Return:

Account | *

public withIncomingTransaction(transaction: Transaction, blockHeight: number, revert: boolean): Account source

Override:

Contract#withIncomingTransaction

Params:

NameTypeAttributeDescription
transaction Transaction
blockHeight number
revert boolean
  • optional

Return:

Account

public withOutgoingTransaction(transaction: Transaction, blockHeight: number, transactionsCache: TransactionCache, revert: boolean): Account | * source

Override:

Account#withOutgoingTransaction

Params:

NameTypeAttributeDescription
transaction Transaction
blockHeight number
transactionsCache TransactionCache
revert boolean
  • optional

Return:

Account | *