Instance with basic information

### Hierarchy

- Instance
  - DarcInstance
  - BEvmInstance
  - CoinInstance
  - CredentialsInstance
  - PopPartyInstance
  - OnChainSecretInstance
  - CalypsoWriteInstance
  - CalypsoReadInstance
  - RoPaSciInstance
  - ValueInstance
  - SpawnerInstance

## Index

### Constructors

- constructor

### Properties

- contractID
- darcID
- data
- id

### Methods

- toBytes
- calcInstID
- fromBytes
- fromByzcoin
- fromProof

## Constructors

### constructor

- new Instance(init: Properties<Instance> | Instance): Instance

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

  #### Parameters

  - ##### init: Properties<Instance> | Instance

  #### Returns Instance

## Properties

### contractID

contractID: string

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

### darcID

darcID: InstanceID

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

### data

data: Buffer

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

### id

id: InstanceID

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

## Methods

### toBytes

- toBytes(): Buffer

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

  Returns a byte representation of the Instance.

  #### Returns Buffer

### Static calcInstID

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

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

  Returns the instanceID given a contract and a preID

  #### Parameters

  - ##### contractID: string

  - ##### preID: Buffer

  #### Returns InstanceID

### Static fromBytes

- fromBytes(buf: Buffer): Instance

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

  Returns an instance from a previously toBytes() call.

  #### Parameters

  - ##### buf: Buffer

  #### Returns Instance

### Static fromByzcoin

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

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

  Create an instance after requesting its proof to byzcoin

  #### Parameters

  - ##### rpc: ByzCoinRPC

    The RPC to use

  - ##### iid: InstanceID

    The ID of the instance

  - ##### 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<Instance>

  the instance if it exists

### Static fromProof

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

- - 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

Generated using TypeDoc