@pioneer-platform/helpers 4.1.0 → 4.1.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/CHANGELOG.md +8 -0
- package/package.json +12 -12
- package/lib/helpers/asset.d.ts +0 -36
- package/lib/helpers/asset.js +0 -208
- package/lib/helpers/liquidity.d.ts +0 -58
- package/lib/helpers/liquidity.js +0 -91
- package/lib/helpers/memo.d.ts +0 -46
- package/lib/helpers/memo.js +0 -43
- package/lib/helpers/others.d.ts +0 -3
- package/lib/helpers/others.js +0 -23
- package/lib/helpers/request.d.ts +0 -5
- package/lib/helpers/request.js +0 -79
- package/lib/helpers/validators.d.ts +0 -1
- package/lib/helpers/validators.js +0 -16
- package/lib/index.d.ts +0 -15
- package/lib/index.js +0 -31
- package/lib/modules/assetValue.d.ts +0 -58
- package/lib/modules/assetValue.js +0 -355
- package/lib/modules/bigIntArithmetics.d.ts +0 -54
- package/lib/modules/bigIntArithmetics.js +0 -598
- package/lib/modules/swapKitError.d.ts +0 -64
- package/lib/modules/swapKitError.js +0 -71
- package/lib/modules/swapKitNumber.d.ts +0 -6
- package/lib/modules/swapKitNumber.js +0 -17
@@ -1,71 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SwapKitError = void 0;
|
4
|
-
const errorMessages = {
|
5
|
-
/**
|
6
|
-
* Core
|
7
|
-
*/
|
8
|
-
core_wallet_connection_not_found: 10001,
|
9
|
-
core_estimated_max_spendable_chain_not_supported: 10002,
|
10
|
-
core_extend_error: 10003,
|
11
|
-
core_inbound_data_not_found: 10004,
|
12
|
-
core_approve_asset_address_or_from_not_found: 10005,
|
13
|
-
core_chain_halted: 10099,
|
14
|
-
/**
|
15
|
-
* Core - Wallet Connection
|
16
|
-
*/
|
17
|
-
core_wallet_xdefi_not_installed: 10101,
|
18
|
-
core_wallet_evmwallet_not_installed: 10102,
|
19
|
-
core_wallet_walletconnect_not_installed: 10103,
|
20
|
-
core_wallet_keystore_not_installed: 10104,
|
21
|
-
core_wallet_ledger_not_installed: 10105,
|
22
|
-
core_wallet_trezor_not_installed: 10106,
|
23
|
-
core_wallet_keplr_not_installed: 10107,
|
24
|
-
core_wallet_okx_not_installed: 10108,
|
25
|
-
core_wallet_keepkey_not_installed: 10109,
|
26
|
-
/**
|
27
|
-
* Core - Swap
|
28
|
-
*/
|
29
|
-
core_swap_invalid_params: 10200,
|
30
|
-
core_swap_route_not_complete: 10201,
|
31
|
-
core_swap_asset_not_recognized: 10202,
|
32
|
-
core_swap_contract_not_found: 10203,
|
33
|
-
core_swap_route_transaction_not_found: 10204,
|
34
|
-
core_swap_contract_not_supported: 10205,
|
35
|
-
core_swap_quote_mode_not_supported: 10207,
|
36
|
-
/**
|
37
|
-
* Core - Transaction
|
38
|
-
*/
|
39
|
-
core_transaction_deposit_error: 10301,
|
40
|
-
core_transaction_create_liquidity_rune_error: 10302,
|
41
|
-
core_transaction_create_liquidity_asset_error: 10303,
|
42
|
-
core_transaction_create_liquidity_invalid_params: 10304,
|
43
|
-
core_transaction_add_liquidity_invalid_params: 10305,
|
44
|
-
core_transaction_add_liquidity_no_rune_address: 10306,
|
45
|
-
core_transaction_add_liquidity_rune_error: 10307,
|
46
|
-
core_transaction_add_liquidity_asset_error: 10308,
|
47
|
-
core_transaction_withdraw_error: 10309,
|
48
|
-
core_transaction_deposit_to_pool_error: 10310,
|
49
|
-
core_transaction_deposit_insufficient_funds_error: 10311,
|
50
|
-
core_transaction_deposit_gas_error: 10312,
|
51
|
-
core_transaction_invalid_sender_address: 10313,
|
52
|
-
core_transaction_deposit_server_error: 10314,
|
53
|
-
core_swap_transaction_error: 10400,
|
54
|
-
/**
|
55
|
-
* Wallets
|
56
|
-
*/
|
57
|
-
wallet_ledger_connection_error: 20001,
|
58
|
-
/**
|
59
|
-
* Helpers
|
60
|
-
*/
|
61
|
-
helpers_number_different_decimals: 99101,
|
62
|
-
};
|
63
|
-
class SwapKitError extends Error {
|
64
|
-
constructor(errorKey, sourceError) {
|
65
|
-
console.error(sourceError, { stack: sourceError === null || sourceError === void 0 ? void 0 : sourceError.stack, message: sourceError === null || sourceError === void 0 ? void 0 : sourceError.message });
|
66
|
-
// @ts-ignore
|
67
|
-
super(errorKey, { cause: { code: errorMessages[errorKey], message: errorKey } });
|
68
|
-
Object.setPrototypeOf(this, SwapKitError.prototype);
|
69
|
-
}
|
70
|
-
}
|
71
|
-
exports.SwapKitError = SwapKitError;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { BigIntArithmetics } from './bigIntArithmetics';
|
2
|
-
export type SwapKitValueType = BigIntArithmetics | string | number;
|
3
|
-
export declare class SwapKitNumber extends BigIntArithmetics {
|
4
|
-
eq(value: SwapKitValueType): boolean;
|
5
|
-
static fromBigInt(value: bigint, decimal?: number): SwapKitNumber;
|
6
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SwapKitNumber = void 0;
|
4
|
-
const bigIntArithmetics_1 = require("./bigIntArithmetics");
|
5
|
-
const DEFAULT_DECIMAL = 8;
|
6
|
-
class SwapKitNumber extends bigIntArithmetics_1.BigIntArithmetics {
|
7
|
-
eq(value) {
|
8
|
-
return this.eqValue(value);
|
9
|
-
}
|
10
|
-
static fromBigInt(value, decimal) {
|
11
|
-
return new SwapKitNumber({
|
12
|
-
decimal,
|
13
|
-
value: (0, bigIntArithmetics_1.formatBigIntToSafeValue)({ value, bigIntDecimal: (0, bigIntArithmetics_1.toMultiplier)(decimal || DEFAULT_DECIMAL), decimal }),
|
14
|
-
});
|
15
|
-
}
|
16
|
-
}
|
17
|
-
exports.SwapKitNumber = SwapKitNumber;
|