@injectivelabs/exceptions 1.0.15 → 1.0.16
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/dist/exception.d.ts.map +1 -1
- package/dist/exception.js +0 -5
- package/dist/exception.js.map +1 -1
- package/dist/exceptions/TransactionException.d.ts +1 -5
- package/dist/exceptions/TransactionException.d.ts.map +1 -1
- package/dist/exceptions/TransactionException.js +3 -21
- package/dist/exceptions/TransactionException.js.map +1 -1
- package/dist/exceptions/Web3GatewayTransactionException.d.ts +4 -0
- package/dist/exceptions/Web3GatewayTransactionException.d.ts.map +1 -0
- package/dist/exceptions/Web3GatewayTransactionException.js +8 -0
- package/dist/exceptions/Web3GatewayTransactionException.js.map +1 -0
- package/dist/exceptions/index.d.ts +3 -2
- package/dist/exceptions/index.d.ts.map +1 -1
- package/dist/exceptions/index.js +5 -2
- package/dist/exceptions/index.js.map +1 -1
- package/dist/messages.d.ts +352 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +356 -0
- package/dist/messages.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/maps.d.ts +7 -0
- package/dist/utils/maps.d.ts.map +1 -0
- package/dist/utils/maps.js +28 -0
- package/dist/utils/maps.js.map +1 -0
- package/package.json +2 -2
package/dist/exception.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,SAAS,EAET,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,8BAAsB,iBAAkB,SAAQ,KAAM,YAAW,SAAS;IACxE;;OAEG;IACI,IAAI,EAAE,SAAS,CAAwB;IAE9C;;OAEG;IACI,IAAI,EAAE,SAAS,CAAuB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IAIhB,QAAQ;CAGhB"}
|
package/dist/exception.js
CHANGED
|
@@ -14,11 +14,6 @@ class ConcreteException extends Error {
|
|
|
14
14
|
* Error specific code (HttpStatus, GrpcStatus, etc)
|
|
15
15
|
*/
|
|
16
16
|
this.code = types_1.UnspecifiedErrorCode;
|
|
17
|
-
/**
|
|
18
|
-
* Providing more context as to why the exception was thrown
|
|
19
|
-
* (ex: on-chain error code, etc)
|
|
20
|
-
*/
|
|
21
|
-
this.contextCode = types_1.UnspecifiedErrorCode;
|
|
22
17
|
/**
|
|
23
18
|
* Parsed message of the exception
|
|
24
19
|
*/
|
package/dist/exception.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.js","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,mCAOgB;AAEhB,MAAsB,iBAAkB,SAAQ,KAAK;IA2CnD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QA3CtB;;WAEG;QACI,SAAI,GAAc,iBAAS,CAAC,WAAW,CAAA;QAE9C;;WAEG;QACI,SAAI,GAAc,4BAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"exception.js","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,mCAOgB;AAEhB,MAAsB,iBAAkB,SAAQ,KAAK;IA2CnD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QA3CtB;;WAEG;QACI,SAAI,GAAc,iBAAS,CAAC,WAAW,CAAA;QAE9C;;WAEG;QACI,SAAI,GAAc,4BAAoB,CAAA;QAmB7C;;WAEG;QACI,YAAO,GAAW,EAAE,CAAA;QAE3B;;WAEG;QACI,UAAK,GAAY,EAAE,CAAA;QAE1B;;WAEG;QACI,iBAAY,GAAW,EAAE,CAAA;QAI9B,IAAI,CAAC,UAAU,C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;IAEM,UAAU,CAAC,OAAe;QAC/B,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAEM,gBAAgB,CAAC,aAAqB;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;IAEM,cAAc,CAAC,IAAsB;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;IACzB,CAAC;IAEM,eAAe;QACpB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;QAE5B,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,OAAO;QACZ,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;QAE5B,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACnE,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AA/HD,8CA+HC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { ConcreteException } from '../exception';
|
|
2
|
-
import { ErrorContext
|
|
3
|
-
export declare const mapMessage: (message: string) => {
|
|
4
|
-
message: string;
|
|
5
|
-
code: ErrorContextCode;
|
|
6
|
-
};
|
|
2
|
+
import { ErrorContext } from '../types';
|
|
7
3
|
export declare class TransactionException extends ConcreteException {
|
|
8
4
|
constructor(error: Error, context?: ErrorContext);
|
|
9
5
|
parse(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionException.d.ts","sourceRoot":"","sources":["../../src/exceptions/TransactionException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"TransactionException.d.ts","sourceRoot":"","sources":["../../src/exceptions/TransactionException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAGlD,qBAAa,oBAAqB,SAAQ,iBAAiB;gBAC7C,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;IAMzC,KAAK,IAAI,IAAI;CASrB"}
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionException =
|
|
3
|
+
exports.TransactionException = void 0;
|
|
4
4
|
const exception_1 = require("../exception");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
-
const
|
|
7
|
-
const [, parsedMessage] = message.split('message index: 0:');
|
|
8
|
-
const [actualMessage] = parsedMessage.split(': invalid request');
|
|
9
|
-
const trimmedMessage = actualMessage.trim().trimEnd();
|
|
10
|
-
if (trimmedMessage.toLowerCase().includes('insufficient fee')) {
|
|
11
|
-
return {
|
|
12
|
-
message: 'You do not have enough funds to cover transaction fees.',
|
|
13
|
-
code: types_1.ChainCosmosErrorCode.ErrInsufficientFee,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
if (trimmedMessage.toLowerCase().includes('insufficient funds')) {
|
|
17
|
-
return {
|
|
18
|
-
message: 'You do not have enough funds to cover transaction fees.',
|
|
19
|
-
code: types_1.ChainCosmosErrorCode.ErrInsufficientFunds,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return { message: trimmedMessage, code: types_1.UnspecifiedErrorCode };
|
|
23
|
-
};
|
|
24
|
-
exports.mapMessage = mapMessage;
|
|
6
|
+
const maps_1 = require("../utils/maps");
|
|
25
7
|
class TransactionException extends exception_1.ConcreteException {
|
|
26
8
|
constructor(error, context) {
|
|
27
9
|
super(error, context);
|
|
@@ -29,7 +11,7 @@ class TransactionException extends exception_1.ConcreteException {
|
|
|
29
11
|
}
|
|
30
12
|
parse() {
|
|
31
13
|
const { message } = this;
|
|
32
|
-
const { message: parsedMessage, code } = (0,
|
|
14
|
+
const { message: parsedMessage, code } = (0, maps_1.mapFailedTransactionMessage)(message);
|
|
33
15
|
this.setMessage(parsedMessage);
|
|
34
16
|
this.setContextCode(code);
|
|
35
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionException.js","sourceRoot":"","sources":["../../src/exceptions/TransactionException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"TransactionException.js","sourceRoot":"","sources":["../../src/exceptions/TransactionException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAClD,wCAA2D;AAE3D,MAAa,oBAAqB,SAAQ,6BAAiB;IACzD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,UAAU,CAAA;IAClC,CAAC;IAEM,KAAK;QACV,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAExB,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,GACpC,IAAA,kCAA2B,EAAC,OAAO,CAAC,CAAA;QAEtC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QAC9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF;AAhBD,oDAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Web3GatewayTransactionException.d.ts","sourceRoot":"","sources":["../../src/exceptions/Web3GatewayTransactionException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,qBAAa,+BAAgC,SAAQ,oBAAoB;CAExE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Web3GatewayTransactionException = void 0;
|
|
4
|
+
const TransactionException_1 = require("./TransactionException");
|
|
5
|
+
class Web3GatewayTransactionException extends TransactionException_1.TransactionException {
|
|
6
|
+
}
|
|
7
|
+
exports.Web3GatewayTransactionException = Web3GatewayTransactionException;
|
|
8
|
+
//# sourceMappingURL=Web3GatewayTransactionException.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Web3GatewayTransactionException.js","sourceRoot":"","sources":["../../src/exceptions/Web3GatewayTransactionException.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAE7D,MAAa,+BAAgC,SAAQ,2CAAoB;CAExE;AAFD,0EAEC"}
|
|
@@ -7,9 +7,10 @@ import { MetamaskException } from './MetamaskException';
|
|
|
7
7
|
import { TrezorException } from './TrezorException';
|
|
8
8
|
import { CosmosWalletException } from './CosmosWalletException';
|
|
9
9
|
import { TransactionException } from './TransactionException';
|
|
10
|
+
import { Web3GatewayTransactionException } from './Web3GatewayTransactionException';
|
|
10
11
|
import { WalletException } from './WalletException';
|
|
11
12
|
import { Exception } from '../types';
|
|
12
|
-
export declare type ThrownException = GrpcUnaryRequestException | HttpRequestException | Web3Exception | GeneralException | LedgerException | MetamaskException | TrezorException | CosmosWalletException | TransactionException | WalletException;
|
|
13
|
+
export declare type ThrownException = GrpcUnaryRequestException | HttpRequestException | Web3Exception | GeneralException | LedgerException | MetamaskException | TrezorException | CosmosWalletException | TransactionException | WalletException | Web3GatewayTransactionException;
|
|
13
14
|
export declare const isThrownException: (exception: Error | Exception) => boolean;
|
|
14
|
-
export { GrpcUnaryRequestException, HttpRequestException, Web3Exception, GeneralException, LedgerException, MetamaskException, TrezorException, CosmosWalletException, TransactionException, WalletException, };
|
|
15
|
+
export { GrpcUnaryRequestException, HttpRequestException, Web3Exception, GeneralException, LedgerException, MetamaskException, TrezorException, CosmosWalletException, TransactionException, WalletException, Web3GatewayTransactionException, };
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,oBAAY,eAAe,GACvB,yBAAyB,GACzB,oBAAoB,GACpB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,oBAAY,eAAe,GACvB,yBAAyB,GACzB,oBAAoB,GACpB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,eAAe,GACf,+BAA+B,CAAA;AAEnC,eAAO,MAAM,iBAAiB,cAAe,KAAK,GAAG,SAAS,KAAG,OAwBhE,CAAA;AAED,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,+BAA+B,GAChC,CAAA"}
|
package/dist/exceptions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletException = exports.TransactionException = exports.CosmosWalletException = exports.TrezorException = exports.MetamaskException = exports.LedgerException = exports.GeneralException = exports.Web3Exception = exports.HttpRequestException = exports.GrpcUnaryRequestException = exports.isThrownException = void 0;
|
|
3
|
+
exports.Web3GatewayTransactionException = exports.WalletException = exports.TransactionException = exports.CosmosWalletException = exports.TrezorException = exports.MetamaskException = exports.LedgerException = exports.GeneralException = exports.Web3Exception = exports.HttpRequestException = exports.GrpcUnaryRequestException = exports.isThrownException = void 0;
|
|
4
4
|
const GrpcUnaryRequestException_1 = require("./GrpcUnaryRequestException");
|
|
5
5
|
Object.defineProperty(exports, "GrpcUnaryRequestException", { enumerable: true, get: function () { return GrpcUnaryRequestException_1.GrpcUnaryRequestException; } });
|
|
6
6
|
const HttpRequestException_1 = require("./HttpRequestException");
|
|
@@ -19,6 +19,8 @@ const CosmosWalletException_1 = require("./CosmosWalletException");
|
|
|
19
19
|
Object.defineProperty(exports, "CosmosWalletException", { enumerable: true, get: function () { return CosmosWalletException_1.CosmosWalletException; } });
|
|
20
20
|
const TransactionException_1 = require("./TransactionException");
|
|
21
21
|
Object.defineProperty(exports, "TransactionException", { enumerable: true, get: function () { return TransactionException_1.TransactionException; } });
|
|
22
|
+
const Web3GatewayTransactionException_1 = require("./Web3GatewayTransactionException");
|
|
23
|
+
Object.defineProperty(exports, "Web3GatewayTransactionException", { enumerable: true, get: function () { return Web3GatewayTransactionException_1.Web3GatewayTransactionException; } });
|
|
22
24
|
const WalletException_1 = require("./WalletException");
|
|
23
25
|
Object.defineProperty(exports, "WalletException", { enumerable: true, get: function () { return WalletException_1.WalletException; } });
|
|
24
26
|
const exception_1 = require("../exception");
|
|
@@ -27,7 +29,6 @@ const isThrownException = (exception) => {
|
|
|
27
29
|
return true;
|
|
28
30
|
}
|
|
29
31
|
if ([
|
|
30
|
-
'WalletException',
|
|
31
32
|
'GrpcUnaryRequestException',
|
|
32
33
|
'HttpRequestException',
|
|
33
34
|
'Web3Exception',
|
|
@@ -37,6 +38,8 @@ const isThrownException = (exception) => {
|
|
|
37
38
|
'TrezorException',
|
|
38
39
|
'CosmosWalletException',
|
|
39
40
|
'TransactionException',
|
|
41
|
+
'WalletException',
|
|
42
|
+
'Web3GatewayTransactionException',
|
|
40
43
|
].includes(exception.constructor.name)) {
|
|
41
44
|
return true;
|
|
42
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;AAsDrE,0GAtDO,qDAAyB,OAsDP;AArD3B,iEAA6D;AAsD3D,qGAtDO,2CAAoB,OAsDP;AArDtB,mDAA+C;AAsD7C,8FAtDO,6BAAa,OAsDP;AArDf,yDAAqD;AAsDnD,iGAtDO,mCAAgB,OAsDP;AArDlB,uDAAmD;AAsDjD,gGAtDO,iCAAe,OAsDP;AArDjB,2DAAuD;AAsDrD,kGAtDO,qCAAiB,OAsDP;AArDnB,uDAAmD;AAsDjD,gGAtDO,iCAAe,OAsDP;AArDjB,mEAA+D;AAsD7D,sGAtDO,6CAAqB,OAsDP;AArDvB,iEAA6D;AAsD3D,qGAtDO,2CAAoB,OAsDP;AArDtB,uFAAmF;AAuDjF,gHAvDO,iEAA+B,OAuDP;AAtDjC,uDAAmD;AAqDjD,gGArDO,iCAAe,OAqDP;AAnDjB,4CAAgD;AAezC,MAAM,iBAAiB,GAAG,CAAC,SAA4B,EAAW,EAAE;IACzE,IAAI,SAAS,YAAY,6BAAiB,EAAE;QAC1C,OAAO,IAAI,CAAA;KACZ;IAED,IACE;QACE,2BAA2B;QAC3B,sBAAsB;QACtB,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,mBAAmB;QACnB,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,iBAAiB;QACjB,iCAAiC;KAClC,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,EACtC;QACA,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAxBY,QAAA,iBAAiB,qBAwB7B"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { ChainCosmosErrorCode, ChainExchangeModuleErrorCode } from './types';
|
|
2
|
+
export declare const messagesMap: {
|
|
3
|
+
'insufficient fee': {
|
|
4
|
+
message: string;
|
|
5
|
+
code: ChainCosmosErrorCode;
|
|
6
|
+
};
|
|
7
|
+
'insufficient funds': {
|
|
8
|
+
message: string;
|
|
9
|
+
code: ChainCosmosErrorCode;
|
|
10
|
+
};
|
|
11
|
+
'tx timeout height': {
|
|
12
|
+
message: string;
|
|
13
|
+
code: ChainCosmosErrorCode;
|
|
14
|
+
};
|
|
15
|
+
'failed to validate order': {
|
|
16
|
+
message: string;
|
|
17
|
+
code: ChainExchangeModuleErrorCode;
|
|
18
|
+
};
|
|
19
|
+
'spot market not found': {
|
|
20
|
+
message: string;
|
|
21
|
+
code: ChainExchangeModuleErrorCode;
|
|
22
|
+
};
|
|
23
|
+
'spot market exists': {
|
|
24
|
+
message: string;
|
|
25
|
+
code: ChainExchangeModuleErrorCode;
|
|
26
|
+
};
|
|
27
|
+
'struct field error': {
|
|
28
|
+
message: string;
|
|
29
|
+
code: ChainExchangeModuleErrorCode;
|
|
30
|
+
};
|
|
31
|
+
'failed to validate market': {
|
|
32
|
+
message: string;
|
|
33
|
+
code: ChainExchangeModuleErrorCode;
|
|
34
|
+
};
|
|
35
|
+
'subaccount has insufficient deposits': {
|
|
36
|
+
message: string;
|
|
37
|
+
code: ChainExchangeModuleErrorCode;
|
|
38
|
+
};
|
|
39
|
+
'unrecognized order type': {
|
|
40
|
+
message: string;
|
|
41
|
+
code: ChainExchangeModuleErrorCode;
|
|
42
|
+
};
|
|
43
|
+
'position quantity insufficient for order': {
|
|
44
|
+
message: string;
|
|
45
|
+
code: ChainExchangeModuleErrorCode;
|
|
46
|
+
};
|
|
47
|
+
'order hash is not valid': {
|
|
48
|
+
message: string;
|
|
49
|
+
code: ChainExchangeModuleErrorCode;
|
|
50
|
+
};
|
|
51
|
+
'subaccount id is not valid': {
|
|
52
|
+
message: string;
|
|
53
|
+
code: ChainExchangeModuleErrorCode;
|
|
54
|
+
};
|
|
55
|
+
'invalid ticker': {
|
|
56
|
+
message: string;
|
|
57
|
+
code: ChainExchangeModuleErrorCode;
|
|
58
|
+
};
|
|
59
|
+
'invalid base denom': {
|
|
60
|
+
message: string;
|
|
61
|
+
code: ChainExchangeModuleErrorCode;
|
|
62
|
+
};
|
|
63
|
+
'invalid quote denom': {
|
|
64
|
+
message: string;
|
|
65
|
+
code: ChainExchangeModuleErrorCode;
|
|
66
|
+
};
|
|
67
|
+
'invalid oracle': {
|
|
68
|
+
message: string;
|
|
69
|
+
code: ChainExchangeModuleErrorCode;
|
|
70
|
+
};
|
|
71
|
+
'invalid expiry': {
|
|
72
|
+
message: string;
|
|
73
|
+
code: ChainExchangeModuleErrorCode;
|
|
74
|
+
};
|
|
75
|
+
'invalid price': {
|
|
76
|
+
message: string;
|
|
77
|
+
code: ChainExchangeModuleErrorCode;
|
|
78
|
+
};
|
|
79
|
+
'invalid quantity': {
|
|
80
|
+
message: string;
|
|
81
|
+
code: ChainExchangeModuleErrorCode;
|
|
82
|
+
};
|
|
83
|
+
'unsupported oracle type': {
|
|
84
|
+
message: string;
|
|
85
|
+
code: ChainExchangeModuleErrorCode;
|
|
86
|
+
};
|
|
87
|
+
'order doesnt exist': {
|
|
88
|
+
message: string;
|
|
89
|
+
code: ChainExchangeModuleErrorCode;
|
|
90
|
+
};
|
|
91
|
+
'spot limit orderbook fill invalid': {
|
|
92
|
+
message: string;
|
|
93
|
+
code: ChainExchangeModuleErrorCode;
|
|
94
|
+
};
|
|
95
|
+
'perpetual market exists': {
|
|
96
|
+
message: string;
|
|
97
|
+
code: ChainExchangeModuleErrorCode;
|
|
98
|
+
};
|
|
99
|
+
'expiry futures market exists': {
|
|
100
|
+
message: string;
|
|
101
|
+
code: ChainExchangeModuleErrorCode;
|
|
102
|
+
};
|
|
103
|
+
'expiry futures market expired': {
|
|
104
|
+
message: string;
|
|
105
|
+
code: ChainExchangeModuleErrorCode;
|
|
106
|
+
};
|
|
107
|
+
'no liquidity on the orderbook': {
|
|
108
|
+
message: string;
|
|
109
|
+
code: ChainExchangeModuleErrorCode;
|
|
110
|
+
};
|
|
111
|
+
'orderbook liquidity cannot satisfy current worst price': {
|
|
112
|
+
message: string;
|
|
113
|
+
code: ChainExchangeModuleErrorCode;
|
|
114
|
+
};
|
|
115
|
+
'order has insufficient margin': {
|
|
116
|
+
message: string;
|
|
117
|
+
code: ChainExchangeModuleErrorCode;
|
|
118
|
+
};
|
|
119
|
+
'derivative market not found': {
|
|
120
|
+
message: string;
|
|
121
|
+
code: ChainExchangeModuleErrorCode;
|
|
122
|
+
};
|
|
123
|
+
'position not found': {
|
|
124
|
+
message: string;
|
|
125
|
+
code: ChainExchangeModuleErrorCode;
|
|
126
|
+
};
|
|
127
|
+
'position direction does not oppose the reduce-only order': {
|
|
128
|
+
message: string;
|
|
129
|
+
code: ChainExchangeModuleErrorCode;
|
|
130
|
+
};
|
|
131
|
+
'price surpasses bankruptcy price': {
|
|
132
|
+
message: string;
|
|
133
|
+
code: ChainExchangeModuleErrorCode;
|
|
134
|
+
};
|
|
135
|
+
'position not liquidable': {
|
|
136
|
+
message: string;
|
|
137
|
+
code: ChainExchangeModuleErrorCode;
|
|
138
|
+
};
|
|
139
|
+
'invalid trigger price': {
|
|
140
|
+
message: string;
|
|
141
|
+
code: ChainExchangeModuleErrorCode;
|
|
142
|
+
};
|
|
143
|
+
'invalid oracle type': {
|
|
144
|
+
message: string;
|
|
145
|
+
code: ChainExchangeModuleErrorCode;
|
|
146
|
+
};
|
|
147
|
+
'invalid minimum price tick size': {
|
|
148
|
+
message: string;
|
|
149
|
+
code: ChainExchangeModuleErrorCode;
|
|
150
|
+
};
|
|
151
|
+
'invalid minimum quantity tick size': {
|
|
152
|
+
message: string;
|
|
153
|
+
code: ChainExchangeModuleErrorCode;
|
|
154
|
+
};
|
|
155
|
+
'invalid minimum order margin': {
|
|
156
|
+
message: string;
|
|
157
|
+
code: ChainExchangeModuleErrorCode;
|
|
158
|
+
};
|
|
159
|
+
'exceeds order side count': {
|
|
160
|
+
message: string;
|
|
161
|
+
code: ChainExchangeModuleErrorCode;
|
|
162
|
+
};
|
|
163
|
+
'subaccount cannot place a market order when a market order in the same market was already placed in same block': {
|
|
164
|
+
message: string;
|
|
165
|
+
code: ChainExchangeModuleErrorCode;
|
|
166
|
+
};
|
|
167
|
+
'cannot place a conditional market order when a conditional market order in same relative direction already exists': {
|
|
168
|
+
message: string;
|
|
169
|
+
code: ChainExchangeModuleErrorCode;
|
|
170
|
+
};
|
|
171
|
+
'an equivalent market launch proposal already exists.': {
|
|
172
|
+
message: string;
|
|
173
|
+
code: ChainExchangeModuleErrorCode;
|
|
174
|
+
};
|
|
175
|
+
'invalid market status': {
|
|
176
|
+
message: string;
|
|
177
|
+
code: ChainExchangeModuleErrorCode;
|
|
178
|
+
};
|
|
179
|
+
'base denom cannot be same with quote denom': {
|
|
180
|
+
message: string;
|
|
181
|
+
code: ChainExchangeModuleErrorCode;
|
|
182
|
+
};
|
|
183
|
+
'oracle base cannot be same with oracle quote': {
|
|
184
|
+
message: string;
|
|
185
|
+
code: ChainExchangeModuleErrorCode;
|
|
186
|
+
};
|
|
187
|
+
'makerfeerate does not match takerfeeeate requirements': {
|
|
188
|
+
message: string;
|
|
189
|
+
code: ChainExchangeModuleErrorCode;
|
|
190
|
+
};
|
|
191
|
+
'maintenancemarginratio cannot be greater than initialmarginratio': {
|
|
192
|
+
message: string;
|
|
193
|
+
code: ChainExchangeModuleErrorCode;
|
|
194
|
+
};
|
|
195
|
+
'oraclescalefactor cannot be greater than maxoraclescalefactor': {
|
|
196
|
+
message: string;
|
|
197
|
+
code: ChainExchangeModuleErrorCode;
|
|
198
|
+
};
|
|
199
|
+
'spot exchange is not enabled yet': {
|
|
200
|
+
message: string;
|
|
201
|
+
code: ChainExchangeModuleErrorCode;
|
|
202
|
+
};
|
|
203
|
+
'derivatives exchange is not enabled yet': {
|
|
204
|
+
message: string;
|
|
205
|
+
code: ChainExchangeModuleErrorCode;
|
|
206
|
+
};
|
|
207
|
+
'oracle price delta exceeds threshold': {
|
|
208
|
+
message: string;
|
|
209
|
+
code: ChainExchangeModuleErrorCode;
|
|
210
|
+
};
|
|
211
|
+
'invalid hourly interest rate': {
|
|
212
|
+
message: string;
|
|
213
|
+
code: ChainExchangeModuleErrorCode;
|
|
214
|
+
};
|
|
215
|
+
'invalid hourly funding rate cap': {
|
|
216
|
+
message: string;
|
|
217
|
+
code: ChainExchangeModuleErrorCode;
|
|
218
|
+
};
|
|
219
|
+
'only perpetual markets can update funding parameters': {
|
|
220
|
+
message: string;
|
|
221
|
+
code: ChainExchangeModuleErrorCode;
|
|
222
|
+
};
|
|
223
|
+
'invalid trading reward campaign': {
|
|
224
|
+
message: string;
|
|
225
|
+
code: ChainExchangeModuleErrorCode;
|
|
226
|
+
};
|
|
227
|
+
'invalid fee discount schedule': {
|
|
228
|
+
message: string;
|
|
229
|
+
code: ChainExchangeModuleErrorCode;
|
|
230
|
+
};
|
|
231
|
+
'invalid liquidation order': {
|
|
232
|
+
message: string;
|
|
233
|
+
code: ChainExchangeModuleErrorCode;
|
|
234
|
+
};
|
|
235
|
+
'unknown error happened for campaign distributions': {
|
|
236
|
+
message: string;
|
|
237
|
+
code: ChainExchangeModuleErrorCode;
|
|
238
|
+
};
|
|
239
|
+
'invalid trading reward points update': {
|
|
240
|
+
message: string;
|
|
241
|
+
code: ChainExchangeModuleErrorCode;
|
|
242
|
+
};
|
|
243
|
+
'invalid batch msg update': {
|
|
244
|
+
message: string;
|
|
245
|
+
code: ChainExchangeModuleErrorCode;
|
|
246
|
+
};
|
|
247
|
+
'post-only order exceeds top of book price': {
|
|
248
|
+
message: string;
|
|
249
|
+
code: ChainExchangeModuleErrorCode;
|
|
250
|
+
};
|
|
251
|
+
'order type not supported for given message': {
|
|
252
|
+
message: string;
|
|
253
|
+
code: ChainExchangeModuleErrorCode;
|
|
254
|
+
};
|
|
255
|
+
'sender must match dmm account': {
|
|
256
|
+
message: string;
|
|
257
|
+
code: ChainExchangeModuleErrorCode;
|
|
258
|
+
};
|
|
259
|
+
'already opted out of rewards': {
|
|
260
|
+
message: string;
|
|
261
|
+
code: ChainExchangeModuleErrorCode;
|
|
262
|
+
};
|
|
263
|
+
'invalid margin ratio': {
|
|
264
|
+
message: string;
|
|
265
|
+
code: ChainExchangeModuleErrorCode;
|
|
266
|
+
};
|
|
267
|
+
'provided funds are below minimum': {
|
|
268
|
+
message: string;
|
|
269
|
+
code: ChainExchangeModuleErrorCode;
|
|
270
|
+
};
|
|
271
|
+
'position is below initial margin requirement': {
|
|
272
|
+
message: string;
|
|
273
|
+
code: ChainExchangeModuleErrorCode;
|
|
274
|
+
};
|
|
275
|
+
'pool has non-positive total lp token supply': {
|
|
276
|
+
message: string;
|
|
277
|
+
code: ChainExchangeModuleErrorCode;
|
|
278
|
+
};
|
|
279
|
+
'passed lp token burn amount is greater than total lp token supply': {
|
|
280
|
+
message: string;
|
|
281
|
+
code: ChainExchangeModuleErrorCode;
|
|
282
|
+
};
|
|
283
|
+
'unsupported action': {
|
|
284
|
+
message: string;
|
|
285
|
+
code: ChainExchangeModuleErrorCode;
|
|
286
|
+
};
|
|
287
|
+
'position quantity cannot be negative': {
|
|
288
|
+
message: string;
|
|
289
|
+
code: ChainExchangeModuleErrorCode;
|
|
290
|
+
};
|
|
291
|
+
'binary options market exists': {
|
|
292
|
+
message: string;
|
|
293
|
+
code: ChainExchangeModuleErrorCode;
|
|
294
|
+
};
|
|
295
|
+
'binary options market not found': {
|
|
296
|
+
message: string;
|
|
297
|
+
code: ChainExchangeModuleErrorCode;
|
|
298
|
+
};
|
|
299
|
+
'invalid settlement': {
|
|
300
|
+
message: string;
|
|
301
|
+
code: ChainExchangeModuleErrorCode;
|
|
302
|
+
};
|
|
303
|
+
'account doesnt exist': {
|
|
304
|
+
message: string;
|
|
305
|
+
code: ChainExchangeModuleErrorCode;
|
|
306
|
+
};
|
|
307
|
+
'sender should be a market admin': {
|
|
308
|
+
message: string;
|
|
309
|
+
code: ChainExchangeModuleErrorCode;
|
|
310
|
+
};
|
|
311
|
+
'market is already scheduled to settle': {
|
|
312
|
+
message: string;
|
|
313
|
+
code: ChainExchangeModuleErrorCode;
|
|
314
|
+
};
|
|
315
|
+
'market not found': {
|
|
316
|
+
message: string;
|
|
317
|
+
code: ChainExchangeModuleErrorCode;
|
|
318
|
+
};
|
|
319
|
+
'denom decimal cannot be below 1 or above max scale factor': {
|
|
320
|
+
message: string;
|
|
321
|
+
code: ChainExchangeModuleErrorCode;
|
|
322
|
+
};
|
|
323
|
+
'state is invalid': {
|
|
324
|
+
message: string;
|
|
325
|
+
code: ChainExchangeModuleErrorCode;
|
|
326
|
+
};
|
|
327
|
+
'transient orders up to cancellation not supported': {
|
|
328
|
+
message: string;
|
|
329
|
+
code: ChainExchangeModuleErrorCode;
|
|
330
|
+
};
|
|
331
|
+
'invalid trade': {
|
|
332
|
+
message: string;
|
|
333
|
+
code: ChainExchangeModuleErrorCode;
|
|
334
|
+
};
|
|
335
|
+
'no margin locked in subaccount': {
|
|
336
|
+
message: string;
|
|
337
|
+
code: ChainExchangeModuleErrorCode;
|
|
338
|
+
};
|
|
339
|
+
'Invalid access level to perform action': {
|
|
340
|
+
message: string;
|
|
341
|
+
code: ChainExchangeModuleErrorCode;
|
|
342
|
+
};
|
|
343
|
+
'Invalid address': {
|
|
344
|
+
message: string;
|
|
345
|
+
code: ChainExchangeModuleErrorCode;
|
|
346
|
+
};
|
|
347
|
+
'Invalid argument': {
|
|
348
|
+
message: string;
|
|
349
|
+
code: ChainExchangeModuleErrorCode;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAE5E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqbvB,CAAA"}
|
package/dist/messages.js
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.messagesMap = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
exports.messagesMap = {
|
|
6
|
+
'insufficient fee': {
|
|
7
|
+
message: 'You do not have enough funds to cover transaction fees.',
|
|
8
|
+
code: types_1.ChainCosmosErrorCode.ErrInsufficientFee,
|
|
9
|
+
},
|
|
10
|
+
'insufficient funds': {
|
|
11
|
+
message: 'You do not have enough funds to cover transaction fees.',
|
|
12
|
+
code: types_1.ChainCosmosErrorCode.ErrInsufficientFunds,
|
|
13
|
+
},
|
|
14
|
+
'tx timeout height': {
|
|
15
|
+
message: 'The transaction failed to be included within a block on time.',
|
|
16
|
+
code: types_1.ChainCosmosErrorCode.ErrTxTimeoutHeight,
|
|
17
|
+
},
|
|
18
|
+
// Exchange Module Messages
|
|
19
|
+
'failed to validate order': {
|
|
20
|
+
message: 'Your order failed to validate',
|
|
21
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrOrderInvalid,
|
|
22
|
+
},
|
|
23
|
+
'spot market not found': {
|
|
24
|
+
message: 'The spot market has not been found',
|
|
25
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSpotMarketNotFound,
|
|
26
|
+
},
|
|
27
|
+
'spot market exists': {
|
|
28
|
+
message: 'The spot market already exists',
|
|
29
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSpotMarketExists,
|
|
30
|
+
},
|
|
31
|
+
'struct field error': {
|
|
32
|
+
message: 'There is an issue with your order',
|
|
33
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrBadField,
|
|
34
|
+
},
|
|
35
|
+
'failed to validate market': {
|
|
36
|
+
message: 'The market failed to validate',
|
|
37
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrMarketInvalid,
|
|
38
|
+
},
|
|
39
|
+
'subaccount has insufficient deposits': {
|
|
40
|
+
message: 'Your trading account has insufficient funds',
|
|
41
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInsufficientDeposit,
|
|
42
|
+
},
|
|
43
|
+
'unrecognized order type': {
|
|
44
|
+
message: 'The order type is not recognized',
|
|
45
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrUnrecognizedOrderType,
|
|
46
|
+
},
|
|
47
|
+
'position quantity insufficient for order': {
|
|
48
|
+
message: 'The position quantity is insufficient for the order',
|
|
49
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInsufficientPositionQuantity,
|
|
50
|
+
},
|
|
51
|
+
'order hash is not valid': {
|
|
52
|
+
message: 'The order hash is not valid',
|
|
53
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrOrderHashInvalid,
|
|
54
|
+
},
|
|
55
|
+
'subaccount id is not valid': {
|
|
56
|
+
message: 'The subaccount id is not valid',
|
|
57
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrBadSubaccountID,
|
|
58
|
+
},
|
|
59
|
+
'invalid ticker': {
|
|
60
|
+
message: "The market's ticker is not valid",
|
|
61
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidTicker,
|
|
62
|
+
},
|
|
63
|
+
'invalid base denom': {
|
|
64
|
+
message: '',
|
|
65
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidBaseDenom,
|
|
66
|
+
},
|
|
67
|
+
'invalid quote denom': {
|
|
68
|
+
message: '',
|
|
69
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidQuoteDenom,
|
|
70
|
+
},
|
|
71
|
+
'invalid oracle': {
|
|
72
|
+
message: 'The oracle is invalid',
|
|
73
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidOracle,
|
|
74
|
+
},
|
|
75
|
+
'invalid expiry': {
|
|
76
|
+
message: 'The expiry date is invalid',
|
|
77
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidExpiry,
|
|
78
|
+
},
|
|
79
|
+
'invalid price': {
|
|
80
|
+
message: 'The price is invalid',
|
|
81
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidPrice,
|
|
82
|
+
},
|
|
83
|
+
'invalid quantity': {
|
|
84
|
+
message: 'The quantity is invalid',
|
|
85
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidQuantity,
|
|
86
|
+
},
|
|
87
|
+
'unsupported oracle type': {
|
|
88
|
+
message: 'The oracle type is not supported',
|
|
89
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrUnsupportedOracleType,
|
|
90
|
+
},
|
|
91
|
+
'order doesnt exist': {
|
|
92
|
+
message: 'The order does not exist',
|
|
93
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrOrderDoesntExist,
|
|
94
|
+
},
|
|
95
|
+
'spot limit orderbook fill invalid': {
|
|
96
|
+
message: '',
|
|
97
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrOrderbookFillInvalid,
|
|
98
|
+
},
|
|
99
|
+
'perpetual market exists': {
|
|
100
|
+
message: 'The perpetual market already exists',
|
|
101
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrPerpetualMarketExists,
|
|
102
|
+
},
|
|
103
|
+
'expiry futures market exists': {
|
|
104
|
+
message: 'The expiry futures market market already exists',
|
|
105
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrExpiryFuturesMarketExists,
|
|
106
|
+
},
|
|
107
|
+
'expiry futures market expired': {
|
|
108
|
+
message: 'The expiry futures market has expired',
|
|
109
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrExpiryFuturesMarketExpired,
|
|
110
|
+
},
|
|
111
|
+
'no liquidity on the orderbook': {
|
|
112
|
+
message: 'There is not enough liquidity',
|
|
113
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrNoLiquidity,
|
|
114
|
+
},
|
|
115
|
+
'orderbook liquidity cannot satisfy current worst price': {
|
|
116
|
+
message: 'There is not enough liquidity',
|
|
117
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSlippageExceedsWorstPrice,
|
|
118
|
+
},
|
|
119
|
+
'order has insufficient margin': {
|
|
120
|
+
message: 'The order has insufficient margin',
|
|
121
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInsufficientOrderMargin,
|
|
122
|
+
},
|
|
123
|
+
'derivative market not found': {
|
|
124
|
+
message: 'The derivative market cannot be found',
|
|
125
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrDerivativeMarketNotFound,
|
|
126
|
+
},
|
|
127
|
+
'position not found': {
|
|
128
|
+
message: 'The position cannot be found',
|
|
129
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrPositionNotFound,
|
|
130
|
+
},
|
|
131
|
+
'position direction does not oppose the reduce-only order': {
|
|
132
|
+
message: 'Position direction does not oppose the reduce-only order',
|
|
133
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidReduceOnlyPositionDirection,
|
|
134
|
+
},
|
|
135
|
+
'price surpasses bankruptcy price': {
|
|
136
|
+
message: 'Your order price surpasses bankruptcy price',
|
|
137
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrPriceSurpassesBankruptcyPrice,
|
|
138
|
+
},
|
|
139
|
+
'position not liquidable': {
|
|
140
|
+
message: 'The position is not liquidable',
|
|
141
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrPositionNotLiquidable,
|
|
142
|
+
},
|
|
143
|
+
'invalid trigger price': {
|
|
144
|
+
message: 'Your order trigger price is not valid',
|
|
145
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidTriggerPrice,
|
|
146
|
+
},
|
|
147
|
+
'invalid oracle type': {
|
|
148
|
+
message: 'The oracle type is not valid',
|
|
149
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidOracleType,
|
|
150
|
+
},
|
|
151
|
+
'invalid minimum price tick size': {
|
|
152
|
+
message: 'The minimum price tick size is not valid',
|
|
153
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidPriceTickSize,
|
|
154
|
+
},
|
|
155
|
+
'invalid minimum quantity tick size': {
|
|
156
|
+
message: 'The minimum quantity tick size is not valid',
|
|
157
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidQuantityTickSize,
|
|
158
|
+
},
|
|
159
|
+
'invalid minimum order margin': {
|
|
160
|
+
message: "Your order's minimum margin is not valid ",
|
|
161
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidMargin,
|
|
162
|
+
},
|
|
163
|
+
'exceeds order side count': {
|
|
164
|
+
message: 'You cannot have more orders for this market for this direction',
|
|
165
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrExceedsOrderSideCount,
|
|
166
|
+
},
|
|
167
|
+
'subaccount cannot place a market order when a market order in the same market was already placed in same block': {
|
|
168
|
+
message: 'You cannot place another market order within this block',
|
|
169
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrMarketOrderAlreadyExists,
|
|
170
|
+
},
|
|
171
|
+
'cannot place a conditional market order when a conditional market order in same relative direction already exists': {
|
|
172
|
+
message: 'You cannot place another conditional market order',
|
|
173
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrConditionalMarketOrderAlreadyExists,
|
|
174
|
+
},
|
|
175
|
+
'an equivalent market launch proposal already exists.': {
|
|
176
|
+
message: 'There is an existing equivalent market launch proposal.',
|
|
177
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrMarketLaunchProposalAlreadyExists,
|
|
178
|
+
},
|
|
179
|
+
'invalid market status': {
|
|
180
|
+
message: 'The market status is not valid',
|
|
181
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidMarketStatus,
|
|
182
|
+
},
|
|
183
|
+
'base denom cannot be same with quote denom': {
|
|
184
|
+
message: 'The base denom and quote denom cannot be same',
|
|
185
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSameDenoms,
|
|
186
|
+
},
|
|
187
|
+
'oracle base cannot be same with oracle quote': {
|
|
188
|
+
message: 'The oracle base and the oracle quote cannot be the same',
|
|
189
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSameOracles,
|
|
190
|
+
},
|
|
191
|
+
'makerfeerate does not match takerfeeeate requirements': {
|
|
192
|
+
message: 'The MakerFeeRate does not match TakerFeeRate requirements',
|
|
193
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrFeeRatesRelation,
|
|
194
|
+
},
|
|
195
|
+
'maintenancemarginratio cannot be greater than initialmarginratio': {
|
|
196
|
+
message: 'The MaintenanceMarginRatio cannot be greater than InitialMarginRatio',
|
|
197
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrMarginsRelation,
|
|
198
|
+
},
|
|
199
|
+
'oraclescalefactor cannot be greater than maxoraclescalefactor': {
|
|
200
|
+
message: 'The OracleScaleFactor cannot be greater than MaxOracleScaleFactor',
|
|
201
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrExceedsMaxOracleScaleFactor,
|
|
202
|
+
},
|
|
203
|
+
'spot exchange is not enabled yet': {
|
|
204
|
+
message: 'Spot exchange is not enabled yet',
|
|
205
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSpotExchangeNotEnabled,
|
|
206
|
+
},
|
|
207
|
+
'derivatives exchange is not enabled yet': {
|
|
208
|
+
message: 'Derivatives exchange is not enabled yet',
|
|
209
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrDerivativesExchangeNotEnabled,
|
|
210
|
+
},
|
|
211
|
+
'oracle price delta exceeds threshold': {
|
|
212
|
+
message: 'The oracle price delta exceeds threshold',
|
|
213
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrOraclePriceDeltaExceedsThreshold,
|
|
214
|
+
},
|
|
215
|
+
'invalid hourly interest rate': {
|
|
216
|
+
message: 'The hourly interest rate is not valid',
|
|
217
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidHourlyInterestRate,
|
|
218
|
+
},
|
|
219
|
+
'invalid hourly funding rate cap': {
|
|
220
|
+
message: 'The hourly funding rate cap is not valid',
|
|
221
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidHourlyFundingRateCap,
|
|
222
|
+
},
|
|
223
|
+
'only perpetual markets can update funding parameters': {
|
|
224
|
+
message: 'You can only update funding parameters on perpetual markets.',
|
|
225
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidMarketFundingParamUpdate,
|
|
226
|
+
},
|
|
227
|
+
'invalid trading reward campaign': {
|
|
228
|
+
message: 'The trading reward campaign is not valid',
|
|
229
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidTradingRewardCampaign,
|
|
230
|
+
},
|
|
231
|
+
'invalid fee discount schedule': {
|
|
232
|
+
message: 'The fee discount schedule is not valid',
|
|
233
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidFeeDiscountSchedule,
|
|
234
|
+
},
|
|
235
|
+
'invalid liquidation order': {
|
|
236
|
+
message: 'The liquidation order is not valid',
|
|
237
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidLiquidationOrder,
|
|
238
|
+
},
|
|
239
|
+
'unknown error happened for campaign distributions': {
|
|
240
|
+
message: 'Unknown error happened for campaign distributions',
|
|
241
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrTradingRewardCampaignDistributionError,
|
|
242
|
+
},
|
|
243
|
+
'invalid trading reward points update': {
|
|
244
|
+
message: 'The updated trading reward points is not valid',
|
|
245
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidTradingRewardsPendingPointsUpdate,
|
|
246
|
+
},
|
|
247
|
+
'invalid batch msg update': {
|
|
248
|
+
message: 'The MsgBatchUpdate is not valid',
|
|
249
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidBatchMsgUpdate,
|
|
250
|
+
},
|
|
251
|
+
'post-only order exceeds top of book price': {
|
|
252
|
+
message: 'The post-only order price exceeds top of the orderbook price',
|
|
253
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrExceedsTopOfBookPrice,
|
|
254
|
+
},
|
|
255
|
+
'order type not supported for given message': {
|
|
256
|
+
message: 'The order type is not supported for this message',
|
|
257
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidOrderTypeForMessage,
|
|
258
|
+
},
|
|
259
|
+
'sender must match dmm account': {
|
|
260
|
+
message: 'The sender must match the DMM address',
|
|
261
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidDMMSender,
|
|
262
|
+
},
|
|
263
|
+
'already opted out of rewards': {
|
|
264
|
+
message: 'The DMM address already opted out of rewards',
|
|
265
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrAlreadyOptedOutOfRewards,
|
|
266
|
+
},
|
|
267
|
+
'invalid margin ratio': {
|
|
268
|
+
message: 'The margin ratio is invalid',
|
|
269
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidMarginRatio,
|
|
270
|
+
},
|
|
271
|
+
'provided funds are below minimum': {
|
|
272
|
+
message: 'The provided funds are below minimum',
|
|
273
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrBelowMinimalContribution,
|
|
274
|
+
},
|
|
275
|
+
'position is below initial margin requirement': {
|
|
276
|
+
message: 'The position is below initial margin requirement',
|
|
277
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrLowPositionMargin,
|
|
278
|
+
},
|
|
279
|
+
'pool has non-positive total lp token supply': {
|
|
280
|
+
message: 'The pool has non-positive total LP token supply',
|
|
281
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidTotalSupply,
|
|
282
|
+
},
|
|
283
|
+
'passed lp token burn amount is greater than total lp token supply': {
|
|
284
|
+
message: 'The passed LP token burn amount is greater than total LP token supply',
|
|
285
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidLpTokenBurnAmount,
|
|
286
|
+
},
|
|
287
|
+
'unsupported action': {
|
|
288
|
+
message: 'This action is not supported',
|
|
289
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrUnsupportedAction,
|
|
290
|
+
},
|
|
291
|
+
'position quantity cannot be negative': {
|
|
292
|
+
message: 'The position quantity cannot be negative',
|
|
293
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrNegativePositionQuantity,
|
|
294
|
+
},
|
|
295
|
+
'binary options market exists': {
|
|
296
|
+
message: 'The BinaryOptions market already exists',
|
|
297
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrBinaryOptionsMarketExists,
|
|
298
|
+
},
|
|
299
|
+
'binary options market not found': {
|
|
300
|
+
message: 'The BinaryOptions market cannot be found',
|
|
301
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrBinaryOptionsMarketNotFound,
|
|
302
|
+
},
|
|
303
|
+
'invalid settlement': {
|
|
304
|
+
message: 'The settlement price is not valid',
|
|
305
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidSettlement,
|
|
306
|
+
},
|
|
307
|
+
'account doesnt exist': {
|
|
308
|
+
message: 'The trading account does not exist',
|
|
309
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrAccountDoesntExist,
|
|
310
|
+
},
|
|
311
|
+
'sender should be a market admin': {
|
|
312
|
+
message: 'The sender should be the admin of the market',
|
|
313
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrSenderIsNotAnAdmin,
|
|
314
|
+
},
|
|
315
|
+
'market is already scheduled to settle': {
|
|
316
|
+
message: 'The market is already scheduled to settle ',
|
|
317
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrMarketAlreadyScheduledToSettle,
|
|
318
|
+
},
|
|
319
|
+
'market not found': {
|
|
320
|
+
message: 'The market cannot be found',
|
|
321
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrGenericMarketNotFound,
|
|
322
|
+
},
|
|
323
|
+
'denom decimal cannot be below 1 or above max scale factor': {
|
|
324
|
+
message: 'The denom decimal cannot be below 1 or above max scale factor',
|
|
325
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidDenomDecimal,
|
|
326
|
+
},
|
|
327
|
+
'state is invalid': {
|
|
328
|
+
message: 'The state is invalid',
|
|
329
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidState,
|
|
330
|
+
},
|
|
331
|
+
'transient orders up to cancellation not supported': {
|
|
332
|
+
message: 'The transient orders up to cancellation not supported',
|
|
333
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrTransientOrdersUpToCancelNotSupported,
|
|
334
|
+
},
|
|
335
|
+
'invalid trade': {
|
|
336
|
+
message: 'The trade is not valid',
|
|
337
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidTrade,
|
|
338
|
+
},
|
|
339
|
+
'no margin locked in subaccount': {
|
|
340
|
+
message: 'There is no margin locked in the trading account',
|
|
341
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrNoMarginLocked,
|
|
342
|
+
},
|
|
343
|
+
'Invalid access level to perform action': {
|
|
344
|
+
message: 'There is no access to perform action',
|
|
345
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidAccessLevel,
|
|
346
|
+
},
|
|
347
|
+
'Invalid address': {
|
|
348
|
+
message: 'The address is not valid',
|
|
349
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidAddress,
|
|
350
|
+
},
|
|
351
|
+
'Invalid argument': {
|
|
352
|
+
message: 'The argument is not valid',
|
|
353
|
+
code: types_1.ChainExchangeModuleErrorCode.ErrInvalidArgument,
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":";;;AAAA,mCAA4E;AAE/D,QAAA,WAAW,GAAG;IACzB,kBAAkB,EAAE;QAClB,OAAO,EAAE,yDAAyD;QAClE,IAAI,EAAE,4BAAoB,CAAC,kBAAkB;KAC9C;IAED,oBAAoB,EAAE;QACpB,OAAO,EAAE,yDAAyD;QAClE,IAAI,EAAE,4BAAoB,CAAC,oBAAoB;KAChD;IAED,mBAAmB,EAAE;QACnB,OAAO,EAAE,+DAA+D;QACxE,IAAI,EAAE,4BAAoB,CAAC,kBAAkB;KAC9C;IAED,2BAA2B;IAC3B,0BAA0B,EAAE;QAC1B,OAAO,EAAE,+BAA+B;QACxC,IAAI,EAAE,oCAA4B,CAAC,eAAe;KACnD;IAED,uBAAuB,EAAE;QACvB,OAAO,EAAE,oCAAoC;QAC7C,IAAI,EAAE,oCAA4B,CAAC,qBAAqB;KACzD;IAED,oBAAoB,EAAE;QACpB,OAAO,EAAE,gCAAgC;QACzC,IAAI,EAAE,oCAA4B,CAAC,mBAAmB;KACvD;IAED,oBAAoB,EAAE;QACpB,OAAO,EAAE,mCAAmC;QAC5C,IAAI,EAAE,oCAA4B,CAAC,WAAW;KAC/C;IAED,2BAA2B,EAAE;QAC3B,OAAO,EAAE,+BAA+B;QACxC,IAAI,EAAE,oCAA4B,CAAC,gBAAgB;KACpD;IAED,sCAAsC,EAAE;QACtC,OAAO,EAAE,6CAA6C;QACtD,IAAI,EAAE,oCAA4B,CAAC,sBAAsB;KAC1D;IAED,yBAAyB,EAAE;QACzB,OAAO,EAAE,kCAAkC;QAC3C,IAAI,EAAE,oCAA4B,CAAC,wBAAwB;KAC5D;IAED,0C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ED,iCAAiC,EAAE;QACjC,OAAO,EAAE,8CAA8C;QACvD,IAAI,EAAE,oCAA4B,CAAC,qBAAqB;KACzD;IAED,uCAAuC,EAAE;QACvC,OAAO,EAAE,4CAA4C;QACrD,IAAI,EAAE,oCAA4B,CAAC,iCAAiC;KACrE;IAED,kBAAkB,EAAE;QAClB,OAAO,EAAE,4BAA4B;QACrC,IAAI,EAAE,oCAA4B,CAAC,wBAAwB;KAC5D;IAED,2DAA2D,EAAE;QAC3D,OAAO,EAAE,+DAA+D;QACxE,IAAI,EAAE,oCAA4B,CAAC,sBAAsB;KAC1D;IAED,kBAAkB,EAAE;QAClB,OAAO,EAAE,sBAAsB;QAC/B,IAAI,EAAE,oCAA4B,CAAC,eAAe;KACnD;IAED,mDAAmD,EAAE;QACnD,OAAO,EAAE,uDAAuD;QAChE,IAAI,EAAE,oCAA4B,CAAC,wCAAwC;KAC5E;IAED,eAAe,EAAE;QACf,OAAO,EAAE,wBAAwB;QACjC,IAAI,EAAE,oCAA4B,CAAC,eAAe;KACnD;IAED,gCAAgC,EAAE;QAChC,OAAO,EAAE,kDAAkD;QAC3D,IAAI,EAAE,oCAA4B,CAAC,iBAAiB;KACrD;IAED,wCAAwC,EAAE;QACxC,OAAO,EAAE,sCAAsC;QAC/C,IAAI,EAAE,oCAA4B,CAAC,qBAAqB;KACzD;IAED,iBAAiB,EAAE;QACjB,OAAO,EAAE,0BAA0B;QACnC,IAAI,EAAE,oCAA4B,CAAC,iBAAiB;KACrD;IAED,kBAAkB,EAAE;QAClB,OAAO,EAAE,2BAA2B;QACpC,IAAI,EAAE,oCAA4B,CAAC,kBAAkB;KACtD;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ErrorContextCode } from '../types';
|
|
2
|
+
export declare const parseMessage: (message: string) => string;
|
|
3
|
+
export declare const mapFailedTransactionMessage: (message: string) => {
|
|
4
|
+
message: string;
|
|
5
|
+
code: ErrorContextCode;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=maps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../src/utils/maps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,UAAU,CAAA;AAEjE,eAAO,MAAM,YAAY,YAAa,MAAM,WAe3C,CAAA;AAED,eAAO,MAAM,2BAA2B,YAC7B,MAAM;aACH,MAAM;UAAQ,gBAAgB;CAW3C,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapFailedTransactionMessage = exports.parseMessage = void 0;
|
|
4
|
+
const messages_1 = require("../messages");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const parseMessage = (message) => {
|
|
7
|
+
const firstParse = message.split('message index: 0:');
|
|
8
|
+
if (firstParse.length === 1) {
|
|
9
|
+
const [firstParseString] = firstParse;
|
|
10
|
+
const secondParse = firstParseString.split(': invalid request');
|
|
11
|
+
const [secondParseString] = secondParse;
|
|
12
|
+
return secondParseString.trim().trimEnd();
|
|
13
|
+
}
|
|
14
|
+
const [, firstParseString] = firstParse;
|
|
15
|
+
const [actualMessage] = firstParseString.split(': invalid request');
|
|
16
|
+
return actualMessage.trim().trimEnd();
|
|
17
|
+
};
|
|
18
|
+
exports.parseMessage = parseMessage;
|
|
19
|
+
const mapFailedTransactionMessage = (message) => {
|
|
20
|
+
const parsedMessage = (0, exports.parseMessage)(message);
|
|
21
|
+
const messageInMapKey = Object.keys(messages_1.messagesMap).find((key) => key.toLowerCase() === parsedMessage.toLowerCase());
|
|
22
|
+
if (!messageInMapKey) {
|
|
23
|
+
return { message: parsedMessage, code: types_1.UnspecifiedErrorCode };
|
|
24
|
+
}
|
|
25
|
+
return messages_1.messagesMap[messageInMapKey];
|
|
26
|
+
};
|
|
27
|
+
exports.mapFailedTransactionMessage = mapFailedTransactionMessage;
|
|
28
|
+
//# sourceMappingURL=maps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps.js","sourceRoot":"","sources":["../../src/utils/maps.ts"],"names":[],"mappings":";;;AAAA,0CAAyC;AACzC,oCAAiE;AAE1D,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAErD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,MAAM,CAAC,gBAAgB,CAAC,GAAG,UAAU,CAAA;QACrC,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAC/D,MAAM,CAAC,iBAAiB,CAAC,GAAG,WAAW,CAAA;QAEvC,OAAO,iBAAiB,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;KAC1C;IAED,MAAM,CAAC,EAAE,gBAAgB,CAAC,GAAG,UAAU,CAAA;IACvC,MAAM,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAEnE,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;AACvC,CAAC,CAAA;AAfY,QAAA,YAAY,gBAexB;AAEM,MAAM,2BAA2B,GAAG,CACzC,OAAe,EAC8B,EAAE;IAC/C,MAAM,aAAa,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,eAAe,GACnB,MAAM,CAAC,IAAI,CAAC,sBAAW,CACxB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC,WAAW,EAAE,CAAC,CAAA;IAElE,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,4BAAoB,EAAE,CAAA;KAC9D;IAED,OAAO,sBAAW,CAAC,eAAe,CAAC,CAAA;AACrC,CAAC,CAAA;AAbY,QAAA,2BAA2B,+BAavC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/exceptions",
|
|
3
3
|
"description": "List of exceptions that can be reused throughout Injective's projects.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"link-module-alias": "^1.2.0",
|
|
38
38
|
"shx": "^0.3.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "afc12adbe53ab6a29c5946f343870bb2177267ef"
|
|
41
41
|
}
|