Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
queueExtrinsic = ({ extrinsic, nonce, publicKey, values }: QueueTx$Extrinsic): QueueTx$Id => {
const { apiSupport } = this.props;
const params = Object.values(extrinsic.params);
const isValid = values.length === params.length &&
params.reduce((isValid, param, index) =>
isValid && !isUndefined(values[index]),
true
);
const encoded = isValid && extrinsic.params
? encode(extrinsic, values, apiSupport)
: new Uint8Array([]);
return this.queueAdd({
isValid,
nonce: nonce || new BN(0),
publicKey,
rpc,
values: [encoded]
});
}
}