@lifi/perps-sdk 0.0.0-preview-c69c4cc → 0.0.0-preview-232a40e
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 +13 -9
- package/dist/cjs/client/PerpsClient.d.ts.map +1 -1
- package/dist/cjs/client/PerpsClient.js +135 -52
- package/dist/cjs/client/PerpsClient.js.map +1 -1
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/api.d.ts +3 -6
- package/dist/cjs/types/api.d.ts.map +1 -1
- package/dist/cjs/types/provider.d.ts +5 -10
- package/dist/cjs/types/provider.d.ts.map +1 -1
- package/dist/cjs/types/withdrawal.d.ts +1 -11
- package/dist/cjs/types/withdrawal.d.ts.map +1 -1
- package/dist/cjs/utils/setupActions.d.ts +4 -2
- package/dist/cjs/utils/setupActions.d.ts.map +1 -1
- package/dist/cjs/utils/setupActions.js +9 -1
- package/dist/cjs/utils/setupActions.js.map +1 -1
- package/dist/cjs/utils/switchChain.js +1 -1
- package/dist/cjs/utils/switchChain.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 +63 -58
- package/dist/esm/client/PerpsClient.d.ts.map +1 -1
- package/dist/esm/client/PerpsClient.js +195 -102
- package/dist/esm/client/PerpsClient.js.map +1 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api.d.ts +24 -23
- package/dist/esm/types/api.d.ts.map +1 -1
- package/dist/esm/types/provider.d.ts +17 -40
- package/dist/esm/types/provider.d.ts.map +1 -1
- package/dist/esm/types/withdrawal.d.ts +1 -30
- package/dist/esm/types/withdrawal.d.ts.map +1 -1
- package/dist/esm/utils/setupActions.d.ts +17 -8
- package/dist/esm/utils/setupActions.d.ts.map +1 -1
- package/dist/esm/utils/setupActions.js +20 -7
- package/dist/esm/utils/setupActions.js.map +1 -1
- package/dist/esm/utils/switchChain.js +1 -1
- package/dist/esm/utils/switchChain.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 +63 -58
- package/dist/types/client/PerpsClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/api.d.ts +24 -23
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/provider.d.ts +17 -40
- package/dist/types/types/provider.d.ts.map +1 -1
- package/dist/types/types/withdrawal.d.ts +1 -30
- package/dist/types/types/withdrawal.d.ts.map +1 -1
- package/dist/types/utils/setupActions.d.ts +17 -8
- package/dist/types/utils/setupActions.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/client/PerpsClient.ts +271 -136
- package/src/index.ts +4 -6
- package/src/types/api.ts +25 -24
- package/src/types/provider.ts +17 -47
- package/src/types/withdrawal.ts +1 -33
- package/src/utils/setupActions.ts +27 -13
- package/src/utils/switchChain.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Address } from 'viem';
|
|
1
|
+
import type { Asset } from '@lifi/perps-types';
|
|
3
2
|
/**
|
|
4
3
|
* Which of a venue's two balance routes a withdrawal is drawn from. Lighter's
|
|
5
4
|
* own vocabulary, carried in the signed tx as `AssetRouteType` (`perps` = 0,
|
|
@@ -47,32 +46,4 @@ export interface WithdrawableBalance {
|
|
|
47
46
|
*/
|
|
48
47
|
withdrawalFee?: string;
|
|
49
48
|
}
|
|
50
|
-
/**
|
|
51
|
-
* The venue accepts a withdrawal to `destination` now.
|
|
52
|
-
*
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
export interface WithdrawFlowReady {
|
|
56
|
-
kind: 'ready';
|
|
57
|
-
destination: Address;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* The venue cannot accept a withdrawal until the listed setup actions are
|
|
61
|
-
* satisfied — Ondo sends funds only to an address in its address book, behind
|
|
62
|
-
* a signed-in session.
|
|
63
|
-
*
|
|
64
|
-
* @public
|
|
65
|
-
*/
|
|
66
|
-
export interface WithdrawFlowSetupRequired {
|
|
67
|
-
kind: 'setupRequired';
|
|
68
|
-
/** Setup action types that must be completed, in execution order. */
|
|
69
|
-
setup: ActionType[];
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The single withdrawal flow a venue offers one address, resolved from the
|
|
73
|
-
* venue's account and setup state.
|
|
74
|
-
*
|
|
75
|
-
* @public
|
|
76
|
-
*/
|
|
77
|
-
export type WithdrawFlow = WithdrawFlowReady | WithdrawFlowSetupRequired;
|
|
78
49
|
//# sourceMappingURL=withdrawal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawal.d.ts","sourceRoot":"","sources":["../../../src/types/withdrawal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"withdrawal.d.ts","sourceRoot":"","sources":["../../../src/types/withdrawal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,eAAe,CAAA;IACtB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAA;IACZ,KAAK,EAAE,eAAe,CAAA;IACtB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ActionType, SetupAction, SetupOption } from '@lifi/perps-types';
|
|
2
2
|
/**
|
|
3
|
-
* Select the `Provider.setup` descriptors a user
|
|
4
|
-
*
|
|
5
|
-
* signs on its own
|
|
6
|
-
*
|
|
3
|
+
* Select the `Provider.setup` descriptors a user sees: every choice step, and
|
|
4
|
+
* every non-choice step signed by {@link PerpsSigner.USER}. A non-choice step
|
|
5
|
+
* the SDK signs on its own is held back — `checkSetup` completes it inline, so
|
|
6
|
+
* surfacing it would render an inert card the user can't act on.
|
|
7
7
|
*
|
|
8
|
-
* Membership is a property of the descriptor
|
|
9
|
-
*
|
|
8
|
+
* Membership is a property of the descriptor alone, independent of any
|
|
9
|
+
* account. When an account is available, prefer `ProviderSetup.checklist`
|
|
10
10
|
* from `checkSetup` for the onboarding list — it applies this filter, omits
|
|
11
11
|
* not-required conditional steps, and carries each entry's satisfied state.
|
|
12
12
|
* This function remains the static, account-free projection.
|
|
@@ -14,5 +14,14 @@ import type { ProviderAction } from '@lifi/perps-types';
|
|
|
14
14
|
* @param setup The provider's `setup` descriptors, in their declared order.
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export declare function selectUserSetupActions(setup:
|
|
17
|
+
export declare function selectUserSetupActions(setup: SetupAction[]): SetupAction[];
|
|
18
|
+
/** Whether a setup step is shown to the user rather than drained silently. */
|
|
19
|
+
export declare function isUserFacingSetupStep(descriptor: SetupAction): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Narrow a setup option to the action it executes, so its bound `params` read
|
|
22
|
+
* with that action's param shape.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare function isSetupOptionFor<T extends ActionType>(option: SetupOption, type: T): option is SetupOption<T>;
|
|
18
27
|
//# sourceMappingURL=setupActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupActions.d.ts","sourceRoot":"","sources":["../../../src/utils/setupActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"setupActions.d.ts","sourceRoot":"","sources":["../../../src/utils/setupActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG7E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAE1E;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EACnD,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,CAAC,GACN,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAE1B"}
|
package/dist/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/perps-sdk",
|
|
3
|
-
"version": "0.0.0-preview-
|
|
3
|
+
"version": "0.0.0-preview-232a40e",
|
|
4
4
|
"description": "LI.FI Perps SDK for perpetuals trading",
|
|
5
5
|
"homepage": "https://github.com/lifinance/perps-sdk",
|
|
6
6
|
"bugs": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"big.js": "^7.0.1",
|
|
47
47
|
"partysocket": "^1.1.19",
|
|
48
48
|
"viem": "^2.55.18",
|
|
49
|
-
"@lifi/perps-types": "^0.0.0-preview-
|
|
49
|
+
"@lifi/perps-types": "^0.0.0-preview-232a40e"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|