Skip to content

Commit

Permalink
Added threshold to api again
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriFS committed Oct 18, 2023
1 parent a2150a7 commit df44b95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Proto/nodeguard.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ service NodeGuardService {
Gets the status for the provided withdrawals request ids
*/
rpc GetWithdrawalsRequestStatus(GetWithdrawalsRequestStatusRequest) returns (GetWithdrawalsRequestStatusResponse);

/*
Gets a channel by id
*/
Expand Down Expand Up @@ -135,6 +135,7 @@ message Wallet {
string name = 2;
bool is_hot_wallet = 3;
repeated AccountKeySettings account_key_settings = 4;
int32 threshold = 5;
}
message GetAvailableWalletsResponse {
repeated Wallet wallets = 1;
Expand Down
11 changes: 6 additions & 5 deletions src/Rpc/NodeGuardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Task<GetNewWalletAddressResponse> GetNewWalletAddress(GetNewWalletAddressRequest
Task<GetAvailableUtxosResponse> GetAvailableUtxos(GetAvailableUtxosRequest request, ServerCallContext context);

Task<GetWithdrawalsRequestStatusResponse> GetWithdrawalsRequestStatus(GetWithdrawalsRequestStatusRequest request, ServerCallContext context);

Task<GetChannelResponse> GetChannel(GetChannelRequest request, ServerCallContext context);
}

Expand Down Expand Up @@ -315,7 +315,8 @@ public override async Task<GetAvailableWalletsResponse> GetAvailableWallets(GetA
{
Xpub = k.XPUB,
})
}
},
Threshold = w.MofN
}).ToList()
}
};
Expand Down Expand Up @@ -629,7 +630,7 @@ public override async Task<GetChannelOperationRequestResponse> GetChannelOperati
ChannelOperationRequestStatus.FinalizingPSBT => CHANNEL_OPERATION_STATUS.FinalizingPsbt,
_ => throw new ArgumentOutOfRangeException(nameof(channelOperationRequest.Status), channelOperationRequest.Status, "Unknown status")
};

var type = channelOperationRequest.RequestType switch
{
OperationRequestType.Open => CHANNEL_OPERATION_TYPE.OpenChannel,
Expand Down Expand Up @@ -901,7 +902,7 @@ public override async Task<GetChannelResponse> GetChannel(GetChannelRequest requ
Channel.ChannelStatus.Closed => CHANNEL_STATUS.Closed,
_ => throw new ArgumentOutOfRangeException(nameof(channel.Status), channel.Status, "Unknown status")
};

var result = new GetChannelResponse()
{
FundingTx = channel.FundingTx,
Expand All @@ -913,7 +914,7 @@ public override async Task<GetChannelResponse> GetChannel(GetChannelRequest requ
IsAutomatedLiquidityEnabled = channel.IsAutomatedLiquidityEnabled,
IsPrivate = channel.IsPrivate,
};

result.BtcCloseAddress = channel.BtcCloseAddress != null ? channel.BtcCloseAddress : String.Empty;

return result;
Expand Down

0 comments on commit df44b95

Please sign in to comment.