Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
order.actions.forEach((action) => {
action.ledgerId = provider.encoder.normalizeAddress(action.ledgerId);
action['senderId'] = action['senderId'] ? provider.encoder.normalizeAddress(action['senderId']) : action['senderId'] = ZERO_ADDRESS;
if (action.kind !== ActionsOrderActionKind.UPDATE_ASSET_IMPRINT && action.kind !== ActionsOrderActionKind.DESTROY_ASSET) {
action['receiverId'] = action['receiverId'] ? provider.encoder.normalizeAddress(action['receiverId']) : action['receiverId'] = ZERO_ADDRESS;
if (action['senderId'] === ZERO_ADDRESS && action['receiverId'] === ZERO_ADDRESS) {
throw new ProviderError(ProviderIssue.WRONG_INPUT, 'Both senderId and receiverId missing.');
}
}
});
}