mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Initial dract of the common structs
This commit is contained in:
36
common/fee.go
Normal file
36
common/fee.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package common
|
||||
|
||||
// Fee is a type that represents the percentage of tokens that will be payed in a transaction
|
||||
// to incentivaise the materialization of it
|
||||
type Fee float64
|
||||
|
||||
// RecommendedFee is the recommended fee to pay in USD per transaction set by the coordinator
|
||||
// according to the tx type (if the tx requires to create an account and register, only register or he account already esists)
|
||||
type RecommendedFee struct {
|
||||
ExistingAccount float64
|
||||
CreatesAccount float64
|
||||
CreatesAccountAndRegister float64
|
||||
}
|
||||
|
||||
// FeeSelector is used to select a percentage from the FeePlan. Max value is 16
|
||||
type FeeSelector uint8
|
||||
|
||||
// FeePlan represents the fee model, a position in the array indicates the percentage of tokens paid in concept of fee for a transaction
|
||||
var FeePlan = [16]float64{
|
||||
0,
|
||||
.001,
|
||||
.002,
|
||||
.005,
|
||||
.01,
|
||||
.02,
|
||||
.05,
|
||||
.1,
|
||||
.2,
|
||||
.5,
|
||||
1,
|
||||
2,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
50,
|
||||
}
|
||||
Reference in New Issue
Block a user