🐛 Fix services unimplmented
This commit is contained in:
@@ -117,6 +117,29 @@ public class SnWalletFund : ModelBase
|
||||
ExpiredAt = ExpiredAt.ToTimestamp(),
|
||||
};
|
||||
|
||||
public Proto.WalletFund ToProtoValueWithRecipients()
|
||||
{
|
||||
var proto = new Proto.WalletFund
|
||||
{
|
||||
Id = Id.ToString(),
|
||||
Currency = Currency,
|
||||
TotalAmount = TotalAmount.ToString(CultureInfo.InvariantCulture),
|
||||
RemainingAmount = RemainingAmount.ToString(CultureInfo.InvariantCulture),
|
||||
SplitType = (Proto.FundSplitType)SplitType,
|
||||
Status = (Proto.FundStatus)Status,
|
||||
Message = Message,
|
||||
CreatorAccountId = CreatorAccountId.ToString(),
|
||||
ExpiredAt = ExpiredAt.ToTimestamp(),
|
||||
};
|
||||
|
||||
foreach (var recipient in Recipients)
|
||||
{
|
||||
proto.Recipients.Add(recipient.ToProtoValue());
|
||||
}
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public static SnWalletFund FromProtoValue(Proto.WalletFund proto) => new()
|
||||
{
|
||||
Id = Guid.Parse(proto.Id),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using DysonNetwork.Shared.Proto;
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
@@ -133,9 +134,9 @@ public class RemotePaymentService(DysonNetwork.Shared.Proto.PaymentService.Payme
|
||||
return response;
|
||||
}
|
||||
|
||||
public async Task<DysonNetwork.Shared.Proto.WalletFund> GetWalletFund(string fundId)
|
||||
public async Task<WalletFund> GetWalletFund(string fundId)
|
||||
{
|
||||
var request = new DysonNetwork.Shared.Proto.GetWalletFundRequest { FundId = fundId };
|
||||
var request = new GetWalletFundRequest { FundId = fundId };
|
||||
var response = await payment.GetWalletFundAsync(request);
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user