🐛 Fix services unimplmented

This commit is contained in:
2026-02-04 13:54:47 +08:00
parent 12199d99b7
commit 2641814a22
5 changed files with 46 additions and 34 deletions

View File

@@ -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),

View File

@@ -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;
}