@gmx-io/sdk 1.6.1 → 1.6.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.
Files changed (40) hide show
  1. package/build/cjs/src/clients/v2/__tests__/subaccount.spec.js +270 -0
  2. package/build/cjs/src/clients/v2/__tests__/testUtil.js +92 -1
  3. package/build/cjs/src/clients/v2/index.js +34 -57
  4. package/build/cjs/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +8 -0
  5. package/build/cjs/src/codegen/prebuilt/hashedMarketConfigKeys.json +61 -0
  6. package/build/cjs/src/codegen/prebuilt/hashedMarketValuesKeys.json +15 -0
  7. package/build/cjs/src/configs/markets.js +11 -1
  8. package/build/cjs/src/configs/tokens.js +11 -0
  9. package/build/cjs/src/utils/__tests__/markets.spec.js +30 -0
  10. package/build/cjs/src/utils/markets/utils.js +16 -12
  11. package/build/cjs/src/utils/positions/utils.js +1 -0
  12. package/build/cjs/src/utils/subaccount/index.js +11 -1
  13. package/build/cjs/src/utils/subaccount/sdkClient.js +367 -0
  14. package/build/cjs/src/utils/subaccount/state.js +76 -0
  15. package/build/esm/src/clients/v2/__tests__/subaccount.spec.js +271 -1
  16. package/build/esm/src/clients/v2/__tests__/testUtil.js +87 -0
  17. package/build/esm/src/clients/v2/index.js +33 -56
  18. package/build/esm/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +8 -0
  19. package/build/esm/src/codegen/prebuilt/hashedMarketConfigKeys.json +61 -0
  20. package/build/esm/src/codegen/prebuilt/hashedMarketValuesKeys.json +15 -0
  21. package/build/esm/src/configs/markets.js +10 -0
  22. package/build/esm/src/configs/tokens.js +11 -0
  23. package/build/esm/src/utils/__tests__/markets.spec.js +30 -0
  24. package/build/esm/src/utils/markets/utils.js +16 -12
  25. package/build/esm/src/utils/positions/utils.js +1 -0
  26. package/build/esm/src/utils/subaccount/index.js +1 -0
  27. package/build/esm/src/utils/subaccount/sdkClient.js +352 -0
  28. package/build/esm/src/utils/subaccount/state.js +64 -0
  29. package/build/tsconfig.tsbuildinfo +1 -1
  30. package/build/types/src/clients/v2/__tests__/testUtil.d.ts +37 -1
  31. package/build/types/src/clients/v2/index.d.ts +8 -2
  32. package/build/types/src/codegen/prebuilt/index.d.ts +84 -0
  33. package/build/types/src/configs/markets.d.ts +1 -0
  34. package/build/types/src/utils/markets/utils.d.ts +4 -3
  35. package/build/types/src/utils/subaccount/index.d.ts +1 -0
  36. package/build/types/src/utils/subaccount/sdkClient.d.ts +36 -0
  37. package/build/types/src/utils/subaccount/state.d.ts +11 -0
  38. package/build/types/src/utils/subaccount/types.d.ts +18 -0
  39. package/build/types/src/utils/tokens/types.d.ts +1 -1
  40. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
- import type { PrepareOrderRequest, PrepareOrderResponse, SubmitOrderResponse, OrderStatusResponse } from "../../../utils/orderTransactions/api";
1
+ import type { IHttp } from "../../../utils/http/types";
2
+ import type { PrepareCancelOrderRequest, PrepareCollateralRequest, PrepareEditOrderRequest, OrderStatusResponse, PrepareOrderRequest, PrepareOrderResponse, SubmitOrderRequest, SubmitOrderResponse } from "../../../utils/orderTransactions/api";
2
3
  import { PrivateKeySigner } from "../../../utils/signer";
3
4
  import type { IAbstractSigner } from "../../../utils/signer";
5
+ import type { SubaccountStatusRequest, SubaccountStatusResponse } from "../../../utils/subaccount/api";
4
6
  import { GmxApiSdk } from "../index";
5
7
  export declare const TEST_CHAIN_ID = 42161;
6
8
  export declare const TEST_SYMBOL = "ETH/USD [WETH-USDC]";
@@ -9,6 +11,40 @@ export declare const TEST_COLLATERAL: {
9
11
  amount: bigint;
10
12
  token: string;
11
13
  };
14
+ export type RecordedOrderPrepareRequest = PrepareOrderRequest | PrepareEditOrderRequest | PrepareCancelOrderRequest | PrepareCollateralRequest;
15
+ export declare class RecordingApi implements IHttp {
16
+ private delegate;
17
+ url: string;
18
+ orderPrepareRequests: RecordedOrderPrepareRequest[];
19
+ orderSubmitRequests: SubmitOrderRequest[];
20
+ constructor(delegate: IHttp);
21
+ fetchJson<TResult>(path: string, opts?: {
22
+ query?: Record<string, any>;
23
+ transform?: (result: any) => TResult;
24
+ }): Promise<TResult>;
25
+ postJson<TResult>(path: string, body: unknown, opts?: {
26
+ transform?: (result: any) => TResult;
27
+ }): Promise<TResult>;
28
+ }
29
+ export declare function buildPreparedOrderResponse(requestId: string): PrepareOrderResponse;
30
+ export declare class ScriptedOrderApi implements IHttp {
31
+ private readonly prepareResponse;
32
+ private readonly submitResponses;
33
+ private readonly subaccountStatusResponses;
34
+ url: string;
35
+ prepareRequests: PrepareOrderRequest[];
36
+ submitRequests: SubmitOrderRequest[];
37
+ subaccountStatusRequests: SubaccountStatusRequest[];
38
+ constructor(prepareResponse: PrepareOrderResponse, submitResponses?: SubmitOrderResponse[], subaccountStatusResponses?: SubaccountStatusResponse[]);
39
+ fetchJson<TResult>(path: string, _opts?: {
40
+ query?: Record<string, any>;
41
+ transform?: (result: any) => TResult;
42
+ }): Promise<TResult>;
43
+ postJson<TResult>(path: string, body: unknown, opts?: {
44
+ transform?: (result: any) => TResult;
45
+ }): Promise<TResult>;
46
+ }
47
+ export declare function buildSubaccountStatusResponse(overrides?: Partial<SubaccountStatusResponse>): SubaccountStatusResponse;
12
48
  export declare function getTestSdk(): GmxApiSdk;
13
49
  export declare function getTestSigner(): PrivateKeySigner | undefined;
14
50
  export declare function requireSigner(): PrivateKeySigner;
@@ -14,6 +14,7 @@ import { MarketRates, RatesParams } from "../../utils/rates/types";
14
14
  import type { IAbstractSigner } from "../../utils/signer";
15
15
  import { StakingPowerResponse } from "../../utils/staking/types";
16
16
  import type { SubaccountStatusRequest, SubaccountStatusResponse, SubaccountApprovalPrepareRequest, SubaccountApprovalPrepareResponse } from "../../utils/subaccount/api";
17
+ import type { SdkSubaccountApproval, SdkSubaccountStatus } from "../../utils/subaccount/types";
17
18
  import type { FetchTradesParams, SearchTradesParams, TradesListResponse } from "../../utils/trades/types";
18
19
  export type { ApyEntry, ApyParams, ApyResponse } from "../../utils/apy/types";
19
20
  export type { MarketTicker, MarketWithTiers } from "../../utils/markets/types";
@@ -36,20 +37,24 @@ export { HttpClientWithFallback } from "../../utils/http/httpFallback";
36
37
  export type { IHttp } from "../../utils/http/types";
37
38
  export { getGasPaymentTokens } from "../../configs/express";
38
39
  export type { SubaccountStatusRequest, SubaccountStatusResponse, SubaccountApprovalPrepareRequest, SubaccountApprovalPrepareResponse, };
40
+ export type { SdkSubaccountStatus } from "../../utils/subaccount/types";
39
41
  export declare class GmxApiSdk {
40
42
  ctx: {
41
43
  chainId: ContractsChainId;
42
44
  api: IHttp;
43
45
  };
44
46
  private _subaccount;
47
+ private preparedSubaccountApprovals;
45
48
  constructor({ chainId, apiUrl, api }: {
46
49
  chainId: ContractsChainId;
47
50
  apiUrl?: string;
48
51
  api?: IHttp;
49
52
  });
53
+ private get subaccountClient();
50
54
  get subaccountAddress(): string | undefined;
55
+ get subaccountStatus(): SdkSubaccountStatus | undefined;
51
56
  get hasActiveSubaccount(): boolean;
52
- get subaccountApprovalMessage(): Record<string, any> | undefined;
57
+ get subaccountApprovalMessage(): SdkSubaccountApproval | undefined;
53
58
  fetchMarketsInfo(): Promise<import("../../utils/markets/types").RawMarketInfo[]>;
54
59
  fetchMarkets(): Promise<MarketWithTiers[]>;
55
60
  fetchMarketsTickers(params?: {
@@ -114,6 +119,7 @@ export declare class GmxApiSdk {
114
119
  prepareCancelOrder(request: PrepareCancelOrderRequest): Promise<PrepareOrderResponse>;
115
120
  prepareCollateral(request: PrepareCollateralRequest): Promise<PrepareOrderResponse>;
116
121
  fetchSubaccountStatus(request: SubaccountStatusRequest): Promise<SubaccountStatusResponse>;
122
+ refreshSubaccountState(account: string): Promise<SdkSubaccountStatus | undefined>;
117
123
  prepareSubaccountApproval(request: SubaccountApprovalPrepareRequest): Promise<SubaccountApprovalPrepareResponse>;
118
124
  signSubaccountApproval(prepared: SubaccountApprovalPrepareResponse, signer: IAbstractSigner): Promise<string>;
119
125
  /**
@@ -133,7 +139,7 @@ export declare class GmxApiSdk {
133
139
  */
134
140
  activateSubaccount(mainSigner: IAbstractSigner, options?: {
135
141
  expiresInSeconds?: number;
136
- maxAllowedCount?: number;
142
+ maxAllowedCount?: number | bigint;
137
143
  }): Promise<string>;
138
144
  clearSubaccount(): void;
139
145
  }
@@ -2104,6 +2104,21 @@ export declare const HASHED_MARKET_VALUES_KEYS: {
2104
2104
  shortInterestInTokensUsingLongToken: string;
2105
2105
  shortInterestInTokensUsingShortToken: string;
2106
2106
  };
2107
+ "0x470128853D74dab7423904a20eA5AA230e9e561B": {
2108
+ longPoolAmount: string;
2109
+ shortPoolAmount: string;
2110
+ positionImpactPoolAmount: string;
2111
+ swapImpactPoolAmountLong: string;
2112
+ swapImpactPoolAmountShort: string;
2113
+ longInterestUsingLongToken: string;
2114
+ longInterestUsingShortToken: string;
2115
+ shortInterestUsingLongToken: string;
2116
+ shortInterestUsingShortToken: string;
2117
+ longInterestInTokensUsingLongToken: string;
2118
+ longInterestInTokensUsingShortToken: string;
2119
+ shortInterestInTokensUsingLongToken: string;
2120
+ shortInterestInTokensUsingShortToken: string;
2121
+ };
2107
2122
  "0xE26E7b91143f367445f1c0a5dCf4f4aC8EaDcDb1": {
2108
2123
  longPoolAmount: string;
2109
2124
  shortPoolAmount: string;
@@ -11408,6 +11423,67 @@ export declare const HASHED_MARKET_CONFIG_KEYS: {
11408
11423
  virtualLongTokenId: string;
11409
11424
  virtualShortTokenId: string;
11410
11425
  };
11426
+ "0x470128853D74dab7423904a20eA5AA230e9e561B": {
11427
+ isDisabled: string;
11428
+ maxLongPoolAmount: string;
11429
+ maxShortPoolAmount: string;
11430
+ maxLongPoolUsdForDeposit: string;
11431
+ maxShortPoolUsdForDeposit: string;
11432
+ reserveFactorLong: string;
11433
+ reserveFactorShort: string;
11434
+ openInterestReserveFactorLong: string;
11435
+ openInterestReserveFactorShort: string;
11436
+ maxOpenInterestLong: string;
11437
+ maxOpenInterestShort: string;
11438
+ minPositionImpactPoolAmount: string;
11439
+ positionImpactPoolDistributionRate: string;
11440
+ borrowingFactorLong: string;
11441
+ borrowingFactorShort: string;
11442
+ borrowingExponentFactorLong: string;
11443
+ borrowingExponentFactorShort: string;
11444
+ fundingFactor: string;
11445
+ fundingExponentFactor: string;
11446
+ fundingIncreaseFactorPerSecond: string;
11447
+ fundingDecreaseFactorPerSecond: string;
11448
+ thresholdForStableFunding: string;
11449
+ thresholdForDecreaseFunding: string;
11450
+ minFundingFactorPerSecond: string;
11451
+ maxFundingFactorPerSecond: string;
11452
+ maxPnlFactorForTradersLong: string;
11453
+ maxPnlFactorForTradersShort: string;
11454
+ maxPnlFactorForDepositsLong: string;
11455
+ maxPnlFactorForDepositsShort: string;
11456
+ maxPnlFactorForWithdrawalsLong: string;
11457
+ maxPnlFactorForWithdrawalsShort: string;
11458
+ positionFeeFactorForBalanceWasImproved: string;
11459
+ positionFeeFactorForBalanceWasNotImproved: string;
11460
+ positionImpactFactorPositive: string;
11461
+ positionImpactFactorNegative: string;
11462
+ maxPositionImpactFactorPositive: string;
11463
+ maxPositionImpactFactorNegative: string;
11464
+ maxPositionImpactFactorForLiquidations: string;
11465
+ maxLendableImpactFactor: string;
11466
+ maxLendableImpactFactorForWithdrawals: string;
11467
+ maxLendableImpactUsd: string;
11468
+ lentPositionImpactPoolAmount: string;
11469
+ minCollateralFactor: string;
11470
+ minCollateralFactorForLiquidation: string;
11471
+ minCollateralFactorForOpenInterestLong: string;
11472
+ minCollateralFactorForOpenInterestShort: string;
11473
+ positionImpactExponentFactorPositive: string;
11474
+ positionImpactExponentFactorNegative: string;
11475
+ swapFeeFactorForBalanceWasImproved: string;
11476
+ swapFeeFactorForBalanceWasNotImproved: string;
11477
+ atomicSwapFeeFactor: string;
11478
+ swapImpactFactorPositive: string;
11479
+ swapImpactFactorNegative: string;
11480
+ swapImpactExponentFactor: string;
11481
+ withdrawalFeeFactorBalanceWasImproved: string;
11482
+ withdrawalFeeFactorBalanceWasNotImproved: string;
11483
+ virtualMarketId: string;
11484
+ virtualLongTokenId: string;
11485
+ virtualShortTokenId: string;
11486
+ };
11411
11487
  "0xE26E7b91143f367445f1c0a5dCf4f4aC8EaDcDb1": {
11412
11488
  isDisabled: string;
11413
11489
  maxLongPoolAmount: string;
@@ -15592,6 +15668,14 @@ export declare const HASHED_KINK_MODEL_MARKET_RATES_KEYS: {
15592
15668
  aboveOptimalUsageBorrowingFactorLong: string;
15593
15669
  aboveOptimalUsageBorrowingFactorShort: string;
15594
15670
  };
15671
+ "0x470128853D74dab7423904a20eA5AA230e9e561B": {
15672
+ optimalUsageFactorLong: string;
15673
+ optimalUsageFactorShort: string;
15674
+ baseBorrowingFactorLong: string;
15675
+ baseBorrowingFactorShort: string;
15676
+ aboveOptimalUsageBorrowingFactorLong: string;
15677
+ aboveOptimalUsageBorrowingFactorShort: string;
15678
+ };
15595
15679
  "0xE26E7b91143f367445f1c0a5dCf4f4aC8EaDcDb1": {
15596
15680
  optimalUsageFactorLong: string;
15597
15681
  optimalUsageFactorShort: string;
@@ -1,6 +1,7 @@
1
1
  import type { ERC20Address, NativeTokenSupportedAddress, Token } from "../utils/tokens/types";
2
2
  import { ContractsChainId } from "./chains";
3
3
  export declare const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5;
4
+ export declare const UI_MAX_LEVERAGE_BY_MARKET: Record<string, number>;
4
5
  export type MarketConfig = {
5
6
  marketTokenAddress: string;
6
7
  indexTokenAddress: string;
@@ -1,5 +1,5 @@
1
1
  import type { ContractsChainId } from "../../configs/chains";
2
- import type { MarketConfig as ConfigMarketConfig } from "../../configs/markets";
2
+ import { type MarketConfig as ConfigMarketConfig } from "../../configs/markets";
3
3
  import type { DayPriceCandle } from "../24h/types";
4
4
  import type { Token, TokenPrices, TokensData } from "../tokens/types";
5
5
  import type { ClaimableFundingData, ContractMarketPrices, Market, MarketConfig, MarketInfo, MarketsData, MarketsInfoData, MarketTicker, MarketValues, MarketWithTiers, RawMarketInfo, RawMarketsInfoData } from "./types";
@@ -42,8 +42,9 @@ export declare function getCappedPoolPnl(p: {
42
42
  poolPnl: bigint;
43
43
  isLong: boolean;
44
44
  }): bigint;
45
- export declare function getMaxLeverageByMinCollateralFactor(minCollateralFactor: bigint | undefined): number;
46
- export declare function getMaxAllowedLeverage({ minCollateralFactor, minCollateralFactorForLiquidation, positionFeeFactorForBalanceWasNotImproved, }: {
45
+ export declare function getMaxLeverageByMinCollateralFactor(minCollateralFactor: bigint | undefined, marketAddress?: string): number;
46
+ export declare function getMaxAllowedLeverage({ marketAddress, minCollateralFactor, minCollateralFactorForLiquidation, positionFeeFactorForBalanceWasNotImproved, }: {
47
+ marketAddress?: string;
47
48
  minCollateralFactor: bigint | undefined;
48
49
  minCollateralFactorForLiquidation: bigint | undefined;
49
50
  positionFeeFactorForBalanceWasNotImproved: bigint | undefined;
@@ -3,5 +3,6 @@ export { generateSubaccount, decryptSubaccountPrivateKey, createSubaccountSigner
3
3
  export { hashSubaccountApproval } from "./hashSubaccountApproval";
4
4
  export { getEmptySubaccountApproval } from "./getEmptySubaccountApproval";
5
5
  export { getSubaccountApprovalTypedData, type SubaccountApprovalTypedData } from "./getSubaccountApprovalTypedData";
6
+ export { isEmptySubaccountApproval, isSameSubaccountApproval, isSubaccountApprovalExpired, isSubaccountApprovalNonceExpired, isSubaccountApprovalSynced, isSubaccountStatusUsable, parseSubaccountStatus, shouldRefreshExplicitSubaccountApproval, toSignedSubaccountApproval, } from "./state";
6
7
  export { fetchSubaccountStatus, prepareSubaccountApproval, signSubaccountApproval } from "./api";
7
8
  export type { SubaccountStatusRequest, SubaccountStatusResponse, SubaccountApprovalPrepareRequest, SubaccountApprovalPrepareResponse, } from "./api";
@@ -0,0 +1,36 @@
1
+ import type { ContractsChainId } from "../../configs/chains";
2
+ import type { IHttp } from "../http/types";
3
+ import type { PrepareCancelOrderRequest, PrepareCollateralRequest, PrepareEditOrderRequest, PrepareOrderRequest, PrepareOrderResponse, SubmitOrderRequest, SubmitOrderResponse } from "../orderTransactions/api";
4
+ import type { IAbstractSigner } from "../signer";
5
+ import type { SdkSubaccountApproval, SdkSubaccountStatus, SubaccountState } from "./types";
6
+ export type SdkSubaccountClientContext = {
7
+ ctx: {
8
+ chainId: ContractsChainId;
9
+ api: IHttp;
10
+ };
11
+ owner: object;
12
+ preparedSubaccountApprovals: Map<string, SdkSubaccountApproval>;
13
+ getSubaccount: () => SubaccountState | undefined;
14
+ setSubaccount: (subaccount: SubaccountState | undefined) => void;
15
+ };
16
+ export type SubaccountPrepareRequest = PrepareOrderRequest | PrepareEditOrderRequest | PrepareCancelOrderRequest | PrepareCollateralRequest;
17
+ export type PrepareWithContext<TRequest extends SubaccountPrepareRequest> = (ctx: {
18
+ api: IHttp;
19
+ }, request: TRequest) => Promise<PrepareOrderResponse>;
20
+ export declare function hasActiveSdkSubaccount(client: SdkSubaccountClientContext): boolean;
21
+ export declare function getSdkSubaccountApprovalMessage(client: SdkSubaccountClientContext): SdkSubaccountApproval | undefined;
22
+ export declare function generateSdkSubaccount(client: SdkSubaccountClientContext, mainSigner: IAbstractSigner): Promise<string>;
23
+ export declare function reconcileSdkSubaccountApproval(subaccount: SubaccountState | undefined): void;
24
+ export declare function refreshSdkSubaccountState(client: SdkSubaccountClientContext, account: string): Promise<SdkSubaccountStatus | undefined>;
25
+ export declare function activateSdkSubaccount(client: SdkSubaccountClientContext, mainSigner: IAbstractSigner, options?: {
26
+ expiresInSeconds?: number;
27
+ maxAllowedCount?: number | bigint;
28
+ }, knownStatus?: SdkSubaccountStatus): Promise<string>;
29
+ export declare function getSdkSubaccountApprovalForOrder(client: SdkSubaccountClientContext, account: string, mainSigner?: IAbstractSigner, options?: {
30
+ forceRefresh?: boolean;
31
+ }): Promise<SdkSubaccountApproval | undefined>;
32
+ export declare function prepareWithSubaccount<TRequest extends SubaccountPrepareRequest>(client: SdkSubaccountClientContext, request: TRequest, prepareFn: PrepareWithContext<TRequest>, mainSigner?: IAbstractSigner): Promise<PrepareOrderResponse>;
33
+ export declare function signOrderWithSubaccount(client: SdkSubaccountClientContext, prepared: PrepareOrderResponse, signer: IAbstractSigner): Promise<string>;
34
+ export declare function submitOrderWithSubaccount(client: SdkSubaccountClientContext, request: SubmitOrderRequest): Promise<SubmitOrderResponse>;
35
+ export declare function executeExpressOrderWithSubaccount(client: SdkSubaccountClientContext, request: PrepareOrderRequest, signer: IAbstractSigner): Promise<SubmitOrderResponse>;
36
+ export declare function clearSdkSubaccount(client: SdkSubaccountClientContext): void;
@@ -0,0 +1,11 @@
1
+ import type { SubaccountApprovalPrepareResponse, SubaccountStatusResponse } from "./api";
2
+ import type { SdkSubaccountApproval, SdkSubaccountStatus, SignedSubaccountApproval, StoredSubaccountApproval } from "./types";
3
+ export declare function parseSubaccountStatus(status: SubaccountStatusResponse): SdkSubaccountStatus;
4
+ export declare function isSubaccountStatusUsable(status: SdkSubaccountStatus | undefined): boolean;
5
+ export declare function isEmptySubaccountApproval(approval: SdkSubaccountApproval): boolean;
6
+ export declare function isSameSubaccountApproval(a: SdkSubaccountApproval, b: SdkSubaccountApproval): boolean;
7
+ export declare function shouldRefreshExplicitSubaccountApproval(approval: SdkSubaccountApproval, status: SdkSubaccountStatus | undefined, pendingApproval: StoredSubaccountApproval | undefined): boolean;
8
+ export declare function isSubaccountApprovalNonceExpired(approval: SdkSubaccountApproval, status: SdkSubaccountStatus): boolean;
9
+ export declare function isSubaccountApprovalSynced(approval: SdkSubaccountApproval, status: SdkSubaccountStatus): boolean;
10
+ export declare function isSubaccountApprovalExpired(approval: SdkSubaccountApproval): boolean;
11
+ export declare function toSignedSubaccountApproval(prepared: SubaccountApprovalPrepareResponse, signature: string): SignedSubaccountApproval;
@@ -31,6 +31,24 @@ export type SignedSubaccountApproval = SubaccountApproval & {
31
31
  signatureChainId: AnyChainId;
32
32
  subaccountRouterAddress: string;
33
33
  };
34
+ export type EmptySubaccountApproval = SubaccountApproval & {
35
+ signature: string;
36
+ };
37
+ export type SdkSubaccountApproval = SignedSubaccountApproval | EmptySubaccountApproval;
38
+ export type SdkSubaccountStatus = SubaccountOnchainData & {
39
+ remainingActions: bigint;
40
+ };
41
+ export type StoredSubaccountApproval = {
42
+ message: SignedSubaccountApproval;
43
+ submittedRequestId?: string;
44
+ };
45
+ export type SubaccountState = {
46
+ account?: string;
47
+ address: string;
48
+ approval?: StoredSubaccountApproval;
49
+ onchainData?: SdkSubaccountStatus;
50
+ lastStatusFetchedAt?: number;
51
+ };
34
52
  export type Subaccount = {
35
53
  address: string;
36
54
  chainId: ContractsChainId;
@@ -11,7 +11,7 @@ export type TokenAddressTypesMap = {
11
11
  export type ContractPrice = bigint & {
12
12
  __brand: "contractPrice";
13
13
  };
14
- export type TokenCategory = "meme" | "layer1" | "layer2" | "defi" | "ai" | "tradfi" | "commodities" | "stocks" | "indices" | "fx";
14
+ export type TokenCategory = "meme" | "layer1" | "layer2" | "defi" | "ai" | "tradfi" | "pre-ipo" | "commodities" | "stocks" | "indices" | "fx";
15
15
  export type Token = {
16
16
  name: string;
17
17
  symbol: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmx-io/sdk",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",