Skip to content

Commit fa987a6

Browse files
committed
Added Ethereum testnets support and fixed bugs
1 parent 6cc3434 commit fa987a6

31 files changed

+878
-398
lines changed

docs.wrm/api-keys.wrm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ const provider = ethers.getDefaultProvider(network, {
130130
// projectSecret: YOUR_INFURA_PROJECT_SECRET,
131131
// },
132132
alchemy: YOUR_ALCHEMY_API_KEY,
133-
pocket: YOUR_POCKET_APPLICATION_KEY
133+
pocket_gateway: YOUR_POCKET_APPLICATION_KEY
134134
// Or if using an application secret key:
135-
// pocket: {
135+
// pocket_gateway: {
136136
// applicationId: ,
137137
// applicationSecretKey:
138+
// endpointType: <loadbalancer || application>
138139
// }
139140
});

docs.wrm/api/providers/api-providers.wrm

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,24 @@ you also need to specify the ``applicationID`` property.
100100
- ``applicationOrigin``: By specifying this property you are setting the `Origin` header in your request
101101
(remember that browsers will swap this header based on the actual origin of the website loaded).
102102
- ``applicationUserAgent``: By specifying this property you are setting the `User-Agent` header in your request.
103+
- ``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)
103104

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

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

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

113115
_definition: **Supported Networks**
114116

115-
- Homestead (Mainnet Full nodes (Archival Support coming soon))
117+
- Homestead (Mainnet Full nodes (non-Archival Nodes))
118+
- Ropsten (proof-of-work testnet)
119+
- Rinkeby (proof-of-authority testnet)
120+
- G&ouml;rli (clique testnet)
116121

117122
_code: Pocket Gateway Examples @lang<javascript>
118123

@@ -122,6 +127,8 @@ const applicationId = "...";
122127
const applicationSecretKey = "...";
123128
const applicationOrigin = "...";
124129
const applicationUserAgent = "...";
130+
// Endpoint Type can be either application or loadbalancer
131+
const endpointType = "...";
125132
// </hide>
126133

127134
// Connect to mainnet (homestead)
@@ -136,7 +143,8 @@ provider = new PocketGatewayProvider("homestead", {
136143
applicationId: applicationId,
137144
applicationSecretKey: applicationSecretKey,
138145
applicationOrigin: applicationOrigin,
139-
applicationUserAgent: applicationUserAgent
146+
applicationUserAgent: applicationUserAgent,
147+
endpointType: endpointType
140148
});
141149

142150
_subsection: InfuraProvider @<InfuraProvider> @INHERIT<[[UrlJsonRpcProvider]]> @src<providers:class.InfuraProvider>

package-lock.json

Lines changed: 72 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)