Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CreateAndExerciseCommand

Create a contract and exercise a choice on it in the same transaction.

Example:

{
    commandType: 'create',
    templateId: {
        packageId: 'some-package-id',
        moduleName: 'SomeModule',
        entityName: 'SomeTemplate'
    },
    createArguments: {
        fields: {
            owner: {
                valueType: 'party',
                party: 'Alice'
            }
        }
    },
    choice: 'Issue',
    choiceArgument: {
        valueType: 'record',
        fields: {
            quantity: {
                valueType: 'int64',
                int64: '100'
            },
            price: {
                valueType: 'decimal',
                decimal: '42'
            }
        }
    }
}

To express values in a more concise way, you can have a look at the ValueHelpers.

see

Identifier

see

Record

see

Value

Hierarchy

  • CreateAndExerciseCommand

Index

Properties

choice

choice: string

The name of the choice the client wants to exercise.

choiceArgument

choiceArgument: Value

The argument for this choice.

commandType

commandType: "createAndExercise"

A fixed type tag that identifies this as a create-and-exercise command

createArguments

createArguments: Record

The arguments required for creating a contract from this template.

templateId

templateId: Identifier

The template of the contract the client wants to create

Generated using TypeDoc