-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #873 from ant-design/feat/bitcoin-psbt
feat(bitcoin): add signPsbt API
- Loading branch information
Showing
14 changed files
with
386 additions
and
115 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 @@ | ||
--- | ||
"@ant-design/web3-bitcoin": minor | ||
--- | ||
|
||
feat: support signPsbt api |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export class NoProviderError extends Error { | ||
name: string; | ||
|
||
constructor(message = 'No Bitcoin wallet installed') { | ||
super(message); | ||
// Ensure the name of this error is the same as the class name | ||
this.name = this.constructor.name; | ||
} | ||
} | ||
|
||
export class NoAddressError extends Error { | ||
name: string; | ||
|
||
constructor(message = "Can't get address from Bitcoin wallet") { | ||
super(message); | ||
this.name = this.constructor.name; | ||
} | ||
} |
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,3 +1,4 @@ | ||
export * from './provider'; | ||
export * from './wallets'; | ||
export * from './types'; | ||
export { useBitcoinWallet } from './adapter/useBitcoinWallet'; |
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,19 @@ | ||
export type { SignPsbtResult, BitcoinProvider } from 'sats-connect'; | ||
|
||
export interface SignPsbtOptions { | ||
signInputs?: Record<string, number[]>; | ||
broadcast?: boolean; | ||
signHash?: number; | ||
} | ||
|
||
export interface SignPsbtParams { | ||
psbt: string; | ||
options?: SignPsbtOptions; | ||
} | ||
|
||
export interface TransferParams { | ||
to: string; | ||
sats: number; | ||
// feeRate is only for unisat. Users can set their desired transaction fee by xverse. | ||
options?: { feeRate: number }; | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.