Skip to content

Commit

Permalink
Add action query for delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
OnedgeLee committed Dec 16, 2024
1 parent 702ac7c commit 683577c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions NineChronicles.Headless/GraphTypes/ActionQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using Nekoyume.Action.ValidatorDelegation;
using Nekoyume.Action.Guild.Migration;
using Lib9c;
using Libplanet.Blockchain;
using Nekoyume.ValidatorDelegation;

namespace NineChronicles.Headless.GraphTypes
{
Expand Down Expand Up @@ -596,6 +598,23 @@ public ActionQuery(StandaloneContext standaloneContext)
context,
new FixToRefundFromNonValidator(targets));
});
Field<ByteStringType>(
name: "delegateValidator",
arguments: new QueryArguments(
new QueryArgument<NonNullGraphType<BigIntGraphType>>
{
Name = "amount",
Description = "Amount of guild gold to delegate."
}
),
resolve: context =>
{
BigInteger amount = context.GetArgument<BigInteger>("amount");
var fav = new FungibleAssetValue(ValidatorDelegatee.ValidatorDelegationCurrency, amount, 0);
var action = new DelegateValidator(fav);
return Encode(context, action);
}
);

RegisterHackAndSlash();
RegisterHackAndSlashSweep();
Expand Down

0 comments on commit 683577c

Please sign in to comment.