zkLink X Documentaion
HomeGitHubBlogExplorer
  • 🙂Welcome
    • Introduction
  • ⚖️Architecture
    • Overview
    • Settlement Layer
      • Working Principal of A Multi-Chain ZK-Rollup
      • Nexus: Settlement on ETH L2s
      • Origin: Settlement on ETH and Alt-L1s
      • Multi-Chain State Synchronization
        • In-Detail: Nexus Multi-Chain State Synchronization
      • Supported Networks of zkLink Nexus and Origin
      • Security Assumptions of zkLink Nexus and Origin
    • Execution Layer
      • TS-zkVM for App Rollup
    • Sequencing Layer
    • DA Layer
  • 🛠️Developer
    • Developer Overview
    • Get Started
    • Examples
      • Base Demo
    • JSON RPC & Websocket & Kafka
      • JSON-RPC API
      • JSON-RPC Errors
      • Websocket
      • Kafka
    • Transactions
      • Basic Types
      • State Update
      • Transaction
        • Deposit
        • FullExit
        • ChangePubKey
        • Withdraw
        • Transfer
        • ForcedExit
        • OrderMatching
        • AutoDeleveraging
        • ContractMatching
        • Funding
        • Liquidation
        • UpdateGlobalVar
      • Private Key & Signature
        • Algorithm
        • ChangePubKey
        • Withdraw
        • Transfer
        • ForcedExit
        • OrderMatching
        • ContractMatching
        • Funding
        • Liquidation
        • AutoDeleveraging
        • UpdateGlobalVar
    • SDK
      • Go
        • Types
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
      • Js
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
      • Dart
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
  • ⚙️Network Information
    • Connected Networks
      • Mainnet
      • Testnet
    • DApps & Deployment Addresses
      • Mainnet
      • Testnet
  • Wallet & User Fund Streamline
    • Withdraw
    • Wallet Integration & AA Wallet
    • Deposit
  • Integration Cases
    • Heavyweight Integration (Multi-Chain Derivatives & Spot Exchange)
    • Simple Integration (Multi-Chain Spot Exchange)
  • Appendix
    • Audits
    • FAQ
    • glossary
Powered by GitBook
On this page
  • type AutoDeleveragingBuilder
  • type AutoDeleveraging

Was this helpful?

  1. Developer
  2. SDK
  3. Go
  4. Transactions

AutoDeleveraging

PreviousContractMatchingNextFunding

Last updated 1 year ago

Was this helpful?

type AutoDeleveragingBuilder

type AutoDeleveragingBuilder struct {
	AccountId       AccountId
	SubAccountId    SubAccountId
	SubAccountNonce Nonce
	ContractPrices  []ContractPrice
	MarginPrices    []SpotPriceInfo
	AdlAccountId    AccountId
	PairId          PairId
	AdlSize         BigUint
	AdlPrice        BigUint
	Fee             BigUint
	FeeToken        TokenId
}

Builder that used to build AutoDeleveraging transaction.

type AutoDeleveraging

transaction type, it's a opaque data type.

func NewAutoDeleveraging

func NewAutoDeleveraging(builder AutoDeleveragingBuilder) *AutoDeleveraging

Create a new AutoDeleveraging transaction.

func (*AutoDeleveraging) GetBytes

func (*AutoDeleveraging) GetBytes() []uint8

func (*AutoDeleveraging) TxHash

func (*AutoDeleveraging) TxHash() []uint8

Get the transaction hash of the transaction.

func (*AutoDeleveraging) JsonStr

func (*AutoDeleveraging) JsonStr() string

Get the json string of the transaction.

func (*AutoDeleveraging) IsValid

func (*AutoDeleveraging) IsValid() bool

Check if the transaction is valid.

func (*AutoDeleveraging) CreateSignedTx

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

Create a new AutoDeleveraging transaction with L3 signature inside.

input:

func (*AutoDeleveraging) GetSignature

func (*AutoDeleveraging) GetSignature() ZkLinkSignature

Get L3 signature of the transaction.

func (*AutoDeleveraging) IsSignatureValid

func (*AutoDeleveraging) IsSignatureValid() bool

Check if the inside L3 signature is valid or not.

func *AutoDeleveraging) ToZklinkTx

func (*AutoDeleveraging) ToZklinkTx() ZkLinkTx

Get the encoded bytes to create the L3 signature. See more in

signer:

Change the transaction to the

🛠️
AutoDeleveraging
Private Key and Signature
ZkLinkTx
ZkLinkSigner