# Class ContractInstanceEncoder

The ContractInstanceEncoder class. Can encode transactions, resolve overloads, and wrap values. Differs from the [[ContractEncoder]] only in that it carries a `to` address for non-constructor transactions. See below for a method listing.

#### Hierarchy

- ContractInstanceEncoder

- Defined in encoder/lib/encoders.ts:1467

#####
Index

### Constructors

constructor

### Properties

contractEncoder
toAddress

### Methods

encodeCreation
encodeTransaction
encodeTxNoResolution
resolveAndWrap
wrap
wrapElementaryValue
wrapForTransaction

## Constructors

### `Protected` constructor

- new ContractInstanceEncoder(contractEncoder, toAddress): ContractInstanceEncoder
- `Protected`

  #### Parameters

  - ##### contractEncoder: ContractEncoder

  - ##### toAddress: string

  #### Returns ContractInstanceEncoder

  - Defined in encoder/lib/encoders.ts:1474

## Properties

### `Private` contractEncoder

contractEncoder: ContractEncoder

- Defined in encoder/lib/encoders.ts:1468

### `Private` toAddress

toAddress: string

- Defined in encoder/lib/encoders.ts:1469

## Methods

### encodeCreation

- encodeCreation(inputs, options?): Promise<Options>

- This method is asynchronous.

  This method functions identically to [[ContractEncoder.encodeCreation]]. The particular contract instance is ignored, only its class is used.

  #### Parameters

  - ##### inputs: unknown[]

  - ##### options: ResolveOptions = {}

  #### Returns Promise<Options>

  - Defined in encoder/lib/encoders.ts:1610

### encodeTransaction

- encodeTransaction(abisOrNameOrSig, inputs, options?): Promise<TxAndAbi>

- This method is asynchronous.

  This method functions identically to [[ContractEncoder.encodeTransaction]], except that the `to` option is automatically set to this contract instance's address. If an explicit `to` address is passed as a transaction option, it will be recognized but ignored.

  #### Parameters

  - ##### abisOrNameOrSig: string | FunctionEntry[]

  - ##### inputs: unknown[]

  - ##### options: ResolveOptions = {}

  #### Returns Promise<TxAndAbi>

  - Defined in encoder/lib/encoders.ts:1587

### encodeTxNoResolution

- encodeTxNoResolution(abi, inputs, options?): Promise<Options>

- This method is asynchronous.

  This method functions identically to [[ContractEncoder.encodeTxNoResolution]], except that, when preparing a function transaction, the `to` option is automatically set to this contract instance's address. If an explicit `to` address is passed as a transaction option, it will be recognized but ignored.

  #### Parameters

  - ##### abi: FunctionEntry | ConstructorEntry

  - ##### inputs: unknown[]

  - ##### options: ResolveOptions = {}

  #### Returns Promise<Options>

  - Defined in encoder/lib/encoders.ts:1558

### resolveAndWrap

- resolveAndWrap(abis, inputs, options?): Promise<Resolution>

- This method is asynchronous.

  This method functions identically to [[ContractEncoder.resolveAndWrap]], except that the `to` option is automatically set to this contract instance's address. If an explicit `to` address is passed as a transaction option, it will be recognized but ignored.

  #### Parameters

  - ##### abis: string | FunctionEntry[]

  - ##### inputs: unknown[]

  - ##### options: ResolveOptions = {}

  #### Returns Promise<Resolution>

  - Defined in encoder/lib/encoders.ts:1535

### wrap

- wrap(dataType, input): Promise<Value>

- See [[ProjectEncoder.wrap]].

  #### Parameters

  - ##### dataType: Type

  - ##### input: unknown

  #### Returns Promise<Value>

  - Defined in encoder/lib/encoders.ts:1495

### wrapElementaryValue

- wrapElementaryValue(dataType, input): Promise<ElementaryValue>

- See [[ProjectEncoder.wrapElementaryValue]].

  #### Parameters

  - ##### dataType: ElementaryType

  - ##### input: unknown

  #### Returns Promise<ElementaryValue>

  - Defined in encoder/lib/encoders.ts:1485

### wrapForTransaction

- wrapForTransaction(abi, inputs, options?): Promise<Resolution>

- This method is asynchronous.

  This method functions identically to [[ContractEncoder.wrapForTransaction]], except that, when preparing a function transaction, the `to` option is automatically set to this contract instance's address. If an explicit `to` address is passed as a transaction option, it will be recognized but ignored.

  #### Parameters

  - ##### abi: FunctionEntry | ConstructorEntry

  - ##### inputs: unknown[]

  - ##### options: ResolveOptions = {}

  #### Returns Promise<Resolution>

  - Defined in encoder/lib/encoders.ts:1511

Generated using TypeDoc