provider-infura.d.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * [[link-infura]] 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. * - Arbitrum Goerli Testnet (``arbitrum-goerli``)
  12. * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)
  13. * - Base (``base``)
  14. * - Base Goerlia Testnet (``base-goerli``)
  15. * - Base Sepolia Testnet (``base-sepolia``)
  16. * - BNB Smart Chain Mainnet (``bnb``)
  17. * - BNB Smart Chain Testnet (``bnbt``)
  18. * - Linea (``linea``)
  19. * - Linea Goerli Testnet (``linea-goerli``)
  20. * - Linea Sepolia Testnet (``linea-sepolia``)
  21. * - Optimism (``optimism``)
  22. * - Optimism Goerli Testnet (``optimism-goerli``)
  23. * - Optimism Sepolia Testnet (``optimism-sepolia``)
  24. * - Polygon (``matic``)
  25. * - Polygon Amoy Testnet (``matic-amoy``)
  26. * - Polygon Mumbai Testnet (``matic-mumbai``)
  27. *
  28. * @_subsection: api/providers/thirdparty:INFURA [providers-infura]
  29. */
  30. import { FetchRequest } from "../utils/index.js";
  31. import { Network } from "./network.js";
  32. import { JsonRpcProvider } from "./provider-jsonrpc.js";
  33. import { WebSocketProvider } from "./provider-websocket.js";
  34. import type { AbstractProvider } from "./abstract-provider.js";
  35. import type { CommunityResourcable } from "./community.js";
  36. import type { Networkish } from "./network.js";
  37. /**
  38. * The **InfuraWebSocketProvider** connects to the [[link-infura]]
  39. * WebSocket end-points.
  40. *
  41. * By default, a highly-throttled API key is used, which is
  42. * appropriate for quick prototypes and simple scripts. To
  43. * gain access to an increased rate-limit, it is highly
  44. * recommended to [sign up here](link-infura-signup).
  45. */
  46. export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable {
  47. /**
  48. * The Project ID for the INFURA connection.
  49. */
  50. readonly projectId: string;
  51. /**
  52. * The Project Secret.
  53. *
  54. * If null, no authenticated requests are made. This should not
  55. * be used outside of private contexts.
  56. */
  57. readonly projectSecret: null | string;
  58. /**
  59. * Creates a new **InfuraWebSocketProvider**.
  60. */
  61. constructor(network?: Networkish, projectId?: string);
  62. isCommunityResource(): boolean;
  63. }
  64. /**
  65. * The **InfuraProvider** connects to the [[link-infura]]
  66. * JSON-RPC end-points.
  67. *
  68. * By default, a highly-throttled API key is used, which is
  69. * appropriate for quick prototypes and simple scripts. To
  70. * gain access to an increased rate-limit, it is highly
  71. * recommended to [sign up here](link-infura-signup).
  72. */
  73. export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable {
  74. /**
  75. * The Project ID for the INFURA connection.
  76. */
  77. readonly projectId: string;
  78. /**
  79. * The Project Secret.
  80. *
  81. * If null, no authenticated requests are made. This should not
  82. * be used outside of private contexts.
  83. */
  84. readonly projectSecret: null | string;
  85. /**
  86. * Creates a new **InfuraProvider**.
  87. */
  88. constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string);
  89. _getProvider(chainId: number): AbstractProvider;
  90. isCommunityResource(): boolean;
  91. /**
  92. * Creates a new **InfuraWebSocketProvider**.
  93. */
  94. static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider;
  95. /**
  96. * Returns a prepared request for connecting to %%network%%
  97. * with %%projectId%% and %%projectSecret%%.
  98. */
  99. static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest;
  100. }
  101. //# sourceMappingURL=provider-infura.d.ts.map