Sha256: 752ddd970ad2d7a660f6d2e89808816dbca68b31ef8257fc3e56c0c884663dba

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.invokeValidator = void 0;
const ts_types_1 = require("@waves/ts-types");
const validators_1 = require("./validators");
const invokeScheme = {
    type: validators_1.isEq(ts_types_1.TRANSACTION_TYPE.INVOKE_SCRIPT),
    senderPublicKey: validators_1.isPublicKey,
    version: validators_1.orEq([undefined, 1, 2]),
    dApp: validators_1.isRecipient,
    call: validators_1.ifElse(validators_1.isRequired(false), validators_1.defaultValue(true), validators_1.validatePipe(validators_1.pipe(validators_1.prop('function'), validators_1.isString), validators_1.pipe(validators_1.prop('function'), validators_1.prop('length'), validators_1.gte(0)), validators_1.pipe(validators_1.prop('args'), validators_1.isArray), (data) => data.every(validators_1.validatePipe(validators_1.isRequired(true), validators_1.isValidDataPair)))),
    payment: validators_1.validatePipe(validators_1.isArray, (data) => data.every(validators_1.validatePipe(validators_1.pipe(validators_1.prop('amount'), validators_1.isNumberLike), validators_1.pipe(validators_1.prop('assetId'), validators_1.isWavesOrAssetId)))),
    fee: validators_1.isNaturalNumberOrZeroLike,
    feeAssetId: validators_1.isWavesOrAssetId,
    chainId: validators_1.isNaturalNumberLike,
    timestamp: validators_1.isNaturalNumberLike,
    proofs: validators_1.ifElse(validators_1.isArray, validators_1.defaultValue(true), validators_1.orEq([undefined])),
};
exports.invokeValidator = validators_1.validateByShema(invokeScheme, validators_1.getError);
//# sourceMappingURL=invoke-script.js.map

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
waves_lib-0.1.0 js/node_modules/@waves/waves-transactions/dist/validators/invoke-script.js