-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JsonRpcProvider: Basic access authentication support
With this patch, `JsonRpcProvider` accepts a url with basic authentication credentials like this: ``` const PoktEndpoint = 'https://scott:[email protected]'; const provider = new JsonRpcProvider({ rpcUrl: PoktEndpoint, dispatchers: [PoktEndpoint], }); ```
- Loading branch information
Showing
2 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,10 @@ import { | |
} from "./config.js"; | ||
|
||
// Instantiate a provider for querying information on the chain! | ||
// | ||
// MAINNET_RPC_URL and an element of DISPATCHERS is a string representing an | ||
// endpoint URL to the Pocket Network which may or may not contains basic | ||
// authentication credentials e.g. "https://scott:[email protected]". | ||
export const provider = new JsonRpcProvider({ | ||
rpcUrl: MAINNET_RPC_URL, | ||
// If you'll Instantiate a relayer, you need to add dispatchers as well | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters