four-flap-meme-sdk 4.0.11 → 4.0.12
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Contract, formatEther } from 'ethers';
|
|
8
8
|
import { ADDRESSES, ZERO_ADDRESS } from '../../core/constants/index.js';
|
|
9
9
|
import { Helper3 } from '../four/contracts/helper3.js';
|
|
10
|
-
import { FlapPortal } from '../flap/portal.js';
|
|
10
|
+
import { FlapPortal, TokenStatus, } from '../flap/portal.js';
|
|
11
11
|
import { getTaxTokenInfo, isTaxToken } from '../four/tax-token.js';
|
|
12
12
|
import { DEFAULT_V3_FEE_TIERS } from './lp-inspect-helpers.js';
|
|
13
13
|
import { getChainConfig } from './registry.js';
|
|
@@ -16,10 +16,19 @@ import { determinePlatform, formatBalance, getProvider, getTokenDecimals, normal
|
|
|
16
16
|
// 常量(从公共模块导入)
|
|
17
17
|
// ============================================================================
|
|
18
18
|
const MULTICALL3_ADDRESS = ADDRESSES.BSC.Multicall3;
|
|
19
|
-
/**
|
|
19
|
+
/** 内盘可交易:1=Tradable,2=InDuel。0=无效(非 Flap 币常见)、3=已杀死、4=已毕业外盘,都不能当内盘提前返回。 */
|
|
20
|
+
function isFlapInnerMarket(status) {
|
|
21
|
+
const n = Number(status);
|
|
22
|
+
return n === TokenStatus.Tradable || n === TokenStatus.InDuel;
|
|
23
|
+
}
|
|
24
|
+
/** BSC V8 买卖税。只有真实 Flap 状态才读买卖税,避免非 Flap 币 slot 残留 100 bps。 */
|
|
20
25
|
function flapV8TaxBps(st) {
|
|
21
|
-
|
|
26
|
+
const status = Number(st.status);
|
|
27
|
+
if (status !== TokenStatus.Tradable &&
|
|
28
|
+
status !== TokenStatus.InDuel &&
|
|
29
|
+
status !== TokenStatus.DEX) {
|
|
22
30
|
return 0;
|
|
31
|
+
}
|
|
23
32
|
return Math.max(Number(st.buyTaxRate ?? 0n), Number(st.sellTaxRate ?? 0n));
|
|
24
33
|
}
|
|
25
34
|
// ============================================================================
|
|
@@ -95,7 +104,7 @@ export async function inspectTokenLP(token, opts) {
|
|
|
95
104
|
st = await flap.getTokenV5(token);
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
|
-
if (st &&
|
|
107
|
+
if (st && isFlapInnerMarket(st.status)) {
|
|
99
108
|
result.platform = 'FLAP';
|
|
100
109
|
let quoteDecimals = 18;
|
|
101
110
|
let quoteSymbol = chainConfig.wrappedNativeSymbol;
|