Documentation ¶
Overview ¶
Package zksync implements transfer operation on ZkSync network.
Index ¶
- Constants
- func TxStateFromZkStatus(status TxStatus) pipelinedb.TxState
- type AccountInfo
- type AccountState
- type Auditor
- type BlockStatus
- type Payer
- func (z Payer) CheckNonceGroup(ctx context.Context, log *zap.Logger, nonceGroup *pipelinedb.NonceGroup, ...) (pipelinedb.TxState, []*pipelinedb.TxStatus, error)
- func (z Payer) CheckPreconditions(ctx context.Context) ([]string, error)
- func (z Payer) CreateRawTransaction(ctx context.Context, log *zap.Logger, payouts []*pipelinedb.Payout, ...) (tx payer.Transaction, from common.Address, err error)
- func (z Payer) GetTokenBalance(ctx context.Context) (*big.Int, error)
- func (z Payer) GetTokenDecimals(ctx context.Context) (int32, error)
- func (z Payer) NextNonce(ctx context.Context) (uint64, error)
- func (z Payer) PrintEstimate(ctx context.Context, remaining int64) error
- func (z Payer) SendTransaction(ctx context.Context, log *zap.Logger, t payer.Transaction) error
- func (z Payer) TxTypeString() string
- type Signature
- type Token
- type Tx
- type TxSignature
- type TxStatus
- type TxWithEthSignature
- type ZkClient
- func (c *ZkClient) Address() (common.Address, error)
- func (c *ZkClient) CreateTransferTx(ctx context.Context, to common.Address, amount *big.Int, fee *big.Int, ...) (TxWithEthSignature, error)
- func (c *ZkClient) CreateTx(ctx context.Context, txType string, to common.Address, amount *big.Int, ...) (TxWithEthSignature, error)
- func (c *ZkClient) GetBalance(ctx context.Context, instrument string) (*big.Int, error)
- func (c *ZkClient) GetFee(ctx context.Context, txType string, address string, instrument string) (*big.Int, error)
- func (c *ZkClient) GetNonce(ctx context.Context) (uint64, error)
- func (c *ZkClient) GetToken(ctx context.Context, symbol string) (Token, error)
- func (c *ZkClient) SubmitTransaction(ctx context.Context, txs TxWithEthSignature) (string, error)
- func (c *ZkClient) Transfer(ctx context.Context, to common.Address, amount *big.Int, fee *big.Int, ...) (string, error)
- func (c *ZkClient) TxStatus(ctx context.Context, txHash string) (TxStatus, error)
Constants ¶
View Source
const EtherSignMessage = "\x19Ethereum Signed Message:\n"
View Source
const ZkSyncMessage = "Access zkSync account.\n\nOnly sign this message for a trusted client!"
Variables ¶
This section is empty.
Functions ¶
func TxStateFromZkStatus ¶
func TxStateFromZkStatus(status TxStatus) pipelinedb.TxState
Types ¶
type AccountInfo ¶
type AccountInfo struct { ID int64 Address string Committed AccountState Verified AccountState }
type AccountState ¶
type Auditor ¶
type Auditor struct {
// contains filtered or unexported fields
}
func (Auditor) CheckConfirmedTransactionState ¶
func (Auditor) CheckTransactionState ¶
type BlockStatus ¶
type Payer ¶
type Payer struct {
// contains filtered or unexported fields
}
func (Payer) CheckNonceGroup ¶
func (z Payer) CheckNonceGroup(ctx context.Context, log *zap.Logger, nonceGroup *pipelinedb.NonceGroup, checkOnly bool) (pipelinedb.TxState, []*pipelinedb.TxStatus, error)
func (Payer) CheckPreconditions ¶
func (Payer) CreateRawTransaction ¶
func (Payer) GetTokenBalance ¶
func (Payer) PrintEstimate ¶
func (Payer) SendTransaction ¶
func (Payer) TxTypeString ¶
type Token ¶
func (Token) MarshalJSON ¶
type Tx ¶
type Tx struct { Type string `json:"type"` AccountID int `json:"accountId"` From common.Address `json:"from"` To common.Address `json:"to"` Token Token `json:"token"` Amount *big.Int `json:"amount"` Fee *big.Int `json:"fee"` Nonce int `json:"nonce"` Signature TxSignature `json:"signature"` }
type TxSignature ¶
type TxStatus ¶
type TxStatus struct { Executed bool Success bool Block BlockStatus }
type TxWithEthSignature ¶
type ZkClient ¶
type ZkClient struct { ChainID int // contains filtered or unexported fields }
func NewZkClient ¶
func NewZkClient(pk *ecdsa.PrivateKey, url string) (ZkClient, error)
func (*ZkClient) CreateTransferTx ¶
func (*ZkClient) GetBalance ¶
func (*ZkClient) SubmitTransaction ¶
Click to show internal directories.
Click to hide internal directories.