transaction

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BjjToString

func BjjToString(bjj babyjub.PublicKeyComp) string

BjjToString convert the BJJ public key to string

func IdxToHez

func IdxToHez(idx hezcommon.Idx, tokenSymbol string) string

IdxToHez convert idx to hez idx

Types

type APITx

type APITx struct {
	TxID      hezcommon.TxID `json:"id" binding:"required"`
	Type      string         `json:"type"`
	TokenID   uint32         `json:"tokenId"`
	FromIdx   string         `json:"fromAccountIndex" binding:"required"`
	ToIdx     string         `json:"toAccountIndex"`
	ToEthAddr string         `json:"toHezEthereumAddress"`
	ToBJJ     string         `json:"toBjj"`
	Amount    string         `json:"amount" binding:"required"`
	Fee       uint64         `json:"fee"`
	Nonce     uint64         `json:"nonce"`
	Signature string         `json:"signature"`
}

APITx is a representation of a transaction API request.

func ExecuteL2Transaction

func ExecuteL2Transaction(hezClient client.HermezClient, apiTx APITx) (apiTxReturn APITx, serverResponse string, err error)

ExecuteL2Transaction submits L2 transaction to the actual coordinator endpoint

func L2Transfer added in v0.0.3

func L2Transfer(hezClient client.HermezClient,
	senderBjjWallet account.BJJWallet,
	receipientAddress string,
	tokenSymbolToTransfer string,
	amount *big.Int,
	feeRangeSelectedID int,
	ethereumChainID int) (apiTxReturn APITx, serverResponse string, err error)

L2Transfer perform token or ETH transfer within Hermez network (we say L2 or Layer2)

func MarshalTransaction

func MarshalTransaction(itemToTransfer string,
	senderAcctDetails account.AccountAPIResponse,
	receipientAcctDetails account.AccountAPIResponse,
	senderBjjWallet account.BJJWallet,
	amount *big.Int,
	feeSelector int,
	ethereumChainID int) (apiTxRequest APITx, err error)

MarshalTransaction marshal transaction information into a Hermez transaction API request

func NewHermezAPITxRequest

func NewHermezAPITxRequest(poolTx *hezcommon.PoolL2Tx, token hezcommon.Token) APITx

NewHermezAPITxRequest convert L2 tx to Hermez API request model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL