# RpcProviderWithRetries

Defined in: [atomiq-chain-starknet/src/starknet/provider/RpcProviderWithRetries.ts:73](https://github.com/atomiqlabs/atomiq-chain-starknet/blob/697277c430597a8514a43540ef8b9a10e2b6a595/src/starknet/provider/RpcProviderWithRetries.ts#L73)

An RPC provider with built-in retry functionality, retries calls to the RPC service on failure

## Extends

* `unknown`

## Constructors

### Constructor

```
new RpcProviderWithRetries(options?, retryPolicy?): RpcProviderWithRetries;
```

Defined in: [atomiq-chain-starknet/src/starknet/provider/RpcProviderWithRetries.ts:83](https://github.com/atomiqlabs/atomiq-chain-starknet/blob/697277c430597a8514a43540ef8b9a10e2b6a595/src/starknet/provider/RpcProviderWithRetries.ts#L83)

Creates a new RPC provider which retries RPC calls on failure, controlled by the passed `retryPolicy` NOTE: Tries to do naive detection of the spec version based on the suffix of nodeUrl, better pass the `options.specVersion` in the options!

#### Parameters

| Parameter                  | Type                                                                        | Description |
| -------------------------- | --------------------------------------------------------------------------- | ----------- |
| `options?`                 | `RpcProviderOptions`                                                        |             |
| `retryPolicy?`             | { `delay?`: `number`; `exponential?`: `boolean`; `maxRetries?`: `number`; } |             |
| `retryPolicy.delay?`       | `number`                                                                    | -           |
| `retryPolicy.exponential?` | `boolean`                                                                   | -           |
| `retryPolicy.maxRetries?`  | `number`                                                                    | -           |

#### Returns

`RpcProviderWithRetries`

#### Overrides

```
RpcProvider.constructor
```
