-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: psbt error and controller handling
- Loading branch information
1 parent
25f0bb9
commit 30b9f50
Showing
10 changed files
with
125 additions
and
98 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
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
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
export enum BitcoinErrorMessage { | ||
InsufficientFunds = 'Insufficient funds', | ||
NoInputsToSign = 'No inputs to sign', | ||
NoOutputsToSign = 'No outputs to sign', | ||
} | ||
|
||
export class BitcoinError extends Error { | ||
constructor(message: string) { | ||
public message: BitcoinErrorKey; | ||
constructor(message: BitcoinErrorKey) { | ||
super(message); | ||
this.name = 'BitcoinError'; | ||
this.message = message; | ||
|
||
// Fix the prototype chain | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} | ||
|
||
export type BitcoinErrorKey = | ||
| 'InvalidAddress' | ||
| 'InsufficientFunds' | ||
| 'NoInputsToSign' | ||
| 'NoOutputsToSign'; |
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