Skip to content

Commit

Permalink
Fix Buy BTC when logged in with Derived Key operating as owner key (#596
Browse files Browse the repository at this point in the history
)

* Append a testnet=true query param if using testnet for the identity embed URL

* Fix BTC buy with derived key operating as owner
  • Loading branch information
lazynina committed Sep 7, 2022
1 parent 4dba578 commit 16a9b4c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/backend-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,14 @@ export class BackendApiService {
FeeRateSatoshisPerKB: number,
Broadcast: boolean
): Observable<any> {
// Check if the user is logged in with a derived key and operating as the owner key.
const DerivedPublicKeyBase58Check =
this.identityService.identityServiceUsers[PublicKeyBase58Check]
?.derivedPublicKeyBase58Check;

let req = this.post(endpoint, BackendRoutes.ExchangeBitcoinRoute, {
PublicKeyBase58Check,
DerivedPublicKeyBase58Check,
BurnAmountSatoshis,
LatestBitcionAPIResponse,
BTCDepositAddress,
Expand All @@ -829,6 +835,7 @@ export class BackendApiService {
switchMap((res) =>
this.post(endpoint, BackendRoutes.ExchangeBitcoinRoute, {
PublicKeyBase58Check,
DerivedPublicKeyBase58Check,
BurnAmountSatoshis,
LatestBitcionAPIResponse,
BTCDepositAddress,
Expand Down

0 comments on commit 16a9b4c

Please sign in to comment.