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



# Class: WrapperService


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

## Index

### Properties

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


### Methods

* [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:128](https://github.com/daostack/arc.js/blob/77005d4/lib/wrapperService.ts#L128)*



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="wrappers"></a>

### «Static» wrappers

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

*Defined in [wrapperService.ts:118](https://github.com/daostack/arc.js/blob/77005d4/lib/wrapperService.ts#L118)*



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)>,.<[ContractWrapperBase](ContractWrapperBase.md)>*  =  new Map<Address, ContractWrapperBase>()

*Defined in [wrapperService.ts:138](https://github.com/daostack/arc.js/blob/77005d4/lib/wrapperService.ts#L138)*



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:122](https://github.com/daostack/arc.js/blob/77005d4/lib/wrapperService.ts#L122)*



Contract wrapper factories grouped by type




___


## Methods
<a id="getContractWrapper"></a>

### «Static» getContractWrapper

► **getContractWrapper**(contractName: *`string`*, address?: *`string`*): `Promise`.<[ContractWrapperBase](ContractWrapperBase.md)⎮`undefined`>



*Defined in [wrapperService.ts:239](https://github.com/daostack/arc.js/blob/77005d4/lib/wrapperService.ts#L239)*



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

Most useful when you have both contract name and 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" |
| address | `string`   |  optional |





**Returns:** `Promise`.<[ContractWrapperBase](ContractWrapperBase.md)⎮`undefined`>





___

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

### «Static» initialize

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



*Defined in [wrapperService.ts:146](https://github.com/daostack/arc.js/blob/77005d4/lib/wrapperService.ts#L146)*



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 | Description |
| ------ | ------ | ------ |
| options | [WrapperServiceInitializeOptions](../interfaces/WrapperServiceInitializeOptions.md)   |  - |





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





___


