Documentation
¶
Index ¶
- Constants
- func GetAddress(ethPrivKeyHex string) (string, error)
- func GetPubKeyHash(ethPrivKeyHex string, chainId int) (string, error)
- type ChangePubKey
- type ChangePubKeyAuthType
- type ChangePubKeyCREATE2
- type ChangePubKeyECDSA
- type ChangePubKeyOnchain
- type ChangePubKeyVariant
- type SignTransfer
- type Signature
- type SignedTransaction
- type TransactionTypeChangePubKey
- type Transfer
- type ZkSigner
Constants ¶
View Source
const ( TransactionTypeChangePubKeyOnchain core.TransactionType = "Onchain" TransactionTypeChangePubKeyECDSA core.TransactionType = "ECDSA" TransactionTypeChangePubKeyCREATE2 core.TransactionType = "CREATE2" )
View Source
const ( Message = "Access ZKSwap account.\n\nOnly sign this message for a trusted client!" TransactionVersion byte = 0x01 )
View Source
const (
TransactionTypeTransfer core.TransactionType = "Transfer"
)
Variables ¶
This section is empty.
Functions ¶
func GetAddress ¶
Types ¶
type ChangePubKey ¶
type ChangePubKey struct {
Type string `json:"type"`
AccountId uint32 `json:"accountId"`
Account string `json:"account"`
NewPkHash string `json:"newPkHash"`
Nonce uint32 `json:"nonce"`
EthSignature string `json:"ethSignature"`
}
func CreateChangePubKeyTx ¶
func (*ChangePubKey) GetTxHash ¶
func (t *ChangePubKey) GetTxHash() (string, error)
type ChangePubKeyAuthType ¶
type ChangePubKeyAuthType string
const ( ChangePubKeyAuthTypeOnchain ChangePubKeyAuthType = `Onchain` ChangePubKeyAuthTypeECDSA ChangePubKeyAuthType = `ECDSA` ChangePubKeyAuthTypeCREATE2 ChangePubKeyAuthType = `CREATE2` )
type ChangePubKeyCREATE2 ¶
type ChangePubKeyCREATE2 struct {
Type ChangePubKeyAuthType `json:"type"`
CreatorAddress string `json:"creatorAddress"`
SaltArg string `json:"saltArg"`
CodeHash string `json:"codeHash"`
}
type ChangePubKeyECDSA ¶
type ChangePubKeyECDSA struct {
Type ChangePubKeyAuthType `json:"type"`
EthSignature string `json:"ethSignature"`
BatchHash string `json:"batchHash"`
}
type ChangePubKeyOnchain ¶
type ChangePubKeyOnchain struct {
Type ChangePubKeyAuthType `json:"type"`
}
type ChangePubKeyVariant ¶
type ChangePubKeyVariant interface {
// contains filtered or unexported methods
}
type SignTransfer ¶
type SignTransfer struct {
Type string `json:"type"`
AccountId uint32 `json:"accountId"`
From string `json:"from"`
To string `json:"to"`
TokenId uint16 `json:"token"`
Amount string `json:"amount"`
FeeTokenId uint8 `json:"feeToken"`
Fee string `json:"fee"`
ChainId uint8 `json:"chainId"`
Nonce uint32 `json:"nonce"`
Signature *Signature `json:"signature"`
}
func CreateSignTransferTx ¶
func CreateSignTransferTx(tx *Transfer) SignTransfer
type SignedTransaction ¶
type SignedTransaction struct {
Transaction SignTransfer `json:"tx"`
EthereumSignature *core.EthSignature `json:"signature"`
}
type TransactionTypeChangePubKey ¶
type TransactionTypeChangePubKey struct {
ChangePubKey string `json:"ChangePubKey"`
}
type Transfer ¶
type Transfer struct {
Type string `json:"type"`
AccountId uint32 `json:"accountId"`
From string `json:"from"`
To string `json:"to"`
TokenId uint16 `json:"token"`
Amount *big.Int `json:"amount"`
FeeTokenId uint8 `json:"feeToken"`
Fee *big.Int `json:"fee"`
ChainId uint8 `json:"chainId"`
Nonce uint32 `json:"nonce"`
Signature *Signature `json:"signature"`
}
func CreateTransferTx ¶
type ZkSigner ¶
type ZkSigner struct {
// contains filtered or unexported fields
}
func NewZkSignerFromSeed ¶
func (*ZkSigner) GetPrivateKey ¶
func (*ZkSigner) GetPublicKey ¶
func (*ZkSigner) GetPublicKeyHash ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.