X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=api%2Ftransact.go;fp=api%2Ftransact.go;h=947b47ed6f341e9090afcbbf36cc8101b162ea5f;hb=df67cacd69caa35cd5d26401470dadfb434cf95a;hp=b444cc94cd51937aa9cc13c45619886b9307eba8;hpb=54794806e4b6ab51ffc5879a7dd286bcb9ac2bbc;p=bytom%2Fbytom.git diff --git a/api/transact.go b/api/transact.go index b444cc94..947b47ed 100644 --- a/api/transact.go +++ b/api/transact.go @@ -226,5 +226,18 @@ func (a *API) estimateTxGas(ctx context.Context, in struct { if err != nil { return NewErrorResponse(err) } + + return NewSuccessResponse(txGasResp) +} + +// POST /estimate-chain-transaction-gas +func (a *API) estimateChainTxGas(ctx context.Context, in struct { + TxTemplates []txbuilder.Template `json:"transaction_templates"` +}) Response { + txGasResp, err := txbuilder.EstimateChainTxGas(in.TxTemplates) + if err != nil { + return NewErrorResponse(err) + } + return NewSuccessResponse(txGasResp) }