[API Reference](../README.md) > [WrapperService](../classes/WrapperService.md)

# Class: WrapperService

Service that provides access to Arc.js contract wrapper classes and class factories.

## Hierarchy

**WrapperService**

## Index

### Properties

* [factories](WrapperService.md#factories)
* [nonUniversalSchemeFactories](WrapperService.md#nonUniversalSchemeFactories)
* [schemeFactories](WrapperService.md#schemeFactories)
* [universalSchemeFactories](WrapperService.md#universalSchemeFactories)
* [wrappers](WrapperService.md#wrappers)
* [wrappersByAddress](WrapperService.md#wrappersByAddress)
* [wrappersByType](WrapperService.md#wrappersByType)

### Methods

* [confirmContractType](WrapperService.md#confirmContractType)
* [getContractWrapper](WrapperService.md#getContractWrapper)
* [initialize](WrapperService.md#initialize)

---

## Properties

<a id="factories"></a>

### `<Static>` factories

**● factories**: *[ArcWrapperFactories](../interfaces/ArcWrapperFactories.md)* =  {} as ArcWrapperFactories

*Defined in [wrapperService.ts:221](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L221)*

Wrapper factories by name. Use these when you want to do `.at()` or `.new()`. You can also use for `deployed()`, but the wrappers for deployed contracts are directly available from the `wrappers` and `wrappersByType` properties.

___
<a id="nonUniversalSchemeFactories"></a>

### `<Static>` nonUniversalSchemeFactories

**● nonUniversalSchemeFactories**: *[ArcNonUniversalSchemeWrapperFactories](../interfaces/ArcNonUniversalSchemeWrapperFactories.md)* =  {} as ArcNonUniversalSchemeWrapperFactories

*Defined in [wrapperService.ts:229](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L229)*

Non-universal scheme contract wrapper factories by name.

___
<a id="schemeFactories"></a>

### `<Static>` schemeFactories

**● schemeFactories**: *[ArcSchemeWrapperFactories](../interfaces/ArcSchemeWrapperFactories.md)* =  {} as ArcSchemeWrapperFactories

*Defined in [wrapperService.ts:233](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L233)*

All scheme contract wrapper factories by name.

___
<a id="universalSchemeFactories"></a>

### `<Static>` universalSchemeFactories

**● universalSchemeFactories**: *[ArcUniversalSchemeWrapperFactories](../interfaces/ArcUniversalSchemeWrapperFactories.md)* =  {} as ArcUniversalSchemeWrapperFactories

*Defined in [wrapperService.ts:225](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L225)*

Universal scheme contract wrapper factories by name.

___
<a id="wrappers"></a>

### `<Static>` wrappers

**● wrappers**: *[ArcWrappers](../interfaces/ArcWrappers.md)* =  {} as ArcWrappers

*Defined in [wrapperService.ts:211](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L211)*

Wrappers by name, hydrated with contracts as deployed by the running version of Arc.js.

___
<a id="wrappersByAddress"></a>

### `<Static>` wrappersByAddress

**● wrappersByAddress**: *`Map`<[Address](../#Address), [IContractWrapper](../interfaces/IContractWrapper.md)>* =  new Map<Address, IContractWrapper>()

*Defined in [wrapperService.ts:243](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L243)*

Map of contract wrappers keyed by address. For example:

`const wrapper = WrapperService.wrappersByAddress.get(anAddress);`

Currently only returns the wrappers for contracts that were deployed by the running version of Arc.js.

___
<a id="wrappersByType"></a>

### `<Static>` wrappersByType

**● wrappersByType**: *[ArcWrappersByType](../interfaces/ArcWrappersByType.md)* =  {} as ArcWrappersByType

*Defined in [wrapperService.ts:215](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L215)*

Contract wrapper factories grouped by type

___

## Methods

<a id="confirmContractType"></a>

### `<Static>` confirmContractType

▸ **confirmContractType**(contractWrapperFound: *`any`*): `Promise`<`boolean`>

*Defined in [wrapperService.ts:385](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L385)*

Confirm the given contract wrapper wraps the same contract as it purports to, and is the one deployed in the running version of Arc.js.

This will reject wrappers of different versions of contracts with the same name in Arc.

**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| contractWrapperFound | `any` |   |

**Returns:** `Promise`<`boolean`>

___
<a id="getContractWrapper"></a>

### `<Static>` getContractWrapper

▸ **getContractWrapper**(contractName: *`string`*, address?: *`string`*): `Promise`< [IContractWrapper](../interfaces/IContractWrapper.md) &#124; `undefined`>

*Defined in [wrapperService.ts:362](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L362)*

Returns the promise of an Arc.js contract wrapper or undefined if not found.

Most useful when you have both contract name and maybe the address and wish to most efficiently return the associated wrapper, or undefined when not found.

**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| contractName | `string` |  name of an Arc contract, like "SchemeRegistrar" |
| `Optional` address | `string` |  optional |

**Returns:** `Promise`< [IContractWrapper](../interfaces/IContractWrapper.md) &#124; `undefined`>

___
<a id="initialize"></a>

### `<Static>` initialize

▸ **initialize**(options?: *[WrapperServiceInitializeOptions](../interfaces/WrapperServiceInitializeOptions.md)*): `Promise`<`void`>

*Defined in [wrapperService.ts:251](https://github.com/daostack/arc.js/blob/6f704389/lib/wrapperService.ts#L251)*

initialize() must be called before any of the static properties will have values. It is called by ArcInitialize(), which in tur must be invoked by any application using Arc.js.

**Parameters:**

| Param | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `Default value` options | [WrapperServiceInitializeOptions](../interfaces/WrapperServiceInitializeOptions.md) |  {} |   |

**Returns:** `Promise`<`void`>

___

