handlers

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(logger *zap.Logger, cfg *config.Config, dbo3 *dbo.DBO) *Handler

func (*Handler) ContractCallTx

func (hd *Handler) ContractCallTx(ctx *gin.Context)

@Summary 只读调用合约(非离线签名,慎用) @Description 仅在本节节点evm副本上执行合约,不会广播交易,不对区块产生影响,不消耗gas。用户估算智能合约消耗的gas,以及用于调用合约只读方法。 @Tags v2-contract @Accept json @Produce json @Param Request body bean.ContractCallTx true "请求参数" @Success 200 {object} bean.EvmCallResult "成功" @Router /v2/contract/call [post]

func (*Handler) ContractDeployTx

func (hd *Handler) ContractDeployTx(ctx *gin.Context)

@Summary 部署合约(非离线签名,慎用) @Description 部署合约(私钥交易,非离线签名,慎用) @Tags v2-contract @Accept json @Produce json @Param Request body bean.ContractDeployTx true "请求参数" @Success 200 {object} bean.PublicResp "成功" @Router /v2/contract/deploy [post]

func (*Handler) ContractInvokeTx

func (hd *Handler) ContractInvokeTx(ctx *gin.Context)

@Summary 调用合约(非离线签名,慎用) @Description 调用合约(私钥交易,非离线签名,慎用),使用本接口调用合约只读方法会消耗gas。 @Tags v2-contract @Accept json @Produce json @Param Request body bean.ContractInvokeTx true "请求参数" @Success 200 {object} bean.PublicResp "成功" @Router /v2/contract/invoke [post]

func (*Handler) ContractSignedCallTx

func (hd *Handler) ContractSignedCallTx(ctx *gin.Context)

@Summary 只读调用合约 @Description 仅在本节节点evm副本上执行合约,不会广播交易,不对区块产生影响,不消耗gas。用户估算智能合约消耗的gas,以及用于调用合约只读方法。 @Tags v2-contract @Accept json @Produce json @Param Request body bean.SignedEvmTx true "请求参数" @Success 200 {object} bean.EvmCallResult "成功" @Router /v2/contract/query [post]

func (*Handler) Multisigner

func (hd *Handler) Multisigner(ctx *gin.Context)

func (*Handler) QueryContract

func (hd *Handler) QueryContract(ctx *gin.Context)

@Summary 查询合约账户信息 @Description 查询合约账户信息 @Tags v2-contract @Accept json @Produce json @Param address path string true "合约地址" @Success 200 {object} bean.V2ContractActResult "成功" @Router /v2/contract/accounts/{address} [get]

func (*Handler) QueryTxEvents

func (hd *Handler) QueryTxEvents(ctx *gin.Context)

@Summary 查询事件日志 @Description 查询事件日志 @Tags v2-contract @Accept json @Produce json @Param txhash path string true "交易hash" @Success 200 {object} bean.V2EvmLog "成功" @Router /v2/contract/events/{txhash} [get]

func (*Handler) QueryV3AccPayments

func (hd *Handler) QueryV3AccPayments(ctx *gin.Context)

@Summary 根据用户地址查询Payment @Description 根据用户地址查询Payment @Tags v3-query @Accept json @Produce json @Param address path string true "账户地址" @Param symbol query string false "币种" @Param contract query string false "币种合约地址" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Payment "成功" @Router /v3/accounts/{address}/payments [get]

func (*Handler) QueryV3AccTxs

func (hd *Handler) QueryV3AccTxs(ctx *gin.Context)

@Summary 根据账户地址查询交易记录 @Description 根据账户地址查询交易记录 @Tags v3-query @Accept json @Produce json @Param address path string true "账户地址" @Param begin query int false "开始时间戳" @Param end query int false "结束时间戳" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Transaction "成功" @Router /v3/accounts/{address}/transactions [get]

func (*Handler) QueryV3Ledger

func (hd *Handler) QueryV3Ledger(ctx *gin.Context)

@Summary 根据高度查询账本 @Description 根据高度查询账本 @Tags v3-query @Accept json @Produce json @Param height path string true "区块高度" @Success 200 {array} database.V3Ledger "成功" @Router /v3/ledgers/{height} [get]

func (*Handler) QueryV3LedgerPayments

func (hd *Handler) QueryV3LedgerPayments(ctx *gin.Context)

@Summary 根据区块高度查询Payment @Description 根据区块高度查询Payment @Tags v3-query @Accept json @Produce json @Param height path string true "区块高度" @Param symbol query string false "币种" @Param contract query string false "币种合约地址" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Payment "成功" @Router /v3/ledgers/{height}/payments [get]

func (*Handler) QueryV3LedgerTxs

func (hd *Handler) QueryV3LedgerTxs(ctx *gin.Context)

@Summary 根据区块高度查询交易记录 @Description 根据区块高度查询交易记录 @Tags v3-query @Accept json @Produce json @Param height path string true "区块高度" @Param begin query int false "开始时间戳" @Param end query int false "结束时间戳" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Transaction "成功" @Router /v3/ledgers/{height}/transactions [get]

func (*Handler) QueryV3Ledgers

func (hd *Handler) QueryV3Ledgers(ctx *gin.Context)

@Summary 查询所有账本 @Description 查询所有账本 @Tags v3-query @Accept json @Produce json @Param begin query int false "开始时间戳" @Param end query int false "结束时间戳" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Ledger "成功" @Router /v3/ledgers [get]

func (*Handler) QueryV3Payments

func (hd *Handler) QueryV3Payments(ctx *gin.Context)

@Summary 查询所有Payment @Description 查询所有Payment @Tags v3-query @Accept json @Produce json @Param symbol query string false "币种" @Param contract query string false "币种合约地址" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Payment "成功" @Router /v3/payments [get]

func (*Handler) QueryV3SingleTx

func (hd *Handler) QueryV3SingleTx(ctx *gin.Context)

@Summary 根据txhash查询交易记录 @Description 根据txhash查询交易记录 @Tags v3-query @Accept json @Produce json @Param txhash path string true "交易hash" @Success 200 {array} database.V3Transaction "成功" @Router /v3/transactions/{txhash} [get]

func (*Handler) QueryV3TxPayments

func (hd *Handler) QueryV3TxPayments(ctx *gin.Context)

@Summary 根据txhash查询Payment @Description 根据txhash查询Payment @Tags v3-query @Accept json @Produce json @Param txhash path string true "交易hash" @Param symbol query string false "币种" @Param contract query string false "币种合约地址" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Payment "成功" @Router /v3/transactions/{txhash}/payments [get]

func (*Handler) QueryV3Txs

func (hd *Handler) QueryV3Txs(ctx *gin.Context)

@Summary 根据所有交易记录 @Description 根据所有交易记录 @Tags v3-query @Accept json @Produce json @Param begin query int false "开始时间戳" @Param end query int false "结束时间戳" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Success 200 {array} database.V3Transaction "成功" @Router /v3/transactions [get]

func (*Handler) SignEvmTransaction

func (hd *Handler) SignEvmTransaction(ctx *gin.Context)

@Summary 根据transaction参数进行签名 @Description 根据transaction参数进行签名 @Tags v2-contract @Accept json @Produce json @Param Request body bean.SignEvmTx true "请求参数" @Success 200 {object} bean.PublicResp "成功" @Router /v2/contract/sign [post]

func (*Handler) SignedBatchTransaction

func (hd *Handler) SignedBatchTransaction(ctx *gin.Context)

@Summary 发起批量交易 @Description 发起批量交易 @Tags v2-general @Accept json @Produce json @Param Request body bean.SignedBatchTx true "请求参数" @Success 200 {object} bean.PublicResp "成功" @Router /v2/transactions [post]

func (*Handler) SignedEvmMutlisigTransaction

func (hd *Handler) SignedEvmMutlisigTransaction(ctx *gin.Context)

@Summary 发起evm多签交易 @Description 发起evm多签交易,支持OLO转账、合约交易 @Tags v2-contract @Accept json @Produce json @Param Request body bean.SignedMultisigEvmTx true "请求参数" @Success 200 {object} bean.PublicResp "成功" @Router /v2/contract/multisigTransactions [post]

func (*Handler) SignedEvmTransaction

func (hd *Handler) SignedEvmTransaction(ctx *gin.Context)

@Summary 发起evm交易 @Description 发起evm交易,支持普通转账、合约交易,普通转账默认使用本接口 @Tags v2-contract @Accept json @Produce json @Param Request body bean.SignedEvmTx true "请求参数" @Success 200 {object} bean.PublicResp "成功" @Router /v2/contract/transactions [post]

func (*Handler) V2Convert

func (hd *Handler) V2Convert(ctx *gin.Context)

@Summary 地址转换 @Description 地址转换,公钥转地址 @Tags v2-general @Accept json @Produce json @Param publickey path string true "v1账户地址,即用户公钥" @Success 200 {object} bean.V2ConvertResult "成功" @Router /v2/convert/{publickey} [get]

func (*Handler) V2GenKey

func (hd *Handler) V2GenKey(ctx *gin.Context)

@Summary 随机生成mondo账户 @Description 随机生成mondo账户,该账户默认未上链,需要通过转账交易激活 @Tags v2-general @Accept json @Produce json @Success 200 {object} bean.V2GenKeyResult "成功" @Router /v2/genkey [get]

func (*Handler) V2QueryAccount

func (hd *Handler) V2QueryAccount(ctx *gin.Context)

@Summary 查询账户信息 @Description 根据地址查询账户信息 @Tags v2-general @Accept json @Produce json @Param address path string true "账户地址" @Success 200 {object} bean.V2AccountResult "成功" @Router /v2/accounts/{address} [get]

func (*Handler) V3QueryConfigNodes

func (hd *Handler) V3QueryConfigNodes(ctx *gin.Context)

@Summary 查询节点配置信息 @Description 查询节点配置信息 @Tags v3-config @Accept json @Produce json @Success 200 {object} config.Nodes "成功" @Router /v3/config/nodes [get]

func (*Handler) V3QueryConfigTokens

func (hd *Handler) V3QueryConfigTokens(ctx *gin.Context)

@Summary 查询已发行代币 @Description 查询已发行代币 @Tags v3-config @Accept json @Produce json @Success 200 {object} config.Tokens "成功" @Router /v3/config/tokens [get]

func (*Handler) V3QueryNode

func (hd *Handler) V3QueryNode(ctx *gin.Context)

@Summary 查询节点信息 @Description 查询节点信息 @Tags v3-dpos @Accept json @Produce json @Param address path string true "地址" @Success 200 {object} types.BeanValidator "成功" @Router /v3/nodes/{address} [get]

func (*Handler) V3QueryNodeVoters

func (hd *Handler) V3QueryNodeVoters(ctx *gin.Context)

@Summary 查询节点投票人信息 @Description 查询节点投票人信息 @Tags v3-dpos @Accept json @Produce json @Param address path string true "地址" @Success 200 {array} types.BeanVots "成功" @Router /v3/nodes/{address}/voters [get]

func (*Handler) V3QueryNodes

func (hd *Handler) V3QueryNodes(ctx *gin.Context)

@Summary 查询所有节点信息 @Description 查询所有节点信息 @Tags v3-dpos @Accept json @Produce json @Success 200 {array} types.BeanValidator "成功" @Router /v3/nodes [get]

func (*Handler) V3QueryPool

func (hd *Handler) V3QueryPool(ctx *gin.Context)

@Summary 查询矿池信息 @Description 查询矿池信息 @Tags v3-dpos @Accept json @Produce json @Success 200 {object} types.BeanDPOSPool "成功" @Router /v3/dpos/pool [get]

func (*Handler) V3QueryPoolLogs

func (hd *Handler) V3QueryPoolLogs(ctx *gin.Context)

@Summary 查询矿池记录 @Description 查询矿池记录 @Tags v3-dpos @Accept json @Produce json @Param height query int false "高度" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Success 200 {array} types.DPOSPoolLog "成功" @Router /v3/dpos/poollogs [get]

func (*Handler) V3QueryPrice

func (hd *Handler) V3QueryPrice(ctx *gin.Context)

@Summary 查询币种价格 @Description 查询币种价格:币种-USDT交易对 @Tags v3-extension @Accept json @Produce json @Param symbol path string false "币种" @Success 200 {object} bean.Ticker "成功" @Router /v3/ext/price/{symbol} [get]

func (*Handler) V3QueryRankLogs

func (hd *Handler) V3QueryRankLogs(ctx *gin.Context)

@Summary 查询DPOS排名 @Description 查询DPOS排名 @Tags v3-dpos @Accept json @Produce json @Param address query string false "地址" @Param height query int false "高度" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Success 200 {array} types.DPOSRankLog "成功" @Router /v3/dpos/ranklogs [get]

func (*Handler) V3QueryTcnLogs

func (hd *Handler) V3QueryTcnLogs(ctx *gin.Context)

@Summary 查询节点dpos记录 @Description 查询节点dpos记录 @Tags v3-dpos @Accept json @Produce json @Param address query string false "地址" @Param height query int false "高度" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Success 200 {array} types.DPOSTcnLog "成功" @Router /v3/dpos/tcnlogs [get]

func (*Handler) V3QueryTinLogs

func (hd *Handler) V3QueryTinLogs(ctx *gin.Context)

@Summary 查询用户dpos记录 @Description 查询用户dpos记录 @Tags v3-dpos @Accept json @Produce json @Param address query string false "地址" @Param height query int false "高度" @Param cursor query int false "游标" @Param limit query int false "限制" @Param order query string false "排序(ASC/DESC)" @Param begin query int false "开始时间" @Param end query int false "结束时间" @Success 200 {array} types.DPOSTinLog "成功" @Router /v3/dpos/tinlogs [get]

func (*Handler) V3QueryVoter

func (hd *Handler) V3QueryVoter(ctx *gin.Context)

@Summary 查询投票者信息 @Description 查询投票者信息 @Tags v3-dpos @Accept json @Produce json @Param address path string true "地址" @Success 200 {object} types.BeanVoter "成功" @Router /v3/voters/{address} [get]

func (*Handler) V3_SendDelegateTx

func (hd *Handler) V3_SendDelegateTx(ctx *gin.Context)

@Summary 用户委托交易 @Description 用户委托交易 @Tags v3-dpos @Accept json @Produce json @Param Request body bean.DelegateTx true "请求参数" @Success 200 "成功" @Router /v3/delegate [post]

type ITx

type ITx interface {
	ToBytes() []byte
	Hash() ethcmn.Hash
}

Jump to

Keyboard shortcuts

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