@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.
Files changed (70) hide show
  1. package/dist/client.d.ts +22 -0
  2. package/dist/client.d.ts.map +1 -0
  3. package/dist/client.js +56 -0
  4. package/dist/hooks/index.d.ts +6 -0
  5. package/dist/hooks/index.d.ts.map +1 -0
  6. package/dist/hooks/index.js +5 -0
  7. package/dist/hooks/use-token-list.d.ts +22 -0
  8. package/dist/hooks/use-token-list.d.ts.map +1 -0
  9. package/dist/hooks/use-token-list.js +27 -0
  10. package/dist/hooks/use-token-price.d.ts +15 -0
  11. package/dist/hooks/use-token-price.d.ts.map +1 -0
  12. package/dist/hooks/use-token-price.js +63 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +5 -0
  16. package/package.json +10 -11
  17. package/project.json +2 -8
  18. package/src/clients/base/SharedQueryClient.ts +2 -2
  19. package/src/clients/base/errors.test.ts +39 -0
  20. package/src/clients/base/errors.ts +9 -1
  21. package/src/clients/base/urls.test.ts +7 -7
  22. package/src/clients/base/urls.ts +5 -5
  23. package/src/clients/base/utils.test.ts +2 -2
  24. package/src/clients/blockaid/createBlockaidApiClient.ts +1 -1
  25. package/src/clients/compliance/createComplianceApiClient.ts +40 -0
  26. package/src/clients/compliance/types.ts +15 -0
  27. package/src/clients/data/createDataServiceApiClient.ts +1 -1
  28. package/src/clients/dataApi/createDataApiServiceClient.ts +4 -4
  29. package/src/clients/dataApi/getGetPortfolioQueryOptions.test.ts +4 -4
  30. package/src/clients/dataApi/getGetPortfolioQueryOptions.ts +10 -6
  31. package/src/clients/embeddedWallet/createEmbeddedWalletApiClient.ts +254 -82
  32. package/src/clients/for/createForApiClient.ts +4 -4
  33. package/src/clients/for/utils.ts +1 -1
  34. package/src/clients/gasService/createGasServiceClient.ts +21 -0
  35. package/src/clients/graphql/queries.graphql +0 -183
  36. package/src/clients/graphql/queries.ts +0 -2
  37. package/src/clients/graphql/schema.graphql +603 -594
  38. package/src/clients/graphql/web/activity.graphql +0 -6
  39. package/src/clients/graphql/web/landing.graphql +0 -20
  40. package/src/clients/graphql/web/token.graphql +21 -3
  41. package/src/clients/lux/createLuxApiClient.ts +4 -21
  42. package/src/clients/trading/api.json +1 -1
  43. package/src/clients/trading/createTradingApiClient.ts +8 -8
  44. package/src/clients/trading/types.ts +1 -1
  45. package/src/clients/unitags/createUnitagsApiClient.test.ts +1 -1
  46. package/src/clients/unitags/createUnitagsApiClient.ts +5 -5
  47. package/src/clients/x/createXVerificationServiceClient.ts +26 -0
  48. package/src/components/ApiInit.test.tsx +2 -2
  49. package/src/components/ApiInit.tsx +5 -5
  50. package/src/connectRpc/utils.ts +1 -1
  51. package/src/getEntryGatewayUrl.ts +1 -1
  52. package/src/getWebSocketUrl.ts +10 -7
  53. package/src/hooks/shared/useQueryWithImmediateGarbageCollection.ts +1 -1
  54. package/src/hooks/useIsSessionInitialized.ts +1 -1
  55. package/src/index.ts +86 -59
  56. package/src/provideSessionService.native.ts +2 -2
  57. package/src/provideSessionService.ts +3 -3
  58. package/src/provideSessionService.web.ts +8 -8
  59. package/src/session/createSessionTransport.test.ts +1 -1
  60. package/src/session/createWithSessionRetry.ts +1 -1
  61. package/src/session/index.ts +1 -1
  62. package/src/storage/createExtensionStorageDriver.ts +1 -1
  63. package/src/storage/getStorageDriver.ts +1 -1
  64. package/src/storage/getStorageDriver.web.ts +1 -1
  65. package/src/transport.ts +1 -1
  66. package/stubs/privy-service-pb.d.ts +150 -3
  67. package/.depcheckrc +0 -17
  68. package/.eslintrc.js +0 -30
  69. package/src/clients/graphql/web/nft/CollectionSearch.graphql +0 -34
  70. package/src/clients/graphql/web/portfolios.graphql +0 -68
@@ -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 '@luxfi/utilities/src/platform'
4
+ import { isExtensionApp } from '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 '@luxfi/utilities/src/platform'
4
+ import { isWebApp } from 'utilities/src/platform'
5
5
 
6
6
  interface SessionTransportOptions {
7
7
  getSessionId?: () => Promise<string | null>
@@ -17,6 +17,21 @@ export declare enum Action {
17
17
  DELETE_RECORD = 7,
18
18
  REGISTER_NEW_AUTHENTICATION_TYPES = 8,
19
19
  LIST_AUTHENTICATORS = 9,
20
+ DELETE_AUTHENTICATOR = 10,
21
+ SETUP_RECOVERY = 11,
22
+ EXECUTE_RECOVERY = 12,
23
+ DELETE_RECOVERY = 13,
24
+ }
25
+
26
+ export declare enum AuthenticatorNameType {
27
+ AUTHENTICATOR_NAME_TYPE_UNSPECIFIED = 0,
28
+ GOOGLE_PASSWORD_MANAGER = 1,
29
+ CHROME_MAC = 2,
30
+ WINDOWS_HELLO = 3,
31
+ ICLOUD_KEYCHAIN_MANAGED = 4,
32
+ ICLOUD_KEYCHAIN = 15,
33
+ PLATFORM_AUTHENTICATOR = 30,
34
+ SECURITY_KEY = 31,
20
35
  }
21
36
 
22
37
  export declare enum RegistrationOptions_AuthenticatorAttachment {
@@ -26,15 +41,38 @@ export declare enum RegistrationOptions_AuthenticatorAttachment {
26
41
  }
27
42
 
28
43
  export declare class ChallengeResponse {
29
- challengeOptions: string
44
+ challengeOptions?: string
45
+ sessionActive: boolean
46
+ signingPayload?: string
47
+ keyQuorumId?: string
48
+ existingPublicKeys: string[]
30
49
  }
31
50
 
32
51
  export declare class CreateWalletResponse {
33
52
  walletAddress: string
34
53
  walletId: string
54
+ deviceKeyQuorumId?: string
55
+ policyId?: string
56
+ policyExpiresAt?: bigint
35
57
  }
36
58
 
37
- export declare class DisconnectResponse {}
59
+ export declare class StartAuthenticatedSessionResponse {
60
+ policyId?: string
61
+ policyExpiresAt?: bigint
62
+ }
63
+
64
+ export declare class DeviceSignatureAuth {
65
+ deviceSignature: string
66
+ walletId: string
67
+ }
68
+
69
+ export declare class AddAuthenticatorResponse {
70
+ credentialId: string
71
+ }
72
+
73
+ export declare class DisconnectResponse {
74
+ success: boolean
75
+ }
38
76
 
39
77
  export declare class RegistrationOptions {
40
78
  authenticatorAttachment?: RegistrationOptions_AuthenticatorAttachment
@@ -44,7 +82,6 @@ export declare class RegistrationOptions {
44
82
  export declare class WalletSignInResponse {
45
83
  walletAddress: string
46
84
  walletId: string
47
- exported?: boolean
48
85
  }
49
86
 
50
87
  export declare class SignMessageResponse {
@@ -58,3 +95,113 @@ export declare class SignTransactionResponse {
58
95
  export declare class SignTypedDataResponse {
59
96
  signature: string
60
97
  }
98
+
99
+ export declare class Authenticator {
100
+ credentialId: string
101
+ providerName: AuthenticatorNameType
102
+ username?: string
103
+ createdAt: bigint
104
+ aaguid?: string
105
+ }
106
+
107
+ export declare class ListAuthenticatorsRequest {
108
+ credential?: string
109
+ walletId?: string
110
+ }
111
+
112
+ export declare class RecoveryMethod {
113
+ type: string
114
+ identifier: string
115
+ createdAt: bigint
116
+ status: string
117
+ }
118
+
119
+ export declare class ListAuthenticatorsResponse {
120
+ authenticators: Authenticator[]
121
+ recoveryMethods: RecoveryMethod[]
122
+ }
123
+
124
+ export declare class AddAuthenticatorRequest {
125
+ newCredential: string
126
+ deviceSignature?: string
127
+ }
128
+
129
+ export declare class StartAuthenticatedSessionRequest {
130
+ existingCredential: string
131
+ devicePublicKey?: string
132
+ }
133
+
134
+ export declare class DeleteAuthenticatorRequest {
135
+ credential: string
136
+ authenticatorId: string
137
+ }
138
+
139
+ export declare class DeleteAuthenticatorResponse {
140
+ success: boolean
141
+ }
142
+
143
+ export declare class OprfEvaluateRequest {
144
+ blindedElement: string
145
+ isRecovery?: boolean
146
+ authMethodId?: string
147
+ }
148
+
149
+ export declare class OprfEvaluateResponse {
150
+ evaluatedElement?: string
151
+ errorMessage?: string
152
+ }
153
+
154
+ export declare class SetupRecoveryRequest {
155
+ walletId: string
156
+ authPublicKey: string
157
+ authMethodId: string
158
+ authMethodType?: string
159
+ }
160
+
161
+ export declare class SetupRecoveryResponse {
162
+ success: boolean
163
+ recoveryQuorumId?: string
164
+ }
165
+
166
+ export declare class ExecuteRecoveryRequest {
167
+ authMethodId: string
168
+ newCredential: string
169
+ authKeySignature: string
170
+ emailJwt: string
171
+ }
172
+
173
+ export declare class ExecuteRecoveryResponse {
174
+ credentialId?: string
175
+ walletAddress?: string
176
+ walletId?: string
177
+ errorMessage?: string
178
+ }
179
+
180
+ export declare class ReportDecryptionResultRequest {
181
+ success: boolean
182
+ authMethodId: string
183
+ newPasskeyPublicKey?: string
184
+ }
185
+
186
+ export declare class ReportDecryptionResultResponse {
187
+ cooldownSeconds: number
188
+ errorMessage?: string
189
+ signingPayload?: string
190
+ }
191
+
192
+ export declare class GetRecoveryConfigResponse {
193
+ found: boolean
194
+ status?: string
195
+ recoveryQuorumId?: string
196
+ authMethodType?: string
197
+ encryptedKeyId?: string
198
+ walletAddress?: string
199
+ }
200
+
201
+ export declare class DeleteRecoveryRequest {
202
+ credential: string
203
+ }
204
+
205
+ export declare class DeleteRecoveryResponse {
206
+ success: boolean
207
+ }
package/.depcheckrc DELETED
@@ -1,17 +0,0 @@
1
- ignores: [
2
- # Dependencies that depcheck thinks are unused but are actually used
3
- "openapi-typescript-codegen",
4
- "typescript",
5
- "@typescript/native-preview",
6
- "depcheck",
7
- "graphql",
8
- "@graphql-codegen/*",
9
- "get-graphql-schema",
10
- "@vitest/coverage-v8",
11
- # Dependencies that depcheck thinks are missing but are actually present
12
- ## Internal packages / workspaces
13
- "@universe/api",
14
- "@universe/config",
15
- "tsconfig",
16
- "utilities",
17
- ]
package/.eslintrc.js DELETED
@@ -1,30 +0,0 @@
1
- const { reactNative: reactNativeImports } = require('@luxfi/eslint-config/restrictedImports')
2
-
3
- module.exports = {
4
- extends: ['@luxfi/eslint-config/lib'],
5
- ignorePatterns: ['graphql.config.ts', 'stubs/**'],
6
- parserOptions: {
7
- tsconfigRootDir: __dirname,
8
- },
9
- overrides: [
10
- {
11
- files: ['**/*.{ts,tsx}'],
12
- excludedFiles: ['**/*.native.*', '**/*.ios.*', '**/*.android.*'],
13
- rules: {
14
- '@typescript-eslint/no-restricted-imports': ['error', reactNativeImports],
15
- },
16
- },
17
- {
18
- files: ['*.ts', '*.tsx'],
19
- rules: {
20
- 'no-relative-import-paths/no-relative-import-paths': [
21
- 'error',
22
- {
23
- allowSameFolder: false,
24
- prefix: '@luxfi/api',
25
- },
26
- ],
27
- },
28
- },
29
- ],
30
- }
@@ -1,34 +0,0 @@
1
- query CollectionSearch($query: String!) {
2
- nftCollections(filter: { nameQuery: $query }) {
3
- edges {
4
- cursor
5
- node {
6
- image {
7
- url
8
- }
9
- isVerified
10
- name
11
- numAssets
12
- nftContracts {
13
- address
14
- chain
15
- name
16
- symbol
17
- totalSupply
18
- }
19
- markets(currencies: ETH) {
20
- floorPrice {
21
- currency
22
- value
23
- }
24
- }
25
- }
26
- }
27
- pageInfo {
28
- endCursor
29
- hasNextPage
30
- hasPreviousPage
31
- startCursor
32
- }
33
- }
34
- }
@@ -1,68 +0,0 @@
1
- fragment QuickTokenBalanceParts on TokenBalance {
2
- id
3
- quantity
4
- denominatedValue {
5
- id
6
- value
7
- currency
8
- }
9
- token {
10
- id
11
- address
12
- chain
13
- standard
14
- }
15
- }
16
-
17
- fragment PortfolioTokenBalanceParts on TokenBalance {
18
- id
19
- quantity
20
- denominatedValue {
21
- id
22
- currency
23
- value
24
- }
25
- token {
26
- ...SimpleTokenDetails
27
- id
28
- address
29
- chain
30
- symbol
31
- name
32
- decimals
33
- standard
34
- project {
35
- id
36
- name
37
- logo {
38
- id
39
- url
40
- }
41
- safetyLevel
42
- logoUrl
43
- isSpam
44
- }
45
- }
46
- tokenProjectMarket {
47
- id
48
- pricePercentChange(duration: DAY) {
49
- id
50
- value
51
- }
52
- tokenProject {
53
- id
54
- logoUrl
55
- isSpam
56
- }
57
- }
58
- }
59
-
60
- # Query only returns basic token, quantity, and denominated value.
61
- query QuickTokenBalancesWeb($ownerAddress: String!, $chains: [Chain!]!) {
62
- portfolios(ownerAddresses: [$ownerAddress], chains: $chains) {
63
- id
64
- tokenBalances {
65
- ...QuickTokenBalanceParts
66
- }
67
- }
68
- }