@deserialize/swap-sdk 1.1.3 → 1.1.4
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/errors.d.ts +5 -2
- package/dist/errors.js +10 -3
- package/dist/errors.js.map +1 -1
- package/package.json +1 -1
- package/src/errors.ts +9 -2
package/dist/errors.d.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
export declare const handleSimulationError: (e: string | {}) => void;
|
2
|
-
export declare class
|
2
|
+
export declare class DeserializeError extends Error {
|
3
3
|
constructor(message: string);
|
4
4
|
}
|
5
|
-
export declare class
|
5
|
+
export declare class TooManyAccountsLockError extends DeserializeError {
|
6
|
+
constructor(message: string);
|
7
|
+
}
|
8
|
+
export declare class PairNotAvailableOnDex extends DeserializeError {
|
6
9
|
constructor(message: string);
|
7
10
|
}
|
package/dist/errors.js
CHANGED
@@ -1,20 +1,27 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.PairNotAvailableOnDex = exports.TooManyAccountsLockError = exports.handleSimulationError = void 0;
|
3
|
+
exports.PairNotAvailableOnDex = exports.TooManyAccountsLockError = exports.DeserializeError = exports.handleSimulationError = void 0;
|
4
4
|
const handleSimulationError = (e) => {
|
5
5
|
if (e.toString().includes("TooManyAccountLocks")) {
|
6
6
|
throw new TooManyAccountsLockError("Too many account locks: consider using the option reduceToTwoHops in the options when getting the routes");
|
7
7
|
}
|
8
8
|
};
|
9
9
|
exports.handleSimulationError = handleSimulationError;
|
10
|
-
class
|
10
|
+
class DeserializeError extends Error {
|
11
|
+
constructor(message) {
|
12
|
+
super(message);
|
13
|
+
this.name = "DeserializeError";
|
14
|
+
}
|
15
|
+
}
|
16
|
+
exports.DeserializeError = DeserializeError;
|
17
|
+
class TooManyAccountsLockError extends DeserializeError {
|
11
18
|
constructor(message) {
|
12
19
|
super(message);
|
13
20
|
this.name = "TooManyAccountsLockError";
|
14
21
|
}
|
15
22
|
}
|
16
23
|
exports.TooManyAccountsLockError = TooManyAccountsLockError;
|
17
|
-
class PairNotAvailableOnDex extends
|
24
|
+
class PairNotAvailableOnDex extends DeserializeError {
|
18
25
|
constructor(message) {
|
19
26
|
super(message);
|
20
27
|
this.name = "PairNotAvailableOnDex";
|
package/dist/errors.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAO,MAAM,qBAAqB,GAAG,CAAC,CAAc,EAAE,EAAE;IACtD,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,wBAAwB,CAChC,0GAA0G,CAC3G,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AANW,QAAA,qBAAqB,yBAMhC;
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAO,MAAM,qBAAqB,GAAG,CAAC,CAAc,EAAE,EAAE;IACtD,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,wBAAwB,CAChC,0GAA0G,CAC3G,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AANW,QAAA,qBAAqB,yBAMhC;AAEF,MAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AALD,4CAKC;AACD,MAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AALD,4DAKC;AAED,MAAa,qBAAsB,SAAQ,gBAAgB;IACzD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC"}
|
package/package.json
CHANGED
package/src/errors.ts
CHANGED
@@ -5,14 +5,21 @@ export const handleSimulationError = (e: string | {}) => {
|
|
5
5
|
);
|
6
6
|
}
|
7
7
|
};
|
8
|
-
|
8
|
+
|
9
|
+
export class DeserializeError extends Error {
|
10
|
+
constructor(message: string) {
|
11
|
+
super(message);
|
12
|
+
this.name = "DeserializeError";
|
13
|
+
}
|
14
|
+
}
|
15
|
+
export class TooManyAccountsLockError extends DeserializeError {
|
9
16
|
constructor(message: string) {
|
10
17
|
super(message);
|
11
18
|
this.name = "TooManyAccountsLockError";
|
12
19
|
}
|
13
20
|
}
|
14
21
|
|
15
|
-
export class PairNotAvailableOnDex extends
|
22
|
+
export class PairNotAvailableOnDex extends DeserializeError {
|
16
23
|
constructor(message: string) {
|
17
24
|
super(message);
|
18
25
|
this.name = "PairNotAvailableOnDex";
|