@lifi/perps-sdk 0.0.0-preview-697b8c5 → 0.0.0-preview-1edeff0

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 (158) hide show
  1. package/dist/cjs/client/PerpsClient.d.ts +3 -1
  2. package/dist/cjs/client/PerpsClient.d.ts.map +1 -1
  3. package/dist/cjs/client/PerpsClient.js +4 -0
  4. package/dist/cjs/client/PerpsClient.js.map +1 -1
  5. package/dist/cjs/index.d.ts +10 -5
  6. package/dist/cjs/index.d.ts.map +1 -1
  7. package/dist/cjs/index.js +18 -6
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/registry/marketRegistry.d.ts +3 -0
  10. package/dist/cjs/registry/marketRegistry.d.ts.map +1 -1
  11. package/dist/cjs/registry/marketRegistry.js +16 -1
  12. package/dist/cjs/registry/marketRegistry.js.map +1 -1
  13. package/dist/cjs/registry/referenceDataRegistry.d.ts.map +1 -1
  14. package/dist/cjs/registry/referenceDataRegistry.js +0 -1
  15. package/dist/cjs/registry/referenceDataRegistry.js.map +1 -1
  16. package/dist/cjs/services/getGasRecommendation.d.ts +9 -0
  17. package/dist/cjs/services/getGasRecommendation.d.ts.map +1 -0
  18. package/dist/cjs/services/getGasRecommendation.js +10 -0
  19. package/dist/cjs/services/getGasRecommendation.js.map +1 -0
  20. package/dist/cjs/services/getMarket.d.ts.map +1 -1
  21. package/dist/cjs/services/getMarket.js +2 -1
  22. package/dist/cjs/services/getMarket.js.map +1 -1
  23. package/dist/cjs/services/getMarkets.d.ts.map +1 -1
  24. package/dist/cjs/services/getMarkets.js +3 -1
  25. package/dist/cjs/services/getMarkets.js.map +1 -1
  26. package/dist/cjs/types/api.d.ts +4 -0
  27. package/dist/cjs/types/api.d.ts.map +1 -1
  28. package/dist/cjs/types/deposit.d.ts +25 -0
  29. package/dist/cjs/types/deposit.d.ts.map +1 -0
  30. package/dist/cjs/types/deposit.js +3 -0
  31. package/dist/cjs/types/deposit.js.map +1 -0
  32. package/dist/cjs/types/provider.d.ts +5 -0
  33. package/dist/cjs/types/provider.d.ts.map +1 -1
  34. package/dist/cjs/utils/accountSummary.d.ts.map +1 -1
  35. package/dist/cjs/utils/accountSummary.js +10 -4
  36. package/dist/cjs/utils/accountSummary.js.map +1 -1
  37. package/dist/cjs/utils/depositAssets.d.ts +8 -0
  38. package/dist/cjs/utils/depositAssets.d.ts.map +1 -0
  39. package/dist/cjs/utils/depositAssets.js +36 -0
  40. package/dist/cjs/utils/depositAssets.js.map +1 -0
  41. package/dist/cjs/utils/scaleToInteger.d.ts +3 -0
  42. package/dist/cjs/utils/scaleToInteger.d.ts.map +1 -0
  43. package/dist/cjs/utils/scaleToInteger.js +30 -0
  44. package/dist/cjs/utils/scaleToInteger.js.map +1 -0
  45. package/dist/cjs/utils/setupActions.d.ts +3 -0
  46. package/dist/cjs/utils/setupActions.d.ts.map +1 -0
  47. package/dist/cjs/utils/setupActions.js +8 -0
  48. package/dist/cjs/utils/setupActions.js.map +1 -0
  49. package/dist/cjs/version.d.ts +1 -1
  50. package/dist/cjs/version.js +1 -1
  51. package/dist/esm/client/PerpsClient.d.ts +13 -1
  52. package/dist/esm/client/PerpsClient.d.ts.map +1 -1
  53. package/dist/esm/client/PerpsClient.js +14 -0
  54. package/dist/esm/client/PerpsClient.js.map +1 -1
  55. package/dist/esm/index.d.ts +11 -6
  56. package/dist/esm/index.d.ts.map +1 -1
  57. package/dist/esm/index.js +6 -3
  58. package/dist/esm/index.js.map +1 -1
  59. package/dist/esm/registry/marketRegistry.d.ts +15 -2
  60. package/dist/esm/registry/marketRegistry.d.ts.map +1 -1
  61. package/dist/esm/registry/marketRegistry.js +26 -2
  62. package/dist/esm/registry/marketRegistry.js.map +1 -1
  63. package/dist/esm/registry/referenceDataRegistry.d.ts +2 -1
  64. package/dist/esm/registry/referenceDataRegistry.d.ts.map +1 -1
  65. package/dist/esm/registry/referenceDataRegistry.js +2 -2
  66. package/dist/esm/registry/referenceDataRegistry.js.map +1 -1
  67. package/dist/esm/services/getGasRecommendation.d.ts +31 -0
  68. package/dist/esm/services/getGasRecommendation.d.ts.map +1 -0
  69. package/dist/esm/services/getGasRecommendation.js +22 -0
  70. package/dist/esm/services/getGasRecommendation.js.map +1 -0
  71. package/dist/esm/services/getMarket.d.ts +5 -4
  72. package/dist/esm/services/getMarket.d.ts.map +1 -1
  73. package/dist/esm/services/getMarket.js +7 -5
  74. package/dist/esm/services/getMarket.js.map +1 -1
  75. package/dist/esm/services/getMarkets.d.ts +6 -3
  76. package/dist/esm/services/getMarkets.d.ts.map +1 -1
  77. package/dist/esm/services/getMarkets.js +9 -4
  78. package/dist/esm/services/getMarkets.js.map +1 -1
  79. package/dist/esm/types/api.d.ts +9 -0
  80. package/dist/esm/types/api.d.ts.map +1 -1
  81. package/dist/esm/types/deposit.d.ts +68 -0
  82. package/dist/esm/types/deposit.d.ts.map +1 -0
  83. package/dist/esm/types/deposit.js +2 -0
  84. package/dist/esm/types/deposit.js.map +1 -0
  85. package/dist/esm/types/provider.d.ts +19 -0
  86. package/dist/esm/types/provider.d.ts.map +1 -1
  87. package/dist/esm/utils/accountSummary.d.ts.map +1 -1
  88. package/dist/esm/utils/accountSummary.js +13 -4
  89. package/dist/esm/utils/accountSummary.js.map +1 -1
  90. package/dist/esm/utils/depositAssets.d.ts +46 -0
  91. package/dist/esm/utils/depositAssets.d.ts.map +1 -0
  92. package/dist/esm/utils/depositAssets.js +71 -0
  93. package/dist/esm/utils/depositAssets.js.map +1 -0
  94. package/dist/esm/utils/scaleToInteger.d.ts +22 -0
  95. package/dist/esm/utils/scaleToInteger.d.ts.map +1 -0
  96. package/dist/esm/utils/scaleToInteger.js +34 -0
  97. package/dist/esm/utils/scaleToInteger.js.map +1 -0
  98. package/dist/esm/utils/setupActions.d.ts +17 -0
  99. package/dist/esm/utils/setupActions.d.ts.map +1 -0
  100. package/dist/esm/utils/setupActions.js +19 -0
  101. package/dist/esm/utils/setupActions.js.map +1 -0
  102. package/dist/esm/version.d.ts +1 -1
  103. package/dist/esm/version.js +1 -1
  104. package/dist/types/client/PerpsClient.d.ts +13 -1
  105. package/dist/types/client/PerpsClient.d.ts.map +1 -1
  106. package/dist/types/index.d.ts +11 -6
  107. package/dist/types/index.d.ts.map +1 -1
  108. package/dist/types/registry/marketRegistry.d.ts +15 -2
  109. package/dist/types/registry/marketRegistry.d.ts.map +1 -1
  110. package/dist/types/registry/referenceDataRegistry.d.ts +2 -1
  111. package/dist/types/registry/referenceDataRegistry.d.ts.map +1 -1
  112. package/dist/types/services/getGasRecommendation.d.ts +31 -0
  113. package/dist/types/services/getGasRecommendation.d.ts.map +1 -0
  114. package/dist/types/services/getMarket.d.ts +5 -4
  115. package/dist/types/services/getMarket.d.ts.map +1 -1
  116. package/dist/types/services/getMarkets.d.ts +6 -3
  117. package/dist/types/services/getMarkets.d.ts.map +1 -1
  118. package/dist/types/types/api.d.ts +9 -0
  119. package/dist/types/types/api.d.ts.map +1 -1
  120. package/dist/types/types/deposit.d.ts +68 -0
  121. package/dist/types/types/deposit.d.ts.map +1 -0
  122. package/dist/types/types/provider.d.ts +19 -0
  123. package/dist/types/types/provider.d.ts.map +1 -1
  124. package/dist/types/utils/accountSummary.d.ts.map +1 -1
  125. package/dist/types/utils/depositAssets.d.ts +46 -0
  126. package/dist/types/utils/depositAssets.d.ts.map +1 -0
  127. package/dist/types/utils/scaleToInteger.d.ts +22 -0
  128. package/dist/types/utils/scaleToInteger.d.ts.map +1 -0
  129. package/dist/types/utils/setupActions.d.ts +17 -0
  130. package/dist/types/utils/setupActions.d.ts.map +1 -0
  131. package/dist/types/version.d.ts +1 -1
  132. package/package.json +4 -3
  133. package/src/client/PerpsClient.ts +19 -0
  134. package/src/index.ts +26 -5
  135. package/src/registry/marketRegistry.ts +33 -2
  136. package/src/registry/referenceDataRegistry.ts +2 -2
  137. package/src/services/getGasRecommendation.ts +45 -0
  138. package/src/services/getMarket.ts +7 -5
  139. package/src/services/getMarkets.ts +14 -4
  140. package/src/types/api.ts +10 -0
  141. package/src/types/deposit.ts +75 -0
  142. package/src/types/provider.ts +24 -0
  143. package/src/utils/accountSummary.ts +18 -5
  144. package/src/utils/depositAssets.ts +77 -0
  145. package/src/utils/scaleToInteger.ts +56 -0
  146. package/src/utils/setupActions.ts +24 -0
  147. package/src/version.ts +1 -1
  148. package/dist/cjs/utils/depositChain.d.ts +0 -6
  149. package/dist/cjs/utils/depositChain.d.ts.map +0 -1
  150. package/dist/cjs/utils/depositChain.js +0 -13
  151. package/dist/cjs/utils/depositChain.js.map +0 -1
  152. package/dist/esm/utils/depositChain.d.ts +0 -27
  153. package/dist/esm/utils/depositChain.d.ts.map +0 -1
  154. package/dist/esm/utils/depositChain.js +0 -23
  155. package/dist/esm/utils/depositChain.js.map +0 -1
  156. package/dist/types/utils/depositChain.d.ts +0 -27
  157. package/dist/types/utils/depositChain.d.ts.map +0 -1
  158. package/src/utils/depositChain.ts +0 -38
@@ -0,0 +1,77 @@
1
+ import { ChainId } from '@lifi/types'
2
+ import { zeroAddress } from 'viem'
3
+ import type { DeclaredDepositAsset } from '../types/deposit.js'
4
+
5
+ /**
6
+ * USDC on Ethereum mainnet — the collateral leg of Lighter's first-deposit
7
+ * pipeline, and the token Ondo's provisioned deposit address is funded in.
8
+ *
9
+ * @public
10
+ */
11
+ export const ETHEREUM_USDC: DeclaredDepositAsset = {
12
+ chainId: ChainId.ETH,
13
+ address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
14
+ decimals: 6,
15
+ }
16
+
17
+ /**
18
+ * Ether on Ethereum mainnet, to broadcast the first-deposit pipeline's legs
19
+ * with.
20
+ *
21
+ * @public
22
+ */
23
+ export const ETHEREUM_NATIVE_GAS: DeclaredDepositAsset = {
24
+ chainId: ChainId.ETH,
25
+ address: zeroAddress,
26
+ decimals: 18,
27
+ }
28
+
29
+ /**
30
+ * USDC on the Hyperliquid venue chain: the 6-decimal perps contract. The same
31
+ * chain also lists an 8-decimal spot `USDC` at
32
+ * `0x6d1e7cde53bA9467B783Cb7c530CE05400000000`, so a deposit destination
33
+ * resolved by symbol lands on the wrong token and the wrong scale.
34
+ *
35
+ * @public
36
+ */
37
+ export const HYPERLIQUID_USDC: DeclaredDepositAsset = {
38
+ chainId: ChainId.HPL,
39
+ address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
40
+ decimals: 6,
41
+ }
42
+
43
+ /**
44
+ * USDC on the Lighter venue chain. The venue chain reuses the mainnet USDC
45
+ * address, so `chainId` is what distinguishes it from {@link ETHEREUM_USDC}.
46
+ *
47
+ * @public
48
+ */
49
+ export const LIGHTER_USDC: DeclaredDepositAsset = {
50
+ chainId: ChainId.LTR,
51
+ address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
52
+ decimals: 6,
53
+ }
54
+
55
+ /**
56
+ * USDG on Robinhood Chain — the collateral the Lighter Robinhood instance is
57
+ * funded in.
58
+ *
59
+ * @public
60
+ */
61
+ export const ROBINHOOD_USDG: DeclaredDepositAsset = {
62
+ chainId: ChainId.OUT,
63
+ address: '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168',
64
+ decimals: 6,
65
+ }
66
+
67
+ /**
68
+ * Ether on Robinhood Chain, to broadcast the Robinhood first-deposit pipeline's
69
+ * legs with.
70
+ *
71
+ * @public
72
+ */
73
+ export const ROBINHOOD_NATIVE_GAS: DeclaredDepositAsset = {
74
+ chainId: ChainId.OUT,
75
+ address: zeroAddress,
76
+ decimals: 18,
77
+ }
@@ -0,0 +1,56 @@
1
+ import { PerpsErrorCode } from '@lifi/perps-types'
2
+ import Big from 'big.js'
3
+ import { PerpsError } from '../errors/PerpsError.js'
4
+
5
+ /**
6
+ * Off-grid resolution for {@link scaleToInteger}:
7
+ * - `truncate` — toward zero, for sizes and collateral amounts. The wire
8
+ * value never exceeds the caller's intent.
9
+ * - `round` — half away from zero, for prices, which snap to the nearest
10
+ * tick.
11
+ * @public
12
+ */
13
+ export type ScaleToIntegerPolicy = 'truncate' | 'round'
14
+
15
+ /**
16
+ * Scale a human-readable decimal string to a scaled integer in exact decimal
17
+ * arithmetic — an on-grid input maps to its exact scaled integer with no
18
+ * binary float artifacts (`'0.29'` at 2 decimals is 29, never 28).
19
+ * Off-grid input resolves per `policy`; there is no silent default.
20
+ *
21
+ * @throws {PerpsError} `ValidationError` when `value` is not a decimal
22
+ * numeric string, `decimals` is not a non-negative integer, or the scaled
23
+ * result's magnitude exceeds `Number.MAX_SAFE_INTEGER`.
24
+ * @public
25
+ */
26
+ export const scaleToInteger = (
27
+ value: string,
28
+ decimals: number,
29
+ policy: ScaleToIntegerPolicy
30
+ ): number => {
31
+ if (!Number.isInteger(decimals) || decimals < 0) {
32
+ throw new PerpsError(
33
+ PerpsErrorCode.ValidationError,
34
+ `Invalid decimals for integer scaling: ${decimals}`
35
+ )
36
+ }
37
+ let parsed: Big
38
+ try {
39
+ parsed = new Big(value)
40
+ } catch {
41
+ throw new PerpsError(
42
+ PerpsErrorCode.ValidationError,
43
+ `Invalid decimal string for integer scaling: '${value}'`
44
+ )
45
+ }
46
+ const scaled = parsed
47
+ .times(new Big(10).pow(decimals))
48
+ .round(0, policy === 'truncate' ? Big.roundDown : Big.roundHalfUp)
49
+ if (scaled.abs().gt(Number.MAX_SAFE_INTEGER)) {
50
+ throw new PerpsError(
51
+ PerpsErrorCode.ValidationError,
52
+ `Scaled value ${scaled.toFixed()} exceeds Number.MAX_SAFE_INTEGER and cannot be encoded exactly.`
53
+ )
54
+ }
55
+ return scaled.toNumber()
56
+ }
@@ -0,0 +1,24 @@
1
+ import type { ProviderAction } from '@lifi/perps-types'
2
+ import { PerpsSigner } from '@lifi/perps-types'
3
+
4
+ /**
5
+ * Select the `Provider.setup` descriptors a user is responsible for satisfying:
6
+ * those whose `signers` include {@link PerpsSigner.USER}. Descriptors the SDK
7
+ * signs on its own (no `USER` signer) are held back — `checkSetup` completes
8
+ * them inline, so surfacing them would render inert cards the user can't act on.
9
+ *
10
+ * Membership is a property of the descriptor's `signers` alone, independent of
11
+ * any account: use this to build the onboarding list, then layer each entry's
12
+ * satisfied/unsatisfied state on top from a live `checkSetup` so the tick never
13
+ * goes stale.
14
+ *
15
+ * @param setup The provider's `setup` descriptors, in their declared order.
16
+ * @public
17
+ */
18
+ export function selectUserSetupActions(
19
+ setup: ProviderAction[]
20
+ ): ProviderAction[] {
21
+ return setup.filter((descriptor) =>
22
+ descriptor.signers.includes(PerpsSigner.USER)
23
+ )
24
+ }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/perps-sdk'
2
- export const version = '0.0.0-preview-697b8c5'
2
+ export const version = '0.0.0-preview-1edeff0'
@@ -1,6 +0,0 @@
1
- import type { AccountConfig } from '@lifi/perps-types';
2
- import { ChainId } from '@lifi/types';
3
- export type DepositProviderKey = AccountConfig['provider'];
4
- export declare const LIFI_DEPOSIT_CHAIN_BY_PROVIDER: Partial<Record<DepositProviderKey, ChainId>>;
5
- export declare function lifiDepositChainForProvider(providerKey: string): ChainId | undefined;
6
- //# sourceMappingURL=depositChain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"depositChain.d.ts","sourceRoot":"","sources":["../../../src/utils/depositChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AASrC,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;AAS1D,eAAO,MAAM,8BAA8B,EAAE,OAAO,CAClD,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAIpC,CAAA;AASD,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,GAAG,SAAS,CAErB"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LIFI_DEPOSIT_CHAIN_BY_PROVIDER = void 0;
4
- exports.lifiDepositChainForProvider = lifiDepositChainForProvider;
5
- const types_1 = require("@lifi/types");
6
- exports.LIFI_DEPOSIT_CHAIN_BY_PROVIDER = {
7
- hyperliquid: types_1.ChainId.HPL,
8
- lighter: types_1.ChainId.LTR,
9
- };
10
- function lifiDepositChainForProvider(providerKey) {
11
- return exports.LIFI_DEPOSIT_CHAIN_BY_PROVIDER[providerKey];
12
- }
13
- //# sourceMappingURL=depositChain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"depositChain.js","sourceRoot":"","sources":["../../../src/utils/depositChain.ts"],"names":[],"mappings":";;;AAiCA,kEAIC;AApCD,uCAAqC;AAkBxB,QAAA,8BAA8B,GAEvC;IACF,WAAW,EAAE,eAAO,CAAC,GAAG;IACxB,OAAO,EAAE,eAAO,CAAC,GAAG;CACrB,CAAA;AASD,SAAgB,2BAA2B,CACzC,WAAmB;IAEnB,OAAO,sCAA8B,CAAC,WAAiC,CAAC,CAAA;AAC1E,CAAC"}
@@ -1,27 +0,0 @@
1
- import type { AccountConfig } from '@lifi/perps-types';
2
- import { ChainId } from '@lifi/types';
3
- /**
4
- * Perps provider keys that may declare a LI.FI deposit-target chain. Absent
5
- * from the map means the provider is not funded via a LI.FI swap (e.g. ondo's
6
- * custodial provisioned-address deposits).
7
- *
8
- * @public
9
- */
10
- export type DepositProviderKey = AccountConfig['provider'];
11
- /**
12
- * Declared single source of truth: perps provider key → the LI.FI chain a
13
- * client opens the swap widget against to fund that provider. Values come from
14
- * the `@lifi/types` `ChainId` enum; never hardcode the numeric ids.
15
- *
16
- * @public
17
- */
18
- export declare const LIFI_DEPOSIT_CHAIN_BY_PROVIDER: Partial<Record<DepositProviderKey, ChainId>>;
19
- /**
20
- * Resolve the LI.FI deposit-target chain for a perps provider key.
21
- *
22
- * @returns The `@lifi/types` `ChainId`, or `undefined` for a provider key with
23
- * no declared deposit chain (the `/providers` wire key is an open `string`).
24
- * @public
25
- */
26
- export declare function lifiDepositChainForProvider(providerKey: string): ChainId | undefined;
27
- //# sourceMappingURL=depositChain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"depositChain.d.ts","sourceRoot":"","sources":["../../../src/utils/depositChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,OAAO,CAClD,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAIpC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,GAAG,SAAS,CAErB"}
@@ -1,23 +0,0 @@
1
- import { ChainId } from '@lifi/types';
2
- /**
3
- * Declared single source of truth: perps provider key → the LI.FI chain a
4
- * client opens the swap widget against to fund that provider. Values come from
5
- * the `@lifi/types` `ChainId` enum; never hardcode the numeric ids.
6
- *
7
- * @public
8
- */
9
- export const LIFI_DEPOSIT_CHAIN_BY_PROVIDER = {
10
- hyperliquid: ChainId.HPL,
11
- lighter: ChainId.LTR,
12
- };
13
- /**
14
- * Resolve the LI.FI deposit-target chain for a perps provider key.
15
- *
16
- * @returns The `@lifi/types` `ChainId`, or `undefined` for a provider key with
17
- * no declared deposit chain (the `/providers` wire key is an open `string`).
18
- * @public
19
- */
20
- export function lifiDepositChainForProvider(providerKey) {
21
- return LIFI_DEPOSIT_CHAIN_BY_PROVIDER[providerKey];
22
- }
23
- //# sourceMappingURL=depositChain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"depositChain.js","sourceRoot":"","sources":["../../../src/utils/depositChain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAWrC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAEvC;IACF,WAAW,EAAE,OAAO,CAAC,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC,GAAG;CACrB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,WAAmB;IAEnB,OAAO,8BAA8B,CAAC,WAAiC,CAAC,CAAA;AAC1E,CAAC"}
@@ -1,27 +0,0 @@
1
- import type { AccountConfig } from '@lifi/perps-types';
2
- import { ChainId } from '@lifi/types';
3
- /**
4
- * Perps provider keys that may declare a LI.FI deposit-target chain. Absent
5
- * from the map means the provider is not funded via a LI.FI swap (e.g. ondo's
6
- * custodial provisioned-address deposits).
7
- *
8
- * @public
9
- */
10
- export type DepositProviderKey = AccountConfig['provider'];
11
- /**
12
- * Declared single source of truth: perps provider key → the LI.FI chain a
13
- * client opens the swap widget against to fund that provider. Values come from
14
- * the `@lifi/types` `ChainId` enum; never hardcode the numeric ids.
15
- *
16
- * @public
17
- */
18
- export declare const LIFI_DEPOSIT_CHAIN_BY_PROVIDER: Partial<Record<DepositProviderKey, ChainId>>;
19
- /**
20
- * Resolve the LI.FI deposit-target chain for a perps provider key.
21
- *
22
- * @returns The `@lifi/types` `ChainId`, or `undefined` for a provider key with
23
- * no declared deposit chain (the `/providers` wire key is an open `string`).
24
- * @public
25
- */
26
- export declare function lifiDepositChainForProvider(providerKey: string): ChainId | undefined;
27
- //# sourceMappingURL=depositChain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"depositChain.d.ts","sourceRoot":"","sources":["../../../src/utils/depositChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,OAAO,CAClD,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAIpC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,GAAG,SAAS,CAErB"}
@@ -1,38 +0,0 @@
1
- import type { AccountConfig } from '@lifi/perps-types'
2
- import { ChainId } from '@lifi/types'
3
-
4
- /**
5
- * Perps provider keys that may declare a LI.FI deposit-target chain. Absent
6
- * from the map means the provider is not funded via a LI.FI swap (e.g. ondo's
7
- * custodial provisioned-address deposits).
8
- *
9
- * @public
10
- */
11
- export type DepositProviderKey = AccountConfig['provider']
12
-
13
- /**
14
- * Declared single source of truth: perps provider key → the LI.FI chain a
15
- * client opens the swap widget against to fund that provider. Values come from
16
- * the `@lifi/types` `ChainId` enum; never hardcode the numeric ids.
17
- *
18
- * @public
19
- */
20
- export const LIFI_DEPOSIT_CHAIN_BY_PROVIDER: Partial<
21
- Record<DepositProviderKey, ChainId>
22
- > = {
23
- hyperliquid: ChainId.HPL,
24
- lighter: ChainId.LTR,
25
- }
26
-
27
- /**
28
- * Resolve the LI.FI deposit-target chain for a perps provider key.
29
- *
30
- * @returns The `@lifi/types` `ChainId`, or `undefined` for a provider key with
31
- * no declared deposit chain (the `/providers` wire key is an open `string`).
32
- * @public
33
- */
34
- export function lifiDepositChainForProvider(
35
- providerKey: string
36
- ): ChainId | undefined {
37
- return LIFI_DEPOSIT_CHAIN_BY_PROVIDER[providerKey as DepositProviderKey]
38
- }