Skip to content

Commit

Permalink
update chagnelog
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinedc committed Jan 15, 2024
1 parent 43a150c commit 1bdc8ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.9] - 2024-01-15
### Changed
- Handle Basic auth

## [0.1.8] - 2024-01-15
### Changed
- Always skip first block
Expand Down
12 changes: 11 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,17 @@ const main = async () => {
}
});

const transport = workspace.rpcServer.startsWith('ws') ? webSocket() : http();
const fetchOptions = () => {
const rpcServer: URL = new URL(workspace.rpcServer);
if (rpcServer.username.length || rpcServer.password.length) {
const base64Credentials = btoa(`${rpcServer.username}:${rpcServer.password}`);
return { headers: { 'Authorization': `Basic ${base64Credentials}` }};
}
else
return {};
};

const transport = workspace.rpcServer.startsWith('ws') ? webSocket() : http(new URL(workspace.rpcServer).origin, { fetchOptions: fetchOptions() });

const client = createPublicClient({ chain, transport });

Expand Down

0 comments on commit 1bdc8ad

Please sign in to comment.