-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MemeFrame improvements, using TokenProcess and StakingProcess
- Loading branch information
1 parent
847e61b
commit 6728e8c
Showing
5 changed files
with
285 additions
and
104 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
using aoww.ProcesModels.Action; | ||
using aoww.ProcesModels.Metadata; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace aoww.ProcesModels | ||
{ | ||
public class StakingProcess : Process | ||
{ | ||
public StakingProcess(string processId) : base(processId) | ||
{ | ||
} | ||
|
||
public override List<ActionMetadata> GetActionMetadata() | ||
{ | ||
return new List<ActionMetadata>() | ||
{ | ||
new ActionMetadata | ||
{ | ||
Name = "View Stakers", | ||
ActionType = ActionType.DryRun, | ||
AoAction = CreateAoActionViewStakers() | ||
}, | ||
new ActionMetadata | ||
{ | ||
Name = "Stake", | ||
ActionType = ActionType.Message, | ||
AoAction = CreateAoActionStake() | ||
}, | ||
new ActionMetadata | ||
{ | ||
Name = "Unstake", | ||
ActionType = ActionType.Message, | ||
AoAction = CreateAoActionUnStake() | ||
}, | ||
// new ActionMetadata | ||
//{ | ||
// Name = "Finalize", | ||
// ActionType = ActionType.Message, | ||
// AoAction = CreateAoActionFinalize() | ||
//}, | ||
}; | ||
} | ||
|
||
private AoAction CreateAoActionViewStakers() | ||
{ | ||
return new AoAction | ||
{ | ||
Params = new List<ActionParam> | ||
{ | ||
new ActionParam { Key= "Target", ParamType = ActionParamType.Target, Value= this.ProcessId }, | ||
new ActionParam { Key= "Action", ParamType = ActionParamType.Filled, Value= "Stakers" }, | ||
} | ||
}; | ||
} | ||
|
||
private AoAction CreateAoActionStake() | ||
{ | ||
return new AoAction | ||
{ | ||
Params = new List<ActionParam> | ||
{ | ||
new ActionParam { Key= "Target", ParamType = ActionParamType.Target, Value= this.ProcessId }, | ||
new ActionParam { Key= "Action", ParamType = ActionParamType.Filled, Value= "Stake" }, | ||
new ActionParam { Key= "Quantity", ParamType = ActionParamType.Balance, Args = new List<string> { this.ProcessId } }, | ||
new ActionParam { Key= "UnstakeDelay", ParamType = ActionParamType.Integer }, | ||
} | ||
}; | ||
} | ||
|
||
private AoAction CreateAoActionUnStake() | ||
{ | ||
return new AoAction | ||
{ | ||
Params = new List<ActionParam> | ||
{ | ||
new ActionParam { Key= "Target", ParamType = ActionParamType.Target, Value= this.ProcessId }, | ||
new ActionParam { Key= "Action", ParamType = ActionParamType.Filled, Value= "Unstake" }, | ||
new ActionParam { Key= "Quantity", ParamType = ActionParamType.Balance, Args = new List<string> { this.ProcessId } }, | ||
} | ||
}; | ||
} | ||
|
||
private AoAction CreateAoActionFinalize() | ||
{ | ||
return new AoAction | ||
{ | ||
Params = new List<ActionParam> | ||
{ | ||
new ActionParam { Key= "Target", ParamType = ActionParamType.Target, Value= this.ProcessId }, | ||
new ActionParam { Key= "Action", ParamType = ActionParamType.Filled, Value= "Finalize" }, | ||
new ActionParam { Key= "Quantity", ParamType = ActionParamType.Balance, Args = new List<string> { this.ProcessId } }, | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.