Skip to content

Commit

Permalink
Merge pull request #97 from secretkeylabs/update-ui
Browse files Browse the repository at this point in the history
Use new default selector config
  • Loading branch information
m-aboelenein authored Apr 15, 2024
2 parents 94cd716 + 37fb520 commit 97b5166
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 35 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,16 @@ await Wallet.disconnect();
## Documentation

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

## Development

### Build the package

```bash
npm run build
```
### Run example app

```bash
npm run dev:example
```
9 changes: 5 additions & 4 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 120 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
]
},
"dependencies": {
"@sats-connect/core": "0.0.4",
"@sats-connect/ui": "0.0.3"
"@sats-connect/core": "0.0.5",
"@sats-connect/ui": "0.0.4",
"@sats-connect/make-default-provider-config": "0.0.1"
},
"devDependencies": {
"husky": "^8.0.3",
Expand All @@ -32,7 +33,7 @@
"rimraf": "^3.0.2",
"ts-jest": "^29.0.5",
"tsup": "^8.0.2",
"typescript": "^4.9.4"
"typescript": "5"
},
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
removeDefaultProvider,
RpcErrorCode,
BaseAdapter,
createDefaultConfig,
} from '@sats-connect/core';
import {
Config,
Expand All @@ -21,6 +20,7 @@ import {
walletOpen,
walletClose,
} from '@sats-connect/ui';
import { makeDefaultConfig } from '@sats-connect/make-default-provider-config';

loadSelector();

Expand Down Expand Up @@ -48,9 +48,11 @@ class Wallet {
throw new Error('No wallets detected, may want to prompt user to install a wallet.');
}

console.log('[ARY]: providers', providers);

const selectorConfig = this.createCustomConfig
? this.createCustomConfig(providers)
: createDefaultConfig(providers);
: makeDefaultConfig(providers);
const nextProviderId = await selectWalletProvider(selectorConfig);
this.providerId = nextProviderId;
}
Expand Down

0 comments on commit 97b5166

Please sign in to comment.