mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
rpc: add CalculateNetworkFee RPC method
This commit is contained in:
parent
d2a81daf57
commit
252e03bc34
4 changed files with 125 additions and 3 deletions
|
@ -28,6 +28,20 @@ import (
|
|||
|
||||
var errNetworkNotInitialized = errors.New("RPC client network is not initialized")
|
||||
|
||||
// CalculateNetworkFee calculates network fee for transaction. The transaction may
|
||||
// have empty witnesses for contract signers and may have only verification scripts
|
||||
// filled for standard sig/multisig signers.
|
||||
func (c *Client) CalculateNetworkFee(tx *transaction.Transaction) (int64, error) {
|
||||
var (
|
||||
params = request.NewRawParams(tx.Bytes())
|
||||
resp int64
|
||||
)
|
||||
if err := c.performRequest("calculatenetworkfee", params, &resp); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// GetApplicationLog returns the contract log based on the specified txid.
|
||||
func (c *Client) GetApplicationLog(hash util.Uint256, trig *trigger.Type) (*result.ApplicationLog, error) {
|
||||
var (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue