@proton/wrap-constants 0.2.101 → 0.2.103
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/coins.d.ts +121 -0
- package/dist/constants.d.ts +63 -0
- package/dist/graph.d.ts +30 -0
- package/dist/index.d.ts +2119 -3
- package/dist/index.js +104 -9
- package/dist/index.mjs +94 -8
- package/dist/math.d.ts +17 -0
- package/dist/parsers/actions.d.ts +1323 -0
- package/dist/parsers/address.d.ts +932 -0
- package/dist/parsers/auth.d.ts +1816 -0
- package/dist/parsers/base.d.ts +35 -0
- package/dist/parsers/currency.d.ts +236 -0
- package/dist/parsers/deposit.d.ts +66 -0
- package/dist/parsers/dex.d.ts +1516 -0
- package/dist/parsers/index.d.ts +13 -0
- package/dist/parsers/login.d.ts +892 -0
- package/dist/parsers/otc.d.ts +46 -0
- package/dist/parsers/pool.d.ts +52 -0
- package/dist/parsers/withdraw.d.ts +1053 -0
- package/dist/parsers/withdrawalHistory.d.ts +98 -0
- package/dist/parsers/wrap.d.ts +109 -0
- package/dist/utils.d.ts +8 -0
- package/dist/wrap-constants.cjs.development.js +2144 -0
- package/dist/wrap-constants.cjs.development.js.map +1 -0
- package/dist/wrap-constants.cjs.production.min.js +2 -0
- package/dist/wrap-constants.cjs.production.min.js.map +1 -0
- package/dist/wrap-constants.esm.js +2069 -0
- package/dist/wrap-constants.esm.js.map +1 -0
- package/package.json +2 -2
- package/src/parsers/base.ts +18 -12
- package/src/parsers/deposit.ts +31 -25
- package/src/parsers/dex.ts +101 -6
package/dist/coins.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|