"github.com/vapor/asset"
"github.com/vapor/blockchain/query"
"github.com/vapor/blockchain/signers"
- "github.com/vapor/blockchain/txbuilder"
+ "github.com/vapor/common/arithmetic"
"github.com/vapor/consensus"
"github.com/vapor/crypto/ed25519"
"github.com/vapor/crypto/ed25519/chainkd"
tx.Outputs = append(tx.Outputs, a.wallet.BuildAnnotatedOutput(&ins.Tx, i))
}
- tx.Fee = txbuilder.CalculateTxFee(&ins.Tx)
+ tx.Fee, _ = arithmetic.CalculateTxFee(&ins.Tx)
return NewSuccessResponse(tx)
}
-// POST /list-unspent-outputs
-func (a *API) listUnspentOutputs(ctx context.Context, filter struct {
+type ListUtxosReq struct {
AccountID string `json:"account_id"`
AccountAlias string `json:"account_alias"`
ID string `json:"id"`
SmartContract bool `json:"smart_contract"`
From uint `json:"from"`
Count uint `json:"count"`
-}) Response {
+}
+
+// POST /list-unspent-outputs
+func (a *API) listUnspentOutputs(ctx context.Context, filter ListUtxosReq) Response {
accountID := filter.AccountID
if filter.AccountAlias != "" {
acc, err := a.wallet.AccountMgr.FindByAlias(filter.AccountAlias)
// return gasRate
func (a *API) gasRate() Response {
- gasrate := map[string]int64{"gas_rate": consensus.VMGasRate}
+ gasrate := map[string]int64{"gas_rate": consensus.ActiveNetParams.VMGasRate}
return NewSuccessResponse(gasrate)
}