@wishknish/knishio-client-js 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +207 -274
  2. package/dist/client.iife.js +533 -0
  3. package/package.json +37 -79
  4. package/src/.babelrc +0 -22
  5. package/src/Atom.js +171 -132
  6. package/src/AtomMeta.js +76 -50
  7. package/src/AuthToken.js +38 -47
  8. package/src/KnishIOClient.js +934 -987
  9. package/src/Meta.js +15 -17
  10. package/src/Molecule.js +423 -494
  11. package/src/PolicyMeta.js +32 -41
  12. package/src/TokenUnit.js +30 -32
  13. package/src/Wallet.js +275 -265
  14. package/src/exception/AtomIndexException.js +4 -8
  15. package/src/exception/AtomsMissingException.js +4 -6
  16. package/src/exception/AuthorizationRejectedException.js +4 -5
  17. package/src/exception/BalanceInsufficientException.js +4 -8
  18. package/src/exception/BaseException.js +6 -8
  19. package/src/exception/BatchIdException.js +5 -7
  20. package/src/exception/CodeException.js +4 -8
  21. package/src/{libraries/ApolloLink/HttpLink.js → exception/DecryptionKeyException.js} +12 -15
  22. package/src/exception/InvalidResponseException.js +4 -5
  23. package/src/exception/MetaMissingException.js +4 -6
  24. package/src/exception/MolecularHashMismatchException.js +4 -6
  25. package/src/exception/MolecularHashMissingException.js +4 -5
  26. package/src/exception/NegativeAmountException.js +4 -5
  27. package/src/exception/PolicyInvalidException.js +4 -4
  28. package/src/exception/SignatureMalformedException.js +4 -5
  29. package/src/exception/SignatureMismatchException.js +4 -5
  30. package/src/exception/StackableUnitAmountException.js +4 -5
  31. package/src/exception/StackableUnitDecimalsException.js +4 -5
  32. package/src/exception/TransferBalanceException.js +4 -5
  33. package/src/exception/TransferMalformedException.js +4 -5
  34. package/src/exception/TransferMismatchedException.js +4 -5
  35. package/src/exception/TransferRemainderException.js +4 -5
  36. package/src/exception/TransferToSelfException.js +4 -5
  37. package/src/exception/TransferUnbalancedException.js +4 -5
  38. package/src/exception/UnauthenticatedException.js +4 -5
  39. package/src/{libraries/ApolloLink/AuthLink.js → exception/WalletCredentialException.js} +12 -40
  40. package/src/exception/WalletShadowException.js +4 -5
  41. package/src/exception/WrongTokenTypeException.js +4 -5
  42. package/src/exception/index.js +26 -26
  43. package/src/index.js +8 -10
  44. package/src/instance/Rules/Callback.js +91 -93
  45. package/src/instance/Rules/Condition.js +21 -23
  46. package/src/instance/Rules/Meta.js +13 -14
  47. package/src/instance/Rules/Rule.js +39 -43
  48. package/src/instance/Rules/exception/RuleArgumentException.js +4 -4
  49. package/src/libraries/CheckMolecule.js +253 -232
  50. package/src/libraries/Decimal.js +13 -17
  51. package/src/libraries/Dot.js +74 -48
  52. package/src/libraries/Hex.js +49 -54
  53. package/src/libraries/array.js +50 -41
  54. package/src/libraries/crypto.js +20 -27
  55. package/src/libraries/strings.js +58 -91
  56. package/src/libraries/urql/UrqlClientWrapper.js +166 -0
  57. package/src/mutation/Mutation.js +44 -25
  58. package/src/mutation/MutationActiveSession.js +12 -12
  59. package/src/mutation/MutationClaimShadowWallet.js +15 -17
  60. package/src/mutation/MutationCreateIdentifier.js +11 -12
  61. package/src/mutation/MutationCreateMeta.js +11 -12
  62. package/src/mutation/MutationCreateRule.js +11 -12
  63. package/src/mutation/MutationCreateToken.js +18 -13
  64. package/src/mutation/MutationCreateWallet.js +9 -11
  65. package/src/mutation/MutationDepositBufferToken.js +7 -9
  66. package/src/mutation/MutationLinkIdentifier.js +12 -14
  67. package/src/mutation/MutationProposeMolecule.js +24 -25
  68. package/src/mutation/MutationRequestAuthorization.js +9 -10
  69. package/src/mutation/MutationRequestAuthorizationGuest.js +12 -15
  70. package/src/mutation/MutationRequestTokens.js +11 -14
  71. package/src/mutation/MutationTransferTokens.js +11 -14
  72. package/src/mutation/MutationWithdrawBufferToken.js +7 -10
  73. package/src/query/Query.js +62 -36
  74. package/src/query/QueryActiveSession.js +11 -13
  75. package/src/query/QueryAtom.js +75 -76
  76. package/src/query/QueryBalance.js +11 -12
  77. package/src/query/QueryBatch.js +17 -14
  78. package/src/query/QueryBatchHistory.js +16 -13
  79. package/src/query/QueryContinuId.js +13 -10
  80. package/src/query/QueryMetaType.js +45 -57
  81. package/src/query/QueryMetaTypeViaAtom.js +49 -57
  82. package/src/query/QueryPolicy.js +11 -12
  83. package/src/query/QueryToken.js +11 -13
  84. package/src/query/QueryUserActivity.js +11 -13
  85. package/src/query/QueryWalletBundle.js +15 -47
  86. package/src/query/QueryWalletList.js +15 -16
  87. package/src/response/Response.js +29 -34
  88. package/src/response/ResponseActiveSession.js +6 -6
  89. package/src/response/ResponseAtom.js +29 -30
  90. package/src/response/ResponseAuthorizationGuest.js +17 -18
  91. package/src/response/ResponseBalance.js +12 -13
  92. package/src/response/ResponseClaimShadowWallet.js +1 -1
  93. package/src/response/ResponseContinuId.js +21 -22
  94. package/src/response/ResponseCreateIdentifier.js +1 -1
  95. package/src/response/ResponseCreateMeta.js +1 -1
  96. package/src/response/ResponseCreateRule.js +1 -1
  97. package/src/response/ResponseCreateToken.js +1 -1
  98. package/src/response/ResponseCreateWallet.js +1 -1
  99. package/src/response/ResponseLinkIdentifier.js +9 -10
  100. package/src/response/ResponseMetaBatch.js +6 -8
  101. package/src/response/ResponseMetaType.js +19 -20
  102. package/src/response/ResponseMetaTypeViaAtom.js +19 -19
  103. package/src/response/ResponsePolicy.js +14 -15
  104. package/src/response/ResponseProposeMolecule.js +27 -30
  105. package/src/response/ResponseQueryActiveSession.js +20 -23
  106. package/src/response/ResponseQueryUserActivity.js +11 -12
  107. package/src/response/ResponseRequestAuthorization.js +11 -16
  108. package/src/response/ResponseRequestAuthorizationGuest.js +18 -21
  109. package/src/response/ResponseRequestTokens.js +1 -1
  110. package/src/response/ResponseTransferTokens.js +8 -9
  111. package/src/response/ResponseWalletBundle.js +16 -17
  112. package/src/response/ResponseWalletList.js +44 -47
  113. package/src/subscribe/ActiveSessionSubscribe.js +5 -6
  114. package/src/subscribe/ActiveWalletSubscribe.js +5 -6
  115. package/src/subscribe/CreateMoleculeSubscribe.js +5 -5
  116. package/src/subscribe/Subscribe.js +26 -26
  117. package/src/subscribe/WalletStatusSubscribe.js +5 -6
  118. package/src/versions/HashAtom.js +78 -0
  119. package/src/versions/Version4.js +34 -0
  120. package/src/versions/index.js +5 -0
  121. package/dist/client.umd.js +0 -453
  122. package/src/httpClient/ApolloClient.js +0 -245
  123. package/src/libraries/ApolloLink/CipherLink.js +0 -117
  124. package/src/libraries/ApolloLink/Client.js +0 -231
  125. package/src/libraries/ApolloLink/PusherLink.js +0 -234
  126. package/src/libraries/ApolloLink/handler.js +0 -106
  127. package/src/libraries/Base58.js +0 -71
  128. package/src/libraries/Base64.js +0 -40
  129. package/src/libraries/BaseX.js +0 -91
  130. package/src/libraries/Soda.js +0 -93
  131. package/src/query/QueryMetaInstance.js +0 -99
  132. package/src/test/Test.js +0 -670
  133. package/src/test/TestTokenUnit.js +0 -340
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Atoms must have an index so that they can be sorted in a Molecule
52
52
  */
53
53
  export default class AtomIndexException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,11 +58,8 @@ export default class AtomIndexException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'There is an atom without an index', fileName = null, lineNumber = null ) {
63
-
64
- super( message, fileName, lineNumber );
65
- this.name = 'AtomIndexException';
66
-
61
+ constructor (message = 'There is an atom without an index', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'AtomIndexException'
67
64
  }
68
-
69
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Empty molecules are not allowed
52
52
  */
53
53
  export default class AtomsMissingException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,9 +58,8 @@ export default class AtomsMissingException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'The molecule does not contain atoms', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'AtomsMissingException';
61
+ constructor (message = 'The molecule does not contain atoms', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'AtomsMissingException'
65
64
  }
66
-
67
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when attempt to authorize is rejected by the node
52
52
  */
53
53
  export default class AuthorizationRejectedException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class AuthorizationRejectedException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Authorization attempt rejected by ledger.', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'AuthorizationRejectedException';
61
+ constructor (message = 'Authorization attempt rejected by ledger.', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'AuthorizationRejectedException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when the node does not have enough tokens to fulfill a T request
52
52
  */
53
53
  export default class BalanceInsufficientException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,11 +58,8 @@ export default class BalanceInsufficientException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Insufficient balance for requested transfer', fileName = null, lineNumber = null ) {
63
-
64
- super( message, fileName, lineNumber );
65
- this.name = 'BalanceInsufficientException';
66
-
61
+ constructor (message = 'Insufficient balance for requested transfer', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'BalanceInsufficientException'
67
64
  }
68
-
69
65
  }
@@ -49,27 +49,25 @@ License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
49
49
  * Base exception class
50
50
  */
51
51
  export default class BaseException extends TypeError {
52
-
53
52
  /**
54
53
  * @param {string|null} message
55
54
  * @param {string|null} fileName
56
55
  * @param {number|null} lineNumber
57
56
  */
58
- constructor ( message = null, fileName = null, lineNumber = null ) {
59
- super( message, fileName, lineNumber );
57
+ constructor (message = null, fileName = null, lineNumber = null) {
58
+ super(message, fileName, lineNumber)
60
59
 
61
- if ( null === message ) {
62
- throw new this( `Unknown ${ this.constructor.name }` );
60
+ if (message === null) {
61
+ throw new this(`Unknown ${ this.constructor.name }`)
63
62
  }
64
63
 
65
- this.name = 'BaseException';
64
+ this.name = 'BaseException'
66
65
  }
67
66
 
68
67
  /**
69
68
  * @return {string}
70
69
  */
71
70
  toString () {
72
- return `${ this.name }: ${ this.message }.\nStack:\n${ this.stack }`;
71
+ return `${ this.name }: ${ this.message }.\nStack:\n${ this.stack }`
73
72
  }
74
-
75
73
  }
@@ -1,4 +1,4 @@
1
- import BaseException from './BaseException';
1
+ import BaseException from './BaseException'
2
2
 
3
3
  /**
4
4
  * Generic code exception
@@ -9,10 +9,8 @@ export default class BatchIdException extends BaseException {
9
9
  * @param {string|null} fileName
10
10
  * @param {number|null} lineNumber
11
11
  */
12
- constructor ( message = 'Incorrect BatchId', fileName = null, lineNumber = null ) {
13
-
14
- super( message, fileName, lineNumber );
15
- this.name = 'BatchIdException';
16
-
12
+ constructor (message = 'Incorrect BatchId', fileName = null, lineNumber = null) {
13
+ super(message, fileName, lineNumber)
14
+ this.name = 'BatchIdException'
17
15
  }
18
- }
16
+ }
@@ -45,23 +45,19 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Generic code exception
52
52
  */
53
53
  export default class CodeException extends BaseException {
54
-
55
54
  /**
56
55
  * @param {string|null} message
57
56
  * @param {string|null} fileName
58
57
  * @param {number|null} lineNumber
59
58
  */
60
- constructor ( message = 'Code exception', fileName = null, lineNumber = null ) {
61
-
62
- super( message, fileName, lineNumber );
63
- this.name = 'CodeException';
64
-
59
+ constructor (message = 'Code exception', fileName = null, lineNumber = null) {
60
+ super(message, fileName, lineNumber)
61
+ this.name = 'CodeException'
65
62
  }
66
-
67
63
  }
@@ -45,24 +45,21 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import { HttpLink as RootHttpLink } from '@apollo/client/core';
49
-
50
-
51
- class HttpLink extends RootHttpLink {
52
-
53
- constructor ( options ) {
54
- super( options );
55
- }
48
+ import BaseException from './BaseException'
56
49
 
50
+ /**
51
+ * Decryption key exception
52
+ */
53
+ export default class DecryptionKeyException extends BaseException {
57
54
  /**
55
+ * Class constructor
58
56
  *
59
- * @param {Operation} operation
60
- * @param {NextLink | undefined} forward
61
- * @returns {Observable<FetchResult> | null}
57
+ * @param {string} message
58
+ * @param {string|null} fileName
59
+ * @param {number|null} lineNumber
62
60
  */
63
- request ( operation, forward ) {
64
- return forward( operation );
61
+ constructor (message = 'The decryption key was not valid for the given message.', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'DecryptionKeyException'
65
64
  }
66
65
  }
67
-
68
- export default HttpLink;
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Exception for bad GraphQL responses
52
52
  */
53
53
  export default class InvalidResponseException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class InvalidResponseException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'GraphQL did not provide a valid response.', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'InvalidResponseException';
61
+ constructor (message = 'GraphQL did not provide a valid response.', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'InvalidResponseException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * M isotope atoms must always contain metadata
52
52
  */
53
53
  export default class MetaMissingException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,9 +58,8 @@ export default class MetaMissingException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Empty meta data.', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'MetaMissingException';
61
+ constructor (message = 'Empty meta data.', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'MetaMissingException'
65
64
  }
66
-
67
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Molecular hash does not match - contents may have been tampered with
52
52
  */
53
53
  export default class MolecularHashMismatchException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,9 +58,8 @@ export default class MolecularHashMismatchException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'The molecular hash does not match', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'MolecularHashMismatchException';
61
+ constructor (message = 'The molecular hash does not match', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'MolecularHashMismatchException'
65
64
  }
66
-
67
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * A molecular hash is always required.
52
52
  */
53
53
  export default class MolecularHashMissingException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class MolecularHashMissingException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'The molecular hash is missing', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'MolecularHashMissingException';
61
+ constructor (message = 'The molecular hash is missing', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'MolecularHashMissingException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when a negative amount is provided
52
52
  */
53
53
  export default class NegativeAmountException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class NegativeAmountException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Amount cannot be negative!', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'NegativeAmountException';
61
+ constructor (message = 'Amount cannot be negative!', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'NegativeAmountException'
65
64
  }
66
65
  }
@@ -45,7 +45,7 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Exception for bad GraphQL responses
@@ -58,8 +58,8 @@ export default class PolicyInvalidException extends BaseException {
58
58
  * @param {string|null} fileName
59
59
  * @param {number|null} lineNumber
60
60
  */
61
- constructor ( message = '', fileName = null, lineNumber = null ) {
62
- super( message, fileName, lineNumber );
63
- this.name = 'PolicyInvalidException';
61
+ constructor (message = '', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'PolicyInvalidException'
64
64
  }
65
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when a molecular signature is malformed
52
52
  */
53
53
  export default class SignatureMalformedException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class SignatureMalformedException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'OTS malformed', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'SignatureMalformedException';
61
+ constructor (message = 'OTS malformed', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'SignatureMalformedException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when signature does not match the public key
52
52
  */
53
53
  export default class SignatureMismatchException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class SignatureMismatchException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'One-time signature (OTS) does not match!', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'SignatureMismatchException';
61
+ constructor (message = 'One-time signature (OTS) does not match!', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'SignatureMismatchException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when a stackable token is being transferred with both unit IDs AND an amount specified (ambiguous)
52
52
  */
53
53
  export default class StackableUnitAmountException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class StackableUnitAmountException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Stackable tokens with unit IDs cannot have decimal places!', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'StackableUnitAmountException';
61
+ constructor (message = 'Stackable tokens with unit IDs cannot have an amount!', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'StackableUnitAmountException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when a stackable token is being created with units and non-zero decimals
52
52
  */
53
53
  export default class StackableUnitDecimalsException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class StackableUnitDecimalsException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Stackable tokens with unit IDs cannot have decimal places!', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'StackableUnitDecimalsException';
61
+ constructor (message = 'Stackable tokens with unit IDs cannot have decimal places!', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'StackableUnitDecimalsException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when you try to transfer more tokens than you have available
52
52
  */
53
53
  export default class TransferBalanceException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class TransferBalanceException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Insufficient balance to make transfer', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'TransferBalanceException';
61
+ constructor (message = 'Insufficient balance to make transfer', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'TransferBalanceException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when V isotope atoms are arranged incorrectly
52
52
  */
53
53
  export default class TransferMalformedException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class TransferMalformedException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Token transfer atoms are malformed', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'TransferMalformedException';
61
+ constructor (message = 'Token transfer atoms are malformed', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'TransferMalformedException'
65
64
  }
66
65
  }
@@ -45,20 +45,19 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when the token slugs of wallets involved in a transfer do not match
52
52
  */
53
53
  export default class TransferMismatchedException extends BaseException {
54
-
55
54
  /**
56
55
  * @param {string} message
57
56
  * @param {string|null} fileName
58
57
  * @param {number|null} lineNumber
59
58
  */
60
- constructor ( message = 'Token slugs for wallets in transfer do not match!', fileName = null, lineNumber = null ) {
61
- super( message, fileName, lineNumber );
62
- this.name = 'TransferMismatchedException';
59
+ constructor (message = 'Token slugs for wallets in transfer do not match!', fileName = null, lineNumber = null) {
60
+ super(message, fileName, lineNumber)
61
+ this.name = 'TransferMismatchedException'
63
62
  }
64
63
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when the remainder atom in a V isotope transfer is incorrect
52
52
  */
53
53
  export default class TransferRemainderException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class TransferRemainderException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Invalid remainder provided', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'TransferRemainderException';
61
+ constructor (message = 'Invalid remainder provided', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'TransferRemainderException'
65
64
  }
66
65
  }
@@ -45,13 +45,12 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import BaseException from './BaseException';
48
+ import BaseException from './BaseException'
49
49
 
50
50
  /**
51
51
  * Thrown when attempting to transfer tokens to yourself
52
52
  */
53
53
  export default class TransferToSelfException extends BaseException {
54
-
55
54
  /**
56
55
  * Class constructor
57
56
  *
@@ -59,8 +58,8 @@ export default class TransferToSelfException extends BaseException {
59
58
  * @param {string|null} fileName
60
59
  * @param {number|null} lineNumber
61
60
  */
62
- constructor ( message = 'Sender and recipient(s) cannot be the same', fileName = null, lineNumber = null ) {
63
- super( message, fileName, lineNumber );
64
- this.name = 'TransferToSelfException';
61
+ constructor (message = 'Sender and recipient(s) cannot be the same', fileName = null, lineNumber = null) {
62
+ super(message, fileName, lineNumber)
63
+ this.name = 'TransferToSelfException'
65
64
  }
66
65
  }