Documentation
¶
Index ¶
- func CreateHermezAuthSignature(ethPk *ecdsa.PrivateKey, ethAccount accounts.Account, ...) (string, error)
- func FromBJJPubKeyCompToHezBJJAddress(pkComp babyjub.PublicKeyComp) (string, error)
- type Account
- type AccountAPIResponse
- type AccountCreation
- type BJJWallet
- func CreateBJJWalletFromSignedMsg(signedMsg []byte) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
- func CreateBjjWalletFromHexPvtKey(hexPvtKey string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
- func CreateBjjWalletFromMnemonic(mnemonic string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
- func CreateBjjWalletWithAccCreationSignatureFromHexPvtKey(hexPvtKey string, chainID int, rollupContractAddress string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
- func CreateBjjWalletWithAccCreationSignatureFromPvtKey(ecdsaPvtKey *ecdsa.PrivateKey, chainID int, rollupContractAddress string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHermezAuthSignature ¶ added in v0.1.4
func CreateHermezAuthSignature(ethPk *ecdsa.PrivateKey, ethAccount accounts.Account, bjjPubKeyComp babyjub.PublicKeyComp, chainID int, rollupContract common.Address) (string, error)
CreateHermezAuthSignature creates the hermez wallet authentication signature
func FromBJJPubKeyCompToHezBJJAddress ¶
func FromBJJPubKeyCompToHezBJJAddress(pkComp babyjub.PublicKeyComp) (string, error)
FromBJJPubKeyCompToHezBJJAddress creates a Hermez BJJ account from a BJJ PubKey Compressed
Types ¶
type AccountAPIResponse ¶
type AccountAPIResponse struct { Accounts []Account `json:"accounts"` PendingItems int `json:"pendingItems"` }
func GetAccountInfo ¶
func GetAccountInfo(hezClient client.HermezClient, account string) (hezAccount AccountAPIResponse, err error)
GetAccountInfo connects to a hermez node and pull account data
type AccountCreation ¶ added in v0.1.4
type AccountCreation struct { EthereumAddress string `json:"hezEthereumAddress"` HezBjjAddress string `json:"bjj"` Signature string `json:"signature"` }
AccountCreation is used to submit new account creation to a Hermez Node
type BJJWallet ¶
type BJJWallet struct { PrivateKey babyjub.PrivateKey PublicKey babyjub.PublicKeyComp HezBjjAddress string EthAccount accounts.Account HezEthAddress string AccountCreationAuthSignature string }
BJJWallet BJJ Wallet
func CreateBJJWalletFromSignedMsg ¶
func CreateBJJWalletFromSignedMsg(signedMsg []byte) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
CreateBJJWalletFromSignedMsg creates BJJWallet from signed hermez standard message to generate account
func CreateBjjWalletFromHexPvtKey ¶
func CreateBjjWalletFromHexPvtKey(hexPvtKey string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
CreateBjjWalletFromHexPvtKey Create a Babyjubjub Wallet from Hexdecimal Private Key
func CreateBjjWalletFromMnemonic ¶
func CreateBjjWalletFromMnemonic(mnemonic string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
CreateBjjWalletFromMnemonic Create a Babyjubjub Wallet from Mnemonic
func CreateBjjWalletWithAccCreationSignatureFromHexPvtKey ¶ added in v0.1.4
func CreateBjjWalletWithAccCreationSignatureFromHexPvtKey(hexPvtKey string, chainID int, rollupContractAddress string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
CreateBjjWalletWithAccCreationSignatureFromHexPvtKey Create a Babyjubjub Wallet from Hexdecimal Private Key with hermez account creation signature
func CreateBjjWalletWithAccCreationSignatureFromPvtKey ¶ added in v0.1.6
func CreateBjjWalletWithAccCreationSignatureFromPvtKey(ecdsaPvtKey *ecdsa.PrivateKey, chainID int, rollupContractAddress string) (bjjWallet BJJWallet, ethAccount accounts.Account, err error)
CreateBjjWalletWithAccCreationSignatureFromPvtKey Create a Babyjubjub Wallet from Hexdecimal Private Key with hermez account creation signature
type Token ¶
type Token struct { USD float64 `json:"USD"` Decimals int `json:"decimals"` EthereumAddress string `json:"ethereumAddress"` EthereumBlockNum int `json:"ethereumBlockNum"` FiatUpdate time.Time `json:"fiatUpdate"` ID int `json:"id"` ItemID int `json:"itemId"` Name string `json:"name"` Symbol string `json:"symbol"` }