provider-ankr.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * [[link-ankr]] provides a third-party service for connecting to
  3. * various blockchains over JSON-RPC.
  4. *
  5. * **Supported Networks**
  6. *
  7. * - Ethereum Mainnet (``mainnet``)
  8. * - Goerli Testnet (``goerli``)
  9. * - Sepolia Testnet (``sepolia``)
  10. * - Arbitrum (``arbitrum``)
  11. * - Base (``base``)
  12. * - Base Goerlia Testnet (``base-goerli``)
  13. * - Base Sepolia Testnet (``base-sepolia``)
  14. * - BNB (``bnb``)
  15. * - BNB Testnet (``bnbt``)
  16. * - Optimism (``optimism``)
  17. * - Optimism Goerli Testnet (``optimism-goerli``)
  18. * - Optimism Sepolia Testnet (``optimism-sepolia``)
  19. * - Polygon (``matic``)
  20. * - Polygon Mumbai Testnet (``matic-mumbai``)
  21. *
  22. * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]
  23. */
  24. import { FetchRequest } from "../utils/index.js";
  25. import { AbstractProvider } from "./abstract-provider.js";
  26. import { Network } from "./network.js";
  27. import { JsonRpcProvider } from "./provider-jsonrpc.js";
  28. import type { CommunityResourcable } from "./community.js";
  29. import type { Networkish } from "./network.js";
  30. import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js";
  31. /**
  32. * The **AnkrProvider** connects to the [[link-ankr]]
  33. * JSON-RPC end-points.
  34. *
  35. * By default, a highly-throttled API key is used, which is
  36. * appropriate for quick prototypes and simple scripts. To
  37. * gain access to an increased rate-limit, it is highly
  38. * recommended to [sign up here](link-ankr-signup).
  39. */
  40. export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable {
  41. /**
  42. * The API key for the Ankr connection.
  43. */
  44. readonly apiKey: string;
  45. /**
  46. * Create a new **AnkrProvider**.
  47. *
  48. * By default connecting to ``mainnet`` with a highly throttled
  49. * API key.
  50. */
  51. constructor(_network?: Networkish, apiKey?: null | string);
  52. _getProvider(chainId: number): AbstractProvider;
  53. /**
  54. * Returns a prepared request for connecting to %%network%% with
  55. * %%apiKey%%.
  56. */
  57. static getRequest(network: Network, apiKey?: null | string): FetchRequest;
  58. getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error;
  59. isCommunityResource(): boolean;
  60. }
  61. //# sourceMappingURL=provider-ankr.d.ts.map