@lifi/perps-sdk 0.0.0-preview-142c251 → 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.
- package/README.md +42 -2
- package/dist/cjs/client/PerpsClient.d.ts +10 -5
- package/dist/cjs/client/PerpsClient.d.ts.map +1 -1
- package/dist/cjs/client/PerpsClient.js +89 -55
- package/dist/cjs/client/PerpsClient.js.map +1 -1
- package/dist/cjs/index.d.ts +13 -8
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +20 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/registry/marketRegistry.d.ts +3 -0
- package/dist/cjs/registry/marketRegistry.d.ts.map +1 -1
- package/dist/cjs/registry/marketRegistry.js +16 -1
- package/dist/cjs/registry/marketRegistry.js.map +1 -1
- package/dist/cjs/registry/referenceDataRegistry.d.ts.map +1 -1
- package/dist/cjs/registry/referenceDataRegistry.js +0 -1
- package/dist/cjs/registry/referenceDataRegistry.js.map +1 -1
- package/dist/cjs/services/getGasRecommendation.d.ts +9 -0
- package/dist/cjs/services/getGasRecommendation.d.ts.map +1 -0
- package/dist/cjs/services/getGasRecommendation.js +10 -0
- package/dist/cjs/services/getGasRecommendation.js.map +1 -0
- package/dist/cjs/services/getMarket.d.ts.map +1 -1
- package/dist/cjs/services/getMarket.js +2 -1
- package/dist/cjs/services/getMarket.js.map +1 -1
- package/dist/cjs/services/getMarkets.d.ts.map +1 -1
- package/dist/cjs/services/getMarkets.js +3 -1
- package/dist/cjs/services/getMarkets.js.map +1 -1
- package/dist/cjs/types/api.d.ts +4 -0
- package/dist/cjs/types/api.d.ts.map +1 -1
- package/dist/cjs/types/config.d.ts.map +1 -1
- package/dist/cjs/types/deposit.d.ts +25 -0
- package/dist/cjs/types/deposit.d.ts.map +1 -0
- package/dist/cjs/types/deposit.js +3 -0
- package/dist/cjs/types/deposit.js.map +1 -0
- package/dist/cjs/types/provider.d.ts +16 -5
- package/dist/cjs/types/provider.d.ts.map +1 -1
- package/dist/cjs/utils/accountSummary.d.ts.map +1 -1
- package/dist/cjs/utils/accountSummary.js +10 -4
- package/dist/cjs/utils/accountSummary.js.map +1 -1
- package/dist/cjs/utils/depositAssets.d.ts +8 -0
- package/dist/cjs/utils/depositAssets.d.ts.map +1 -0
- package/dist/cjs/utils/depositAssets.js +36 -0
- package/dist/cjs/utils/depositAssets.js.map +1 -0
- package/dist/cjs/utils/explorer.d.ts +1 -0
- package/dist/cjs/utils/explorer.d.ts.map +1 -1
- package/dist/cjs/utils/explorer.js +7 -3
- package/dist/cjs/utils/explorer.js.map +1 -1
- package/dist/cjs/utils/format.d.ts +3 -0
- package/dist/cjs/utils/format.d.ts.map +1 -1
- package/dist/cjs/utils/format.js +31 -24
- package/dist/cjs/utils/format.js.map +1 -1
- package/dist/cjs/utils/scaleToInteger.d.ts +3 -0
- package/dist/cjs/utils/scaleToInteger.d.ts.map +1 -0
- package/dist/cjs/utils/scaleToInteger.js +30 -0
- package/dist/cjs/utils/scaleToInteger.js.map +1 -0
- package/dist/cjs/utils/setupActions.d.ts +3 -0
- package/dist/cjs/utils/setupActions.d.ts.map +1 -0
- package/dist/cjs/utils/setupActions.js +8 -0
- package/dist/cjs/utils/setupActions.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/PerpsClient.d.ts +41 -14
- package/dist/esm/client/PerpsClient.d.ts.map +1 -1
- package/dist/esm/client/PerpsClient.js +128 -73
- package/dist/esm/client/PerpsClient.js.map +1 -1
- package/dist/esm/index.d.ts +14 -9
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/registry/marketRegistry.d.ts +15 -2
- package/dist/esm/registry/marketRegistry.d.ts.map +1 -1
- package/dist/esm/registry/marketRegistry.js +26 -2
- package/dist/esm/registry/marketRegistry.js.map +1 -1
- package/dist/esm/registry/referenceDataRegistry.d.ts +2 -1
- package/dist/esm/registry/referenceDataRegistry.d.ts.map +1 -1
- package/dist/esm/registry/referenceDataRegistry.js +2 -2
- package/dist/esm/registry/referenceDataRegistry.js.map +1 -1
- package/dist/esm/services/getGasRecommendation.d.ts +31 -0
- package/dist/esm/services/getGasRecommendation.d.ts.map +1 -0
- package/dist/esm/services/getGasRecommendation.js +22 -0
- package/dist/esm/services/getGasRecommendation.js.map +1 -0
- package/dist/esm/services/getMarket.d.ts +5 -4
- package/dist/esm/services/getMarket.d.ts.map +1 -1
- package/dist/esm/services/getMarket.js +7 -5
- package/dist/esm/services/getMarket.js.map +1 -1
- package/dist/esm/services/getMarkets.d.ts +6 -3
- package/dist/esm/services/getMarkets.d.ts.map +1 -1
- package/dist/esm/services/getMarkets.js +9 -4
- package/dist/esm/services/getMarkets.js.map +1 -1
- package/dist/esm/types/api.d.ts +9 -0
- package/dist/esm/types/api.d.ts.map +1 -1
- package/dist/esm/types/config.d.ts +4 -1
- package/dist/esm/types/config.d.ts.map +1 -1
- package/dist/esm/types/deposit.d.ts +68 -0
- package/dist/esm/types/deposit.d.ts.map +1 -0
- package/dist/esm/types/deposit.js +2 -0
- package/dist/esm/types/deposit.js.map +1 -0
- package/dist/esm/types/provider.d.ts +53 -17
- package/dist/esm/types/provider.d.ts.map +1 -1
- package/dist/esm/utils/accountSummary.d.ts.map +1 -1
- package/dist/esm/utils/accountSummary.js +13 -4
- package/dist/esm/utils/accountSummary.js.map +1 -1
- package/dist/esm/utils/depositAssets.d.ts +46 -0
- package/dist/esm/utils/depositAssets.d.ts.map +1 -0
- package/dist/esm/utils/depositAssets.js +71 -0
- package/dist/esm/utils/depositAssets.js.map +1 -0
- package/dist/esm/utils/explorer.d.ts +10 -0
- package/dist/esm/utils/explorer.d.ts.map +1 -1
- package/dist/esm/utils/explorer.js +16 -4
- package/dist/esm/utils/explorer.js.map +1 -1
- package/dist/esm/utils/format.d.ts +22 -0
- package/dist/esm/utils/format.d.ts.map +1 -1
- package/dist/esm/utils/format.js +57 -27
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/scaleToInteger.d.ts +22 -0
- package/dist/esm/utils/scaleToInteger.d.ts.map +1 -0
- package/dist/esm/utils/scaleToInteger.js +34 -0
- package/dist/esm/utils/scaleToInteger.js.map +1 -0
- package/dist/esm/utils/setupActions.d.ts +17 -0
- package/dist/esm/utils/setupActions.d.ts.map +1 -0
- package/dist/esm/utils/setupActions.js +19 -0
- package/dist/esm/utils/setupActions.js.map +1 -0
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/client/PerpsClient.d.ts +41 -14
- package/dist/types/client/PerpsClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +14 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/registry/marketRegistry.d.ts +15 -2
- package/dist/types/registry/marketRegistry.d.ts.map +1 -1
- package/dist/types/registry/referenceDataRegistry.d.ts +2 -1
- package/dist/types/registry/referenceDataRegistry.d.ts.map +1 -1
- package/dist/types/services/getGasRecommendation.d.ts +31 -0
- package/dist/types/services/getGasRecommendation.d.ts.map +1 -0
- package/dist/types/services/getMarket.d.ts +5 -4
- package/dist/types/services/getMarket.d.ts.map +1 -1
- package/dist/types/services/getMarkets.d.ts +6 -3
- package/dist/types/services/getMarkets.d.ts.map +1 -1
- package/dist/types/types/api.d.ts +9 -0
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +4 -1
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/deposit.d.ts +68 -0
- package/dist/types/types/deposit.d.ts.map +1 -0
- package/dist/types/types/provider.d.ts +53 -17
- package/dist/types/types/provider.d.ts.map +1 -1
- package/dist/types/utils/accountSummary.d.ts.map +1 -1
- package/dist/types/utils/depositAssets.d.ts +46 -0
- package/dist/types/utils/depositAssets.d.ts.map +1 -0
- package/dist/types/utils/explorer.d.ts +10 -0
- package/dist/types/utils/explorer.d.ts.map +1 -1
- package/dist/types/utils/format.d.ts +22 -0
- package/dist/types/utils/format.d.ts.map +1 -1
- package/dist/types/utils/scaleToInteger.d.ts +22 -0
- package/dist/types/utils/scaleToInteger.d.ts.map +1 -0
- package/dist/types/utils/setupActions.d.ts +17 -0
- package/dist/types/utils/setupActions.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -3
- package/src/client/PerpsClient.ts +206 -106
- package/src/index.ts +34 -8
- package/src/registry/marketRegistry.ts +33 -2
- package/src/registry/referenceDataRegistry.ts +2 -2
- package/src/services/getGasRecommendation.ts +45 -0
- package/src/services/getMarket.ts +7 -5
- package/src/services/getMarkets.ts +14 -4
- package/src/types/api.ts +10 -0
- package/src/types/config.ts +4 -1
- package/src/types/deposit.ts +75 -0
- package/src/types/provider.ts +56 -25
- package/src/utils/accountSummary.ts +18 -5
- package/src/utils/depositAssets.ts +77 -0
- package/src/utils/explorer.ts +20 -4
- package/src/utils/format.ts +108 -28
- package/src/utils/scaleToInteger.ts +56 -0
- package/src/utils/setupActions.ts +24 -0
- package/src/version.ts +1 -1
- package/dist/cjs/client/clientLog.d.ts +0 -4
- package/dist/cjs/client/clientLog.d.ts.map +0 -1
- package/dist/cjs/client/clientLog.js +0 -9
- package/dist/cjs/client/clientLog.js.map +0 -1
- package/dist/cjs/utils/depositChain.d.ts +0 -6
- package/dist/cjs/utils/depositChain.d.ts.map +0 -1
- package/dist/cjs/utils/depositChain.js +0 -13
- package/dist/cjs/utils/depositChain.js.map +0 -1
- package/dist/esm/client/clientLog.d.ts +0 -16
- package/dist/esm/client/clientLog.d.ts.map +0 -1
- package/dist/esm/client/clientLog.js +0 -18
- package/dist/esm/client/clientLog.js.map +0 -1
- package/dist/esm/utils/depositChain.d.ts +0 -27
- package/dist/esm/utils/depositChain.d.ts.map +0 -1
- package/dist/esm/utils/depositChain.js +0 -23
- package/dist/esm/utils/depositChain.js.map +0 -1
- package/dist/types/client/clientLog.d.ts +0 -16
- package/dist/types/client/clientLog.d.ts.map +0 -1
- package/dist/types/utils/depositChain.d.ts +0 -27
- package/dist/types/utils/depositChain.d.ts.map +0 -1
- package/src/client/clientLog.ts +0 -20
- package/src/utils/depositChain.ts +0 -38
|
@@ -58,7 +58,10 @@ export interface SDKRequestOptions {
|
|
|
58
58
|
* getOrder, getActivity, getAccount). Create via
|
|
59
59
|
* `lighterSigner.createAuthToken(deadline, context)`. Sent only to Lighter
|
|
60
60
|
* venue endpoints, never to the LI.FI backend — read-only by design
|
|
61
|
-
* (8h max TTL, cannot authorize writes).
|
|
61
|
+
* (8h max TTL, cannot authorize writes). Each call routes to a single Lighter
|
|
62
|
+
* instance via `params.provider`, so this token scopes to that instance's
|
|
63
|
+
* venue; token caches are held per `lighterProvider()` instance and do not
|
|
64
|
+
* cross between instances.
|
|
62
65
|
*/
|
|
63
66
|
lighterAuthToken?: string;
|
|
64
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;AAE/D;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAE9C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAA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,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ActionType } from '@lifi/perps-types';
|
|
2
|
+
import type { Address } from 'viem';
|
|
3
|
+
/**
|
|
4
|
+
* A token the SDK declares as part of a deposit flow, by full on-chain
|
|
5
|
+
* identity. Matched by `chainId` + `address`: a symbol is not identity — the
|
|
6
|
+
* Hyperliquid venue chain lists two `USDC` contracts with different decimals.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface DeclaredDepositAsset {
|
|
11
|
+
chainId: number;
|
|
12
|
+
/** EIP-55 checksummed address; the zero address denotes the chain's native gas token. */
|
|
13
|
+
address: Address;
|
|
14
|
+
decimals: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fund the account by swapping whatever the user holds into `destination`
|
|
18
|
+
* through the LI.FI surface. The source token is picked inside that surface, so
|
|
19
|
+
* it is not part of the flow; LI.FI routing owns whether that resolves to a
|
|
20
|
+
* same-chain swap or a bridge.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export interface DepositFlowLifiSwap {
|
|
25
|
+
kind: 'lifiSwap';
|
|
26
|
+
destination: DeclaredDepositAsset;
|
|
27
|
+
/**
|
|
28
|
+
* Credited address when it is not the user's own — a venue-provisioned
|
|
29
|
+
* deposit address. Absent means the user's address receives the deposit.
|
|
30
|
+
*/
|
|
31
|
+
toAddress?: Address;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fund an address that has no venue account yet. Collateral and the native gas
|
|
35
|
+
* to broadcast with are both needed on `chainId`, where the venue's
|
|
36
|
+
* {@link ActionType.DEPOSIT} action stages the on-chain legs that open the
|
|
37
|
+
* account.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export interface DepositFlowFirstDepositPipeline {
|
|
42
|
+
kind: 'firstDepositPipeline';
|
|
43
|
+
/** Chain the deposit legs broadcast on; the user's wallet must be switched to it. */
|
|
44
|
+
chainId: number;
|
|
45
|
+
gasAsset: DeclaredDepositAsset;
|
|
46
|
+
collateral: DeclaredDepositAsset;
|
|
47
|
+
bridgeAction: ActionType.DEPOSIT;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The venue cannot name a deposit destination until the listed setup actions
|
|
51
|
+
* are satisfied — Ondo provisions its deposit address behind a signed-in
|
|
52
|
+
* session.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export interface DepositFlowSetupRequired {
|
|
57
|
+
kind: 'setupRequired';
|
|
58
|
+
/** Outstanding `Provider.setup` action types, in the order they must be run. */
|
|
59
|
+
setup: ActionType[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The single deposit flow a venue offers one address, resolved from the venue's
|
|
63
|
+
* account and setup state.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
export type DepositFlow = DepositFlowLifiSwap | DepositFlowFirstDepositPipeline | DepositFlowSetupRequired;
|
|
68
|
+
//# sourceMappingURL=deposit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../../src/types/deposit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,yFAAyF;IACzF,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,oBAAoB,CAAA;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,sBAAsB,CAAA;IAC5B,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,UAAU,EAAE,oBAAoB,CAAA;IAChC,YAAY,EAAE,UAAU,CAAC,OAAO,CAAA;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,eAAe,CAAA;IACrB,gFAAgF;IAChF,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACnB,mBAAmB,GACnB,+BAA+B,GAC/B,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deposit.js","sourceRoot":"","sources":["../../../src/types/deposit.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { AccountConfig, AccountConfigSetting, AccountResponse, AccountSummary, ActionResult, ActionStep, ActionType, ActivitiesResponse, ActivityType,
|
|
1
|
+
import type { AccountConfig, AccountConfigSetting, AccountResponse, AccountSummary, ActionResult, ActionStep, ActionType, ActivitiesResponse, ActivityType, FillsResponse, Market, Order, OrdersResponse, PerpsMarket, PerpsSigner, Position, PositionsResponse, ProviderAction, Quote, QuoteSide, SignedActionStep, SigningMethod, TradeType } from '@lifi/perps-types';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { PerpsBaseConfig, PerpsClientSigner, SDKRequestOptions } from './config.js';
|
|
4
|
+
import type { DepositFlow } from './deposit.js';
|
|
4
5
|
/**
|
|
5
6
|
* Low-level SDK client: resolved config, the optional end-user wallet, and the
|
|
6
7
|
* registered provider plugins. Returned by {@link createPerpsClient} and
|
|
@@ -25,6 +26,26 @@ export interface PerpsSDKClient {
|
|
|
25
26
|
*
|
|
26
27
|
* @public
|
|
27
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* Progress for one on-chain leg of an `EVM_TX` batch (e.g. a native deposit's
|
|
31
|
+
* `approve` then `deposit`). Emitted twice per leg: `submitted` once the wallet
|
|
32
|
+
* broadcasts and the hash is known, then `confirmed` once the receipt mines. A
|
|
33
|
+
* consumer can render a live per-transaction stepper from these.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export interface SignActionProgress {
|
|
38
|
+
/** 0-based index of this leg within the batch. */
|
|
39
|
+
index: number;
|
|
40
|
+
/** Total legs in the batch. */
|
|
41
|
+
total: number;
|
|
42
|
+
action: ActionType;
|
|
43
|
+
/** Contract function the leg invokes, e.g. `"approve"` or the deposit method. */
|
|
44
|
+
functionName: string;
|
|
45
|
+
chainId: number;
|
|
46
|
+
status: 'submitted' | 'confirmed';
|
|
47
|
+
txHash: string;
|
|
48
|
+
}
|
|
28
49
|
export interface SignActionsContext {
|
|
29
50
|
userWallet?: PerpsClientSigner;
|
|
30
51
|
/**
|
|
@@ -45,6 +66,13 @@ export interface SignActionsContext {
|
|
|
45
66
|
* absent (local/private-key signer, or no hook).
|
|
46
67
|
*/
|
|
47
68
|
switchToChain?: (chainId: number) => Promise<PerpsClientSigner>;
|
|
69
|
+
/**
|
|
70
|
+
* Optional progress sink for on-chain legs. A plugin whose legs broadcast
|
|
71
|
+
* transactions (Lighter's `EVM_TX`) calls it as each leg is submitted and
|
|
72
|
+
* confirmed, so a consumer can show a live per-transaction stepper. Bound by
|
|
73
|
+
* core from the `onProgress` passed to {@link PerpsClient.execute}.
|
|
74
|
+
*/
|
|
75
|
+
onProgress?: (progress: SignActionProgress) => void;
|
|
48
76
|
}
|
|
49
77
|
/**
|
|
50
78
|
* Signer-bearing wire fields a provider plugin contributes to an action's
|
|
@@ -100,13 +128,12 @@ export interface ProviderAccountExistsParams {
|
|
|
100
128
|
address: Address;
|
|
101
129
|
}
|
|
102
130
|
/**
|
|
103
|
-
* Read params for {@link PerpsProviderPlugin.
|
|
131
|
+
* Read params for {@link PerpsProviderPlugin.getDepositFlow}.
|
|
104
132
|
*
|
|
105
133
|
* @public
|
|
106
134
|
*/
|
|
107
|
-
export interface
|
|
135
|
+
export interface ProviderGetDepositFlowParams {
|
|
108
136
|
address: Address;
|
|
109
|
-
sourceAsset: DepositAsset;
|
|
110
137
|
}
|
|
111
138
|
/**
|
|
112
139
|
* Read params for {@link PerpsProvider.getPositions}.
|
|
@@ -222,6 +249,16 @@ export interface PerpsProviderPlugin {
|
|
|
222
249
|
* look the provider up via {@link PerpsSDKClient.getProvider}.
|
|
223
250
|
*/
|
|
224
251
|
readonly type: string;
|
|
252
|
+
/**
|
|
253
|
+
* Setup actions the provider completes on its own, without surfacing a card
|
|
254
|
+
* to the caller. `PerpsClient.checkSetup` drains each such pending step in
|
|
255
|
+
* place — building, signing, and executing it with the provider's own
|
|
256
|
+
* credentials — and omits it from the returned `setup` list. A descriptor
|
|
257
|
+
* whose `signers` include {@link PerpsSigner.USER} is never treated as
|
|
258
|
+
* internal, even when named here. Omit when the provider has no
|
|
259
|
+
* self-completed setup steps.
|
|
260
|
+
*/
|
|
261
|
+
readonly internalSetupActions?: readonly ActionType[];
|
|
225
262
|
/**
|
|
226
263
|
* Inject the runtime {@link PerpsSDKClient} into the plugin once, during
|
|
227
264
|
* {@link createPerpsClient}. The plugin captures it (config, fetch, retry,
|
|
@@ -240,11 +277,15 @@ export interface PerpsProviderPlugin {
|
|
|
240
277
|
*/
|
|
241
278
|
accountExists(params: ProviderAccountExistsParams, options?: SDKRequestOptions): Promise<boolean>;
|
|
242
279
|
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
280
|
+
* The deposit flow this venue offers `params.address`, resolved from the
|
|
281
|
+
* venue's own account and setup state — which collateral token a deposit must
|
|
282
|
+
* land in, whether the address first needs the account-opening pipeline, and
|
|
283
|
+
* whether venue setup gates naming a destination at all.
|
|
284
|
+
*
|
|
285
|
+
* Optional: a provider that cannot be funded through the SDK omits it, and
|
|
286
|
+
* `PerpsClient.getDepositFlow` then resolves `undefined`.
|
|
246
287
|
*/
|
|
247
|
-
|
|
288
|
+
getDepositFlow?(params: ProviderGetDepositFlowParams, options?: SDKRequestOptions): Promise<DepositFlow>;
|
|
248
289
|
getPositions(params: ProviderGetPositionsParams, options?: SDKRequestOptions): Promise<PositionsResponse>;
|
|
249
290
|
getOrders(params: ProviderGetOrdersParams, options?: SDKRequestOptions): Promise<OrdersResponse>;
|
|
250
291
|
getOrder(params: ProviderGetOrderParams, options?: SDKRequestOptions): Promise<Order>;
|
|
@@ -358,16 +399,11 @@ export interface PerpsProviderPlugin {
|
|
|
358
399
|
*/
|
|
359
400
|
signActions?(method: SigningMethod, steps: ActionStep[], address: Address, ctx?: SignActionsContext): Promise<SignedActionStep[]>;
|
|
360
401
|
/**
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
* `signActions` as `headers`) must never transit the LI.FI backend, so the
|
|
365
|
-
* venue call happens SDK-side. The provider owns base-URL resolution and
|
|
366
|
-
* mapping the venue response onto {@link ActionResult}s — these results are
|
|
367
|
-
* authoritative for the caller; `PerpsClient.execute` submits the steps to
|
|
368
|
-
* the backend afterwards for bookkeeping only, with `headers` stripped.
|
|
402
|
+
* Observe the per-step results of an `/executeAction` round trip before the
|
|
403
|
+
* core surfaces failures. Lets a provider react to structured failure codes
|
|
404
|
+
* — e.g. evicting a locally stored credential the venue no longer accepts.
|
|
369
405
|
*/
|
|
370
|
-
|
|
406
|
+
onExecuteResults?(address: Address, results: ActionResult[]): Promise<void>;
|
|
371
407
|
}
|
|
372
408
|
/**
|
|
373
409
|
* Runtime provider returned by {@link PerpsSDKClient.getProvider} and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,cAAc,EACd,WAAW,EACX,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,SAAS,EACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAA;IACvC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,aAAa,EAAE,CAAA;IACnC,0EAA0E;IAC1E,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CA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AAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5E;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountSummary.d.ts","sourceRoot":"","sources":["../../../src/utils/accountSummary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,QAAQ,EACT,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"accountSummary.d.ts","sourceRoot":"","sources":["../../../src/utils/accountSummary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,QAAQ,EACT,MAAM,mBAAmB,CAAA;AAY1B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;AAErE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,EAAE,mBAAmB,GAC7B,cAAc,CAuChB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { stringToFloat } from './parse.js';
|
|
2
2
|
const sumValueUsd = (balances) => balances.reduce((sum, b) => sum + stringToFloat(b.valueUsd), 0);
|
|
3
|
+
const sumMarginUsd = (balances) => balances.reduce((sum, b) => sum + stringToFloat(b.valueUsd) * (b.collateralWeight ?? 1), 0);
|
|
3
4
|
/**
|
|
4
5
|
* Roll an {@link AccountResponse} and its open positions up into an
|
|
5
6
|
* {@link AccountSummary}.
|
|
@@ -16,17 +17,25 @@ export function summarizeAccount(account, positions, semantics) {
|
|
|
16
17
|
unrealizedPnl += stringToFloat(p.unrealizedPnl);
|
|
17
18
|
}
|
|
18
19
|
const collateral = sumValueUsd(account.collateralBalances);
|
|
20
|
+
// Margin-eligible collateral: each row's value scaled by its loan-to-value
|
|
21
|
+
// weight (1 when unset), so a haircut asset backs buying power at less than
|
|
22
|
+
// face while `portfolioValue` still reflects its full value.
|
|
23
|
+
const marginCollateral = sumMarginUsd(account.collateralBalances);
|
|
19
24
|
const balances = sumValueUsd(account.balances);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
const withLocked = semantics === 'free' || semantics === 'net';
|
|
26
|
+
const grossCollateral = withLocked ? collateral + marginUsed : collateral;
|
|
27
|
+
const grossMarginCollateral = withLocked
|
|
28
|
+
? marginCollateral + marginUsed
|
|
29
|
+
: marginCollateral;
|
|
23
30
|
const equity = semantics === 'equity' || semantics === 'net'
|
|
24
31
|
? grossCollateral
|
|
25
32
|
: grossCollateral + unrealizedPnl;
|
|
26
33
|
// Buying power is equity net of locked margin, so unrealized PnL counts
|
|
27
34
|
// toward it. The `'free'` rows exclude uPnL from available margin, holding
|
|
28
35
|
// it purely as free collateral.
|
|
29
|
-
const availableMargin =
|
|
36
|
+
const availableMargin = grossMarginCollateral +
|
|
37
|
+
(semantics === 'gross' ? unrealizedPnl : 0) -
|
|
38
|
+
marginUsed;
|
|
30
39
|
return {
|
|
31
40
|
portfolioValue: (balances + equity).toString(),
|
|
32
41
|
availableMargin: availableMargin.toString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountSummary.js","sourceRoot":"","sources":["../../../src/utils/accountSummary.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,WAAW,GAAG,CAAC,QAAqC,EAAU,EAAE,CACpE,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":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AM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAA;IACzE,MAAM,qBAAqB,GAAG,UAAU;QACtC,CAAC,CAAC,gBAAgB,GAAG,UAAU;QAC/B,CAAC,CAAC,gBAAgB,CAAA;IACpB,MAAM,MAAM,GACV,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,KAAK;QAC3C,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,eAAe,GAAG,aAAa,CAAA;IAErC,wEAAwE;IACxE,2EAA2E;IAC3E,gCAAgC;IAChC,MAAM,eAAe,GACnB,qBAAqB;QACrB,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,UAAU,CAAA;IAEZ,OAAO;QACL,cAAc,EAAE,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC,QAAQ,EAAE;QAC9C,eAAe,EAAE,eAAe,CAAC,QAAQ,EAAE;QAC3C,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE;QACjC,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE;KACxC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DeclaredDepositAsset } from '../types/deposit.js';
|
|
2
|
+
/**
|
|
3
|
+
* USDC on Ethereum mainnet — the collateral leg of Lighter's first-deposit
|
|
4
|
+
* pipeline, and the token Ondo's provisioned deposit address is funded in.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare const ETHEREUM_USDC: DeclaredDepositAsset;
|
|
9
|
+
/**
|
|
10
|
+
* Ether on Ethereum mainnet, to broadcast the first-deposit pipeline's legs
|
|
11
|
+
* with.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const ETHEREUM_NATIVE_GAS: DeclaredDepositAsset;
|
|
16
|
+
/**
|
|
17
|
+
* USDC on the Hyperliquid venue chain: the 6-decimal perps contract. The same
|
|
18
|
+
* chain also lists an 8-decimal spot `USDC` at
|
|
19
|
+
* `0x6d1e7cde53bA9467B783Cb7c530CE05400000000`, so a deposit destination
|
|
20
|
+
* resolved by symbol lands on the wrong token and the wrong scale.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const HYPERLIQUID_USDC: DeclaredDepositAsset;
|
|
25
|
+
/**
|
|
26
|
+
* USDC on the Lighter venue chain. The venue chain reuses the mainnet USDC
|
|
27
|
+
* address, so `chainId` is what distinguishes it from {@link ETHEREUM_USDC}.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare const LIGHTER_USDC: DeclaredDepositAsset;
|
|
32
|
+
/**
|
|
33
|
+
* USDG on Robinhood Chain — the collateral the Lighter Robinhood instance is
|
|
34
|
+
* funded in.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export declare const ROBINHOOD_USDG: DeclaredDepositAsset;
|
|
39
|
+
/**
|
|
40
|
+
* Ether on Robinhood Chain, to broadcast the Robinhood first-deposit pipeline's
|
|
41
|
+
* legs with.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare const ROBINHOOD_NATIVE_GAS: DeclaredDepositAsset;
|
|
46
|
+
//# sourceMappingURL=depositAssets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depositAssets.d.ts","sourceRoot":"","sources":["../../../src/utils/depositAssets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,oBAI3B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,oBAIjC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,oBAI9B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,oBAI1B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,oBAI5B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,oBAIlC,CAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ChainId } from '@lifi/types';
|
|
2
|
+
import { zeroAddress } from 'viem';
|
|
3
|
+
/**
|
|
4
|
+
* USDC on Ethereum mainnet — the collateral leg of Lighter's first-deposit
|
|
5
|
+
* pipeline, and the token Ondo's provisioned deposit address is funded in.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export const ETHEREUM_USDC = {
|
|
10
|
+
chainId: ChainId.ETH,
|
|
11
|
+
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
12
|
+
decimals: 6,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Ether on Ethereum mainnet, to broadcast the first-deposit pipeline's legs
|
|
16
|
+
* with.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export const ETHEREUM_NATIVE_GAS = {
|
|
21
|
+
chainId: ChainId.ETH,
|
|
22
|
+
address: zeroAddress,
|
|
23
|
+
decimals: 18,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* USDC on the Hyperliquid venue chain: the 6-decimal perps contract. The same
|
|
27
|
+
* chain also lists an 8-decimal spot `USDC` at
|
|
28
|
+
* `0x6d1e7cde53bA9467B783Cb7c530CE05400000000`, so a deposit destination
|
|
29
|
+
* resolved by symbol lands on the wrong token and the wrong scale.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export const HYPERLIQUID_USDC = {
|
|
34
|
+
chainId: ChainId.HPL,
|
|
35
|
+
address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
36
|
+
decimals: 6,
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* USDC on the Lighter venue chain. The venue chain reuses the mainnet USDC
|
|
40
|
+
* address, so `chainId` is what distinguishes it from {@link ETHEREUM_USDC}.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export const LIGHTER_USDC = {
|
|
45
|
+
chainId: ChainId.LTR,
|
|
46
|
+
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
47
|
+
decimals: 6,
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* USDG on Robinhood Chain — the collateral the Lighter Robinhood instance is
|
|
51
|
+
* funded in.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export const ROBINHOOD_USDG = {
|
|
56
|
+
chainId: ChainId.OUT,
|
|
57
|
+
address: '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168',
|
|
58
|
+
decimals: 6,
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Ether on Robinhood Chain, to broadcast the Robinhood first-deposit pipeline's
|
|
62
|
+
* legs with.
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export const ROBINHOOD_NATIVE_GAS = {
|
|
67
|
+
chainId: ChainId.OUT,
|
|
68
|
+
address: zeroAddress,
|
|
69
|
+
decimals: 18,
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=depositAssets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depositAssets.js","sourceRoot":"","sources":["../../../src/utils/depositAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAGlC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAyB;IACjD,OAAO,EAAE,OAAO,CAAC,GAAG;IACpB,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,CAAC;CACZ,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,OAAO,EAAE,OAAO,CAAC,GAAG;IACpB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,EAAE;CACb,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAyB;IACpD,OAAO,EAAE,OAAO,CAAC,GAAG;IACpB,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,CAAC;CACZ,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAyB;IAChD,OAAO,EAAE,OAAO,CAAC,GAAG;IACpB,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,CAAC;CACZ,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,OAAO,EAAE,OAAO,CAAC,GAAG;IACpB,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,CAAC;CACZ,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyB;IACxD,OAAO,EAAE,OAAO,CAAC,GAAG;IACpB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,EAAE;CACb,CAAA"}
|
|
@@ -22,6 +22,16 @@ export declare const ExplorerChainId: {
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
export type ExplorerChainId = (typeof ExplorerChainId)[keyof typeof ExplorerChainId];
|
|
25
|
+
/**
|
|
26
|
+
* Build a fully-resolved block-explorer URL from an explicit base URL, for
|
|
27
|
+
* settling venues whose explorer is not one of the {@link ExplorerChainId}
|
|
28
|
+
* entries (e.g. a second provider instance carrying its own base).
|
|
29
|
+
*
|
|
30
|
+
* @returns The explorer URL, or `undefined` when either the base or the hash is
|
|
31
|
+
* absent (no explorer configured, or no on-chain tx to link).
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export declare function explorerTxUrlFromBase(baseUrl: string | undefined, txHash: string | undefined): string | undefined;
|
|
25
35
|
/**
|
|
26
36
|
* Build a fully-resolved block-explorer URL for a tx on a known chain.
|
|
27
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer.d.ts","sourceRoot":"","sources":["../../../src/utils/explorer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;CAKlB,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAA;AASxD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"explorer.d.ts","sourceRoot":"","sources":["../../../src/utils/explorer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;CAKlB,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAA;AASxD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS,CAKpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS,CAEpB"}
|
|
@@ -22,6 +22,21 @@ const TX_BASE_URL_BY_CHAIN = {
|
|
|
22
22
|
[ExplorerChainId.LIGHTER]: 'https://app.lighter.xyz/explorer/logs/',
|
|
23
23
|
[ExplorerChainId.HYPERLIQUID]: 'https://app.hyperliquid.xyz/explorer/tx/',
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Build a fully-resolved block-explorer URL from an explicit base URL, for
|
|
27
|
+
* settling venues whose explorer is not one of the {@link ExplorerChainId}
|
|
28
|
+
* entries (e.g. a second provider instance carrying its own base).
|
|
29
|
+
*
|
|
30
|
+
* @returns The explorer URL, or `undefined` when either the base or the hash is
|
|
31
|
+
* absent (no explorer configured, or no on-chain tx to link).
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export function explorerTxUrlFromBase(baseUrl, txHash) {
|
|
35
|
+
if (!baseUrl || !txHash) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return `${baseUrl}${txHash}`;
|
|
39
|
+
}
|
|
25
40
|
/**
|
|
26
41
|
* Build a fully-resolved block-explorer URL for a tx on a known chain.
|
|
27
42
|
*
|
|
@@ -30,9 +45,6 @@ const TX_BASE_URL_BY_CHAIN = {
|
|
|
30
45
|
* @public
|
|
31
46
|
*/
|
|
32
47
|
export function explorerTxUrl(chainId, txHash) {
|
|
33
|
-
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
return `${TX_BASE_URL_BY_CHAIN[chainId]}${txHash}`;
|
|
48
|
+
return explorerTxUrlFromBase(TX_BASE_URL_BY_CHAIN[chainId], txHash);
|
|
37
49
|
}
|
|
38
50
|
//# sourceMappingURL=explorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer.js","sourceRoot":"","sources":["../../../src/utils/explorer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,GAAG;CACR,CAAA;AAUV,MAAM,oBAAoB,GAAoC;IAC5D,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,0BAA0B;IACtD,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,yBAAyB;IACzD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,wCAAwC;IACnE,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,0CAA0C;CAC1E,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"explorer.js","sourceRoot":"","sources":["../../../src/utils/explorer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,GAAG;CACR,CAAA;AAUV,MAAM,oBAAoB,GAAoC;IAC5D,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,0BAA0B;IACtD,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,yBAAyB;IACzD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,wCAAwC;IACnE,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,0CAA0C;CAC1E,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAA2B,EAC3B,MAA0B;IAE1B,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,GAAG,OAAO,GAAG,MAAM,EAAE,CAAA;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAwB,EACxB,MAA0B;IAE1B,OAAO,qBAAqB,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAA;AACrE,CAAC"}
|
|
@@ -10,8 +10,30 @@ export interface FormatOptions {
|
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
/** BCP 47 locale controlling digit grouping and separators (e.g. `'en-US'`). */
|
|
12
12
|
locale?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Rounding applied when reducing to `decimals` places. Defaults to
|
|
15
|
+
* `'halfUp'`. `'floor'` truncates toward zero (matching big.js `roundDown`),
|
|
16
|
+
* so the rendered magnitude never exceeds the source — use it for readouts
|
|
17
|
+
* validated against a ceiling (available balance, removable margin).
|
|
18
|
+
*/
|
|
19
|
+
rounding?: RoundingMode;
|
|
13
20
|
}
|
|
21
|
+
/** Rounding mode for {@link FormatOptions.rounding}. */
|
|
22
|
+
export type RoundingMode = 'halfUp' | 'floor';
|
|
14
23
|
type FormatInput = number | string | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Format a bare number, unsigned, with no currency symbol: `1,234.50`,
|
|
26
|
+
* `-1,500.00`, `0.00`. The core the `$`/`%` formatters wrap; use it for
|
|
27
|
+
* balance labels and symbol-suffixed amounts (`12.5 LIT`).
|
|
28
|
+
*
|
|
29
|
+
* Two decimal places with locale digit grouping by default. Negatives keep a
|
|
30
|
+
* leading `-`. `rounding: 'floor'` truncates toward zero so the rendered
|
|
31
|
+
* magnitude never exceeds the source (`99.999` at 2dp → `99.99`, `-99.999` →
|
|
32
|
+
* `-99.99`). Null/undefined/non-finite input renders the placeholder.
|
|
33
|
+
*
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatNumber(value: FormatInput, options?: FormatOptions): string;
|
|
15
37
|
/**
|
|
16
38
|
* Format a USD value, unsigned: `$1,234.50`, `-$1,500.00`, `$0.00`.
|
|
17
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,MAAM,CAAC,EAAE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