@luxexchange/api 1.0.0 → 1.0.1
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/client.d.ts +22 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +56 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/use-token-list.d.ts +22 -0
- package/dist/hooks/use-token-list.d.ts.map +1 -0
- package/dist/hooks/use-token-list.js +27 -0
- package/dist/hooks/use-token-price.d.ts +15 -0
- package/dist/hooks/use-token-price.d.ts.map +1 -0
- package/dist/hooks/use-token-price.js +63 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/package.json +10 -11
- package/project.json +2 -8
- package/src/clients/base/SharedQueryClient.ts +2 -2
- package/src/clients/base/errors.test.ts +39 -0
- package/src/clients/base/errors.ts +9 -1
- package/src/clients/base/urls.test.ts +7 -7
- package/src/clients/base/urls.ts +5 -5
- package/src/clients/base/utils.test.ts +2 -2
- package/src/clients/blockaid/createBlockaidApiClient.ts +1 -1
- package/src/clients/compliance/createComplianceApiClient.ts +40 -0
- package/src/clients/compliance/types.ts +15 -0
- package/src/clients/data/createDataServiceApiClient.ts +1 -1
- package/src/clients/dataApi/createDataApiServiceClient.ts +4 -4
- package/src/clients/dataApi/getGetPortfolioQueryOptions.test.ts +4 -4
- package/src/clients/dataApi/getGetPortfolioQueryOptions.ts +10 -6
- package/src/clients/embeddedWallet/createEmbeddedWalletApiClient.ts +254 -82
- package/src/clients/for/createForApiClient.ts +4 -4
- package/src/clients/for/utils.ts +1 -1
- package/src/clients/gasService/createGasServiceClient.ts +21 -0
- package/src/clients/graphql/queries.graphql +0 -183
- package/src/clients/graphql/queries.ts +0 -2
- package/src/clients/graphql/schema.graphql +603 -594
- package/src/clients/graphql/web/activity.graphql +0 -6
- package/src/clients/graphql/web/landing.graphql +0 -20
- package/src/clients/graphql/web/token.graphql +21 -3
- package/src/clients/lux/createLuxApiClient.ts +4 -21
- package/src/clients/trading/api.json +1 -1
- package/src/clients/trading/createTradingApiClient.ts +8 -8
- package/src/clients/trading/types.ts +1 -1
- package/src/clients/unitags/createUnitagsApiClient.test.ts +1 -1
- package/src/clients/unitags/createUnitagsApiClient.ts +5 -5
- package/src/clients/x/createXVerificationServiceClient.ts +26 -0
- package/src/components/ApiInit.test.tsx +2 -2
- package/src/components/ApiInit.tsx +5 -5
- package/src/connectRpc/utils.ts +1 -1
- package/src/getEntryGatewayUrl.ts +1 -1
- package/src/getWebSocketUrl.ts +10 -7
- package/src/hooks/shared/useQueryWithImmediateGarbageCollection.ts +1 -1
- package/src/hooks/useIsSessionInitialized.ts +1 -1
- package/src/index.ts +86 -59
- 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/stubs/privy-service-pb.d.ts +150 -3
- package/.depcheckrc +0 -17
- package/.eslintrc.js +0 -30
- package/src/clients/graphql/web/nft/CollectionSearch.graphql +0 -34
- package/src/clients/graphql/web/portfolios.graphql +0 -68
|
@@ -264,9 +264,3 @@ query ActivityWeb($account: String!, $chains: [Chain!]!, $onRampTransactionIDs:
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
|
|
268
|
-
subscription OnAssetActivity($subscriptionId: ID!, $account: String!) {
|
|
269
|
-
onAssetActivity(subscriptionId: $subscriptionId, addresses: [$account]) {
|
|
270
|
-
...AssetActivityParts
|
|
271
|
-
}
|
|
272
|
-
}
|
|
@@ -16,23 +16,3 @@ query TokenPromo($chain: Chain!, $address: String = null) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
query CollectionPromo($addresses: [String!]!) {
|
|
21
|
-
nftCollections(filter: { addresses: $addresses }) {
|
|
22
|
-
edges {
|
|
23
|
-
node {
|
|
24
|
-
markets(currencies: ETH) {
|
|
25
|
-
floorPricePercentChange(duration: DAY) {
|
|
26
|
-
value
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
query DailyProtocolVolume($version: ProtocolVersion!) {
|
|
35
|
-
historicalProtocolVolume(chain: ETHEREUM, version: $version, duration: MONTH) {
|
|
36
|
-
value
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
query TokenWeb($chain: Chain!, $address: String = null) {
|
|
1
|
+
query TokenWeb($chain: Chain!, $address: String = null, $multichain: Boolean = false) {
|
|
2
2
|
token(chain: $chain, address: $address) {
|
|
3
3
|
id
|
|
4
4
|
decimals
|
|
@@ -7,7 +7,7 @@ query TokenWeb($chain: Chain!, $address: String = null) {
|
|
|
7
7
|
address
|
|
8
8
|
symbol
|
|
9
9
|
standard
|
|
10
|
-
market(currency: USD) {
|
|
10
|
+
market(currency: USD, multichain: $multichain) {
|
|
11
11
|
id
|
|
12
12
|
totalValueLocked {
|
|
13
13
|
id
|
|
@@ -19,7 +19,7 @@ query TokenWeb($chain: Chain!, $address: String = null) {
|
|
|
19
19
|
value
|
|
20
20
|
currency
|
|
21
21
|
}
|
|
22
|
-
volume24H: volume(duration: DAY) {
|
|
22
|
+
volume24H: volume(duration: DAY, multichain: $multichain) {
|
|
23
23
|
id
|
|
24
24
|
value
|
|
25
25
|
currency
|
|
@@ -45,6 +45,24 @@ query TokenWeb($chain: Chain!, $address: String = null) {
|
|
|
45
45
|
id
|
|
46
46
|
chain
|
|
47
47
|
address
|
|
48
|
+
market(currency: USD) {
|
|
49
|
+
id
|
|
50
|
+
totalValueLocked {
|
|
51
|
+
id
|
|
52
|
+
value
|
|
53
|
+
currency
|
|
54
|
+
}
|
|
55
|
+
price {
|
|
56
|
+
id
|
|
57
|
+
value
|
|
58
|
+
currency
|
|
59
|
+
}
|
|
60
|
+
volume24H: volume(duration: DAY) {
|
|
61
|
+
id
|
|
62
|
+
value
|
|
63
|
+
currency
|
|
64
|
+
}
|
|
65
|
+
}
|
|
48
66
|
}
|
|
49
67
|
markets(currencies: [USD]) {
|
|
50
68
|
id
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import type { TransactionRequest } from '@ethersproject/providers'
|
|
2
|
-
import type { FetchClient } from '@
|
|
2
|
+
import type { FetchClient } from '@universe/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 '
|
|
7
|
+
} from '@universe/api/src/clients/trading/types'
|
|
8
|
+
import { isWebApp } from '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 = {
|
|
12
12
|
gasFee: '/v1/gas-fee',
|
|
13
|
-
trmScreen: '/v1/screen',
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
type FetchGasFn = ({
|
|
@@ -23,15 +22,7 @@ type FetchGasFn = ({
|
|
|
23
22
|
smartContractDelegationAddress?: Address
|
|
24
23
|
}) => Promise<GasFeeResultWithoutState>
|
|
25
24
|
|
|
26
|
-
export
|
|
27
|
-
block: boolean
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type ScreenRequest = {
|
|
31
|
-
address: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface LuxApiClientContext {
|
|
25
|
+
export interface UniswapApiClientContext {
|
|
35
26
|
fetchClient: FetchClient
|
|
36
27
|
processGasFeeResponse: (gasFeeResponse: GasFeeResponse, gasStrategy: GasStrategy) => GasFeeResultWithoutState
|
|
37
28
|
estimateGasWithClientSideProvider: (params: {
|
|
@@ -42,7 +33,6 @@ export interface LuxApiClientContext {
|
|
|
42
33
|
|
|
43
34
|
export interface LuxApiClient {
|
|
44
35
|
fetchGasFee: FetchGasFn
|
|
45
|
-
fetchTrmScreen: (params: ScreenRequest) => Promise<ScreenResponse>
|
|
46
36
|
}
|
|
47
37
|
|
|
48
38
|
export function createLuxApiClient(ctx: LuxApiClientContext): LuxApiClient {
|
|
@@ -87,14 +77,7 @@ export function createLuxApiClient(ctx: LuxApiClientContext): LuxApiClient {
|
|
|
87
77
|
}
|
|
88
78
|
}
|
|
89
79
|
|
|
90
|
-
const fetchTrmScreen = async (params: ScreenRequest): Promise<ScreenResponse> => {
|
|
91
|
-
return await client.post<ScreenResponse>(LUX_API_PATHS.trmScreen, {
|
|
92
|
-
body: JSON.stringify(params),
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
|
|
96
80
|
return {
|
|
97
81
|
fetchGasFee,
|
|
98
|
-
fetchTrmScreen,
|
|
99
82
|
}
|
|
100
83
|
}
|