-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a function to set fees for request_withdrawal
- Loading branch information
Showing
5 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved | ||
package objects | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
type OnChainFeeTarget int | ||
|
||
const ( | ||
OnChainFeeTargetUndefined OnChainFeeTarget = iota | ||
|
||
// OnChainFeeTargetHigh Transaction expected to be confirmed within 2 blocks. | ||
OnChainFeeTargetHigh | ||
// OnChainFeeTargetMedium Transaction expected to be confirmed within 6 blocks. | ||
OnChainFeeTargetMedium | ||
// OnChainFeeTargetLow Transaction expected to be confirmed within 18 blocks. | ||
OnChainFeeTargetLow | ||
// OnChainFeeTargetBackground Transaction expected to be confirmed within 50 blocks. | ||
OnChainFeeTargetBackground | ||
) | ||
|
||
func (a *OnChainFeeTarget) UnmarshalJSON(b []byte) error { | ||
var s string | ||
if err := json.Unmarshal(b, &s); err != nil { | ||
return err | ||
} | ||
switch s { | ||
default: | ||
*a = OnChainFeeTargetUndefined | ||
case "HIGH": | ||
*a = OnChainFeeTargetHigh | ||
case "MEDIUM": | ||
*a = OnChainFeeTargetMedium | ||
case "LOW": | ||
*a = OnChainFeeTargetLow | ||
case "BACKGROUND": | ||
*a = OnChainFeeTargetBackground | ||
|
||
} | ||
return nil | ||
} | ||
|
||
func (a OnChainFeeTarget) StringValue() string { | ||
var s string | ||
switch a { | ||
default: | ||
s = "undefined" | ||
case OnChainFeeTargetHigh: | ||
s = "HIGH" | ||
case OnChainFeeTargetMedium: | ||
s = "MEDIUM" | ||
case OnChainFeeTargetLow: | ||
s = "LOW" | ||
case OnChainFeeTargetBackground: | ||
s = "BACKGROUND" | ||
|
||
} | ||
return s | ||
} | ||
|
||
func (a OnChainFeeTarget) MarshalJSON() ([]byte, error) { | ||
s := a.StringValue() | ||
return json.Marshal(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters