LiskHQ / lisk-desktop

🖥 Lisk graphical user interface for desktop
https://lisk.com/wallet
GNU General Public License v3.0
580 stars 95 forks source link

Fetch command fee for token transfer and validator registration #4717

Closed reyraa closed 1 year ago

reyraa commented 1 year ago

Description

For each command (transaction) implement command fee logic to fetch the fees required using generic endpoint invoke.

The following commands require command fee:

As a result the fee value should look like:

[
  { value: 10523000, type: 'total' }, //  The value of commandFee is added to the total value
  { value: 23000, type: 'minFee' },
  { value: 500000, type: 'commandFee' },
]

If an account has a zero balance and its nonce is zero it needs to be initialized You can retrieve commandFee (e.g token transfer initialization fee) using the invoke method from Lisk Service. Simply send a WS request as

{
  "endpoint" : "token_getInitializationFees",
  "params": {} // Empty
}

Acceptance criteria

Additional information

Enhancing the hook created by #4716 , we should use fetch the command fee and incorporate it in the fee values. As mentioned, the value of command fee is defined by the blockchain developer, and no calculation is involved in it. We should merely fetch it from Lisk Service and add it:

ManuGowda commented 1 year ago

Need to groom this issue related to transaction pool logic to calculate the tie breaker