@ercworldio/blockchain-shared 1.0.2-dev.5 → 1.0.2-dev.7
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.
|
@@ -507,7 +507,9 @@
|
|
|
507
507
|
"overflow_treasury_receiver": "TWA4NYYdVtnb7iZfmyruC5MefsFdw84iZu",
|
|
508
508
|
"overflow_threshold_decimal": 100000,
|
|
509
509
|
"min_funding_wallet_balance_usd": 5,
|
|
510
|
-
"allowed_receivers": [
|
|
510
|
+
"allowed_receivers": [
|
|
511
|
+
"TWA4NYYdVtnb7iZfmyruC5MefsFdw84iZu"
|
|
512
|
+
]
|
|
511
513
|
},
|
|
512
514
|
"rpcMetadata": {
|
|
513
515
|
"rpcBaseUrl": "https://rpc.ankr.com/premium-http/tron",
|
package/build/errors/errors.d.ts
CHANGED
|
@@ -61,7 +61,9 @@ export declare const ErrorMessages: {
|
|
|
61
61
|
readonly NOT_WHITELISTED: "The provided wallet address is not whitelisted";
|
|
62
62
|
readonly INVALID_WALLET_TYPE: "WalletType is invalid. Use \"funding\", \"rent-energy\" or \"escrow\"";
|
|
63
63
|
readonly ONLY_NATIVE_WITHDRAWAL: "Only native tokens can be withdrawn";
|
|
64
|
-
readonly RENT_ENERGY_API_ERROR: "Encountered error when calling rent API
|
|
64
|
+
readonly RENT_ENERGY_API_ERROR: "Encountered error when calling rent API";
|
|
65
|
+
readonly INSUFFICIENT_ENERGY_WALLET_BALANCE: "Rent energy wallet has insufficient balance";
|
|
66
|
+
readonly RENT_ENERGY_MIN_WITHDRAWAL_ERROR: "Minimum withdrawal of 50TRX required.";
|
|
65
67
|
};
|
|
66
68
|
export declare const ErrorCodes: {
|
|
67
69
|
readonly INTERNAL_SERVER: "error.internal_server_error";
|
|
@@ -120,6 +122,8 @@ export declare const ErrorCodes: {
|
|
|
120
122
|
readonly INVALID_WALLET_TYPE: "error.invalid_wallet_type";
|
|
121
123
|
readonly ONLY_NATIVE_WITHDRAWAL: "error.only_native_withdrawal";
|
|
122
124
|
readonly RENT_ENERGY_API_ERROR: "error.rent_enegy_api_error";
|
|
125
|
+
readonly INSUFFICIENT_ENERGY_WALLET_BALANCE: "error.insufficient_energy_wallet_balance";
|
|
126
|
+
readonly RENT_ENERGY_MIN_WITHDRAWAL_ERROR: "error.rent_energy_min_withdrawal_error";
|
|
123
127
|
};
|
|
124
128
|
export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
|
|
125
129
|
export interface ErrorCodeEntry {
|
|
@@ -201,7 +205,9 @@ declare class BaseErrors {
|
|
|
201
205
|
NotWhitelisted(): "The provided wallet address is not whitelisted";
|
|
202
206
|
InvalidWalletType(): "WalletType is invalid. Use \"funding\", \"rent-energy\" or \"escrow\"";
|
|
203
207
|
OnlyNativeWithdrawal(): "Only native tokens can be withdrawn";
|
|
204
|
-
RentEnergyApiError(): "Encountered error when calling rent API
|
|
208
|
+
RentEnergyApiError(): "Encountered error when calling rent API";
|
|
209
|
+
InsufficientRentEnergyWalletBalance(): "Rent energy wallet has insufficient balance";
|
|
210
|
+
RentEnergyMinWithdrawalError(): "Minimum withdrawal of 50TRX required.";
|
|
205
211
|
/** Handler methods */
|
|
206
212
|
handle_error: (error: any, source_method: string) => ErrorHandlerResponse;
|
|
207
213
|
get_error_code_base: (message: string) => ErrorCodeEntry | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqFtB,2BAA2B;;;;IAK3B,sBAAsB
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,CAAC,CAAC,EAAE,GAAG;IAC9B,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG;IAChB,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG;IACzB,gBAAgB;IAChB,sBAAsB;IACtB,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG;IACvB,sBAAsB,CAAC,CAAC,CAAC,EAAE,GAAG;IAC9B,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG;IACrB,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG;IACvB,oBAAoB,CAAC,CAAC,CAAC,EAAE,GAAG;IAC5B,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG;IAC3B,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM;IAC/B,yBAAyB,CAAC,CAAC,CAAC,EAAE,GAAG;IACjC,gBAAgB,CAAC,CAAC,CAAC,EAAE,GAAG;IACxB,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG;IACrB,yBAAyB;IACzB,WAAW;IACX,cAAc;IACd,iBAAiB;IACjB,oBAAoB;IACpB,kBAAkB;IAClB,mCAAmC;IACnC,4BAA4B;IAEnC,sBAAsB;IACf,YAAY,GAAI,OAAO,GAAG,EAAE,eAAe,MAAM,KAAG,oBAAoB,CAuB9E;IAEM,mBAAmB,GAAI,SAAS,MAAM,KAAG,cAAc,GAAG,IAAI,CAmCpE;CACJ;AAED,eAAe,UAAU,CAAC"}
|
package/build/errors/errors.js
CHANGED
|
@@ -99,7 +99,9 @@ exports.ErrorMessages = {
|
|
|
99
99
|
NOT_WHITELISTED: `The provided wallet address is not whitelisted`, // 400
|
|
100
100
|
INVALID_WALLET_TYPE: `WalletType is invalid. Use "funding", "rent-energy" or "escrow"`, // 400
|
|
101
101
|
ONLY_NATIVE_WITHDRAWAL: `Only native tokens can be withdrawn`, // 400
|
|
102
|
-
RENT_ENERGY_API_ERROR: `Encountered error when calling rent API
|
|
102
|
+
RENT_ENERGY_API_ERROR: `Encountered error when calling rent API`, // 500
|
|
103
|
+
INSUFFICIENT_ENERGY_WALLET_BALANCE: `Rent energy wallet has insufficient balance`,
|
|
104
|
+
RENT_ENERGY_MIN_WITHDRAWAL_ERROR: `Minimum withdrawal of 50TRX required.`,
|
|
103
105
|
};
|
|
104
106
|
exports.ErrorCodes = {
|
|
105
107
|
INTERNAL_SERVER: 'error.internal_server_error',
|
|
@@ -164,6 +166,8 @@ exports.ErrorCodes = {
|
|
|
164
166
|
INVALID_WALLET_TYPE: `error.invalid_wallet_type`,
|
|
165
167
|
ONLY_NATIVE_WITHDRAWAL: `error.only_native_withdrawal`,
|
|
166
168
|
RENT_ENERGY_API_ERROR: `error.rent_enegy_api_error`,
|
|
169
|
+
INSUFFICIENT_ENERGY_WALLET_BALANCE: `error.insufficient_energy_wallet_balance`,
|
|
170
|
+
RENT_ENERGY_MIN_WITHDRAWAL_ERROR: `error.rent_energy_min_withdrawal_error`,
|
|
167
171
|
};
|
|
168
172
|
class BaseErrors {
|
|
169
173
|
constructor() {
|
|
@@ -263,6 +267,10 @@ class BaseErrors {
|
|
|
263
267
|
return Object.assign(Object.assign({}, this.codes[400]), { error_code: exports.ErrorCodes.ONLY_NATIVE_WITHDRAWAL });
|
|
264
268
|
if (message.includes(exports.ErrorMessages.RENT_ENERGY_API_ERROR))
|
|
265
269
|
return Object.assign(Object.assign({}, this.codes[400]), { error_code: exports.ErrorCodes.RENT_ENERGY_API_ERROR });
|
|
270
|
+
if (message.includes(exports.ErrorMessages.INSUFFICIENT_ENERGY_WALLET_BALANCE))
|
|
271
|
+
return Object.assign(Object.assign({}, this.codes[400]), { error_code: exports.ErrorCodes.INSUFFICIENT_ENERGY_WALLET_BALANCE });
|
|
272
|
+
if (message.includes(exports.ErrorMessages.RENT_ENERGY_MIN_WITHDRAWAL_ERROR))
|
|
273
|
+
return Object.assign(Object.assign({}, this.codes[400]), { error_code: exports.ErrorCodes.RENT_ENERGY_MIN_WITHDRAWAL_ERROR });
|
|
266
274
|
return null;
|
|
267
275
|
};
|
|
268
276
|
}
|
|
@@ -327,5 +335,9 @@ class BaseErrors {
|
|
|
327
335
|
;
|
|
328
336
|
RentEnergyApiError() { return exports.ErrorMessages.RENT_ENERGY_API_ERROR; }
|
|
329
337
|
;
|
|
338
|
+
InsufficientRentEnergyWalletBalance() { return exports.ErrorMessages.INSUFFICIENT_ENERGY_WALLET_BALANCE; }
|
|
339
|
+
;
|
|
340
|
+
RentEnergyMinWithdrawalError() { return exports.ErrorMessages.RENT_ENERGY_MIN_WITHDRAWAL_ERROR; }
|
|
341
|
+
;
|
|
330
342
|
}
|
|
331
343
|
exports.default = BaseErrors;
|