### Hierarchy

- Instance
  - ValueInstance

## Index

### Constructors

- constructor

### Properties

- _value
- contractID
- darcID
- data
- id
- rpc
- argumentValue
- commandUpdate
- contractID

### Accessors

- value

### Methods

- toBytes
- update
- updateValue
- calcInstID
- create
- fromBytes
- fromByzcoin
- fromProof
- spawn

## Constructors

### constructor

- new ValueInstance(rpc: ByzCoinRPC, inst: Instance): ValueInstance

- Overrides Instance.constructor

  - Defined in src/byzcoin/contracts/value-instance.ts:87

  Constructs a new ValueInstance. If the instance is not of type ValueInstance, an error will be thrown.

  #### Parameters

  - ##### rpc: ByzCoinRPC

    a working RPC instance

  - ##### inst: Instance

    an instance representing a ValueInstance

  #### Returns ValueInstance

## Properties

### _value

_value: Buffer

- Defined in src/byzcoin/contracts/value-instance.ts:80

### contractID

contractID: string

Inherited from Instance.contractID

- Defined in src/byzcoin/instance.ts:67

### darcID

darcID: InstanceID

Inherited from Instance.darcID

- Defined in src/byzcoin/instance.ts:68

### data

data: Buffer

Inherited from Instance.data

- Defined in src/byzcoin/instance.ts:69

### id

id: InstanceID

Inherited from Instance.id

- Defined in src/byzcoin/instance.ts:66

### Private rpc

rpc: ByzCoinRPC

- Defined in src/byzcoin/contracts/value-instance.ts:96

a working RPC instance

### Static argumentValue

argumentValue: "value" = "value"

- Defined in src/byzcoin/contracts/value-instance.ts:9

### Static commandUpdate

commandUpdate: "update" = "update"

- Defined in src/byzcoin/contracts/value-instance.ts:8

### Static contractID

contractID: "value" = "value"

- Defined in src/byzcoin/contracts/value-instance.ts:7

## Accessors

### value

- get value(): Buffer

- - Defined in src/byzcoin/contracts/value-instance.ts:85

  #### Returns Buffer

  value of the instance

## Methods

### toBytes

- toBytes(): Buffer

- Inherited from Instance.toBytes

  - Defined in src/byzcoin/instance.ts:81

  Returns a byte representation of the Instance.

  #### Returns Buffer

### update

- update(): Promise<ValueInstance>

- - Defined in src/byzcoin/contracts/value-instance.ts:132

  Update the data of this instance

  #### Returns Promise<ValueInstance>

  the updated instance

### updateValue

- updateValue(signers: Signer[], value: Buffer, wait?: number): Promise<void>

- - Defined in src/byzcoin/contracts/value-instance.ts:112

  Update the value

  #### Parameters

  - ##### signers: Signer[]

    The list of signers for the transaction

  - ##### value: Buffer

    The new value to be set

  - ##### Optional wait: number

    Number of blocks to wait for inclusion

  #### Returns Promise<void>

### Static calcInstID

- calcInstID(contractID: string, preID: Buffer): InstanceID

- Inherited from Instance.calcInstID

  - Defined in src/byzcoin/instance.ts:60

  Returns the instanceID given a contract and a preID

  #### Parameters

  - ##### contractID: string

  - ##### preID: Buffer

  #### Returns InstanceID

### Static create

- create(bc: ByzCoinRPC, valueID: InstanceID, darcID: InstanceID, value: Buffer): ValueInstance

- - Defined in src/byzcoin/contracts/value-instance.ts:53

  Create returns a ValueInstance from the given parameters.

  #### Parameters

  - ##### bc: ByzCoinRPC

  - ##### valueID: InstanceID

  - ##### darcID: InstanceID

  - ##### value: Buffer

  #### Returns ValueInstance

### Static fromBytes

- fromBytes(buf: Buffer): Instance

- Inherited from Instance.fromBytes

  - Defined in src/byzcoin/instance.ts:45

  Returns an instance from a previously toBytes() call.

  #### Parameters

  - ##### buf: Buffer

  #### Returns Instance

### Static fromByzcoin

- fromByzcoin(bc: ByzCoinRPC, iid: InstanceID, waitMatch?: number, interval?: number): Promise<ValueInstance>

- Overrides Instance.fromByzcoin

  - Defined in src/byzcoin/contracts/value-instance.ts:75

  Initializes using an existing ValueInstance from ByzCoin

  #### Parameters

  - ##### bc: ByzCoinRPC

    The RPC to use

  - ##### iid: InstanceID

    The instance ID

  - ##### Default value waitMatch: number = 0

    how many times to wait for a match - useful if its called just after an addTransactionAndWait.

  - ##### Default value interval: number = 1000

    how long to wait between two attempts in waitMatch.

  #### Returns Promise<ValueInstance>

  a promise that resolves with the coin instance

### Static fromProof

- fromProof(id: InstanceID, p: Proof): Instance

- Inherited from Instance.fromProof

  - Defined in src/byzcoin/instance.ts:18

  Create an instance from a proof

  #### Parameters

  - ##### id: InstanceID

    the instance-id to extract

  - ##### p: Proof

    The proof

  #### Returns Instance

  the instance

### Static spawn

- spawn(bc: ByzCoinRPC, darcID: InstanceID, signers: Signer[], value: Buffer, preID?: Buffer): Promise<ValueInstance>

- - Defined in src/byzcoin/contracts/value-instance.ts:21

  Spawn a value instance from a darc id

  #### Parameters

  - ##### bc: ByzCoinRPC

    The RPC to use

  - ##### darcID: InstanceID

    The darc instance ID

  - ##### signers: Signer[]

    The list of signers for the transaction

  - ##### value: Buffer

    The value to be put in the value instance

  - ##### Optional preID: Buffer

    Can be used to set the InstanceID of the value

  #### Returns Promise<ValueInstance>

  a promise that resolves with the new instance

Generated using TypeDoc