Liquidation

type LiquidationBuilder

type LiquidationBuilder struct {
    AccountId            AccountId
    SubAccountId         SubAccountId
    SubAccountNonce      Nonce
    ContractPrices       []ContractPrice
    MarginPrices         []SpotPriceInfo
    LiquidationAccountId AccountId
    Fee                  BigUint
    FeeToken             TokenId
}

The builder used to create the Liquidation transaction.

type Liquidation

Liquidation transaction type, it's a opaque data type.

func NewLiquidation(builder LiquidationBuilder)

func NewLiquidation(builder LiquidationBuilder) *Liquidation

Create a new Liquidation transaction.

func (*Liquidation) GetBytes

func (*Liquidation) GetBytes() []uint8

Get the encoded bytes to create the L3 signature. See more in Private Key and Signature

func (*Liquidation) TxHash

func (*Liquidation) TxHash() []uint8

Get the transaction hash of the transaction.

func (*Liquidation) JsonStr

func (*Liquidation) JsonStr() string

Get the json string of the transaction.

func (*Liquidation) IsValid

func (*Liquidation) IsValid() bool

Check if the transaction is valid.

func (*Liquidation) CreateSignedTx

func (*Liquidation) CreateSignedTx(signer *ZkLinkSigner) (*Liquidation, error)

Create a new Liquidation transaction with L3 signature inside. input:

func (*Liquidation) GetSignature

func (*Liquidation) GetSignature() ZkLinkSignature

Get L3 signature of the transaction.

func (*Liquidation) IsSignatureValid

func (*Liquidation) IsSignatureValid() bool

Check if the inside L3 signature is valid or not.

func (*Liquidation) ToZklinkTx

func (*Liquidation) ToZklinkTx() ZkLinkTx

Change the transaction to the ZkLinkTx

Last updated