An instruction represents one action

### Hierarchy

- Message<Instruction>
  - Instruction
    - InstructionV1

## Index

### Constructors

- constructor

### Properties

- $type
- delete
- instanceID
- invoke
- signatures
- signerCounter
- signerIdentities
- spawn
- $type
- typeDelete
- typeInvoke
- typeSpawn

### Accessors

- type

### Methods

- beautify
- deriveId
- deriveIdArg
- hash
- hashForVersion
- setCounters
- signWith
- toJSON
- updateCounters
- create
- createDelete
- createInvoke
- createSpawn
- decode
- decodeDelimited
- encode
- encodeDelimited
- fromObject
- register
- toObject
- verify

## Constructors

### constructor

- new Instruction(props?: Properties<Instruction>): Instruction

- Overrides Message.__constructor

  - Defined in src/byzcoin/client-transaction.ts:205

  #### Parameters

  - ##### Optional props: Properties<Instruction>

  #### Returns Instruction

## Properties

### $type

$type: Type

Inherited from Message.$type

- Defined in node_modules/protobufjs/index.d.ts:524

Reference to the reflected type.

### delete

delete: Delete

- Defined in src/byzcoin/client-transaction.ts:201

### instanceID

instanceID: InstanceID

- Defined in src/byzcoin/client-transaction.ts:202

### invoke

invoke: Invoke

- Defined in src/byzcoin/client-transaction.ts:200

### signatures

signatures: Buffer[]

- Defined in src/byzcoin/client-transaction.ts:205

### signerCounter

signerCounter: Long[]

- Defined in src/byzcoin/client-transaction.ts:203

### signerIdentities

signerIdentities: IdentityWrapper[]

- Defined in src/byzcoin/client-transaction.ts:204

### spawn

spawn: Spawn

- Defined in src/byzcoin/client-transaction.ts:199

### Static $type

$type: Type

Inherited from Message.$type

- Defined in node_modules/protobufjs/index.d.ts:521

Reference to the reflected type.

### Static typeDelete

typeDelete: 2 = 2

- Defined in src/byzcoin/client-transaction.ts:145

### Static typeInvoke

typeInvoke: 1 = 1

- Defined in src/byzcoin/client-transaction.ts:144

### Static typeSpawn

typeSpawn: 0 = 0

- Defined in src/byzcoin/client-transaction.ts:143

## Accessors

### type

- get type(): InstructionType

- - Defined in src/byzcoin/client-transaction.ts:131

  Get the type of the instruction

  #### Returns InstructionType

  the type as a number

## Methods

### beautify

- beautify(): IBeautifierSchema

- - Defined in src/byzcoin/client-transaction.ts:350

  Return a general-purpose json representation of an instruction that is contracts aware, ie. knows how to render specific contracts arguments. It returns the following status:

  0: the default hex representation is used 1: has been specifically interpreted

  The JSON has the following structure:

  { status: 0 | 1 type: "spawn|invoke|delete", contract: "config|darc|..." args: [ { "name": "<NAME>", "value": "<VALUE>", // Arg value or its summary "full": "<FULL VALUE>" // Optional. useful if the argument // have a very long representation. } ... ] }

  #### Returns IBeautifierSchema

### deriveId

- deriveId(what?: string): Buffer

- - Defined in src/byzcoin/client-transaction.ts:290

  Get the unique identifier of the instruction

  #### Parameters

  - ##### Default value what: string = ""

  #### Returns Buffer

  the id as a buffer

### deriveIdArg

- deriveIdArg(what?: string, arg?: string): InstanceID

- - Defined in src/byzcoin/client-transaction.ts:313

  Returns the instance ID of the new instance to be spawned. If the argument 'arg' exists, it is used to calculate a client-defined ID. If the argument 'arg' doesn't exist, the normal deriveId is used. It throws an error if the instruction is not of type spawn.

  #### Parameters

  - ##### Default value what: string = ""

    to be used if arg is not given

  - ##### Default value arg: string = "preID"

    holding the pre-image of the instanceID

  #### Returns InstanceID

### hash

- hash(): Buffer

- - Defined in src/byzcoin/client-transaction.ts:282

  Hash the instruction

  #### Returns Buffer

  a buffer of the hash

### Protected hashForVersion

- hashForVersion(version: number): Buffer

- - Defined in src/byzcoin/client-transaction.ts:412

  #### Parameters

  - ##### version: number

  #### Returns Buffer

### setCounters

- setCounters(counters: Long[], identities: IdentityWrapper[]): void

- - Defined in src/byzcoin/client-transaction.ts:259

  Set the signer counters and identities

  #### Parameters

  - ##### counters: Long[]

    List of counters

  - ##### identities: IdentityWrapper[]

    List of identities

  #### Returns void

### signWith

- signWith(ctxHash: Buffer, signers: Signer[]): void

- - Defined in src/byzcoin/client-transaction.ts:249

  Use the signers to make a signature of the hash

  #### Parameters

  - ##### ctxHash: Buffer

    The client transaction hash

  - ##### signers: Signer[]

    The list of signers

  #### Returns void

### toJSON

- toJSON(): object

- Inherited from Message.toJSON

  - Defined in node_modules/protobufjs/index.d.ts:589

  Converts this message to JSON.

  #### Returns object

  JSON object

  - ##### [k: string]: any

### updateCounters

- updateCounters(rpc: ICounterUpdater, signers: IIdentity[]): Promise<void>

- - Defined in src/byzcoin/client-transaction.ts:272

  Fetch and update the counters

  #### Parameters

  - ##### rpc: ICounterUpdater

    the RPC to use to fetch

  - ##### signers: IIdentity[]

    the list of signers

  #### Returns Promise<void>

### Static create

- create<T>(this: Constructor<T>, properties?: object): Message<T>

- Inherited from Message.create

  - Defined in node_modules/protobufjs/index.d.ts:531

  Creates a new message of this type using the specified properties.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### Optional properties: object

    - ##### [k: string]: any

  #### Returns Message<T>

  Message instance

### Static createDelete

- createDelete(iid: Buffer, contractID: string): Instruction

- - Defined in src/byzcoin/client-transaction.ts:191

  Helper to create a delete instruction

  #### Parameters

  - ##### iid: Buffer

    The instance ID

  - ##### contractID: string

    The contract name

  #### Returns Instruction

  the instruction

### Static createInvoke

- createInvoke(iid: Buffer, contractID: string, command: string, args: Argument[]): Instruction

- - Defined in src/byzcoin/client-transaction.ts:177

  Helper to create a invoke instruction

  #### Parameters

  - ##### iid: Buffer

    The instance ID

  - ##### contractID: string

    The contract name

  - ##### command: string

    The command to invoke

  - ##### args: Argument[]

    The list of arguments

  #### Returns Instruction

  the instruction

### Static createSpawn

- createSpawn(iid: Buffer, contractID: string, args: Argument[]): Instruction

- - Defined in src/byzcoin/client-transaction.ts:161

  Helper to create a spawn instruction

  #### Parameters

  - ##### iid: Buffer

    The instance ID

  - ##### contractID: string

    The contract name

  - ##### args: Argument[]

    Arguments for the instruction

  #### Returns Instruction

  the instruction

### Static decode

- decode<T>(this: Constructor<T>, reader: Reader | Uint8Array): T

- Inherited from Message.decode

  - Defined in node_modules/protobufjs/index.d.ts:554

  Decodes a message of this type.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### reader: Reader | Uint8Array

    Reader or buffer to decode

  #### Returns T

  Decoded message

### Static decodeDelimited

- decodeDelimited<T>(this: Constructor<T>, reader: Reader | Uint8Array): T

- Inherited from Message.decodeDelimited

  - Defined in node_modules/protobufjs/index.d.ts:561

  Decodes a message of this type preceeded by its length as a varint.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### reader: Reader | Uint8Array

    Reader or buffer to decode

  #### Returns T

  Decoded message

### Static encode

- encode<T>(this: Constructor<T>, message: T | object, writer?: Writer): Writer

- Inherited from Message.encode

  - Defined in node_modules/protobufjs/index.d.ts:539

  Encodes a message of this type.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static encodeDelimited

- encodeDelimited<T>(this: Constructor<T>, message: T | object, writer?: Writer): Writer

- Inherited from Message.encodeDelimited

  - Defined in node_modules/protobufjs/index.d.ts:547

  Encodes a message of this type preceeded by its length as a varint.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static fromObject

- fromObject<T>(this: Constructor<T>, object: object): T

- Inherited from Message.fromObject

  - Defined in node_modules/protobufjs/index.d.ts:575

  Creates a new message of this type from a plain object. Also converts values to their respective internal types.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### object: object

    Plain object

    - ##### [k: string]: any

  #### Returns T

  Message instance

### Static register

- register(): void

- - Defined in src/byzcoin/client-transaction.ts:150
  see

    README#Message classes

  #### Returns void

### Static toObject

- toObject<T>(this: Constructor<T>, message: T, options?: IConversionOptions): object

- Inherited from Message.toObject

  - Defined in node_modules/protobufjs/index.d.ts:583

  Creates a plain object from a message of this type. Also converts values to other types if specified.

  #### Type parameters

  - #### T: Message<Instruction>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T

    Message instance

  - ##### Optional options: IConversionOptions

  #### Returns object

  Plain object

  - ##### [k: string]: any

### Static verify

- verify(message: object): string

- Inherited from Message.verify

  - Defined in node_modules/protobufjs/index.d.ts:568

  Verifies a message of this type.

  #### Parameters

  - ##### message: object

    Plain object to verify

    - ##### [k: string]: any

  #### Returns string

  `null` if valid, otherwise the reason why it is not

Generated using TypeDoc