@lifi/perps-sdk 0.0.0-preview-ba2d335 → 0.0.0-preview-7ff840c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client/PerpsClient.d.ts +1 -0
- package/dist/cjs/client/PerpsClient.d.ts.map +1 -1
- package/dist/cjs/client/PerpsClient.js +36 -0
- package/dist/cjs/client/PerpsClient.js.map +1 -1
- package/dist/cjs/client/clientLog.d.ts +4 -0
- package/dist/cjs/client/clientLog.d.ts.map +1 -0
- package/dist/cjs/client/clientLog.js +9 -0
- package/dist/cjs/client/clientLog.js.map +1 -0
- package/dist/cjs/storage/encryptedStorage.d.ts.map +1 -1
- package/dist/cjs/storage/encryptedStorage.js +31 -16
- package/dist/cjs/storage/encryptedStorage.js.map +1 -1
- package/dist/cjs/types/provider.d.ts +2 -1
- package/dist/cjs/types/provider.d.ts.map +1 -1
- package/dist/cjs/utils/depositChain.d.ts +1 -1
- package/dist/cjs/utils/depositChain.d.ts.map +1 -1
- package/dist/cjs/utils/depositChain.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/PerpsClient.d.ts +8 -0
- package/dist/esm/client/PerpsClient.d.ts.map +1 -1
- package/dist/esm/client/PerpsClient.js +46 -1
- package/dist/esm/client/PerpsClient.js.map +1 -1
- package/dist/esm/client/clientLog.d.ts +16 -0
- package/dist/esm/client/clientLog.d.ts.map +1 -0
- package/dist/esm/client/clientLog.js +18 -0
- package/dist/esm/client/clientLog.js.map +1 -0
- package/dist/esm/storage/encryptedStorage.d.ts +2 -1
- package/dist/esm/storage/encryptedStorage.d.ts.map +1 -1
- package/dist/esm/storage/encryptedStorage.js +40 -18
- package/dist/esm/storage/encryptedStorage.js.map +1 -1
- package/dist/esm/types/provider.d.ts +12 -1
- package/dist/esm/types/provider.d.ts.map +1 -1
- package/dist/esm/utils/depositChain.d.ts +4 -2
- package/dist/esm/utils/depositChain.d.ts.map +1 -1
- package/dist/esm/utils/depositChain.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/client/PerpsClient.d.ts +8 -0
- package/dist/types/client/PerpsClient.d.ts.map +1 -1
- package/dist/types/client/clientLog.d.ts +16 -0
- package/dist/types/client/clientLog.d.ts.map +1 -0
- package/dist/types/storage/encryptedStorage.d.ts +2 -1
- package/dist/types/storage/encryptedStorage.d.ts.map +1 -1
- package/dist/types/types/provider.d.ts +12 -1
- package/dist/types/types/provider.d.ts.map +1 -1
- package/dist/types/utils/depositChain.d.ts +4 -2
- package/dist/types/utils/depositChain.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/client/PerpsClient.ts +72 -1
- package/src/client/clientLog.ts +20 -0
- package/src/storage/encryptedStorage.ts +43 -24
- package/src/types/provider.ts +18 -0
- package/src/utils/depositChain.ts +5 -4
- package/src/version.ts +1 -1
package/src/types/provider.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
AccountConfigSetting,
|
|
4
4
|
AccountResponse,
|
|
5
5
|
AccountSummary,
|
|
6
|
+
ActionResult,
|
|
6
7
|
ActionStep,
|
|
7
8
|
ActionType,
|
|
8
9
|
ActivitiesResponse,
|
|
@@ -18,6 +19,7 @@ import type {
|
|
|
18
19
|
ProviderAction,
|
|
19
20
|
Quote,
|
|
20
21
|
QuoteSide,
|
|
22
|
+
RestCallSignedActionStep,
|
|
21
23
|
SignedActionStep,
|
|
22
24
|
SigningMethod,
|
|
23
25
|
TradeType,
|
|
@@ -446,6 +448,22 @@ export interface PerpsProviderPlugin {
|
|
|
446
448
|
address: Address,
|
|
447
449
|
ctx?: SignActionsContext
|
|
448
450
|
): Promise<SignedActionStep[]>
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Execute credential-bearing rest-call steps directly against the venue.
|
|
454
|
+
* Required for providers whose descriptors declare
|
|
455
|
+
* `SigningMethod.AUTH_TOKEN`: the client-held credential (attached by
|
|
456
|
+
* `signActions` as `headers`) must never transit the LI.FI backend, so the
|
|
457
|
+
* venue call happens SDK-side. The provider owns base-URL resolution and
|
|
458
|
+
* mapping the venue response onto {@link ActionResult}s — these results are
|
|
459
|
+
* authoritative for the caller; `PerpsClient.execute` submits the steps to
|
|
460
|
+
* the backend afterwards for bookkeeping only, with `headers` stripped.
|
|
461
|
+
*/
|
|
462
|
+
executeRestCallActions?(
|
|
463
|
+
steps: RestCallSignedActionStep[],
|
|
464
|
+
address: Address,
|
|
465
|
+
options?: SDKRequestOptions
|
|
466
|
+
): Promise<ActionResult[]>
|
|
449
467
|
}
|
|
450
468
|
|
|
451
469
|
/**
|
|
@@ -2,7 +2,9 @@ import type { AccountConfig } from '@lifi/perps-types'
|
|
|
2
2
|
import { ChainId } from '@lifi/types'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Perps provider keys that
|
|
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).
|
|
6
8
|
*
|
|
7
9
|
* @public
|
|
8
10
|
*/
|
|
@@ -15,9 +17,8 @@ export type DepositProviderKey = AccountConfig['provider']
|
|
|
15
17
|
*
|
|
16
18
|
* @public
|
|
17
19
|
*/
|
|
18
|
-
export const LIFI_DEPOSIT_CHAIN_BY_PROVIDER:
|
|
19
|
-
DepositProviderKey,
|
|
20
|
-
ChainId
|
|
20
|
+
export const LIFI_DEPOSIT_CHAIN_BY_PROVIDER: Partial<
|
|
21
|
+
Record<DepositProviderKey, ChainId>
|
|
21
22
|
> = {
|
|
22
23
|
hyperliquid: ChainId.HPL,
|
|
23
24
|
lighter: ChainId.LTR,
|
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-
|
|
2
|
+
export const version = '0.0.0-preview-7ff840c'
|