@luxexchange/gating 1.0.1 → 1.0.3
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/.depcheckrc +13 -0
- package/.eslintrc.js +21 -0
- package/README.md +3 -0
- package/package.json +3 -2
- package/project.json +2 -2
- package/src/LocalOverrideAdapterWrapper.ts +1 -1
- package/src/configs.ts +13 -6
- package/src/experiments.ts +0 -7
- package/src/flags.ts +16 -28
- package/src/getIsHashcashSolverEnabled.ts +2 -2
- package/src/getIsPerformanceTrackingEnabled.ts +2 -2
- package/src/getIsSessionServiceEnabled.ts +3 -3
- package/src/getIsSessionUpgradeAutoEnabled.ts +3 -3
- package/src/getIsTurnstileSolverEnabled.ts +2 -2
- package/src/hooks.ts +4 -4
- package/src/index.ts +20 -18
- package/src/sdk/statsig.native.ts +2 -2
- package/src/sdk/statsig.ts +7 -4
- package/src/utils.ts +1 -1
- package/tsconfig.json +17 -4
- package/tsconfig.lint.json +8 -0
package/.depcheckrc
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@luxamm/eslint-config/lib'],
|
|
3
|
+
parserOptions: {
|
|
4
|
+
tsconfigRootDir: __dirname,
|
|
5
|
+
},
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: ['*.ts', '*.tsx'],
|
|
9
|
+
rules: {
|
|
10
|
+
'no-relative-import-paths/no-relative-import-paths': [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
allowSameFolder: false,
|
|
14
|
+
prefix: '@luxexchange/gating',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}
|
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxexchange/gating",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@statsig/client-core": "3.12.2",
|
|
6
6
|
"@statsig/js-client": "3.12.2",
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
"@statsig/react-bindings": "3.12.2",
|
|
9
9
|
"@statsig/react-native-bindings": "3.12.2",
|
|
10
10
|
"@luxexchange/api": "workspace:*",
|
|
11
|
+
"@luxexchange/config": "workspace:*",
|
|
11
12
|
"@luxfi/utilities": "workspace:*"
|
|
12
13
|
},
|
|
13
14
|
"devDependencies": {
|
|
14
15
|
"@types/node": "22.13.1",
|
|
15
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
16
|
+
"@typescript/native-preview": "7.0.0-dev.20260311.1",
|
|
16
17
|
"@luxfi/eslint-config": "workspace:^",
|
|
17
18
|
"depcheck": "1.4.7",
|
|
18
19
|
"eslint": "8.57.1",
|
package/project.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@
|
|
2
|
+
"name": "@luxexchange/gating",
|
|
3
3
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "
|
|
4
|
+
"sourceRoot": "pkgs/gating/src",
|
|
5
5
|
"projectType": "library",
|
|
6
6
|
"tags": ["scope:gating", "type:lib"],
|
|
7
7
|
"targets": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LocalOverrideAdapter } from '@statsig/js-local-overrides'
|
|
2
|
-
import { getStatsigClient } from '@
|
|
2
|
+
import { getStatsigClient } from '@luxexchange/gating/src/sdk/statsig'
|
|
3
3
|
|
|
4
4
|
// Workaround for @statsig 3.x.x refreshing client after applying overrides to get the result without reloading
|
|
5
5
|
// Should be removed after statsig add real time override apply functionality
|
package/src/configs.ts
CHANGED
|
@@ -85,12 +85,13 @@ export enum DynamicConfigs {
|
|
|
85
85
|
|
|
86
86
|
// Web
|
|
87
87
|
AstroChain = 'astro_chain',
|
|
88
|
-
|
|
88
|
+
EmbeddedWalletBetaPassphrases = 'embedded_wallet_beta_passphrases',
|
|
89
89
|
ExternallyConnectableExtension = 'externally_connectable_extension',
|
|
90
90
|
LPConfig = 'lp_config',
|
|
91
91
|
AllowedV4WethHookAddresses = 'allowed_v4_weth_hook_addresses',
|
|
92
92
|
OutageBannerChainId = 'outage_banner_chain_id',
|
|
93
93
|
VerifiedAuctions = 'verified_auctions',
|
|
94
|
+
CreateAuction = 'create_auction_config',
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
// Config values go here for easy access
|
|
@@ -187,10 +188,6 @@ export enum DatadogSessionSampleRateKey {
|
|
|
187
188
|
Rate = 'rate',
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
export enum BlockedNftCollectionsConfigKey {
|
|
191
|
-
BlocklistedCollections = 'blocklistedCollections',
|
|
192
|
-
}
|
|
193
|
-
|
|
194
191
|
export enum ExternallyConnectableExtensionConfigKey {
|
|
195
192
|
ExtensionId = 'extensionId',
|
|
196
193
|
}
|
|
@@ -243,6 +240,15 @@ export enum OutageBannerChainIdConfigKey {
|
|
|
243
240
|
ChainId = 'chainId',
|
|
244
241
|
}
|
|
245
242
|
|
|
243
|
+
export enum CreateAuctionConfigKey {
|
|
244
|
+
AllowedNetworks = 'allowedNetworks',
|
|
245
|
+
AllowedTokenCreationNetworks = 'allowedTokenCreationNetworks',
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export enum EmbeddedWalletBetaPassphrasesKey {
|
|
249
|
+
Passphrases = 'passphrases',
|
|
250
|
+
}
|
|
251
|
+
|
|
246
252
|
export type DynamicConfigKeys = {
|
|
247
253
|
// Shared
|
|
248
254
|
[DynamicConfigs.Swap]: SwapConfigKey
|
|
@@ -262,13 +268,14 @@ export type DynamicConfigKeys = {
|
|
|
262
268
|
|
|
263
269
|
// Web
|
|
264
270
|
[DynamicConfigs.AstroChain]: AstroChainConfigKey
|
|
265
|
-
[DynamicConfigs.BlockedNftCollections]: BlockedNftCollectionsConfigKey
|
|
266
271
|
[DynamicConfigs.ExternallyConnectableExtension]: ExternallyConnectableExtensionConfigKey
|
|
267
272
|
[DynamicConfigs.LPConfig]: LPConfigKey
|
|
268
273
|
[DynamicConfigs.AllowedV4WethHookAddresses]: AllowedV4WethHookAddressesConfigKey
|
|
269
274
|
[DynamicConfigs.VerifiedAuctions]: VerifiedAuctionsConfigKey
|
|
270
275
|
[DynamicConfigs.BlockedAsyncSubmissionChainIds]: BlockedAsyncSubmissionChainIdsConfigKey
|
|
271
276
|
[DynamicConfigs.OutageBannerChainId]: OutageBannerChainIdConfigKey
|
|
277
|
+
[DynamicConfigs.CreateAuction]: CreateAuctionConfigKey
|
|
278
|
+
[DynamicConfigs.EmbeddedWalletBetaPassphrases]: EmbeddedWalletBetaPassphrasesKey
|
|
272
279
|
}
|
|
273
280
|
|
|
274
281
|
// This type must match the format in statsig dynamic config for uwulink
|
package/src/experiments.ts
CHANGED
|
@@ -7,7 +7,6 @@ export enum Experiments {
|
|
|
7
7
|
EthAsErc20DEX = 'eth_as_erc20_luxx_experiment',
|
|
8
8
|
ExploreBackendSorting = 'explore_backend_sorting',
|
|
9
9
|
NativeTokenPercentageBuffer = 'lp_native_buffer',
|
|
10
|
-
PriceUxUpdate = 'price_ux_update',
|
|
11
10
|
PrivateRpc = 'private_rpc',
|
|
12
11
|
SwapConfirmation = 'swap-confirmation',
|
|
13
12
|
UnichainFlashblocksModal = 'unichain_flashblocks_modal',
|
|
@@ -51,16 +50,11 @@ export enum ExploreBackendSortingProperties {
|
|
|
51
50
|
// Swap Layer experiment properties
|
|
52
51
|
|
|
53
52
|
export enum SwapLayerProperties {
|
|
54
|
-
UpdatedPriceUX = 'updatedPriceUX',
|
|
55
53
|
FlashblocksModalEnabled = 'flashblocksModalEnabled',
|
|
56
54
|
EthAsErc20DEXEnabled = 'ethAsErc20DEXEnabled',
|
|
57
55
|
MinEthErc20USDValueThresholdByChain = 'minEthErc20USDValueThresholdByChain',
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
export enum PriceUxUpdateProperties {
|
|
61
|
-
UpdatedPriceUX = SwapLayerProperties.UpdatedPriceUX,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
58
|
export enum UnichainFlashblocksProperties {
|
|
65
59
|
FlashblocksModalEnabled = SwapLayerProperties.FlashblocksModalEnabled,
|
|
66
60
|
}
|
|
@@ -75,7 +69,6 @@ export type ExperimentProperties = {
|
|
|
75
69
|
[Experiments.EthAsErc20DEX]: EthAsErc20DEXProperties
|
|
76
70
|
[Experiments.ExploreBackendSorting]: ExploreBackendSortingProperties
|
|
77
71
|
[Experiments.NativeTokenPercentageBuffer]: NativeTokenPercentageBufferProperties
|
|
78
|
-
[Experiments.PriceUxUpdate]: PriceUxUpdateProperties
|
|
79
72
|
[Experiments.PrivateRpc]: PrivateRpcProperties
|
|
80
73
|
[Experiments.SwapConfirmation]: SwapConfirmationProperties
|
|
81
74
|
[Experiments.UnichainFlashblocksModal]: UnichainFlashblocksProperties
|
package/src/flags.ts
CHANGED
|
@@ -12,7 +12,6 @@ export enum FeatureFlags {
|
|
|
12
12
|
AllowDEXOnlyRoutesInSwapSettings,
|
|
13
13
|
ArbitrumDutchV3,
|
|
14
14
|
BlockaidFotLogging,
|
|
15
|
-
BridgedAssetsBannerV2,
|
|
16
15
|
CentralizedPrices,
|
|
17
16
|
ChainedActions,
|
|
18
17
|
DisableSwap7702,
|
|
@@ -23,10 +22,12 @@ export enum FeatureFlags {
|
|
|
23
22
|
ForcePermitTransactions,
|
|
24
23
|
ForSessionsEnabled,
|
|
25
24
|
ForUrlMigration,
|
|
25
|
+
GasServiceV2,
|
|
26
26
|
HashcashSolverEnabled,
|
|
27
27
|
Monad,
|
|
28
28
|
MultichainTokenUx,
|
|
29
|
-
|
|
29
|
+
NetworkFilterV2,
|
|
30
|
+
NoLxInterfaceFees,
|
|
30
31
|
PortionFields,
|
|
31
32
|
ProfitLoss,
|
|
32
33
|
SessionsPerformanceTrackingEnabled,
|
|
@@ -36,6 +37,7 @@ export enum FeatureFlags {
|
|
|
36
37
|
SmartWalletDisableVideo,
|
|
37
38
|
Solana,
|
|
38
39
|
Soneium,
|
|
40
|
+
Tempo,
|
|
39
41
|
TurnstileSolverEnabled,
|
|
40
42
|
TwoSecondSwapQuotePollingInterval,
|
|
41
43
|
UnichainFlashblocks,
|
|
@@ -50,14 +52,13 @@ export enum FeatureFlags {
|
|
|
50
52
|
XLayer,
|
|
51
53
|
|
|
52
54
|
// Wallet
|
|
53
|
-
BlurredLockScreen,
|
|
54
55
|
BottomTabs,
|
|
55
|
-
BridgedAssetsBanner,
|
|
56
56
|
DisableFiatOnRampKorea,
|
|
57
57
|
Eip5792Methods,
|
|
58
58
|
EnableExportPrivateKeys,
|
|
59
59
|
EnableRestoreSeedPhrase,
|
|
60
60
|
EnableTransactionSpacingForDelegatedAccounts,
|
|
61
|
+
ExpoImage,
|
|
61
62
|
|
|
62
63
|
NotificationApiDataSource,
|
|
63
64
|
NotificationOnboardingCard,
|
|
@@ -71,28 +72,21 @@ export enum FeatureFlags {
|
|
|
71
72
|
|
|
72
73
|
// Web
|
|
73
74
|
AATestWeb,
|
|
75
|
+
AuctionDetailsV2,
|
|
74
76
|
BatchedSwaps,
|
|
75
|
-
ConversionApiMigration,
|
|
76
|
-
ConversionTracking,
|
|
77
77
|
DummyFlagTest,
|
|
78
|
-
GoogleConversionTracking,
|
|
79
|
-
GqlTokenLists,
|
|
80
78
|
LimitsFees,
|
|
81
79
|
LiquidityBatchedTransactions,
|
|
80
|
+
LpDynamicNativeSlippage,
|
|
82
81
|
LpIncentives,
|
|
83
|
-
|
|
84
|
-
NoLuxInterfaceFeesNotification,
|
|
82
|
+
NoLxInterfaceFeesNotification,
|
|
85
83
|
PortfolioDefiTab,
|
|
86
|
-
PortfolioTokensAllocationChart,
|
|
87
84
|
PortoWalletConnector,
|
|
88
|
-
PriceRangeInputV2,
|
|
89
85
|
SolanaPromo,
|
|
90
86
|
TDPTokenCarousel,
|
|
91
|
-
Toucan,
|
|
92
87
|
ToucanAuctionKYC,
|
|
93
88
|
ToucanLaunchAuction,
|
|
94
89
|
TraceJsonRpc,
|
|
95
|
-
TwitterConversionTracking,
|
|
96
90
|
UnificationCopy,
|
|
97
91
|
UnirouteEnabled,
|
|
98
92
|
UniversalSwap,
|
|
@@ -105,7 +99,6 @@ export const SHARED_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
|
105
99
|
[FeatureFlags.AllowDEXOnlyRoutesInSwapSettings, 'allow_luxx_only_routes_in_swap_settings'],
|
|
106
100
|
[FeatureFlags.ArbitrumDutchV3, 'luxx_dutchv3_orders_arbitrum'],
|
|
107
101
|
[FeatureFlags.BlockaidFotLogging, 'blockaid_fot_logging'],
|
|
108
|
-
[FeatureFlags.BridgedAssetsBannerV2, 'bridged_assets_banner_v2'],
|
|
109
102
|
[FeatureFlags.CentralizedPrices, 'centralized_prices'],
|
|
110
103
|
[FeatureFlags.ChainedActions, 'enable_chained_actions'],
|
|
111
104
|
[FeatureFlags.DisableSwap7702, 'disable-swap-7702'],
|
|
@@ -116,10 +109,12 @@ export const SHARED_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
|
116
109
|
[FeatureFlags.ForcePermitTransactions, 'force_permit_transactions'],
|
|
117
110
|
[FeatureFlags.ForSessionsEnabled, 'for_sessions_enabled'],
|
|
118
111
|
[FeatureFlags.ForUrlMigration, 'for_url_migration'],
|
|
112
|
+
[FeatureFlags.GasServiceV2, 'gas_service_v2'],
|
|
119
113
|
[FeatureFlags.HashcashSolverEnabled, 'sessions_hashcash_solver_enabled'],
|
|
120
114
|
[FeatureFlags.Monad, 'monad'],
|
|
121
115
|
[FeatureFlags.MultichainTokenUx, 'multichain_token_ux'],
|
|
122
|
-
[FeatureFlags.
|
|
116
|
+
[FeatureFlags.NetworkFilterV2, 'network_filter_v2'],
|
|
117
|
+
[FeatureFlags.NoLxInterfaceFees, 'no_lx_interface_fees'],
|
|
123
118
|
[FeatureFlags.NotificationApiDataSource, 'notification_api_data_source'],
|
|
124
119
|
[FeatureFlags.PortionFields, 'portion-fields'],
|
|
125
120
|
[FeatureFlags.ProfitLoss, 'profit_loss'],
|
|
@@ -131,6 +126,7 @@ export const SHARED_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
|
131
126
|
[FeatureFlags.SmartWalletDisableVideo, 'smart_wallet_disable_video'],
|
|
132
127
|
[FeatureFlags.Solana, 'solana'],
|
|
133
128
|
[FeatureFlags.Soneium, 'soneium'],
|
|
129
|
+
[FeatureFlags.Tempo, 'tempo'],
|
|
134
130
|
[FeatureFlags.TurnstileSolverEnabled, 'sessions_turnstile_solver_enabled'],
|
|
135
131
|
[FeatureFlags.TwoSecondSwapQuotePollingInterval, 'two_second_swap_quote_polling_interval'],
|
|
136
132
|
[FeatureFlags.UnichainFlashblocks, 'unichain_flashblocks'],
|
|
@@ -151,28 +147,21 @@ export const SHARED_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
|
151
147
|
export const WEB_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
152
148
|
...SHARED_FEATURE_FLAG_NAMES,
|
|
153
149
|
[FeatureFlags.AATestWeb, 'aatest_web'],
|
|
150
|
+
[FeatureFlags.AuctionDetailsV2, 'auction_details_v2'],
|
|
154
151
|
[FeatureFlags.BatchedSwaps, 'batched_swaps'],
|
|
155
|
-
[FeatureFlags.ConversionApiMigration, 'conversion_api_migration'],
|
|
156
|
-
[FeatureFlags.ConversionTracking, 'conversion-tracking'],
|
|
157
152
|
[FeatureFlags.DummyFlagTest, 'dummy_flag_test'],
|
|
158
|
-
[FeatureFlags.GoogleConversionTracking, 'google_conversion_tracking'],
|
|
159
|
-
[FeatureFlags.GqlTokenLists, 'gql_token_lists'],
|
|
160
153
|
[FeatureFlags.LimitsFees, 'limits_fees'],
|
|
161
154
|
[FeatureFlags.LiquidityBatchedTransactions, 'liquidity_batched_transactions'],
|
|
155
|
+
[FeatureFlags.LpDynamicNativeSlippage, 'lp_dynamic_native_slippage'],
|
|
162
156
|
[FeatureFlags.LpIncentives, 'lp_incentives'],
|
|
163
|
-
[FeatureFlags.
|
|
164
|
-
[FeatureFlags.NoLuxInterfaceFeesNotification, 'no_lux_interface_fees_notification'],
|
|
157
|
+
[FeatureFlags.NoLxInterfaceFeesNotification, 'no_lx_interface_fees_notification'],
|
|
165
158
|
[FeatureFlags.PortfolioDefiTab, 'portfolio_defi_tab'],
|
|
166
|
-
[FeatureFlags.PortfolioTokensAllocationChart, 'portfolio_tokens_allocation_chart'],
|
|
167
159
|
[FeatureFlags.PortoWalletConnector, 'porto_wallet_connector'],
|
|
168
|
-
[FeatureFlags.PriceRangeInputV2, 'price_range_input_v2'],
|
|
169
160
|
[FeatureFlags.SolanaPromo, 'solana_promo'],
|
|
170
161
|
[FeatureFlags.TDPTokenCarousel, 'tdp_token_carousel'],
|
|
171
|
-
[FeatureFlags.Toucan, 'toucan'],
|
|
172
162
|
[FeatureFlags.ToucanAuctionKYC, 'toucan_auction_kyc'],
|
|
173
163
|
[FeatureFlags.ToucanLaunchAuction, 'toucan_launch_auction'],
|
|
174
164
|
[FeatureFlags.TraceJsonRpc, 'traceJsonRpc'],
|
|
175
|
-
[FeatureFlags.TwitterConversionTracking, 'twitter_conversion_tracking'],
|
|
176
165
|
[FeatureFlags.UnichainFlashblocks, 'unichain_flashblocks'],
|
|
177
166
|
[FeatureFlags.UnificationCopy, 'unification_copy'],
|
|
178
167
|
[FeatureFlags.UniversalSwap, 'universal_swap'],
|
|
@@ -182,14 +171,13 @@ export const WEB_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
|
182
171
|
// Add in alphabetical order to decrease probability of merge conflicts.
|
|
183
172
|
export const WALLET_FEATURE_FLAG_NAMES = new Map<FeatureFlags, string>([
|
|
184
173
|
...SHARED_FEATURE_FLAG_NAMES,
|
|
185
|
-
[FeatureFlags.BlurredLockScreen, 'blurred_lock_screen'],
|
|
186
174
|
[FeatureFlags.BottomTabs, 'bottom_tabs'],
|
|
187
|
-
[FeatureFlags.BridgedAssetsBanner, 'bridged_assets_banner'],
|
|
188
175
|
[FeatureFlags.DisableFiatOnRampKorea, 'disable-fiat-onramp-korea'],
|
|
189
176
|
[FeatureFlags.Eip5792Methods, 'eip_5792_methods'],
|
|
190
177
|
[FeatureFlags.EnableExportPrivateKeys, 'enable-export-private-keys'],
|
|
191
178
|
[FeatureFlags.EnableRestoreSeedPhrase, 'enable-restore-seed-phrase'],
|
|
192
179
|
[FeatureFlags.EnableTransactionSpacingForDelegatedAccounts, 'enable_transaction_spacing_for_delegated_accounts'],
|
|
180
|
+
[FeatureFlags.ExpoImage, 'expo_image'],
|
|
193
181
|
|
|
194
182
|
[FeatureFlags.NotificationOnboardingCard, 'notification_onboarding_card'],
|
|
195
183
|
[FeatureFlags.NotificationService, 'notification_system'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureFlags } from '@
|
|
2
|
-
import { getFeatureFlag, useFeatureFlag } from '@
|
|
1
|
+
import { FeatureFlags } from '@luxexchange/gating/src/flags'
|
|
2
|
+
import { getFeatureFlag, useFeatureFlag } from '@luxexchange/gating/src/hooks'
|
|
3
3
|
|
|
4
4
|
function getIsHashcashSolverEnabled(): boolean {
|
|
5
5
|
return getFeatureFlag(FeatureFlags.HashcashSolverEnabled)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureFlags } from '@
|
|
2
|
-
import { getFeatureFlag, useFeatureFlag } from '@
|
|
1
|
+
import { FeatureFlags } from '@luxexchange/gating/src/flags'
|
|
2
|
+
import { getFeatureFlag, useFeatureFlag } from '@luxexchange/gating/src/hooks'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Returns whether sessions performance tracking is enabled.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getConfig } from '@
|
|
2
|
-
import { FeatureFlags } from '@
|
|
3
|
-
import { getFeatureFlag, useFeatureFlag } from '@
|
|
1
|
+
import { getConfig } from '@luxexchange/config'
|
|
2
|
+
import { FeatureFlags } from '@luxexchange/gating/src/flags'
|
|
3
|
+
import { getFeatureFlag, useFeatureFlag } from '@luxexchange/gating/src/hooks'
|
|
4
4
|
|
|
5
5
|
function getIsSessionServiceEnabled(): boolean {
|
|
6
6
|
return getConfig().enableSessionService || getFeatureFlag(FeatureFlags.SessionsServiceEnabled)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getConfig } from '@
|
|
2
|
-
import { FeatureFlags } from '@
|
|
3
|
-
import { getFeatureFlag } from '@
|
|
1
|
+
import { getConfig } from '@luxexchange/config'
|
|
2
|
+
import { FeatureFlags } from '@luxexchange/gating/src/flags'
|
|
3
|
+
import { getFeatureFlag } from '@luxexchange/gating/src/hooks'
|
|
4
4
|
|
|
5
5
|
function getIsSessionUpgradeAutoEnabled(): boolean {
|
|
6
6
|
return getConfig().enableSessionUpgradeAuto || getFeatureFlag(FeatureFlags.SessionsUpgradeAutoEnabled)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureFlags } from '@
|
|
2
|
-
import { getFeatureFlag, useFeatureFlag } from '@
|
|
1
|
+
import { FeatureFlags } from '@luxexchange/gating/src/flags'
|
|
2
|
+
import { getFeatureFlag, useFeatureFlag } from '@luxexchange/gating/src/hooks'
|
|
3
3
|
|
|
4
4
|
function getIsTurnstileSolverEnabled(): boolean {
|
|
5
5
|
return getFeatureFlag(FeatureFlags.TurnstileSolverEnabled)
|
package/src/hooks.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StatsigClientEventCallback, StatsigLoadingStatus } from '@statsig/client-core'
|
|
2
|
-
import { DynamicConfigKeys } from '@
|
|
3
|
-
import { ExperimentProperties, Experiments } from '@
|
|
4
|
-
import { FeatureFlags, getFeatureFlagName } from '@
|
|
2
|
+
import { DynamicConfigKeys } from '@luxexchange/gating/src/configs'
|
|
3
|
+
import { ExperimentProperties, Experiments } from '@luxexchange/gating/src/experiments'
|
|
4
|
+
import { FeatureFlags, getFeatureFlagName } from '@luxexchange/gating/src/flags'
|
|
5
5
|
import {
|
|
6
6
|
getStatsigClient,
|
|
7
7
|
TypedReturn,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useGateValue,
|
|
12
12
|
useLayer,
|
|
13
13
|
useStatsigClient,
|
|
14
|
-
} from '@
|
|
14
|
+
} from '@luxexchange/gating/src/sdk/statsig'
|
|
15
15
|
import { useEffect, useMemo, useState } from 'react'
|
|
16
16
|
import { logger } from 'utilities/src/logger/logger'
|
|
17
17
|
|
package/src/index.ts
CHANGED
|
@@ -9,14 +9,16 @@ export type {
|
|
|
9
9
|
GasStrategyWithConditions,
|
|
10
10
|
UwULinkAllowlist,
|
|
11
11
|
UwULinkAllowlistItem,
|
|
12
|
-
} from '@
|
|
12
|
+
} from '@luxexchange/gating/src/configs'
|
|
13
13
|
export {
|
|
14
14
|
AllowedV4WethHookAddressesConfigKey,
|
|
15
15
|
BlockedAsyncSubmissionChainIdsConfigKey,
|
|
16
16
|
ChainsConfigKey,
|
|
17
|
+
CreateAuctionConfigKey,
|
|
17
18
|
DatadogIgnoredErrorsConfigKey,
|
|
18
19
|
DatadogSessionSampleRateKey,
|
|
19
20
|
DynamicConfigs,
|
|
21
|
+
EmbeddedWalletBetaPassphrasesKey,
|
|
20
22
|
EmbeddedWalletConfigKey,
|
|
21
23
|
ExtensionBiometricUnlockConfigKey,
|
|
22
24
|
ExternallyConnectableExtensionConfigKey,
|
|
@@ -30,9 +32,9 @@ export {
|
|
|
30
32
|
SyncTransactionSubmissionChainIdsConfigKey,
|
|
31
33
|
UwuLinkConfigKey,
|
|
32
34
|
VerifiedAuctionsConfigKey,
|
|
33
|
-
} from '@
|
|
34
|
-
export { StatsigCustomAppValue } from '@
|
|
35
|
-
export type { ExperimentProperties } from '@
|
|
35
|
+
} from '@luxexchange/gating/src/configs'
|
|
36
|
+
export { StatsigCustomAppValue } from '@luxexchange/gating/src/constants'
|
|
37
|
+
export type { ExperimentProperties } from '@luxexchange/gating/src/experiments'
|
|
36
38
|
export {
|
|
37
39
|
EthAsErc20DEXProperties,
|
|
38
40
|
Experiments,
|
|
@@ -40,29 +42,28 @@ export {
|
|
|
40
42
|
LayerProperties,
|
|
41
43
|
Layers,
|
|
42
44
|
NativeTokenPercentageBufferProperties,
|
|
43
|
-
PriceUxUpdateProperties,
|
|
44
45
|
PrivateRpcProperties,
|
|
45
46
|
UnichainFlashblocksProperties,
|
|
46
|
-
} from '@
|
|
47
|
+
} from '@luxexchange/gating/src/experiments'
|
|
47
48
|
export {
|
|
48
49
|
FeatureFlagClient,
|
|
49
50
|
FeatureFlags,
|
|
50
51
|
getFeatureFlagName,
|
|
51
52
|
WALLET_FEATURE_FLAG_NAMES,
|
|
52
53
|
WEB_FEATURE_FLAG_NAMES,
|
|
53
|
-
} from '@
|
|
54
|
-
export { getIsHashcashSolverEnabled, useIsHashcashSolverEnabled } from '@
|
|
54
|
+
} from '@luxexchange/gating/src/flags'
|
|
55
|
+
export { getIsHashcashSolverEnabled, useIsHashcashSolverEnabled } from '@luxexchange/gating/src/getIsHashcashSolverEnabled'
|
|
55
56
|
export {
|
|
56
57
|
getIsSessionsPerformanceTrackingEnabled,
|
|
57
58
|
useIsSessionsPerformanceTrackingEnabled,
|
|
58
|
-
} from '@
|
|
59
|
-
export { getIsSessionServiceEnabled, useIsSessionServiceEnabled } from '@
|
|
60
|
-
export { getIsSessionUpgradeAutoEnabled } from '@
|
|
59
|
+
} from '@luxexchange/gating/src/getIsPerformanceTrackingEnabled'
|
|
60
|
+
export { getIsSessionServiceEnabled, useIsSessionServiceEnabled } from '@luxexchange/gating/src/getIsSessionServiceEnabled'
|
|
61
|
+
export { getIsSessionUpgradeAutoEnabled } from '@luxexchange/gating/src/getIsSessionUpgradeAutoEnabled'
|
|
61
62
|
export {
|
|
62
63
|
getIsTurnstileSolverEnabled,
|
|
63
64
|
useIsTurnstileSolverEnabled,
|
|
64
|
-
} from '@
|
|
65
|
-
export { getStatsigEnvName } from '@
|
|
65
|
+
} from '@luxexchange/gating/src/getIsTurnstileSolverEnabled'
|
|
66
|
+
export { getStatsigEnvName } from '@luxexchange/gating/src/getStatsigEnvName'
|
|
66
67
|
export {
|
|
67
68
|
getDynamicConfigValue,
|
|
68
69
|
getExperimentValue,
|
|
@@ -76,13 +77,13 @@ export {
|
|
|
76
77
|
useFeatureFlagWithExposureLoggingDisabled,
|
|
77
78
|
useFeatureFlagWithLoading,
|
|
78
79
|
useStatsigClientStatus,
|
|
79
|
-
} from '@
|
|
80
|
-
export { LocalOverrideAdapterWrapper } from '@
|
|
80
|
+
} from '@luxexchange/gating/src/hooks'
|
|
81
|
+
export { LocalOverrideAdapterWrapper } from '@luxexchange/gating/src/LocalOverrideAdapterWrapper'
|
|
81
82
|
export type {
|
|
82
83
|
StatsigOptions,
|
|
83
84
|
StatsigUser,
|
|
84
85
|
StorageProvider,
|
|
85
|
-
} from '@
|
|
86
|
+
} from '@luxexchange/gating/src/sdk/statsig'
|
|
86
87
|
export {
|
|
87
88
|
getOverrideAdapter,
|
|
88
89
|
getStatsigClient,
|
|
@@ -92,6 +93,7 @@ export {
|
|
|
92
93
|
Storage,
|
|
93
94
|
useClientAsyncInit,
|
|
94
95
|
useExperiment,
|
|
96
|
+
useGateValue,
|
|
95
97
|
useLayer,
|
|
96
|
-
} from '@
|
|
97
|
-
export { getOverrides } from '@
|
|
98
|
+
} from '@luxexchange/gating/src/sdk/statsig'
|
|
99
|
+
export { getOverrides } from '@luxexchange/gating/src/utils'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type StatsigClient } from '@statsig/react-bindings'
|
|
2
2
|
import { StatsigClientRN } from '@statsig/react-native-bindings'
|
|
3
|
-
import { getConfig } from '@
|
|
4
|
-
import { LocalOverrideAdapterWrapper } from '@
|
|
3
|
+
import { getConfig } from '@luxexchange/config'
|
|
4
|
+
import { LocalOverrideAdapterWrapper } from '@luxexchange/gating/src/LocalOverrideAdapterWrapper'
|
|
5
5
|
|
|
6
6
|
const config = getConfig()
|
|
7
7
|
|
package/src/sdk/statsig.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StatsigClient } from '@statsig/react-bindings'
|
|
2
|
-
import { getConfig } from '@
|
|
3
|
-
import { LocalOverrideAdapterWrapper } from '@
|
|
2
|
+
import { getConfig } from '@luxexchange/config'
|
|
3
|
+
import { LocalOverrideAdapterWrapper } from '@luxexchange/gating/src/LocalOverrideAdapterWrapper'
|
|
4
4
|
import { isTestEnv } from 'utilities/src/environment/env'
|
|
5
5
|
|
|
6
6
|
export {
|
|
@@ -28,8 +28,11 @@ function getStatsigApiKeyOrThrow(): string {
|
|
|
28
28
|
// A dummy key is used in test env b/c the wallet/mobile tests use this file instead of the statsig.native file
|
|
29
29
|
const statsigApiKey = isTestEnv() ? 'dummy-test-key' : getConfig().statsigApiKey
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (!statsigApiKey) {
|
|
32
|
+
throw new Error('STATSIG_API_KEY is not set')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return statsigApiKey
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
export function getOverrideAdapter(): LocalOverrideAdapterWrapper {
|
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrecomputedEvaluationsInterface } from '@statsig/js-client'
|
|
2
|
-
import { getOverrideAdapter } from '@
|
|
2
|
+
import { getOverrideAdapter } from '@luxexchange/gating/src/sdk/statsig'
|
|
3
3
|
|
|
4
4
|
export function isStatsigReady(client: PrecomputedEvaluationsInterface): boolean {
|
|
5
5
|
return client.loadingStatus === 'Ready'
|
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../config/tsconfig/app.json",
|
|
3
|
-
"include": [
|
|
4
|
-
|
|
3
|
+
"include": [
|
|
4
|
+
"src/**/*.ts",
|
|
5
|
+
"src/**/*.tsx",
|
|
6
|
+
"src/**/*.json",
|
|
7
|
+
"src/global.d.ts"
|
|
8
|
+
],
|
|
9
|
+
"exclude": [
|
|
10
|
+
"src/**/*.spec.ts",
|
|
11
|
+
"src/**/*.spec.tsx",
|
|
12
|
+
"src/**/*.test.ts",
|
|
13
|
+
"src/**/*.test.tsx"
|
|
14
|
+
],
|
|
5
15
|
"compilerOptions": {
|
|
6
16
|
"emitDeclarationOnly": true,
|
|
7
17
|
"noEmit": false,
|
|
@@ -10,13 +20,16 @@
|
|
|
10
20
|
},
|
|
11
21
|
"references": [
|
|
12
22
|
{
|
|
13
|
-
"path": "../
|
|
23
|
+
"path": "../utilities"
|
|
14
24
|
},
|
|
15
25
|
{
|
|
16
|
-
"path": "../
|
|
26
|
+
"path": "../config"
|
|
17
27
|
},
|
|
18
28
|
{
|
|
19
29
|
"path": "../api"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"path": "../eslint-config"
|
|
20
33
|
}
|
|
21
34
|
]
|
|
22
35
|
}
|