34 lines
930 B
Go
34 lines
930 B
Go
package rest
|
|
|
|
import (
|
|
eth "custodial/pkg/eth"
|
|
store "custodial/pkg/store"
|
|
|
|
gin "github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func EthRestV1(r *gin.RouterGroup) {
|
|
eth.InitMasterFromPrivateSettings()
|
|
store.Init()
|
|
|
|
var node eth.EthNode
|
|
|
|
_, err := node.Init()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
r.POST("/create-account", EthCreateAccountV1)
|
|
r.POST("/address-balance", EthAddressBalanceV1)
|
|
r.POST("/account-balance", EthAccountBalanceV1)
|
|
r.POST("/withdraw-usdt", EthWithdrawUsdtV1)
|
|
r.POST("/withdraw-eth", EthWithdrawEthV1)
|
|
r.POST("/approve-usdt-spender", EthApproveUsdtSpenderV1)
|
|
r.POST("/approve-usdt-contract", EthApproveUsdtContractV1)
|
|
r.POST("/withdraw-usdt-by-spender", EthWithdrawUsdtBySpenderV1)
|
|
r.POST("/withdraw-usdt-by-contract", EthWithdrawUsdtByContractV1)
|
|
r.POST("/recharge-eth-by-spender", EthRechargeEthBySpenderV1)
|
|
r.POST("/approve-usdt-custody", EthApproveUsdtCustodyV1)
|
|
r.POST("/tx-info", EthTransactionInfoV1)
|
|
}
|