Skip to content

Instantly share code, notes, and snippets.

@ch3ll0v3k

ch3ll0v3k/test.js

Created Mar 22, 2019
Embed
What would you like to do?
CVTResMessage: function( inp ){
switch( inp ){
case 'address must be valid': return 'At least one address supplied in the request was invalid. Addresses are validated before processing a request. If validation fails, an error containing this message is returned. ';
case 'FAILURE_SERVER_LIMIT': return 'The number of accounts that are allowed to harvest on NIS was exceeded.';
case 'FAILURE_UNKNOWN_ACCOUNT': return 'The account specified in the request is not known.';
case 'FAILURE_PAST_DEADLINE': return 'The deadline for the entity has already expired. The deadline must always lie in the future.';
case 'FAILURE_FUTURE_DEADLINE': return 'The deadline lies too far in the future. Deadlines are only allowed to lie up to 24 hours in the future.';
case 'FAILURE_INSUFFICIENT_BALANCE': return 'The account does not have enough funds.';
case 'FAILURE_MESSAGE_TOO_LARGE': return 'The message for the transaction exceeds the limit of 512 bytes.';
case 'FAILURE_HASH_EXISTS': return 'The hash of the entity already exists either in the cache or in the database.';
case 'FAILURE_SIGNATURE_NOT_VERIFIABLE': return 'The signature of the entity failed upon verification.';
case 'FAILURE_TIMESTAMP_TOO_FAR_IN_PAST': return 'The timestamp of the entity lies to far in the past.';
case 'FAILURE_TIMESTAMP_TOO_FAR_IN_FUTURE': return 'The timestamp of the entity lies too far in the future.';
case 'FAILURE_INELIGIBLE_BLOCK_SIGNER': return 'Validation failed because the block had an ineligible signer. This usually occurs when remote harvesting is in the process of being activated or deactivated. ';
case 'FAILURE_ENTITY_UNUSABLE_OUT_OF_SYNC': return 'The entity cannot be processed because the remote node is out of synchronization with the local node. This happens frequently when a node is not fully synchronized and receives a new block with much larger height than its own chain. ';
case 'FAILURE_INSUFFICIENT_FEE': return 'The supplied transaction has an insufficient fee.';
case 'FAILURE_NEMESIS_ACCOUNT_TRANSACTION_AFTER_NEMESIS_BLOCK': return 'The supplied transaction has the nemesis account as sender and cannot be included in a normal block.';
case 'FAILURE_TRANSACTION_CACHE_TOO_FULL': return 'The transaction was rejected because the transaction cache is too full. This happens when an account tries to send too many transactions in a short time. To improve the chance that the transaction gets accepted you can try to raise the transaction fee. ';
case 'FAILURE_WRONG_NETWORK': return 'Entity was rejected because it has the wrong network specified.';
case 'FAILURE_CANNOT_HARVEST_FROM_BLOCKED_ACCOUNT': return 'Block was rejected because it was harvested by a blocked account (typically a reserved NEM fund).';
case 'FAILURE_DESTINATION_ACCOUNT_HAS_NONZERO_BALANCE': return 'The importance cannot be transferred to an account with nonzero balance.';
case 'FAILURE_IMPORTANCE_TRANSFER_IN_PROGRESS': return 'The transaction is conflicting because there is already a transfer of importance in progress.';
case 'FAILURE_IMPORTANCE_TRANSFER_NEEDS_TO_BE_DEACTIVATED': return 'The transaction is conflicting because the importance was already transferred.';
case 'FAILURE_IMPORTANCE_TRANSFER_IS_NOT_ACTIVE': return 'The transaction is conflicting because no importance has been transferred yet.';
case 'FAILURE_TRANSACTION_NOT_ALLOWED_FOR_REMOTE': return 'Validation failed because transaction is using remote account in an improper way.';
case 'FAILURE_MULTISIG_NOT_A_COSIGNER': return 'The multisig transaction was rejected because the signer of the transaction is not a cosignatory of the sender account of the inner transaction. ';
case 'FAILURE_MULTISIG_INVALID_COSIGNERS': return 'Validation failed because the cosignatories attached to a multisig transaction were invalid.';
case 'FAILURE_MULTISIG_NO_MATCHING_MULTISIG': return 'The signature transaction was rejected because the corresponding multisig transaction was not found.';
case 'FAILURE_TRANSACTION_NOT_ALLOWED_FOR_MULTISIG': return 'The transaction was rejected because the signer is a multisig account. Multisig accounts are not allowed to initiate any transaction (only cosignatories are allowed to do so). ';
case 'FAILURE_MULTISIG_ALREADY_A_COSIGNER': return 'The transaction was rejected because it tried to add a cosignatory to a multisig account which already has this cosignatory.';
case 'FAILURE_MULTISIG_MODIFICATION_MULTIPLE_DELETES': return 'The transaction was rejected because it tried to remove multiple cosignatories at once. It is only allowed to remove one cosignatory at a time.';
case 'FAILURE_MULTISIG_MODIFICATION_REDUNDANT_MODIFICATIONS': return 'The transaction was rejected because it tried to do redundant modifications. This can happen if a transaction tries to add the same cosignatory two time. ';
case 'FAILURE_CONFLICTING_MULTISIG_MODIFICATION': return 'The transaction was rejected because it contained conflicting modifications to a multisig account. This can for instance happen if a transaction tries to add and then delete the same cosignatory. ';
case 'FAILURE_TOO_MANY_MULTISIG_COSIGNERS': return 'The transaction was rejected because it contains too many cosignatories. The maximum number of cosignatories allowed for a multisig account is 32. ';
case 'FAILURE_MULTISIG_ACCOUNT_CANNOT_BE_COSIGNER': return 'Validation failed because a multisig modification would result in a multisig account being a cosigner.';
case 'FAILURE_MULTISIG_MIN_COSIGNATORIES_OUT_OF_RANGE': return 'Validation failed because the minimum number of cosignatories is negative or larger than the number of cosignatories.';
case 'FAILURE_NAMESPACE_UNKNOWN': return 'Validation failed because the namespace is unknown.';
case 'FAILURE_NAMESPACE_ALREADY_EXISTS': return 'Validation failed because the namespace already exists.';
case 'FAILURE_NAMESPACE_EXPIRED': return 'Validation failed because the namespace has expired.';
case 'FAILURE_NAMESPACE_OWNER_CONFLICT': return 'Validation failed because the transaction signer is not the owner of the namespace.';
case 'FAILURE_NAMESPACE_INVALID_NAME': return 'Validation failed because the name for the namespace is invalid.';
case 'FAILURE_NAMESPACE_INVALID_RENTAL_FEE_SINK': return 'Validation failed because the specified namespace rental fee sink is invalid.';
case 'FAILURE_NAMESPACE_INVALID_RENTAL_FEE': return 'Validation failed because the specified rental fee is invalid.';
case 'FAILURE_NAMESPACE_PROVISION_TOO_EARLY': return 'Validation failed because the provision was done too early.';
case 'FAILURE_NAMESPACE_NOT_CLAIMABLE': return 'Validation failed because the namespace contains a reserved part and is not claimable.';
case 'FAILURE_MOSAIC_UNKNOWN': return 'Validation failed because the mosaic is unknown.';
case 'FAILURE_MOSAIC_MODIFICATION_NOT_ALLOWED': return 'Validation failed because the modification of the existing mosaic is not allowed.';
case 'FAILURE_MOSAIC_CREATOR_CONFLICT': return 'Validation failed because the transaction signer is not the creator of the mosaic.';
case 'FAILURE_MOSAIC_SUPPLY_IMMUTABLE': return 'Validation failed because the mosaic supply is immutable.';
case 'FAILURE_MOSAIC_MAX_SUPPLY_EXCEEDED': return 'Validation failed because the maximum overall mosaic supply is exceeded.';
case 'FAILURE_MOSAIC_SUPPLY_NEGATIVE': return 'Validation failed because the resulting mosaic supply would be negative.';
case 'FAILURE_MOSAIC_NOT_TRANSFERABLE': return 'Validation failed because the mosaic is not transferable.';
case 'FAILURE_MOSAIC_DIVISIBILITY_VIOLATED': return 'Validation failed because the divisibility of the mosaic is violated.';
case 'FAILURE_CONFLICTING_MOSAIC_CREATION': return 'Validation failed because conflicting mosaic creation is present.';
case 'FAILURE_MOSAIC_INVALID_CREATION_FEE_SINK': return 'Validation failed because the mosaic creation fee sink is invalid.';
case 'FAILURE_MOSAIC_INVALID_CREATION_FEE': return 'Validation failed because the specified creation fee is invalid.';
case 'FAILURE_TOO_MANY_MOSAIC_TRANSFERS': return 'Validation failed because a transfer transaction had too many attached mosaic transfers.';
}
return inp;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment