ContractMatching
type ContractBuilder
Builder used to build Contract
type Contract
The Contract struct of taker and maker in perpetual contract, it's a opaque data type.
func NewContract
Create a new Contract.
func (*Contract) IsLong
Return true if the contract opens a long position.
func (*Contract) IsShort
Return true if the contract opens a short position.
func (*Contract) GetSignature
Get the L3 signature of the contract.
func (*Contract) IsSignatureValid
Check if the signature is valid or not.
func (*Contract) GetBytes
Get the encoded bytes that used to create the L3 signature.
func (*Contract) CreateSignedContract
Create a new contract with L3 signature.
input:
zklinkSigner: zklinkSigner
type ContractMatchingBuilder
type ContractMatching
The ContractMatching transaction in perpetual contract, it's a opaque data type.
NewContractMatching(builder ContractMatchingBuilder)
Create a new ContractMatching transaction.
func (*ContractMatching) GetBytes
Get the encoded bytes that used to create the L3 signature. See more in Private Key and Signature.
func (*ContractMatching) TxHash
Get the transaction hash of the transaction.
func (*ContractMatching) JsonStr
Get the json string of the the transaction.
func (*ContractMatching) IsValid
Check if the transaction is valid or not.
func (*ContractMatching) CreateSignedTx
Create a new transaction with L3 signature.
input:
signer: ZkLinkSigner
func (*ContractMatching) GetSignature
Get the L3 signature of the transaction.
func (*ContractMatching) IsSignatureValid
Check if the inside L3 signature is valid or not.
func (*ContractMatching) ToZklinkTx
Change the transaction to the ZkLinkTx
Last updated