@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.
- package/README.md +207 -274
- package/dist/client.iife.js +533 -0
- package/package.json +37 -79
- package/src/.babelrc +0 -22
- package/src/Atom.js +171 -132
- package/src/AtomMeta.js +76 -50
- package/src/AuthToken.js +38 -47
- package/src/KnishIOClient.js +934 -987
- package/src/Meta.js +15 -17
- package/src/Molecule.js +423 -494
- package/src/PolicyMeta.js +32 -41
- package/src/TokenUnit.js +30 -32
- package/src/Wallet.js +275 -265
- package/src/exception/AtomIndexException.js +4 -8
- package/src/exception/AtomsMissingException.js +4 -6
- package/src/exception/AuthorizationRejectedException.js +4 -5
- package/src/exception/BalanceInsufficientException.js +4 -8
- package/src/exception/BaseException.js +6 -8
- package/src/exception/BatchIdException.js +5 -7
- package/src/exception/CodeException.js +4 -8
- package/src/{libraries/ApolloLink/HttpLink.js → exception/DecryptionKeyException.js} +12 -15
- package/src/exception/InvalidResponseException.js +4 -5
- package/src/exception/MetaMissingException.js +4 -6
- package/src/exception/MolecularHashMismatchException.js +4 -6
- package/src/exception/MolecularHashMissingException.js +4 -5
- package/src/exception/NegativeAmountException.js +4 -5
- package/src/exception/PolicyInvalidException.js +4 -4
- package/src/exception/SignatureMalformedException.js +4 -5
- package/src/exception/SignatureMismatchException.js +4 -5
- package/src/exception/StackableUnitAmountException.js +4 -5
- package/src/exception/StackableUnitDecimalsException.js +4 -5
- package/src/exception/TransferBalanceException.js +4 -5
- package/src/exception/TransferMalformedException.js +4 -5
- package/src/exception/TransferMismatchedException.js +4 -5
- package/src/exception/TransferRemainderException.js +4 -5
- package/src/exception/TransferToSelfException.js +4 -5
- package/src/exception/TransferUnbalancedException.js +4 -5
- package/src/exception/UnauthenticatedException.js +4 -5
- package/src/{libraries/ApolloLink/AuthLink.js → exception/WalletCredentialException.js} +12 -40
- package/src/exception/WalletShadowException.js +4 -5
- package/src/exception/WrongTokenTypeException.js +4 -5
- package/src/exception/index.js +26 -26
- package/src/index.js +8 -10
- package/src/instance/Rules/Callback.js +91 -93
- package/src/instance/Rules/Condition.js +21 -23
- package/src/instance/Rules/Meta.js +13 -14
- package/src/instance/Rules/Rule.js +39 -43
- package/src/instance/Rules/exception/RuleArgumentException.js +4 -4
- package/src/libraries/CheckMolecule.js +253 -232
- package/src/libraries/Decimal.js +13 -17
- package/src/libraries/Dot.js +74 -48
- package/src/libraries/Hex.js +49 -54
- package/src/libraries/array.js +50 -41
- package/src/libraries/crypto.js +20 -27
- package/src/libraries/strings.js +58 -91
- package/src/libraries/urql/UrqlClientWrapper.js +166 -0
- package/src/mutation/Mutation.js +44 -25
- package/src/mutation/MutationActiveSession.js +12 -12
- package/src/mutation/MutationClaimShadowWallet.js +15 -17
- package/src/mutation/MutationCreateIdentifier.js +11 -12
- package/src/mutation/MutationCreateMeta.js +11 -12
- package/src/mutation/MutationCreateRule.js +11 -12
- package/src/mutation/MutationCreateToken.js +18 -13
- package/src/mutation/MutationCreateWallet.js +9 -11
- package/src/mutation/MutationDepositBufferToken.js +7 -9
- package/src/mutation/MutationLinkIdentifier.js +12 -14
- package/src/mutation/MutationProposeMolecule.js +24 -25
- package/src/mutation/MutationRequestAuthorization.js +9 -10
- package/src/mutation/MutationRequestAuthorizationGuest.js +12 -15
- package/src/mutation/MutationRequestTokens.js +11 -14
- package/src/mutation/MutationTransferTokens.js +11 -14
- package/src/mutation/MutationWithdrawBufferToken.js +7 -10
- package/src/query/Query.js +62 -36
- package/src/query/QueryActiveSession.js +11 -13
- package/src/query/QueryAtom.js +75 -76
- package/src/query/QueryBalance.js +11 -12
- package/src/query/QueryBatch.js +17 -14
- package/src/query/QueryBatchHistory.js +16 -13
- package/src/query/QueryContinuId.js +13 -10
- package/src/query/QueryMetaType.js +45 -57
- package/src/query/QueryMetaTypeViaAtom.js +49 -57
- package/src/query/QueryPolicy.js +11 -12
- package/src/query/QueryToken.js +11 -13
- package/src/query/QueryUserActivity.js +11 -13
- package/src/query/QueryWalletBundle.js +15 -47
- package/src/query/QueryWalletList.js +15 -16
- package/src/response/Response.js +29 -34
- package/src/response/ResponseActiveSession.js +6 -6
- package/src/response/ResponseAtom.js +29 -30
- package/src/response/ResponseAuthorizationGuest.js +17 -18
- package/src/response/ResponseBalance.js +12 -13
- package/src/response/ResponseClaimShadowWallet.js +1 -1
- package/src/response/ResponseContinuId.js +21 -22
- package/src/response/ResponseCreateIdentifier.js +1 -1
- package/src/response/ResponseCreateMeta.js +1 -1
- package/src/response/ResponseCreateRule.js +1 -1
- package/src/response/ResponseCreateToken.js +1 -1
- package/src/response/ResponseCreateWallet.js +1 -1
- package/src/response/ResponseLinkIdentifier.js +9 -10
- package/src/response/ResponseMetaBatch.js +6 -8
- package/src/response/ResponseMetaType.js +19 -20
- package/src/response/ResponseMetaTypeViaAtom.js +19 -19
- package/src/response/ResponsePolicy.js +14 -15
- package/src/response/ResponseProposeMolecule.js +27 -30
- package/src/response/ResponseQueryActiveSession.js +20 -23
- package/src/response/ResponseQueryUserActivity.js +11 -12
- package/src/response/ResponseRequestAuthorization.js +11 -16
- package/src/response/ResponseRequestAuthorizationGuest.js +18 -21
- package/src/response/ResponseRequestTokens.js +1 -1
- package/src/response/ResponseTransferTokens.js +8 -9
- package/src/response/ResponseWalletBundle.js +16 -17
- package/src/response/ResponseWalletList.js +44 -47
- package/src/subscribe/ActiveSessionSubscribe.js +5 -6
- package/src/subscribe/ActiveWalletSubscribe.js +5 -6
- package/src/subscribe/CreateMoleculeSubscribe.js +5 -5
- package/src/subscribe/Subscribe.js +26 -26
- package/src/subscribe/WalletStatusSubscribe.js +5 -6
- package/src/versions/HashAtom.js +78 -0
- package/src/versions/Version4.js +34 -0
- package/src/versions/index.js +5 -0
- package/dist/client.umd.js +0 -453
- package/src/httpClient/ApolloClient.js +0 -245
- package/src/libraries/ApolloLink/CipherLink.js +0 -117
- package/src/libraries/ApolloLink/Client.js +0 -231
- package/src/libraries/ApolloLink/PusherLink.js +0 -234
- package/src/libraries/ApolloLink/handler.js +0 -106
- package/src/libraries/Base58.js +0 -71
- package/src/libraries/Base64.js +0 -40
- package/src/libraries/BaseX.js +0 -91
- package/src/libraries/Soda.js +0 -93
- package/src/query/QueryMetaInstance.js +0 -99
- package/src/test/Test.js +0 -670
- 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 (
|
|
63
|
-
|
|
64
|
-
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
|
|
64
|
-
|
|
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 (
|
|
59
|
-
super(
|
|
57
|
+
constructor (message = null, fileName = null, lineNumber = null) {
|
|
58
|
+
super(message, fileName, lineNumber)
|
|
60
59
|
|
|
61
|
-
if (
|
|
62
|
-
throw new this(
|
|
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 (
|
|
13
|
-
|
|
14
|
-
|
|
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 (
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
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 {
|
|
60
|
-
* @param {
|
|
61
|
-
* @
|
|
57
|
+
* @param {string} message
|
|
58
|
+
* @param {string|null} fileName
|
|
59
|
+
* @param {number|null} lineNumber
|
|
62
60
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
62
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
61
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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 (
|
|
63
|
-
super(
|
|
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
|
}
|