Skip to content

Commit

Permalink
Added Ethereum testnets support and fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
luyzdeleon committed Jan 18, 2021
1 parent 6cc3434 commit fa987a6
Show file tree
Hide file tree
Showing 31 changed files with 878 additions and 398 deletions.
5 changes: 3 additions & 2 deletions docs.wrm/api-keys.wrm
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ const provider = ethers.getDefaultProvider(network, {
// projectSecret: YOUR_INFURA_PROJECT_SECRET,
// },
alchemy: YOUR_ALCHEMY_API_KEY,
pocket: YOUR_POCKET_APPLICATION_KEY
pocket_gateway: YOUR_POCKET_APPLICATION_KEY
// Or if using an application secret key:
// pocket: {
// pocket_gateway: {
// applicationId: ,
// applicationSecretKey:
// endpointType: <loadbalancer || application>
// }
});
14 changes: 11 additions & 3 deletions docs.wrm/api/providers/api-providers.wrm
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,24 @@ you also need to specify the ``applicationID`` property.
- ``applicationOrigin``: By specifying this property you are setting the `Origin` header in your request
(remember that browsers will swap this header based on the actual origin of the website loaded).
- ``applicationUserAgent``: By specifying this property you are setting the `User-Agent` header in your request.
- ``endpointType``: By specifying this property you can select to connect via the Pocket Gateway Single Application endpoint or a Load Balancer Endpoint (defaults to Load Balancer)

The //network// and //apiKey// are specified the same as [the constructor](PocketGatewayProvider).

_note: Note: Default API keys
In the event of the //apiKey// not being present in the constructor, a shared ApplicationID will be provided,
which has the capacity of sending up to 1 million requests per day (41,750 per hour).
which has the capacity of sending up to 10 million requests per day (417,500 per hour) for Ethereum Mainnet,
for Ropsten, Rinkeby and G&ouml;rli there's a shared capacity of 1 million requests per day each (41,750 per hour).

For production applications it is highly recommended to register your application on the
[Pocket Gateway](link-pocket-gateway) for your own API key.

_definition: **Supported Networks**

- Homestead (Mainnet Full nodes (Archival Support coming soon))
- Homestead (Mainnet Full nodes (non-Archival Nodes))
- Ropsten (proof-of-work testnet)
- Rinkeby (proof-of-authority testnet)
- G&ouml;rli (clique testnet)

_code: Pocket Gateway Examples @lang<javascript>

Expand All @@ -122,6 +127,8 @@ const applicationId = "...";
const applicationSecretKey = "...";
const applicationOrigin = "...";
const applicationUserAgent = "...";
// Endpoint Type can be either application or loadbalancer
const endpointType = "...";
// </hide>

// Connect to mainnet (homestead)
Expand All @@ -136,7 +143,8 @@ provider = new PocketGatewayProvider("homestead", {
applicationId: applicationId,
applicationSecretKey: applicationSecretKey,
applicationOrigin: applicationOrigin,
applicationUserAgent: applicationUserAgent
applicationUserAgent: applicationUserAgent,
endpointType: endpointType
});

_subsection: InfuraProvider @<InfuraProvider> @INHERIT<[[UrlJsonRpcProvider]]> @src<providers:class.InfuraProvider>
Expand Down
82 changes: 72 additions & 10 deletions package-lock.json

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

Loading

0 comments on commit fa987a6

Please # to comment.