ChangePubKey
Type Create2Data
type Create2Data struct {
CreatorAddress ZkLinkAddress
SaltArg H256
CodeHash H256
}
Type ChangePubKeyAuthDataEthCreate2
type ChangePubKeyAuthDataEthCreate2 struct {
Data Create2Data
}
Type ChangePubKeyAuthDataEthEcdsa
type ChangePubKeyAuthDataEthEcdsa struct {
EthSignature PackedEthSignature
}
Type ChangePubKeyAuthDataOnchain
type ChangePubKeyAuthDataOnchain struct {}
func CreateSignedChangePubkey
func CreateSignedChangePubkey(zklinkSigner *ZkLinkSigner, tx *ChangePubKey, ethAuthData ChangePubKeyAuthData) (*ChangePubKey, error)
Create a signed ChangePubkey
input:
zklinkSigner: zklink signer
tx: unsigned transaction ChangePubkey
ethAuthData:
ChangePubKeyAuthData
is a interface which can be ChangePubKeyAuthDataOnchain, ChangePubKeyAuthDataEthCreate2 or ChangePubKeyAuthDataEthEcdsa
type ChangePubKeyBuilder
The ChangePubKeyBuilder is used to build the type ChangePubKey
type ChangePubKeyBuilder struct {
ChainId ChainId
AccountId AccountId
SubAccountId SubAccountId
NewPubkeyHash PubKeyHash
FeeToken TokenId
Fee BigUint
Nonce Nonce
EthSignature *PackedEthSignature
Timestamp TimeStamp
}
type ChangePubKey
ChangePubkey transaction type, it's a opaque data type.
func NewChangePubKey
Create a ChangePubkey
func NewChangePubKey(builder ChangePubKeyBuilder) *ChangePubKey
input:
builder: ChangePubKeyBuilder
func (*ChangePubKey) GetSignature
func (*ChangePubKey) GetSignature() ZkLinkSignature
Get the L3 signature of the ChangePubKey
func (*ChangePubKey) GetBytes
func (*ChangePubKey) GetBytes() []uint8
Get the encoded bytes of ChangePubKey, which is used to create the L3 signature.
func (*ChangePubKey) TxHash
func (*ChangePubKey) TxHash() []uint8
Get the Transaction Hash of ChangePubKey
func (*ChangePubKey) JsonStr
func (*ChangePubKey) JsonStr() string
Get the json str of ChangePubKey
func (*ChangePubKey) IsValid
func (*ChangePubKey) IsValid() bool
Check if all the fields in ChangePubKey are valid. For example, if the ChainId
is exceeded the maximum ChainId, it will return false.
func (*ChangePubKey) IsOnchain
func (*ChangePubKey) IsOnchain() bool
Check if the transaction's auth data is OnChain.
func (*ChangePubKey) IsSignatureValid
func (*ChangePubKey) IsSignatureValid() bool
Check if the L3 signature is valid or not.
func (*ChangePubKey) SubmitterSignature
func (*ChangePubKey) SubmitterSignature(signer *ZkLinkSigner) (ZkLinkSignature, error)
Create the submitter signature.
input:
signer: ZkLinkSigner
func (*ChangePubKey) ToZklinkTx
func (*ChangePubKey) ToZklinkTx() ZkLinkTx
Change the ChangePubKey transaction type to ZkLinkTx type.
Last updated
Was this helpful?