{
    "type": "object",
    "properties": {
        "type": {
            "$ref": "https://raw.githubusercontent.com/acrylplatform/acryl-transactions/master/src/schemas/IInvokeScriptTransaction.json#/definitions/TRANSACTION_TYPE.INVOKE_SCRIPT"
        },
        "dApp": {
            "type": "string"
        },
        "feeAssetId": {
            "type": [
                "null",
                "string"
            ]
        },
        "call": {
            "$ref": "https://raw.githubusercontent.com/acrylplatform/acryl-transactions/master/src/schemas/IInvokeScriptTransaction.json#/definitions/IInvokeScriptCall"
        },
        "payment": {
            "type": "array",
            "items": {
                "$ref": "https://raw.githubusercontent.com/acrylplatform/acryl-transactions/master/src/schemas/IInvokeScriptTransaction.json#/definitions/IInvokeScriptPayment<string|number>"
            }
        },
        "timestamp": {
            "type": "number"
        },
        "fee": {
            "$ref": "https://raw.githubusercontent.com/acrylplatform/acryl-transactions/master/src/schemas/IInvokeScriptTransaction.json#/definitions/LONG"
        },
        "version": {
            "type": "number"
        },
        "proofs": {
            "description": "ITransaction signatures",
            "minItems": 0,
            "maxItems": 8,
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "senderPublicKey": {
            "description": "Account public key. This account will pay fee and this account's script will be executed if exists",
            "type": "string"
        },
        "chainId": {
            "description": "Network byte.\nE.g.,\n65 is used for Acryl mainnet, 75 for Acryl testnet",
            "type": "number"
        }
    },
    "required": [
        "chainId",
        "dApp",
        "fee",
        "proofs",
        "senderPublicKey",
        "timestamp",
        "type",
        "version"
    ],
    "definitions": {
        "TRANSACTION_TYPE.INVOKE_SCRIPT": {
            "type": "number",
            "enum": [
                16
            ]
        },
        "IInvokeScriptCall": {
            "type": "object",
            "properties": {
                "function": {
                    "description": "Function name",
                    "type": "string"
                },
                "args": {
                    "description": "Array of function arguments. E.g.:\n{type: 'integer', value: 200} or\n{ type: 'binary', value: 'base64:AQa3b8tH'}",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "enum": [
                                    "binary",
                                    "boolean",
                                    "integer",
                                    "string"
                                ],
                                "type": "string"
                            },
                            "value": {
                                "type": [
                                    "string",
                                    "number",
                                    "boolean"
                                ]
                            }
                        },
                        "required": [
                            "type",
                            "value"
                        ]
                    }
                }
            },
            "required": [
                "args",
                "function"
            ]
        },
        "IInvokeScriptPayment<string|number>": {
            "type": "object",
            "properties": {
                "assetId": {
                    "type": [
                        "null",
                        "string"
                    ]
                },
                "amount": {
                    "type": [
                        "string",
                        "number"
                    ]
                }
            },
            "required": [
                "amount",
                "assetId"
            ]
        },
        "LONG": {
            "type": [
                "number"
            ]
        }
    },
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://raw.githubusercontent.com/acrylplatform/acryl-transactions/master/src/schemas/IInvokeScriptTransaction.json"
}
