Ant Design Web3 officially provides @ant-design/web3-bitcoin
to adapt to Bitcoin, which provides the ability for @ant-design/web3
components to connect to Bitcoin. You don't need to handle the connection status of the components yourself. It will provide relevant global states and interfaces for the components through Web3ConfigProvider
. At the same time, you don't need to customize the handling of wallets. useBitcoinWallet
exposes common methods such as signing and transactions, which can be directly called. Of course, you can still call the unique APIs of different wallets through provider
.
The wallets currently supported are as follows, and we also welcome you to submit GitHub issues or PRs to support other wallets.
Property | Description | Type | Default | Version |
---|---|---|---|---|
autoConnect | Whether to connect automatically | boolean | false | - |
balance | Whether to display balance | boolean | false | - |
wallets | Wallets | WalletFactory[] | - | - |
locale | Multilingual settings | Locale | - | - |
Property | Description | Type | Version |
---|---|---|---|
name | The connected wallet's name | string | 1.0.0 |
provider | The connected wallet's provider | any | 1.0.0 |
account | Represents the web3 account address of the current user | string | 1.0.0 |
connect | Connect the wallet | () => Promise<void> | 1.0.0 |
getBalance | Get the balance of the wallet | () => Promise<Balance> | 1.0.0 |
signMessage | Sign message | (message: string) => Promise<string> | 1.0.0 |
sendTransfer | Transfer bticoin | (prams: TranssferParams) => Promise<string> | 1.0.0 |
signPsbt | Sign PSBT | (params: SignPsbtParams) => Promise<SignPsbtResult> | 1.1.0 |
getInscriptions | Get Inscriptions | (offset?: number, size?: number) => Promise<{ total: number; list: Inscription[] }> | 1.3.0 |
Property | Description | Type | Default | Version |
---|---|---|---|---|
to | The recipient's address | string | - | - |
sats | The amount to send to the recipient in satoshis(1BTC = 100000000sats) | number | - | - |
options | Options, transaction fee rate | { feeRate: number } | - | - |
Property | Description | Type | Default | Version |
---|---|---|---|---|
psbt | The base64 encoded PSBT to sign | string | - | - |
options | Psbt options | SignPsbtOptions | - | - |
Property | Description | Type | Default | Version |
---|---|---|---|---|
signInputs | The inputs to sign. The key is the address and the value is an array of indexes of the inputs to sign | Record<string, number[]> | - | - |
broadcast | Whether to broadcast the transaction after signing | boolean | false | - |
signHash | The sigHash type to use for signing. Will default to the sighash type of the input if not provided. | number | - | - |
Property | Description | Type | Default | Version |
---|---|---|---|---|
psbt | The base64 encoded PSBT after signing | string | - | - |
txid | The transaction hash, only returned if broadcast equals true | string | - | - |
Property | Description | Type | Default | Version |
---|---|---|---|---|
inscriptionId | Inscription id | string | - | - |
address | Inscription number | string | - | - |
outputValue | The output value of inscription | string | - | - |
content | The content url of inscription | string | - | - |
contentLength | The content length of inscription | string | - | - |
contentType | The content type of inscription | string | - | - |
preview | The preview link | string | - | - |
timestamp | The blocktime of inscription | number | - | - |
offset | The offset of inscription | number | - | - |
genesisTransaction | The txid of genesis transaction | string | - | - |
location | The txid and vout of current location | string | - | - |