This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 300
[LL-8097] sell/fund flow #4361
Merged
Merged
[LL-8097] sell/fund flow #4361
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
46aa392
LL-6995 POC for platform exchange
juan-cortes d16ed5d
Forward the transactionType to the commands/device actions
juan-cortes f50f327
It's exchangeType not transactionType
juan-cortes 1e54dc7
tmp rename
juan-cortes f5f8eb0
Folder name casing fix
juan-cortes 9661b3e
wip: test sell flow
4cbe983
preventBackdropClick for platform related modals
4152690
Call onCancel callback when closing modal body
b977529
Clean up integration in WebPlatformPlayer
81f6304
cleanup completeExchange body modal
5311259
Add sell flow UI in device actions
42f3e2b
fixup! cleanup completeExchange body modal
47bc65b
wip: set live-common dep url to related commit
4336554
wip: update LLC dep
715cc7e
Add proper modal for fund flow
chabroA 8f774fe
fixup! Add proper modal for fund flow
chabroA 9cd1bca
update yarn.lock
chabroA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// @flow | ||
|
||
import type { Observable } from "rxjs"; | ||
import { from } from "rxjs"; | ||
import type { ExchangeRaw } from "@ledgerhq/live-common/lib/exchange/platform/types"; | ||
import completeExchange from "@ledgerhq/live-common/lib/exchange/platform/completeExchange"; | ||
import { fromExchangeRaw } from "@ledgerhq/live-common/lib/exchange/platform/serialization"; | ||
import type { TransactionRaw } from "@ledgerhq/live-common/lib/types"; | ||
import { fromTransactionRaw } from "@ledgerhq/live-common/lib/transaction"; | ||
|
||
type Input = { | ||
deviceId: string, | ||
provider: string, | ||
binaryPayload: string, | ||
signature: string, | ||
exchange: ExchangeRaw, | ||
transaction: TransactionRaw, | ||
exchangeType: number, | ||
}; | ||
|
||
const cmd = ({ | ||
deviceId, | ||
provider, | ||
binaryPayload, | ||
signature, | ||
exchange, | ||
transaction, | ||
exchangeType, | ||
}: Input): Observable<any> => { | ||
// TODO type the events? | ||
return from( | ||
completeExchange({ | ||
deviceId, | ||
provider, | ||
binaryPayload, | ||
signature, | ||
exchange: fromExchangeRaw(exchange), | ||
transaction: fromTransactionRaw(transaction), | ||
exchangeType, | ||
}), | ||
); | ||
}; | ||
export default cmd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// @flow | ||
|
||
import type { Observable } from "rxjs"; | ||
import { from } from "rxjs"; | ||
import startExchange from "@ledgerhq/live-common/lib/exchange/platform/startExchange"; | ||
|
||
type Input = { | ||
deviceId: string, | ||
exchangeType: number, | ||
}; | ||
|
||
const cmd = ({ deviceId, exchangeType }: Input): Observable<any> => { | ||
return from( | ||
startExchange({ | ||
deviceId, | ||
exchangeType, | ||
}), | ||
); | ||
}; | ||
export default cmd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not in the case statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering why you have the conditional statement within the 0x02 case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it just less lines of code rather than writing the return statement in both the 0x01 and the 0x02 statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it avoids code duplication.
FYI it is not only within the 0x02 case, but also within the 0x01 case (cf. -> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch#methods_for_multi-criteria_case)