Skip to content

Commit

Permalink
default to base adapter if no adapter was found
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aboelenein committed Mar 26, 2024
1 parent 8fe2d10 commit c156725
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
getDefaultProvider,
removeDefaultProvider,
RpcErrorCode,
BaseAdapter,
} from '@sats-connect/core';

Check failure on line 14 in src/index.ts

View workflow job for this annotation

GitHub Actions / publish-beta

Cannot find module '@sats-connect/core' or its corresponding type declarations.
import {
Config,
Expand Down Expand Up @@ -112,8 +113,9 @@ class WalletProvider {
}
}
const adapter = { ...this.defaultAdapters, ...this.userAdapters }[this.providerId as string];

const response = await new adapter().request(method, params);
const response = adapter
? await new adapter().request(method, params)
: await new BaseAdapter(this.providerId as string).request(method, params);
if (!response) {
return {
status: 'error',
Expand Down

0 comments on commit c156725

Please sign in to comment.