Skip to content

Commit

Permalink
add usage example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aboelenein committed Apr 5, 2024
1 parent a46850c commit 70ac819
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,39 @@ Developers building apps on the Bitcoin ecosystem can use Sats connect to intera
npm i sats-connect
```

## Usage

### import

```
import Wallet from 'sats-connect';
```


### Connect Wallet

```
const response = await Wallet.request('getAccounts', {
purposes: [
AddressPurpose.Payment,
AddressPurpose.Ordinals,
AddressPurpose.Stacks
],
message: 'Cool app wants to know your addresses!'
});
```
### Request a wallet action

```
await Wallet.request('sendTransfer', {...});
```

### Disconnect Wallet

```
await Wallet.disconnect();
```

## Documentation

For full documentation, visit [docs.xverse.app](https://docs.xverse.app/sats-connect/).

0 comments on commit 70ac819

Please sign in to comment.