@lifi/perps-types 0.1.1-alpha.0 → 0.1.1-alpha.1

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@lifi/types": "^17.57.0",
6
6
  "viem": "^2.33.2"
7
7
  },
8
- "version": "0.1.1-alpha.0",
8
+ "version": "0.1.1-alpha.1",
9
9
  "files": [
10
10
  "src",
11
11
  "!src/**/*.tsbuildinfo"
package/src/_cjs/index.js CHANGED
@@ -20,5 +20,6 @@ __exportStar(require("./market.js"), exports);
20
20
  __exportStar(require("./authorization.js"), exports);
21
21
  __exportStar(require("./account.js"), exports);
22
22
  __exportStar(require("./trading.js"), exports);
23
+ __exportStar(require("./withdrawal.js"), exports);
23
24
  __exportStar(require("./errors.js"), exports);
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,6CAA0B;AAC1B,8CAA2B;AAC3B,qDAAkC;AAClC,+CAA4B;AAC5B,+CAA4B;AAC5B,8CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,6CAA0B;AAC1B,8CAA2B;AAC3B,qDAAkC;AAClC,+CAA4B;AAC5B,+CAA4B;AAC5B,kDAA+B;AAC/B,8CAA2B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=withdrawal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawal.js","sourceRoot":"","sources":["../withdrawal.ts"],"names":[],"mappings":""}
package/src/_esm/index.js CHANGED
@@ -4,5 +4,6 @@ export * from './market.js';
4
4
  export * from './authorization.js';
5
5
  export * from './account.js';
6
6
  export * from './trading.js';
7
+ export * from './withdrawal.js';
7
8
  export * from './errors.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=withdrawal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawal.js","sourceRoot":"","sources":["../withdrawal.ts"],"names":[],"mappings":""}
@@ -4,5 +4,6 @@ export * from './market.js';
4
4
  export * from './authorization.js';
5
5
  export * from './account.js';
6
6
  export * from './trading.js';
7
+ export * from './withdrawal.js';
7
8
  export * from './errors.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
@@ -1,11 +1,10 @@
1
1
  import type { TypedData, SignedTypedData } from '@lifi/types';
2
2
  import type { Address, Hex, TypedDataDomain, TypedDataParameter } from 'viem';
3
- export type PerpsTypedDataPrimaryType = 'HyperliquidTransaction:ApproveAgent' | 'HyperliquidTransaction:ApproveBuilderFee' | 'HyperliquidTransaction:UserSetAbstraction' | 'Agent';
4
3
  export type PerpsTypedData = Omit<TypedData, 'primaryType'> & {
5
- primaryType: PerpsTypedDataPrimaryType;
4
+ primaryType: string;
6
5
  };
7
6
  export type PerpsSignedTypedData = Omit<SignedTypedData, 'primaryType'> & {
8
- primaryType: PerpsTypedDataPrimaryType;
7
+ primaryType: string;
9
8
  };
10
9
  export type { Address, Hex, TypedDataDomain, TypedDataParameter };
11
10
  //# sourceMappingURL=typedData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAE7E,MAAM,MAAM,yBAAyB,GACjC,qCAAqC,GACrC,0CAA0C,GAC1C,2CAA2C,GAC3C,OAAO,CAAA;AAEX,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,GAAG;IAC5D,WAAW,EAAE,yBAAyB,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG;IACxE,WAAW,EAAE,yBAAyB,CAAA;CACvC,CAAA;AAGD,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAE7E,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,GAAG;IAC5D,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG;IACxE,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAGD,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,37 @@
1
+ import type { Address, Hex, PerpsTypedData } from './typedData.js';
2
+ export interface WithdrawalInput {
3
+ destination: Address;
4
+ amount: string;
5
+ }
6
+ export interface CreateWithdrawalRequest {
7
+ dex: string;
8
+ address: Address;
9
+ withdrawal: WithdrawalInput;
10
+ }
11
+ export interface WithdrawalAction {
12
+ action: string;
13
+ description?: string;
14
+ typedData: PerpsTypedData;
15
+ }
16
+ export interface CreateWithdrawalResponse {
17
+ action: WithdrawalAction;
18
+ }
19
+ export interface SignedWithdrawal {
20
+ action: string;
21
+ typedData: PerpsTypedData;
22
+ signature: Hex;
23
+ }
24
+ export interface SubmitWithdrawalRequest {
25
+ dex: string;
26
+ address: Address;
27
+ action: SignedWithdrawal;
28
+ }
29
+ export interface WithdrawalResult {
30
+ action: string;
31
+ success: boolean;
32
+ error?: string;
33
+ }
34
+ export interface SubmitWithdrawalResponse {
35
+ result: WithdrawalResult;
36
+ }
37
+ //# sourceMappingURL=withdrawal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawal.d.ts","sourceRoot":"","sources":["../withdrawal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAElE,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,eAAe,CAAA;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,cAAc,CAAA;CAC1B;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,gBAAgB,CAAA;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,cAAc,CAAA;IACzB,SAAS,EAAE,GAAG,CAAA;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,gBAAgB,CAAA;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,gBAAgB,CAAA;CACzB"}
package/src/index.ts CHANGED
@@ -4,4 +4,5 @@ export * from './market.js'
4
4
  export * from './authorization.js'
5
5
  export * from './account.js'
6
6
  export * from './trading.js'
7
+ export * from './withdrawal.js'
7
8
  export * from './errors.js'
package/src/typedData.ts CHANGED
@@ -1,18 +1,12 @@
1
1
  import type { TypedData, SignedTypedData } from '@lifi/types'
2
2
  import type { Address, Hex, TypedDataDomain, TypedDataParameter } from 'viem'
3
3
 
4
- export type PerpsTypedDataPrimaryType =
5
- | 'HyperliquidTransaction:ApproveAgent'
6
- | 'HyperliquidTransaction:ApproveBuilderFee'
7
- | 'HyperliquidTransaction:UserSetAbstraction'
8
- | 'Agent'
9
-
10
4
  export type PerpsTypedData = Omit<TypedData, 'primaryType'> & {
11
- primaryType: PerpsTypedDataPrimaryType
5
+ primaryType: string
12
6
  }
13
7
 
14
8
  export type PerpsSignedTypedData = Omit<SignedTypedData, 'primaryType'> & {
15
- primaryType: PerpsTypedDataPrimaryType
9
+ primaryType: string
16
10
  }
17
11
 
18
12
  // Re-export viem primitives used across perps types
@@ -0,0 +1,44 @@
1
+ import type { Address, Hex, PerpsTypedData } from './typedData.js'
2
+
3
+ export interface WithdrawalInput {
4
+ destination: Address
5
+ amount: string // e.g., "100.5" — units are $1 USDC
6
+ }
7
+
8
+ export interface CreateWithdrawalRequest {
9
+ dex: string
10
+ address: Address
11
+ withdrawal: WithdrawalInput
12
+ }
13
+
14
+ export interface WithdrawalAction {
15
+ action: string // "Withdraw"
16
+ description?: string
17
+ typedData: PerpsTypedData
18
+ }
19
+
20
+ export interface CreateWithdrawalResponse {
21
+ action: WithdrawalAction
22
+ }
23
+
24
+ export interface SignedWithdrawal {
25
+ action: string
26
+ typedData: PerpsTypedData
27
+ signature: Hex
28
+ }
29
+
30
+ export interface SubmitWithdrawalRequest {
31
+ dex: string
32
+ address: Address
33
+ action: SignedWithdrawal
34
+ }
35
+
36
+ export interface WithdrawalResult {
37
+ action: string
38
+ success: boolean
39
+ error?: string
40
+ }
41
+
42
+ export interface SubmitWithdrawalResponse {
43
+ result: WithdrawalResult
44
+ }