@luxexchange/api 1.0.1 → 1.0.2
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/package.json +1 -1
- package/project.json +1 -1
- package/src/clients/base/SharedQueryClient.ts +2 -2
- package/src/clients/base/errors.test.ts +1 -1
- package/src/clients/base/urls.test.ts +1 -1
- package/src/clients/base/urls.ts +2 -2
- package/src/clients/base/utils.test.ts +2 -2
- package/src/clients/blockaid/createBlockaidApiClient.ts +1 -1
- package/src/clients/compliance/createComplianceApiClient.ts +2 -2
- package/src/clients/data/createDataServiceApiClient.ts +1 -1
- package/src/clients/dataApi/getGetPortfolioQueryOptions.test.ts +3 -3
- package/src/clients/dataApi/getGetPortfolioQueryOptions.ts +4 -4
- package/src/clients/for/createForApiClient.ts +4 -4
- package/src/clients/for/utils.ts +1 -1
- package/src/clients/lux/createLuxApiClient.ts +3 -3
- package/src/clients/trading/createTradingApiClient.ts +6 -6
- package/src/clients/trading/types.ts +1 -1
- package/src/clients/unitags/createUnitagsApiClient.ts +5 -5
- package/src/components/ApiInit.test.tsx +1 -1
- package/src/components/ApiInit.tsx +5 -5
- package/src/connectRpc/utils.ts +1 -1
- package/src/getEntryGatewayUrl.ts +1 -1
- package/src/getWebSocketUrl.ts +3 -3
- package/src/hooks/shared/useQueryWithImmediateGarbageCollection.ts +1 -1
- package/src/hooks/useIsSessionInitialized.ts +1 -1
- package/src/index.ts +56 -56
- package/src/provideSessionService.native.ts +2 -2
- package/src/provideSessionService.ts +3 -3
- package/src/provideSessionService.web.ts +8 -8
- package/src/session/createSessionTransport.test.ts +1 -1
- package/src/session/createWithSessionRetry.ts +1 -1
- package/src/session/index.ts +1 -1
- package/src/storage/createExtensionStorageDriver.ts +1 -1
- package/src/storage/getStorageDriver.ts +1 -1
- package/src/storage/getStorageDriver.web.ts +1 -1
- package/src/transport.ts +1 -1
package/package.json
CHANGED
package/project.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query'
|
|
2
2
|
import { FetchError } from '@luxfi/api/src/clients/base/errors'
|
|
3
|
-
import { hashKey } from 'utilities/src/reactQuery/hashKey'
|
|
4
|
-
import { ONE_DAY_MS, ONE_SECOND_MS } from 'utilities/src/time/time'
|
|
3
|
+
import { hashKey } from '@luxfi/utilities/src/reactQuery/hashKey'
|
|
4
|
+
import { ONE_DAY_MS, ONE_SECOND_MS } from '@luxfi/utilities/src/time/time'
|
|
5
5
|
|
|
6
6
|
export const SharedQueryClient = new QueryClient({
|
|
7
7
|
defaultOptions: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Code, ConnectError } from '@connectrpc/connect'
|
|
2
|
-
import { FetchError, is401Error } from '@
|
|
2
|
+
import { FetchError, is401Error } from '@luxexchange/api/src/clients/base/errors'
|
|
3
3
|
import { describe, expect, it } from 'vitest'
|
|
4
4
|
|
|
5
5
|
describe('is401Error', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
2
2
|
|
|
3
|
-
import { TrafficFlows } from '@
|
|
3
|
+
import { TrafficFlows } from '@luxexchange/api/src/clients/base/urls'
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
5
5
|
|
|
6
6
|
// Mock the platform and environment utilities
|
package/src/clients/base/urls.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isBetaEnv, isDevEnv, isPlaywrightEnv, isTestEnv } from 'utilities/src/environment/env'
|
|
2
|
-
import { isAndroid, isExtensionApp, isMobileApp, isWebApp } from 'utilities/src/platform'
|
|
1
|
+
import { isBetaEnv, isDevEnv, isPlaywrightEnv, isTestEnv } from '@luxfi/utilities/src/environment/env'
|
|
2
|
+
import { isAndroid, isExtensionApp, isMobileApp, isWebApp } from '@luxfi/utilities/src/platform'
|
|
3
3
|
|
|
4
4
|
export enum TrafficFlows {
|
|
5
5
|
GraphQL = 'graphql',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FetchClient } from '@
|
|
2
|
-
import { createFetcher } from '@
|
|
1
|
+
import type { FetchClient } from '@luxexchange/api/src/clients/base/types'
|
|
2
|
+
import { createFetcher } from '@luxexchange/api/src/clients/base/utils'
|
|
3
3
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
4
4
|
|
|
5
5
|
describe('createFetcher', () => {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
getBlockaidScanSiteResponseSchema,
|
|
10
10
|
getBlockaidScanTransactionResponseSchema,
|
|
11
11
|
} from '@luxfi/api/src/clients/blockaid/types'
|
|
12
|
-
import { logger } from 'utilities/src/logger/logger'
|
|
12
|
+
import { logger } from '@luxfi/utilities/src/logger/logger'
|
|
13
13
|
|
|
14
14
|
export interface BlockaidApiClient {
|
|
15
15
|
scanSite: (url: string) => Promise<DappVerificationStatus>
|
|
@@ -3,14 +3,14 @@ import type {
|
|
|
3
3
|
ComplianceApiClientContext,
|
|
4
4
|
ScreenRequest,
|
|
5
5
|
ScreenResponse,
|
|
6
|
-
} from '@
|
|
6
|
+
} from '@luxexchange/api/src/clients/compliance/types'
|
|
7
7
|
|
|
8
8
|
export type {
|
|
9
9
|
ComplianceApiClient,
|
|
10
10
|
ComplianceApiClientContext,
|
|
11
11
|
ScreenRequest,
|
|
12
12
|
ScreenResponse,
|
|
13
|
-
} from '@
|
|
13
|
+
} from '@luxexchange/api/src/clients/compliance/types'
|
|
14
14
|
|
|
15
15
|
const COMPLIANCE_API_PATHS = {
|
|
16
16
|
screenAddress: '/uniswap.compliancev2service.v1.compliancev2Service/ScreenAddress',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GetPortfolioResponse } from '@uniswap/client-data-api/dist/data/v1/api_pb'
|
|
2
|
-
import type { DataApiServiceClient } from '@
|
|
3
|
-
import { getGetPortfolioQueryOptions } from '@
|
|
4
|
-
import { ReactQueryCacheKey } from 'utilities/src/reactQuery/cache'
|
|
2
|
+
import type { DataApiServiceClient } from '@luxexchange/api/src/clients/dataApi/createDataApiServiceClient'
|
|
3
|
+
import { getGetPortfolioQueryOptions } from '@luxexchange/api/src/clients/dataApi/getGetPortfolioQueryOptions'
|
|
4
|
+
import { ReactQueryCacheKey } from '@luxfi/utilities/src/reactQuery/cache'
|
|
5
5
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
6
6
|
|
|
7
7
|
describe('getGetPortfolioQueryOptions', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type PartialMessage } from '@bufbuild/protobuf'
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query'
|
|
3
3
|
import type { GetPortfolioRequest, GetPortfolioResponse } from '@uniswap/client-data-api/dist/data/v1/api_pb'
|
|
4
|
-
import { type DataApiServiceClient } from '@
|
|
5
|
-
import { transformInput, type WithoutWalletAccount } from '@
|
|
6
|
-
import { ReactQueryCacheKey } from 'utilities/src/reactQuery/cache'
|
|
7
|
-
import { type QueryOptionsResult } from 'utilities/src/reactQuery/queryOptions'
|
|
4
|
+
import { type DataApiServiceClient } from '@luxexchange/api/src/clients/dataApi/createDataApiServiceClient'
|
|
5
|
+
import { transformInput, type WithoutWalletAccount } from '@luxexchange/api/src/connectRpc/utils'
|
|
6
|
+
import { ReactQueryCacheKey } from '@luxfi/utilities/src/reactQuery/cache'
|
|
7
|
+
import { type QueryOptionsResult } from '@luxfi/utilities/src/reactQuery/queryOptions'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Sorts `chainIds` in a query cache inputs object so that the same logical input
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
WidgetUrlRequest,
|
|
19
19
|
WidgetUrlResponse,
|
|
20
20
|
} from '@uniswap/client-for/dist/for/v1/api_pb'
|
|
21
|
-
import { FetchClient } from '@
|
|
22
|
-
import { createFetcher } from '@
|
|
23
|
-
import { FORQuoteResponse } from '@
|
|
24
|
-
import { transformPaymentMethods } from '@
|
|
21
|
+
import { FetchClient } from '@luxexchange/api/src/clients/base/types'
|
|
22
|
+
import { createFetcher } from '@luxexchange/api/src/clients/base/utils'
|
|
23
|
+
import { FORQuoteResponse } from '@luxexchange/api/src/clients/for/types'
|
|
24
|
+
import { transformPaymentMethods } from '@luxexchange/api/src/clients/for/utils'
|
|
25
25
|
|
|
26
26
|
type ForApiClientContext = {
|
|
27
27
|
fetchClient: FetchClient
|
package/src/clients/for/utils.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TransactionRequest } from '@ethersproject/providers'
|
|
2
|
-
import type { FetchClient } from '@
|
|
2
|
+
import type { FetchClient } from '@luxexchange/api/src/clients/base/types'
|
|
3
3
|
import {
|
|
4
4
|
type GasFeeResponse,
|
|
5
5
|
type GasFeeResultWithoutState,
|
|
6
6
|
type GasStrategy,
|
|
7
|
-
} from '@
|
|
8
|
-
import { isWebApp } from 'utilities/src/platform'
|
|
7
|
+
} from '@luxexchange/api/src/clients/trading/types'
|
|
8
|
+
import { isWebApp } from '@luxfi/utilities/src/platform'
|
|
9
9
|
|
|
10
10
|
// TODO(app-infra), de-duplicate with luxUrls when other consumers are migrated to use this client
|
|
11
11
|
const LUX_API_PATHS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FetchClient } from '@
|
|
2
|
-
import { createFetcher } from '@
|
|
1
|
+
import type { FetchClient } from '@luxexchange/api/src/clients/base/types'
|
|
2
|
+
import { createFetcher } from '@luxexchange/api/src/clients/base/utils'
|
|
3
3
|
import type {
|
|
4
4
|
ApprovalRequest,
|
|
5
5
|
ApprovalResponse,
|
|
@@ -22,15 +22,15 @@ import type {
|
|
|
22
22
|
WalletCheckDelegationRequestBody,
|
|
23
23
|
WalletCheckDelegationResponseBody,
|
|
24
24
|
WalletEncode7702RequestBody,
|
|
25
|
-
} from '@
|
|
26
|
-
import { CreatePlanRequest, PlanResponse, RoutingPreference } from '@
|
|
25
|
+
} from '@luxexchange/api/src/clients/trading/__generated__'
|
|
26
|
+
import { CreatePlanRequest, PlanResponse, RoutingPreference } from '@luxexchange/api/src/clients/trading/__generated__'
|
|
27
27
|
import type {
|
|
28
28
|
DiscriminatedQuoteResponse,
|
|
29
29
|
ExistingPlanRequest,
|
|
30
30
|
SwappableTokensParams,
|
|
31
31
|
UpdatePlanRequestWithPlanId,
|
|
32
|
-
} from '@
|
|
33
|
-
import { logger } from 'utilities/src/logger/logger'
|
|
32
|
+
} from '@luxexchange/api/src/clients/trading/tradeTypes'
|
|
33
|
+
import { logger } from '@luxfi/utilities/src/logger/logger'
|
|
34
34
|
|
|
35
35
|
// TODO(app-infra), de-duplicate with luxUrls.tradingApiPaths when other consumers are migrated to use TradingApiClient
|
|
36
36
|
export const TRADING_API_PATHS = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// They are internal to lux, so they are not declared in the Trading API public definition.
|
|
3
3
|
// Once the experiment is complete, we can remove them easily or add them to the public API definition.
|
|
4
4
|
|
|
5
|
-
import type { FetchError } from '@
|
|
5
|
+
import type { FetchError } from '@luxexchange/api/src/clients/base/errors'
|
|
6
6
|
|
|
7
7
|
export enum FeeType {
|
|
8
8
|
LEGACY = 'legacy',
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
createSignedRequestBody,
|
|
3
3
|
createSignedRequestParams,
|
|
4
4
|
type SignedRequestParams,
|
|
5
|
-
} from '@
|
|
6
|
-
import { type FetchClient } from '@
|
|
7
|
-
import { createFetcher } from '@
|
|
5
|
+
} from '@luxexchange/api/src/clients/base/auth'
|
|
6
|
+
import { type FetchClient } from '@luxexchange/api/src/clients/base/types'
|
|
7
|
+
import { createFetcher } from '@luxexchange/api/src/clients/base/utils'
|
|
8
8
|
import {
|
|
9
9
|
type ProfileMetadata,
|
|
10
10
|
type UnitagAddressesRequest,
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
type UnitagUpdateMetadataResponse,
|
|
23
23
|
type UnitagUsernameRequest,
|
|
24
24
|
type UnitagUsernameResponse,
|
|
25
|
-
} from '@
|
|
26
|
-
import { sanitizeAvatarUrl } from 'utilities/src/format/urls'
|
|
25
|
+
} from '@luxexchange/api/src/clients/unitags/types'
|
|
26
|
+
import { sanitizeAvatarUrl } from '@luxfi/utilities/src/format/urls'
|
|
27
27
|
|
|
28
28
|
const UNI_SIG_HEADER_KEY = 'x-uni-sig'
|
|
29
29
|
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
type LuxIdentifierService,
|
|
19
19
|
} from '@luxfi/sessions'
|
|
20
20
|
import React from 'react'
|
|
21
|
-
import { sleep } from 'utilities/src/time/timing'
|
|
21
|
+
import { sleep } from '@luxfi/utilities/src/time/timing'
|
|
22
22
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
23
23
|
|
|
24
24
|
// Mock platform detection - we're testing as extension by default
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
2
|
-
import { SharedQueryClient } from '@
|
|
3
|
-
import type { SessionInitializationService, SessionInitResult } from '@
|
|
4
|
-
import { SessionError } from '@
|
|
2
|
+
import { SharedQueryClient } from '@luxexchange/api/src/clients/base/SharedQueryClient'
|
|
3
|
+
import type { SessionInitializationService, SessionInitResult } from '@luxexchange/sessions'
|
|
4
|
+
import { SessionError } from '@luxexchange/sessions'
|
|
5
5
|
import { useState } from 'react'
|
|
6
|
-
import type { Logger } from 'utilities/src/logger/logger'
|
|
7
|
-
import { ReactQueryCacheKey } from 'utilities/src/reactQuery/cache'
|
|
6
|
+
import type { Logger } from '@luxfi/utilities/src/logger/logger'
|
|
7
|
+
import { ReactQueryCacheKey } from '@luxfi/utilities/src/reactQuery/cache'
|
|
8
8
|
|
|
9
9
|
interface ApiInitProps {
|
|
10
10
|
getSessionInitService: () => SessionInitializationService
|
package/src/connectRpc/utils.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ProtectionResult,
|
|
9
9
|
SafetyLevel,
|
|
10
10
|
} from '@luxfi/api/src/clients/graphql/__generated__/schema-types'
|
|
11
|
-
import { logger } from 'utilities/src/logger/logger'
|
|
11
|
+
import { logger } from '@luxfi/utilities/src/logger/logger'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Helper functions to parse string enum fields from REST API responses.
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
STAGING_ENTRY_GATEWAY_API_BASE_URL,
|
|
4
4
|
} from '@luxfi/api/src/clients/base/urls'
|
|
5
5
|
import { getConfig } from '@luxfi/config'
|
|
6
|
-
import { Environment, getCurrentEnv } from 'utilities/src/environment/getCurrentEnv'
|
|
6
|
+
import { Environment, getCurrentEnv } from '@luxfi/utilities/src/environment/getCurrentEnv'
|
|
7
7
|
/**
|
|
8
8
|
* Returns the appropriate Entry Gateway API base URL based on the current environment.
|
|
9
9
|
* When proxy is enabled, returns the proxy path. Otherwise returns the direct URL.
|
package/src/getWebSocketUrl.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PROD_WEBSOCKET_BASE_URL, STAGING_WEBSOCKET_BASE_URL } from '@
|
|
2
|
-
import { getConfig } from '@
|
|
3
|
-
import { Environment, getCurrentEnv } from 'utilities/src/environment/getCurrentEnv'
|
|
1
|
+
import { PROD_WEBSOCKET_BASE_URL, STAGING_WEBSOCKET_BASE_URL } from '@luxexchange/api/src/clients/base/urls'
|
|
2
|
+
import { getConfig } from '@luxexchange/config'
|
|
3
|
+
import { Environment, getCurrentEnv } from '@luxfi/utilities/src/environment/getCurrentEnv'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns the appropriate WebSocket URL based on the current environment.
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
useQueryClient,
|
|
10
10
|
} from '@tanstack/react-query'
|
|
11
11
|
import { useEffect } from 'react'
|
|
12
|
-
import { logger } from 'utilities/src/logger/logger'
|
|
12
|
+
import { logger } from '@luxfi/utilities/src/logger/logger'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* This is a wrapper around react-query's `useQuery` that immediately clears the cache if the data is older than `gcTime`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useQueryClient } from '@tanstack/react-query'
|
|
2
|
-
import { SESSION_INIT_QUERY_KEY } from '@
|
|
2
|
+
import { SESSION_INIT_QUERY_KEY } from '@luxexchange/api/src/components/ApiInit'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Hook to check if session initialization is complete.
|
package/src/index.ts
CHANGED
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
// Foundations
|
|
12
|
-
export { createFetchClient } from '@
|
|
12
|
+
export { createFetchClient } from '@luxexchange/api/src/clients/base/createFetchClient'
|
|
13
13
|
export {
|
|
14
14
|
FetchError,
|
|
15
15
|
is401Error,
|
|
16
16
|
is404Error,
|
|
17
17
|
isRateLimitFetchError,
|
|
18
|
-
} from '@
|
|
18
|
+
} from '@luxexchange/api/src/clients/base/errors'
|
|
19
19
|
export type {
|
|
20
20
|
CustomOptions,
|
|
21
21
|
FetchClient,
|
|
22
22
|
StandardFetchOptions,
|
|
23
|
-
} from '@
|
|
24
|
-
export { SharedQueryClient } from '@
|
|
23
|
+
} from '@luxexchange/api/src/clients/base/types'
|
|
24
|
+
export { SharedQueryClient } from '@luxexchange/api/src/clients/base/SharedQueryClient'
|
|
25
25
|
|
|
26
26
|
// Constants and URLs
|
|
27
27
|
export {
|
|
@@ -34,46 +34,46 @@ export {
|
|
|
34
34
|
PROD_ENTRY_GATEWAY_API_BASE_URL,
|
|
35
35
|
STAGING_ENTRY_GATEWAY_API_BASE_URL,
|
|
36
36
|
TrafficFlows,
|
|
37
|
-
} from '@
|
|
37
|
+
} from '@luxexchange/api/src/clients/base/urls'
|
|
38
38
|
|
|
39
39
|
// Auth
|
|
40
|
-
export type { AuthData, SignedRequestParams, SignMessageFunc } from '@
|
|
41
|
-
export { createSignedRequestBody, createSignedRequestParams } from '@
|
|
40
|
+
export type { AuthData, SignedRequestParams, SignMessageFunc } from '@luxexchange/api/src/clients/base/auth'
|
|
41
|
+
export { createSignedRequestBody, createSignedRequestParams } from '@luxexchange/api/src/clients/base/auth'
|
|
42
42
|
|
|
43
43
|
// GraphQL API
|
|
44
|
-
export * as GraphQLApi from '@
|
|
44
|
+
export * as GraphQLApi from '@luxexchange/api/src/clients/graphql/generated'
|
|
45
45
|
export {
|
|
46
46
|
useTokenBasicInfoPartsFragment,
|
|
47
47
|
useTokenBasicProjectPartsFragment,
|
|
48
48
|
useTokenMarketPartsFragment,
|
|
49
49
|
useTokenProjectMarketsPartsFragment,
|
|
50
50
|
useTokenProjectUrlsPartsFragment,
|
|
51
|
-
} from '@
|
|
52
|
-
export { GQLQueries } from '@
|
|
53
|
-
export type { GqlResult } from '@
|
|
54
|
-
export { isError, isNonPollingRequestInFlight, isWarmLoadingStatus } from '@
|
|
51
|
+
} from '@luxexchange/api/src/clients/graphql/fragments'
|
|
52
|
+
export { GQLQueries } from '@luxexchange/api/src/clients/graphql/queries'
|
|
53
|
+
export type { GqlResult } from '@luxexchange/api/src/clients/graphql/types'
|
|
54
|
+
export { isError, isNonPollingRequestInFlight, isWarmLoadingStatus } from '@luxexchange/api/src/clients/graphql/utils'
|
|
55
55
|
|
|
56
56
|
// Jupiter API
|
|
57
57
|
export {
|
|
58
58
|
createJupiterApiClient,
|
|
59
59
|
type JupiterApiClient,
|
|
60
|
-
} from '@
|
|
60
|
+
} from '@luxexchange/api/src/clients/jupiter/createJupiterApiClient'
|
|
61
61
|
export type {
|
|
62
62
|
JupiterExecuteResponse,
|
|
63
63
|
JupiterOrderResponse,
|
|
64
64
|
JupiterExecuteUrlParams,
|
|
65
65
|
JupiterOrderUrlParams,
|
|
66
|
-
} from '@
|
|
66
|
+
} from '@luxexchange/api/src/clients/jupiter/types'
|
|
67
67
|
export {
|
|
68
68
|
jupiterExecuteResponseSchema,
|
|
69
69
|
jupiterOrderResponseSchema,
|
|
70
|
-
} from '@
|
|
70
|
+
} from '@luxexchange/api/src/clients/jupiter/types'
|
|
71
71
|
|
|
72
72
|
// Blockaid API
|
|
73
73
|
export {
|
|
74
74
|
createBlockaidApiClient,
|
|
75
75
|
type BlockaidApiClient,
|
|
76
|
-
} from '@
|
|
76
|
+
} from '@luxexchange/api/src/clients/blockaid/createBlockaidApiClient'
|
|
77
77
|
export {
|
|
78
78
|
getBlockaidScanSiteResponseSchema,
|
|
79
79
|
getBlockaidScanTransactionRequestSchema,
|
|
@@ -88,15 +88,15 @@ export {
|
|
|
88
88
|
type BlockaidScanTransactionResponse,
|
|
89
89
|
type BlockaidScanJsonRpcRequest,
|
|
90
90
|
type BlockaidScanJsonRpcResponse,
|
|
91
|
-
} from '@
|
|
91
|
+
} from '@luxexchange/api/src/clients/blockaid/types'
|
|
92
92
|
|
|
93
93
|
// Trading API
|
|
94
|
-
export * as TradingApi from '@
|
|
94
|
+
export * as TradingApi from '@luxexchange/api/src/clients/trading/__generated__'
|
|
95
95
|
export {
|
|
96
96
|
createTradingApiClient,
|
|
97
97
|
type TradingApiClient,
|
|
98
98
|
type TradingClientContext,
|
|
99
|
-
} from '@
|
|
99
|
+
} from '@luxexchange/api/src/clients/trading/createTradingApiClient'
|
|
100
100
|
export {
|
|
101
101
|
type BridgeQuoteResponse,
|
|
102
102
|
type ChainedQuoteResponse,
|
|
@@ -110,7 +110,7 @@ export {
|
|
|
110
110
|
type UnwrapQuoteResponse,
|
|
111
111
|
type UpdatePlanRequestWithPlanId,
|
|
112
112
|
type WrapQuoteResponse,
|
|
113
|
-
} from '@
|
|
113
|
+
} from '@luxexchange/api/src/clients/trading/tradeTypes'
|
|
114
114
|
export {
|
|
115
115
|
FeeType,
|
|
116
116
|
type FormattedDEXGasFeeInfo,
|
|
@@ -123,36 +123,36 @@ export {
|
|
|
123
123
|
type GasStrategy,
|
|
124
124
|
type TransactionEip1559FeeParams,
|
|
125
125
|
type TransactionLegacyFeeParams,
|
|
126
|
-
} from '@
|
|
126
|
+
} from '@luxexchange/api/src/clients/trading/types'
|
|
127
127
|
|
|
128
128
|
// Liquidity Service API
|
|
129
129
|
export {
|
|
130
130
|
createLiquidityServiceClient,
|
|
131
131
|
type LiquidityServiceClient,
|
|
132
|
-
} from '@
|
|
132
|
+
} from '@luxexchange/api/src/clients/liquidity/createLiquidityServiceClient'
|
|
133
133
|
export {
|
|
134
134
|
createAuctionMutationClient,
|
|
135
135
|
type AuctionMutationClient,
|
|
136
|
-
} from '@
|
|
136
|
+
} from '@luxexchange/api/src/clients/liquidity/createAuctionMutationClient'
|
|
137
137
|
|
|
138
138
|
// Auction Service API
|
|
139
139
|
export {
|
|
140
140
|
createAuctionServiceClient,
|
|
141
141
|
type AuctionServiceClient,
|
|
142
|
-
} from '@
|
|
142
|
+
} from '@luxexchange/api/src/clients/auctions/createAuctionServiceClient'
|
|
143
143
|
|
|
144
144
|
// X Verification Service API
|
|
145
145
|
export {
|
|
146
146
|
createXVerificationServiceClient,
|
|
147
147
|
type XVerificationServiceClient,
|
|
148
|
-
} from '@
|
|
148
|
+
} from '@luxexchange/api/src/clients/x/createXVerificationServiceClient'
|
|
149
149
|
|
|
150
150
|
// Uniswap API
|
|
151
151
|
export {
|
|
152
152
|
createUniswapApiClient,
|
|
153
153
|
type UniswapApiClient,
|
|
154
154
|
type UniswapApiClientContext,
|
|
155
|
-
} from '@
|
|
155
|
+
} from '@luxexchange/api/src/clients/uniswap/createUniswapApiClient'
|
|
156
156
|
|
|
157
157
|
// Compliance API
|
|
158
158
|
export {
|
|
@@ -161,7 +161,7 @@ export {
|
|
|
161
161
|
type ComplianceApiClientContext,
|
|
162
162
|
type ScreenRequest,
|
|
163
163
|
type ScreenResponse,
|
|
164
|
-
} from '@
|
|
164
|
+
} from '@luxexchange/api/src/clients/compliance/createComplianceApiClient'
|
|
165
165
|
|
|
166
166
|
// Unitags API
|
|
167
167
|
export {
|
|
@@ -186,15 +186,15 @@ export {
|
|
|
186
186
|
type UnitagUpdateMetadataResponse,
|
|
187
187
|
type UnitagUsernameRequest,
|
|
188
188
|
type UnitagUsernameResponse,
|
|
189
|
-
} from '@
|
|
190
|
-
export { createUnitagsApiClient } from '@
|
|
189
|
+
} from '@luxexchange/api/src/clients/unitags/types'
|
|
190
|
+
export { createUnitagsApiClient } from '@luxexchange/api/src/clients/unitags/createUnitagsApiClient'
|
|
191
191
|
|
|
192
192
|
// Gas Service API (ConnectRPC - estimateGasFee via UniRPC v2)
|
|
193
193
|
export {
|
|
194
194
|
createGasServiceClient,
|
|
195
195
|
type GasServiceClient,
|
|
196
196
|
type GasServiceClientContext,
|
|
197
|
-
} from '@
|
|
197
|
+
} from '@luxexchange/api/src/clients/gasService/createGasServiceClient'
|
|
198
198
|
export type {
|
|
199
199
|
EstimateGasFeeRequest as GasServiceEstimateRequest,
|
|
200
200
|
EstimateGasFeeResponse as GasServiceEstimateResponse,
|
|
@@ -205,11 +205,11 @@ export {
|
|
|
205
205
|
createDataApiServiceClient,
|
|
206
206
|
type DataApiServiceClient,
|
|
207
207
|
type DataApiServiceClientContext,
|
|
208
|
-
} from '@
|
|
208
|
+
} from '@luxexchange/api/src/clients/dataApi/createDataApiServiceClient'
|
|
209
209
|
export {
|
|
210
210
|
getGetPortfolioQueryOptions,
|
|
211
211
|
type GetPortfolioQueryParams,
|
|
212
|
-
} from '@
|
|
212
|
+
} from '@luxexchange/api/src/clients/dataApi/getGetPortfolioQueryOptions'
|
|
213
213
|
export {
|
|
214
214
|
TopPoolsOrderBy,
|
|
215
215
|
TokensOrderBy,
|
|
@@ -228,11 +228,11 @@ export {
|
|
|
228
228
|
type DataServiceApiClientContext,
|
|
229
229
|
TokenReportEventType,
|
|
230
230
|
ReportAssetType,
|
|
231
|
-
} from '@
|
|
231
|
+
} from '@luxexchange/api/src/clients/data/createDataServiceApiClient'
|
|
232
232
|
|
|
233
233
|
// Notifications API
|
|
234
|
-
export { createNotificationsApiClient } from '@
|
|
235
|
-
export { BackgroundType, ContentStyle, OnClickAction } from '@
|
|
234
|
+
export { createNotificationsApiClient } from '@luxexchange/api/src/clients/notifications/createNotificationsApiClient'
|
|
235
|
+
export { BackgroundType, ContentStyle, OnClickAction } from '@luxexchange/api/src/clients/notifications/types'
|
|
236
236
|
export type {
|
|
237
237
|
AckNotificationRequest,
|
|
238
238
|
AckNotificationResponse,
|
|
@@ -241,14 +241,14 @@ export type {
|
|
|
241
241
|
InAppNotification,
|
|
242
242
|
NotificationsApiClient,
|
|
243
243
|
NotificationsClientContext,
|
|
244
|
-
} from '@
|
|
244
|
+
} from '@luxexchange/api/src/clients/notifications/types'
|
|
245
245
|
|
|
246
246
|
// FOR (Fiat On-Ramp) API
|
|
247
247
|
export {
|
|
248
248
|
createForApiClient,
|
|
249
249
|
type ForApiClient,
|
|
250
|
-
} from '@
|
|
251
|
-
export { transformPaymentMethods } from '@
|
|
250
|
+
} from '@luxexchange/api/src/clients/for/createForApiClient'
|
|
251
|
+
export { transformPaymentMethods } from '@luxexchange/api/src/clients/for/utils'
|
|
252
252
|
export type {
|
|
253
253
|
FORCountry,
|
|
254
254
|
FORLogo,
|
|
@@ -258,7 +258,7 @@ export type {
|
|
|
258
258
|
FORSupportedFiatCurrency,
|
|
259
259
|
FORSupportedToken,
|
|
260
260
|
FORTransaction,
|
|
261
|
-
} from '@
|
|
261
|
+
} from '@luxexchange/api/src/clients/for/types'
|
|
262
262
|
// Re-export FOR protobuf types for consumer packages
|
|
263
263
|
export {
|
|
264
264
|
RampDirection,
|
|
@@ -287,17 +287,17 @@ export {
|
|
|
287
287
|
ALL_NETWORKS_ARG,
|
|
288
288
|
createConnectTransportWithDefaults,
|
|
289
289
|
type ConnectRpcContext,
|
|
290
|
-
} from '@
|
|
290
|
+
} from '@luxexchange/api/src/connectRpc/base'
|
|
291
291
|
export {
|
|
292
292
|
parseProtectionInfo,
|
|
293
293
|
parseRestProtocolVersion,
|
|
294
294
|
parseSafetyLevel,
|
|
295
295
|
transformInput,
|
|
296
296
|
type WithoutWalletAccount,
|
|
297
|
-
} from '@
|
|
297
|
+
} from '@luxexchange/api/src/connectRpc/utils'
|
|
298
298
|
|
|
299
299
|
// Conversion Tracking API
|
|
300
|
-
export * as ConversionTrackingApi from '@
|
|
300
|
+
export * as ConversionTrackingApi from '@luxexchange/api/src/clients/conversionTracking'
|
|
301
301
|
|
|
302
302
|
// Embedded Wallet API
|
|
303
303
|
export {
|
|
@@ -306,40 +306,40 @@ export {
|
|
|
306
306
|
type EmbeddedWalletClientContext,
|
|
307
307
|
type RecoveryMethod,
|
|
308
308
|
type SignAuth,
|
|
309
|
-
} from '@
|
|
309
|
+
} from '@luxexchange/api/src/clients/embeddedWallet/createEmbeddedWalletApiClient'
|
|
310
310
|
|
|
311
311
|
// Other Utilities
|
|
312
312
|
export {
|
|
313
313
|
createFetcher,
|
|
314
314
|
objectToQueryString,
|
|
315
|
-
} from '@
|
|
315
|
+
} from '@luxexchange/api/src/clients/base/utils'
|
|
316
316
|
|
|
317
317
|
// Session API
|
|
318
|
-
export { ApiInit, reinitializeSession, SESSION_INIT_QUERY_KEY } from '@
|
|
319
|
-
export { provideSessionService } from '@
|
|
320
|
-
export { useIsSessionInitialized } from '@
|
|
318
|
+
export { ApiInit, reinitializeSession, SESSION_INIT_QUERY_KEY } from '@luxexchange/api/src/components/ApiInit'
|
|
319
|
+
export { provideSessionService } from '@luxexchange/api/src/provideSessionService'
|
|
320
|
+
export { useIsSessionInitialized } from '@luxexchange/api/src/hooks/useIsSessionInitialized'
|
|
321
321
|
|
|
322
322
|
// Session Transport (pure factory, no platform detection)
|
|
323
|
-
export { createSessionTransport, type CreateSessionTransportOptions } from '@
|
|
324
|
-
export { createWithSessionRetry } from '@
|
|
323
|
+
export { createSessionTransport, type CreateSessionTransportOptions } from '@luxexchange/api/src/session'
|
|
324
|
+
export { createWithSessionRetry } from '@luxexchange/api/src/session/createWithSessionRetry'
|
|
325
325
|
|
|
326
326
|
export type {
|
|
327
327
|
UseQueryApiHelperHookArgs,
|
|
328
328
|
UseQueryWithImmediateGarbageCollectionApiHelperHookArgs,
|
|
329
|
-
} from '@
|
|
330
|
-
export { useQueryWithImmediateGarbageCollection } from '@
|
|
329
|
+
} from '@luxexchange/api/src/hooks/shared/types'
|
|
330
|
+
export { useQueryWithImmediateGarbageCollection } from '@luxexchange/api/src/hooks/shared/useQueryWithImmediateGarbageCollection'
|
|
331
331
|
|
|
332
332
|
// Other Types
|
|
333
333
|
export {
|
|
334
334
|
CustomRankingType,
|
|
335
335
|
RankingType,
|
|
336
336
|
SpamCode,
|
|
337
|
-
} from '@
|
|
337
|
+
} from '@luxexchange/api/src/clients/content/types'
|
|
338
338
|
|
|
339
|
-
export { getTransport } from '@
|
|
339
|
+
export { getTransport } from '@luxexchange/api/src/transport'
|
|
340
340
|
|
|
341
|
-
export { getEntryGatewayUrl, getMigratedForApiUrl } from '@
|
|
341
|
+
export { getEntryGatewayUrl, getMigratedForApiUrl } from '@luxexchange/api/src/getEntryGatewayUrl'
|
|
342
342
|
|
|
343
|
-
export { getWebSocketUrl } from '@
|
|
343
|
+
export { getWebSocketUrl } from '@luxexchange/api/src/getWebSocketUrl'
|
|
344
344
|
|
|
345
|
-
export { provideLuxIdentifierService } from '@
|
|
345
|
+
export { provideLuxIdentifierService } from '@luxexchange/api/src/provideLuxIdentifierService'
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
createSessionService,
|
|
10
10
|
type SessionService,
|
|
11
11
|
} from '@luxfi/sessions'
|
|
12
|
-
import type { Logger } from 'utilities/src/logger/logger'
|
|
13
|
-
import { REQUEST_SOURCE } from 'utilities/src/platform/requestSource'
|
|
12
|
+
import type { Logger } from '@luxfi/utilities/src/logger/logger'
|
|
13
|
+
import { REQUEST_SOURCE } from '@luxfi/utilities/src/platform/requestSource'
|
|
14
14
|
|
|
15
15
|
function provideSessionService(ctx: {
|
|
16
16
|
getBaseUrl: () => string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SessionService, LuxIdentifierService } from '@
|
|
2
|
-
import { PlatformSplitStubError } from 'utilities/src/errors'
|
|
3
|
-
import type { Logger } from 'utilities/src/logger/logger'
|
|
1
|
+
import type { SessionService, LuxIdentifierService } from '@luxexchange/sessions'
|
|
2
|
+
import { PlatformSplitStubError } from '@luxfi/utilities/src/errors'
|
|
3
|
+
import type { Logger } from '@luxfi/utilities/src/logger/logger'
|
|
4
4
|
|
|
5
5
|
export function provideSessionService(_ctx: {
|
|
6
6
|
getBaseUrl: () => string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { provideDeviceIdService } from '@
|
|
2
|
-
import { provideSessionStorage } from '@
|
|
3
|
-
import { provideLuxIdentifierService } from '@
|
|
4
|
-
import { getTransport } from '@
|
|
1
|
+
import { provideDeviceIdService } from '@luxexchange/api/src/provideDeviceIdService'
|
|
2
|
+
import { provideSessionStorage } from '@luxexchange/api/src/provideSessionStorage'
|
|
3
|
+
import { provideLuxIdentifierService } from '@luxexchange/api/src/provideLuxIdentifierService'
|
|
4
|
+
import { getTransport } from '@luxexchange/api/src/transport'
|
|
5
5
|
import {
|
|
6
6
|
createNoopSessionService,
|
|
7
7
|
createSessionClient,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
createSessionService,
|
|
10
10
|
type SessionService,
|
|
11
11
|
type LuxIdentifierService,
|
|
12
|
-
} from '@
|
|
13
|
-
import type { Logger } from 'utilities/src/logger/logger'
|
|
14
|
-
import { isWebApp } from 'utilities/src/platform'
|
|
15
|
-
import { REQUEST_SOURCE } from 'utilities/src/platform/requestSource'
|
|
12
|
+
} from '@luxexchange/sessions'
|
|
13
|
+
import type { Logger } from '@luxfi/utilities/src/logger/logger'
|
|
14
|
+
import { isWebApp } from '@luxfi/utilities/src/platform'
|
|
15
|
+
import { REQUEST_SOURCE } from '@luxfi/utilities/src/platform/requestSource'
|
|
16
16
|
|
|
17
17
|
function provideSessionService(ctx: {
|
|
18
18
|
getBaseUrl: () => string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSessionTransport } from '@
|
|
1
|
+
import { createSessionTransport } from '@luxexchange/api/src/session/createSessionTransport'
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
|
|
4
4
|
describe('createSessionTransport', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { is401Error } from '@
|
|
1
|
+
import { is401Error } from '@luxexchange/api/src/clients/base/errors'
|
|
2
2
|
|
|
3
3
|
/** Creates a function that will attempt to reinitialize the app session and retry the input function once, if the first invocation of the function fails. */
|
|
4
4
|
export function createWithSessionRetry(ctx: {
|
package/src/session/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StorageDriver } from '@luxfi/api/src/storage/types'
|
|
2
|
-
import { getChromeWithThrow } from 'utilities/src/chrome/chrome'
|
|
2
|
+
import { getChromeWithThrow } from '@luxfi/utilities/src/chrome/chrome'
|
|
3
3
|
|
|
4
4
|
export function createExtensionStorageDriver(): StorageDriver {
|
|
5
5
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StorageDriver } from '@luxfi/api/src/storage/types'
|
|
2
|
-
import { PlatformSplitStubError } from 'utilities/src/errors'
|
|
2
|
+
import { PlatformSplitStubError } from '@luxfi/utilities/src/errors'
|
|
3
3
|
|
|
4
4
|
export function getStorageDriver(): StorageDriver {
|
|
5
5
|
throw new PlatformSplitStubError('getStorageDriver')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createExtensionStorageDriver } from '@luxfi/api/src/storage/createExtensionStorageDriver'
|
|
2
2
|
import { createWebStorageDriver } from '@luxfi/api/src/storage/createWebStorageDriver'
|
|
3
3
|
import { type StorageDriver } from '@luxfi/api/src/storage/types'
|
|
4
|
-
import { isExtensionApp } from 'utilities/src/platform'
|
|
4
|
+
import { isExtensionApp } from '@luxfi/utilities/src/platform'
|
|
5
5
|
|
|
6
6
|
export function getStorageDriver(): StorageDriver {
|
|
7
7
|
if (isExtensionApp) {
|
package/src/transport.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ConnectTransportOptions, createConnectTransport } from '@connectrpc/connect-web'
|
|
2
2
|
import { provideDeviceIdService } from '@luxfi/api/src/provideDeviceIdService'
|
|
3
3
|
import { provideSessionStorage } from '@luxfi/api/src/provideSessionStorage'
|
|
4
|
-
import { isWebApp } from 'utilities/src/platform'
|
|
4
|
+
import { isWebApp } from '@luxfi/utilities/src/platform'
|
|
5
5
|
|
|
6
6
|
interface SessionTransportOptions {
|
|
7
7
|
getSessionId?: () => Promise<string | null>
|