hermez-node/api/config.go
api/config.goRaw
1package api
2
3import (
4 "math/big"
5 "net/http"
6
7 "github.com/gin-gonic/gin"
8 "github.com/hermeznetwork/hermez-node/common"
9)
10
11type rollupConstants struct {
12 PublicConstants common.RollupConstants `json:"publicConstants"`
13 MaxFeeIdxCoordinator int `json:"maxFeeIdxCoordinator"`
14 ReservedIdx int `json:"reservedIdx"`
15 ExitIdx int `json:"exitIdx"`
16 LimitLoadAmount *big.Int `json:"limitLoadAmount"`
17 LimitL2TransferAmount *big.Int `json:"limitL2TransferAmount"`
18 LimitTokens int `json:"limitTokens"`
19 L1CoordinatorTotalBytes int `json:"l1CoordinatorTotalBytes"`
20 L1UserTotalBytes int `json:"l1UserTotalBytes"`
21 MaxL1UserTx int `json:"maxL1UserTx"`
22 MaxL1Tx int `json:"maxL1Tx"`
23 InputSHAConstantBytes int `json:"inputSHAConstantBytes"`
24 NumBuckets int `json:"numBuckets"`
25 MaxWithdrawalDelay int `json:"maxWithdrawalDelay"`
26 ExchangeMultiplier int `json:"exchangeMultiplier"`
27}
28
29type configAPI struct {
30 RollupConstants rollupConstants `json:"hermez"`
31 AuctionConstants common.AuctionConstants `json:"auction"`
32 WDelayerConstants common.WDelayerConstants `json:"withdrawalDelayer"`
33}
34
35func getConfig(c *gin.Context) {
36 c.JSON(http.StatusOK, cg)
37}