### Hierarchy

- Instance
  - OnChainSecretInstance

## Index

### Constructors

- constructor

### Properties

- contractID
- darcID
- data
- id
- rpc
- write
- contractID

### Methods

- toBytes
- calcInstID
- fromBytes
- fromByzcoin
- fromProof
- spawn

## Constructors

### constructor

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

- Overrides Instance.constructor

  - Defined in src/calypso/calypso-instance.ts:59

  #### Parameters

  - ##### rpc: ByzCoinRPC

  - ##### inst: Instance

  #### Returns OnChainSecretInstance

## Properties

### 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/calypso/calypso-instance.ts:61

### write

write: Write

- Defined in src/calypso/calypso-instance.ts:59

### Static contractID

contractID: "longTermSecret" = "longTermSecret"

- Defined in src/calypso/calypso-instance.ts:16

## Methods

### toBytes

- toBytes(): Buffer

- Inherited from Instance.toBytes

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

  Returns a byte representation of the Instance.

  #### Returns Buffer

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

- Overrides Instance.fromByzcoin

  - Defined in src/calypso/calypso-instance.ts:55

  Initializes using an existing coinInstance 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<OnChainSecretInstance>

  a promise that resolves with the OnChainSecret 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[]): Promise<OnChainSecretInstance>

- - Defined in src/calypso/calypso-instance.ts:27

  Spawn a longTermSecret instance

  #### Parameters

  - ##### bc: ByzCoinRPC

    The RPC to use

  - ##### darcID: InstanceID

    The darc instance ID

  - ##### signers: Signer[]

    The list of signers for the transaction

  #### Returns Promise<OnChainSecretInstance>

  a promise that resolves with the new instance

Generated using TypeDoc