GreenField: Generate Store OnChain Wallet (#2708)

* GreenField: Generate Store OnChain Wallet

* Greenfield: Do not generate wallet if already configured
This commit is contained in:
Andrew Camilleri
2021-07-27 16:53:44 +02:00
committed by GitHub
parent 80483ba76f
commit c59798e9c4
12 changed files with 505 additions and 12 deletions

View File

@@ -78,5 +78,17 @@ namespace BTCPayServer.Client
method: HttpMethod.Get), token);
return await HandleResponse<OnChainPaymentMethodPreviewResultData>(response);
}
public virtual async Task<OnChainPaymentMethodDataWithSensitiveData> GenerateOnChainWallet(string storeId,
string cryptoCode, GenerateOnChainWalletRequest request,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain/{cryptoCode}/generate",
bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<OnChainPaymentMethodDataWithSensitiveData>(response);
}
}
}