@proton/wrap-constants 0.2.71 → 0.2.72
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/index.d.ts +8868 -6
- package/dist/index.js +3728 -5
- package/dist/index.mjs +3602 -0
- package/package.json +6 -12
- package/dist/coins.d.ts +0 -121
- package/dist/constants.d.ts +0 -63
- package/dist/graph.d.ts +0 -30
- package/dist/math.d.ts +0 -17
- package/dist/parsers/actions.d.ts +0 -1323
- package/dist/parsers/address.d.ts +0 -932
- package/dist/parsers/auth.d.ts +0 -1816
- package/dist/parsers/base.d.ts +0 -35
- package/dist/parsers/currency.d.ts +0 -236
- package/dist/parsers/deposit.d.ts +0 -66
- package/dist/parsers/dex.d.ts +0 -1516
- package/dist/parsers/index.d.ts +0 -13
- package/dist/parsers/login.d.ts +0 -892
- package/dist/parsers/otc.d.ts +0 -46
- package/dist/parsers/pool.d.ts +0 -52
- package/dist/parsers/withdraw.d.ts +0 -1053
- package/dist/parsers/withdrawalHistory.d.ts +0 -98
- package/dist/parsers/wrap.d.ts +0 -109
- package/dist/utils.d.ts +0 -8
- package/dist/wrap-constants.cjs.development.js +0 -2228
- package/dist/wrap-constants.cjs.development.js.map +0 -1
- package/dist/wrap-constants.cjs.production.min.js +0 -2
- package/dist/wrap-constants.cjs.production.min.js.map +0 -1
- package/dist/wrap-constants.esm.js +0 -2162
- package/dist/wrap-constants.esm.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proton/wrap-constants",
|
|
3
3
|
"author": "Metallicus",
|
|
4
|
-
"module": "dist/
|
|
4
|
+
"module": "dist/index.mjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.2.
|
|
8
|
+
"version": "0.2.72",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -17,11 +17,8 @@
|
|
|
17
17
|
"node": ">=10"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"test": "tsdx test",
|
|
23
|
-
"lint": "tsdx lint",
|
|
24
|
-
"prepare": "tsdx build",
|
|
20
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
21
|
+
"dev": "tsup src/index.ts --watch",
|
|
25
22
|
"size": "size-limit",
|
|
26
23
|
"analyze": "size-limit --why"
|
|
27
24
|
},
|
|
@@ -32,10 +29,7 @@
|
|
|
32
29
|
"@size-limit/preset-small-lib": "^4.9.1",
|
|
33
30
|
"@types/lodash.clonedeep": "^4.5.6",
|
|
34
31
|
"@typescript-eslint/parser": "^4.28.2",
|
|
35
|
-
"size-limit": "^4.9.1"
|
|
36
|
-
"tsdx": "^0.14.1",
|
|
37
|
-
"tslib": "^2.3.1",
|
|
38
|
-
"typescript": "4.5"
|
|
32
|
+
"size-limit": "^4.9.1"
|
|
39
33
|
},
|
|
40
34
|
"dependencies": {
|
|
41
35
|
"lodash.clonedeep": "^4.5.0",
|
|
@@ -44,5 +38,5 @@
|
|
|
44
38
|
"resolutions": {
|
|
45
39
|
"typescript": "4.5"
|
|
46
40
|
},
|
|
47
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "acf71eeaea7a32a70c7dc5da8e4c5b913b24ab22"
|
|
48
42
|
}
|
package/dist/coins.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Asset } from '@bloks/numbers';
|
|
2
|
-
export declare enum Chains {
|
|
3
|
-
BitcoinMainnet = "Bitcoin",
|
|
4
|
-
BitcoinTestnet = "Bitcoin (Testnet)",
|
|
5
|
-
EthereumMainnet = "Ethereum",
|
|
6
|
-
EthereumRopsten = "Ethereum (Ropsten)",
|
|
7
|
-
LitecoinMainnet = "Litecoin",
|
|
8
|
-
LitecoinTestnet = "Litecoin (Testnet)",
|
|
9
|
-
BitcoinCashMainnet = "Bitcoin Cash",
|
|
10
|
-
BitcoinCashTestnet = "Bitcoin Cash (Testnet)",
|
|
11
|
-
StellarMainnet = "Stellar",
|
|
12
|
-
StellarTestnet = "Stellar (Testnet)",
|
|
13
|
-
ProtonMainnet = "Proton",
|
|
14
|
-
ProtonTestnet = "Proton (Testnet)",
|
|
15
|
-
PolkadotMainnet = "Polkadot",
|
|
16
|
-
BinanceBEP2 = "Binance (BEP2)",
|
|
17
|
-
BinanceBEP20 = "Binance (BEP20)",
|
|
18
|
-
EosMainnet = "EOS",
|
|
19
|
-
EosTestnet = "EOS (Jungle Testnet)",
|
|
20
|
-
HederaMainnet = "Hedera (Mainnet)",
|
|
21
|
-
HederaTestnet = "Hedera (Testnet)",
|
|
22
|
-
DogeMainnet = "Dogecoin",
|
|
23
|
-
CardanoMainnet = "Cardano",
|
|
24
|
-
AvalancheXChain = "Avalanche X-Chain",
|
|
25
|
-
AvalancheCChain = "Avalanche C-Chain",
|
|
26
|
-
PolygonMainnet = "Polygon",
|
|
27
|
-
TerraMainnet = "Terra",
|
|
28
|
-
RippleMainnet = "Ripple",
|
|
29
|
-
SolanaMainnet = "Solana",
|
|
30
|
-
XDCMainnet = "XDC Network",
|
|
31
|
-
MetalXTestnet = "Metal X-Chain (Testnet)",
|
|
32
|
-
MetalCTestnet = "Metal C-Chain (Testnet)",
|
|
33
|
-
MetalCMainnet = "Metal C-Chain"
|
|
34
|
-
}
|
|
35
|
-
export declare enum Networks {
|
|
36
|
-
Mainnet = "mainnet",
|
|
37
|
-
Testnet = "testnet",
|
|
38
|
-
Ropsten = "ropsten",
|
|
39
|
-
ERC20 = "erc20",
|
|
40
|
-
BEP20 = "bep20",
|
|
41
|
-
XLM = "xlm",
|
|
42
|
-
AVM = "avm",
|
|
43
|
-
EVM = "evm"
|
|
44
|
-
}
|
|
45
|
-
export declare const similarChains: {
|
|
46
|
-
Ethereum: Chains[];
|
|
47
|
-
"Binance (BEP20)": Chains[];
|
|
48
|
-
};
|
|
49
|
-
export interface Coin {
|
|
50
|
-
allowSwap: boolean;
|
|
51
|
-
allowBridge: boolean;
|
|
52
|
-
allowLend: boolean;
|
|
53
|
-
allowBorrow: boolean;
|
|
54
|
-
name: string;
|
|
55
|
-
coin: string;
|
|
56
|
-
xtokenSymbol: string;
|
|
57
|
-
xtokenPrecision: number;
|
|
58
|
-
xtokenContract: string;
|
|
59
|
-
wallets: Wallet[];
|
|
60
|
-
image: string;
|
|
61
|
-
coingeckoId: string;
|
|
62
|
-
balance?: Asset;
|
|
63
|
-
}
|
|
64
|
-
export interface Wallet {
|
|
65
|
-
wallet: string;
|
|
66
|
-
symbol: string;
|
|
67
|
-
chain: Chains;
|
|
68
|
-
network: Networks;
|
|
69
|
-
precision: number;
|
|
70
|
-
contract: string | undefined;
|
|
71
|
-
provider: string;
|
|
72
|
-
hasWithdrawMemo: boolean;
|
|
73
|
-
}
|
|
74
|
-
export declare enum Providers {
|
|
75
|
-
FIREBLOCKS = "fireblocks",
|
|
76
|
-
METAL = "metal"
|
|
77
|
-
}
|
|
78
|
-
export declare type CoinWallet = Exclude<Coin, 'wallets'> & Wallet;
|
|
79
|
-
export declare const explorerLinkByChain: {
|
|
80
|
-
Bitcoin: (txid: string) => string;
|
|
81
|
-
"Bitcoin (Testnet)": (txid: string) => string;
|
|
82
|
-
Ethereum: (txid: string) => string;
|
|
83
|
-
"Ethereum (Ropsten)": (txid: string) => string;
|
|
84
|
-
Litecoin: (txid: string) => string;
|
|
85
|
-
"Litecoin (Testnet)": (txid: string) => string;
|
|
86
|
-
"Bitcoin Cash": (txid: string) => string;
|
|
87
|
-
"Bitcoin Cash (Testnet)": (txid: string) => string;
|
|
88
|
-
Stellar: (txid: string) => string;
|
|
89
|
-
"Stellar (Testnet)": (txid: string) => string;
|
|
90
|
-
Proton: (txid: string, traces?: boolean | undefined) => string;
|
|
91
|
-
"Proton (Testnet)": (txid: string, traces?: boolean | undefined) => string;
|
|
92
|
-
Polkadot: (txid: string) => string;
|
|
93
|
-
"Binance (BEP2)": (txid: string) => string;
|
|
94
|
-
"Binance (BEP20)": (txid: string) => string;
|
|
95
|
-
EOS: (txid: string) => string;
|
|
96
|
-
"EOS (Jungle Testnet)": (txid: string) => string;
|
|
97
|
-
"Hedera (Mainnet)": (txid: string) => string;
|
|
98
|
-
"Hedera (Testnet)": (txid: string) => string;
|
|
99
|
-
Dogecoin: (txid: string) => string;
|
|
100
|
-
Cardano: (txid: string) => string;
|
|
101
|
-
"Avalanche X-Chain": (txid: string) => string;
|
|
102
|
-
"Avalanche C-Chain": (txid: string) => string;
|
|
103
|
-
Polygon: (txid: string) => string;
|
|
104
|
-
Terra: (txid: string) => string;
|
|
105
|
-
Ripple: (txid: string) => string;
|
|
106
|
-
Solana: (txid: string) => string;
|
|
107
|
-
"Metal X-Chain (Testnet)": (txid: string) => string;
|
|
108
|
-
"Metal C-Chain (Testnet)": (txid: string) => string;
|
|
109
|
-
"Metal C-Chain": (txid: string) => string;
|
|
110
|
-
"XDC Network": (txid: string) => string;
|
|
111
|
-
};
|
|
112
|
-
export declare const protonExplorerTxUrl: (chain: string, txId: string, traces?: boolean | undefined) => string;
|
|
113
|
-
export declare const initializeCoins: (protonChain: string) => {
|
|
114
|
-
allCoins: Coin[];
|
|
115
|
-
swapCoins: Coin[];
|
|
116
|
-
bridgeCoins: Coin[];
|
|
117
|
-
lendCoins: Coin[];
|
|
118
|
-
borrowCoins: Coin[];
|
|
119
|
-
loanCoins: Coin[];
|
|
120
|
-
allEnabledCoins: Coin[];
|
|
121
|
-
};
|
package/dist/constants.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Coin, CoinWallet } from './coins';
|
|
2
|
-
export declare const WRAP_CONTRACT = "proton.wrap";
|
|
3
|
-
export declare const WRAP_AUTH_ACTION = "generateauth";
|
|
4
|
-
export declare const FEE_FACTOR = 10000;
|
|
5
|
-
export declare const initializeConstants: (chain: string) => {
|
|
6
|
-
SWAP_CONTRACT: string;
|
|
7
|
-
DEX_CONTRACT: string;
|
|
8
|
-
FEE_FACTOR: number;
|
|
9
|
-
GOOGLE_MAPS_KEY: string;
|
|
10
|
-
SWAP_URL: string;
|
|
11
|
-
WRAP_SERVER_URL: string;
|
|
12
|
-
WRAP_CONTRACT: string;
|
|
13
|
-
WRAP_ACTIONS: {
|
|
14
|
-
SAVE_ADDRESS: string;
|
|
15
|
-
DELETE_ADDRESS: string;
|
|
16
|
-
WRAP_START: string;
|
|
17
|
-
WRAP_FINISH: string;
|
|
18
|
-
WRAP_PROCESS: string;
|
|
19
|
-
WRAP_SET_CONF: string;
|
|
20
|
-
};
|
|
21
|
-
WRAP_TABLES: {
|
|
22
|
-
ADDRESSES: string;
|
|
23
|
-
WRAPS: string;
|
|
24
|
-
};
|
|
25
|
-
ADDRESSES_INDEXES: {
|
|
26
|
-
BY_ACCOUNT: number;
|
|
27
|
-
BY_ADDR_HASH: number;
|
|
28
|
-
};
|
|
29
|
-
WRAPS_INDEXES: {
|
|
30
|
-
BY_ACCOUNT: number;
|
|
31
|
-
BY_STATUS: number;
|
|
32
|
-
BY_WRAP_HASH: number;
|
|
33
|
-
};
|
|
34
|
-
WRAP_PROCESS_TIMER: number;
|
|
35
|
-
FARM_CONTRACT: string;
|
|
36
|
-
WEBHOOK_PERMISSION: string;
|
|
37
|
-
PUBLIC_PERMISSION: string;
|
|
38
|
-
LIGHT_PERMISSION: string;
|
|
39
|
-
WRAP_AUTH_ACTION: string;
|
|
40
|
-
METAL_ENDPOINT: string;
|
|
41
|
-
METAL_PROTON_ENDPOINT: string;
|
|
42
|
-
METAL_DEX_HTTP_ENDPOINT: string;
|
|
43
|
-
METAL_DEX_WS_ENDPOINT: string;
|
|
44
|
-
PROTON_ENDPOINTS: string[];
|
|
45
|
-
CHAIN_ID: string;
|
|
46
|
-
DEX_PROCESS_SIZE: number;
|
|
47
|
-
DEX_SLTPPROCESS_SIZE: number;
|
|
48
|
-
MAX_PRICE: string;
|
|
49
|
-
MAX_ITEMS_PER_PAGE_DESKTOP: number;
|
|
50
|
-
MIN_PRICE: number;
|
|
51
|
-
DEFAULT_DEX_SYMBOL: string;
|
|
52
|
-
CHAIN: string;
|
|
53
|
-
SWAP_COINS: Coin[];
|
|
54
|
-
BRIDGE_COINS: Coin[];
|
|
55
|
-
ALL_ENABLED_COINS: Coin[];
|
|
56
|
-
LEND_COINS: Coin[];
|
|
57
|
-
BORROW_COINS: Coin[];
|
|
58
|
-
LOAN_COINS: Coin[];
|
|
59
|
-
ALL_COINS: Coin[];
|
|
60
|
-
findBridgeCoinWalletByXtokenAndChain(xtokenSymbol: string, chain: string): CoinWallet | undefined;
|
|
61
|
-
findBridgeCoinWallet(coin: string, wallet: string): CoinWallet | undefined;
|
|
62
|
-
findBridgeCoinNetwork(coin: string, network: string): CoinWallet | undefined;
|
|
63
|
-
};
|
package/dist/graph.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare class INode<T> {
|
|
2
|
-
key: string;
|
|
3
|
-
data: T;
|
|
4
|
-
constructor(key: string, data?: T);
|
|
5
|
-
}
|
|
6
|
-
export declare class ILink<T> {
|
|
7
|
-
from: INode<T>;
|
|
8
|
-
to: INode<T>;
|
|
9
|
-
data: T;
|
|
10
|
-
constructor(from: INode<T>, to: INode<T>, data?: T);
|
|
11
|
-
}
|
|
12
|
-
export declare class Graph<T> {
|
|
13
|
-
nodes: INode<T>[];
|
|
14
|
-
links: ILink<T>[];
|
|
15
|
-
lastPathFound: INode<T>[];
|
|
16
|
-
isEquals: (a: INode<T>, b: INode<T>) => boolean;
|
|
17
|
-
addNode(k: string, v?: T): void;
|
|
18
|
-
addNodes(...nodes: (string | [string, T?])[]): void;
|
|
19
|
-
findNode(k: string): INode<T> | undefined;
|
|
20
|
-
findNodes(...keys: string[]): (INode<T> | undefined)[];
|
|
21
|
-
requireFindNodes(...keys: string[]): INode<T>[];
|
|
22
|
-
addLink(nodeA: string, nodeB: string, data?: T): void;
|
|
23
|
-
addLinks(...links: [nodeA: string, nodeB: string, data?: T][]): void;
|
|
24
|
-
/**
|
|
25
|
-
* Get all nodes linked
|
|
26
|
-
* to from `node`.
|
|
27
|
-
*/
|
|
28
|
-
findLinkedNodes(node: INode<T>): INode<T>[];
|
|
29
|
-
findAllPaths(from: string, to: string): INode<T>[][];
|
|
30
|
-
}
|
package/dist/math.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BigNumber as BN } from 'bignumber.js';
|
|
2
|
-
/**
|
|
3
|
-
* XPR<>XUSDT (XPR -> XUSDT)
|
|
4
|
-
*
|
|
5
|
-
* pool1 * pool2
|
|
6
|
-
* term = pool2 - --------------
|
|
7
|
-
* pool1 + swap
|
|
8
|
-
*
|
|
9
|
-
* result = term - (term * fee)
|
|
10
|
-
*/
|
|
11
|
-
export declare const compute_transfer: (pool1: BN.Instance, pool2: BN.Instance, swap: BN.Instance, exchange_fee: number, precision: number) => BN;
|
|
12
|
-
export declare const compute_transfer_curve: (reserve_in: number, reserve_out: number, amount_in: number, exchange_fee: number, precision: number, amplifier: number) => BN;
|
|
13
|
-
export declare const compute_liquidity: (amount_lt: BN.Instance, pool: BN.Instance, lt_supply: BN.Instance, precision: number) => number;
|
|
14
|
-
export declare const isInputInvalid: (data: string, value: string | number, pool: {
|
|
15
|
-
xtokenPrecision: number;
|
|
16
|
-
}) => boolean;
|
|
17
|
-
export declare const applyDiscountToFee: (fee: number, staked: number) => number;
|