-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (signer-btc): Implement getWalletAddress device action and sample a…
…pp getWalletAddress
- Loading branch information
1 parent
808e5a6
commit 4d3fb61
Showing
20 changed files
with
867 additions
and
80 deletions.
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,5 @@ | ||
--- | ||
"@ledgerhq/device-signer-kit-bitcoin": minor | ||
--- | ||
|
||
Implement get wallet device action and sample app getWalletAddress |
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
47 changes: 47 additions & 0 deletions
47
packages/signer/signer-btc/src/api/app-binder/GetWalletAddressDeviceActionTypes.ts
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,47 @@ | ||
import { | ||
type CommandErrorResult, | ||
type DeviceActionState, | ||
type ExecuteDeviceActionReturnType, | ||
type OpenAppDAError, | ||
type OpenAppDARequiredInteraction, | ||
} from "@ledgerhq/device-management-kit"; | ||
|
||
import { type WalletAddress } from "@api/model/Wallet"; | ||
import { type Wallet as ApiWallet } from "@api/model/Wallet"; | ||
import { type BtcErrorCodes } from "@internal/app-binder/command/utils/bitcoinAppErrors"; | ||
|
||
export type GetWalletAddressDAOutput = WalletAddress; | ||
|
||
export type GetWalletAddressDAInput = { | ||
checkOnDevice: boolean; | ||
wallet: ApiWallet; | ||
change: boolean; | ||
addressIndex: number; | ||
}; | ||
|
||
export type GetWalletAddressDAError = | ||
| OpenAppDAError | ||
| CommandErrorResult<BtcErrorCodes>["error"]; | ||
|
||
type GetWalletAddressDARequiredInteraction = OpenAppDARequiredInteraction; | ||
|
||
export type GetWalletAddressDAIntermediateValue = { | ||
requiredUserInteraction: GetWalletAddressDARequiredInteraction; | ||
}; | ||
|
||
export type GetWalletAddressDAState = DeviceActionState< | ||
GetWalletAddressDAOutput, | ||
GetWalletAddressDAError, | ||
GetWalletAddressDAIntermediateValue | ||
>; | ||
|
||
export type GetWalletAddressDAInternalState = { | ||
readonly error: GetWalletAddressDAError | null; | ||
readonly walletAddress: WalletAddress | null; | ||
}; | ||
|
||
export type GetWalletAddressDAReturnType = ExecuteDeviceActionReturnType< | ||
GetWalletAddressDAOutput, | ||
GetWalletAddressDAError, | ||
GetWalletAddressDAIntermediateValue | ||
>; |
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
4 changes: 4 additions & 0 deletions
4
packages/signer/signer-btc/src/api/model/WalletAddressOptions.ts
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,4 @@ | ||
export type WalletAddressOptions = { | ||
checkOnDevice?: boolean; | ||
change?: boolean; | ||
}; |
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
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.