polygonprovider
v0.0.3
Published
An ethers-compatible provider for polygon using the polygonscan.com third-party service.
Downloads
3
Readme
DevDannyC Package: Polygon Provider
Installing and Importing
Node
/home/ricmoo> npm i polygonprovider
// JavaScript
const { PolygonscanProvider } = require("polygonprovider");
// TypeScript
import { PolygonscanProvider } from "polygonprovider";
Browser
Include the ESM module (ethers-polygonscan-provider.esm.js) in the same folder as the core library (i.e. ethers.esm.js) and import using:
<script type="module">
import { PolygonscanProvider } from "./polygon.esm.js";
</script>
Application Programming Interface (API)
getDefaultProvider(networkish?)
Create a new default provider connected to networkish, which may
be a chain name (i.e. "polygon-mainnet"
or "polygon-testnet
") or chain ID.
This will create a FallbackProvider, backed by all popular Third-Party polygon services (currently only polygoncsan).
PolygonscanProvider
The API for this provider is identical to the EtherscanProvider, except uses polygonscan.com (which is owned and operated by the same company as Etherscan and has the same underlying API) as its source for the Polygon network.
See EtherscanProvider.
License
MIT License.