@0xmonaco/types 0.1.0 → 0.1.5
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/api/index.d.ts +19 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +8 -0
- package/dist/api/index.js.map +1 -0
- package/dist/auth/index.d.ts +91 -72
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/responses.d.ts +37 -37
- package/dist/auth/responses.d.ts.map +1 -1
- package/dist/contracts/balances.d.ts +17 -17
- package/dist/contracts/balances.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +5 -5
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/profile/index.d.ts +93 -0
- package/dist/profile/index.d.ts.map +1 -0
- package/dist/profile/index.js +7 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/sdk/index.d.ts +15 -26
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/network.d.ts +3 -3
- package/dist/sdk/network.d.ts.map +1 -1
- package/dist/trading/index.d.ts +36 -9
- package/dist/trading/index.d.ts.map +1 -1
- package/dist/trading/orders.d.ts +31 -1
- package/dist/trading/orders.d.ts.map +1 -1
- package/dist/trading/responses.d.ts +64 -8
- package/dist/trading/responses.d.ts.map +1 -1
- package/dist/vault/index.d.ts +2 -6
- package/dist/vault/index.d.ts.map +1 -1
- package/dist/vault/responses.d.ts +17 -17
- package/dist/vault/responses.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base API Types
|
|
3
|
+
*
|
|
4
|
+
* Common interface that all API implementations should inherit from.
|
|
5
|
+
* Provides standardized methods for token management and common functionality.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base API interface that all API implementations should inherit from.
|
|
9
|
+
* Provides common functionality for access token management.
|
|
10
|
+
*/
|
|
11
|
+
export interface BaseAPI {
|
|
12
|
+
/**
|
|
13
|
+
* Set the access token for authenticated requests.
|
|
14
|
+
*
|
|
15
|
+
* @param token - JWT access token
|
|
16
|
+
*/
|
|
17
|
+
setAccessToken(token: string): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;GAGG;AACH,MAAM,WAAW,OAAO;IACvB;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -4,87 +4,106 @@
|
|
|
4
4
|
* Types for authentication operations including challenge creation,
|
|
5
5
|
* signature verification, and backend authentication.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
type ChallengeResponse,
|
|
9
|
+
type VerifyResponse,
|
|
10
|
+
type BackendAuthResponse,
|
|
11
|
+
type TokenRefreshResponse,
|
|
12
|
+
User,
|
|
13
|
+
} from "./responses";
|
|
8
14
|
/**
|
|
9
15
|
* Auth API interface.
|
|
10
16
|
* Provides methods for frontend and backend authentication.
|
|
11
17
|
* Handles challenge creation, signature verification, and backend auth.
|
|
12
18
|
*/
|
|
13
19
|
export interface AuthAPI {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Complete authentication flow for frontend applications.
|
|
22
|
+
*
|
|
23
|
+
* This method handles the entire authentication process:
|
|
24
|
+
* 1. Creates a challenge
|
|
25
|
+
* 2. Signs the challenge message
|
|
26
|
+
* 3. Verifies the signature and returns JWT tokens
|
|
27
|
+
*
|
|
28
|
+
* @param clientId - Client ID of the application
|
|
29
|
+
* @returns Promise resolving to the verification response with JWT tokens
|
|
30
|
+
*/
|
|
31
|
+
authenticate(clientId: string): Promise<VerifyResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Signs a challenge message using the wallet client.
|
|
34
|
+
*
|
|
35
|
+
* Signs the provided message using the wallet's private key.
|
|
36
|
+
* This is used in the authentication flow to prove ownership of the wallet.
|
|
37
|
+
*
|
|
38
|
+
* @param message - The message to sign
|
|
39
|
+
* @returns Promise resolving to the signature
|
|
40
|
+
*/
|
|
41
|
+
signChallenge(message: string): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a challenge for frontend authentication.
|
|
44
|
+
* Generates a unique nonce and message that the user must sign with their wallet.
|
|
45
|
+
* @param address - Wallet address of the user
|
|
46
|
+
* @param clientId - Client ID of the application
|
|
47
|
+
* @returns Promise resolving to the challenge response
|
|
48
|
+
*/
|
|
49
|
+
createChallenge(
|
|
50
|
+
address: string,
|
|
51
|
+
clientId: string,
|
|
52
|
+
): Promise<ChallengeResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Verifies a signature for frontend authentication.
|
|
55
|
+
* Validates the signature against the challenge and returns JWT tokens.
|
|
56
|
+
* @param address - Wallet address of the user
|
|
57
|
+
* @param signature - Signature of the challenge message
|
|
58
|
+
* @param nonce - Nonce from the challenge response
|
|
59
|
+
* @param clientId - Client ID of the application
|
|
60
|
+
* @returns Promise resolving to the verification response with JWT tokens
|
|
61
|
+
*/
|
|
62
|
+
verifySignature(
|
|
63
|
+
address: string,
|
|
64
|
+
signature: string,
|
|
65
|
+
nonce: string,
|
|
66
|
+
clientId: string,
|
|
67
|
+
): Promise<VerifyResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Authenticates a backend service using a secret key.
|
|
70
|
+
* Returns JWT tokens for API access.
|
|
71
|
+
* @param secretKey - Secret key of the application
|
|
72
|
+
* @returns Promise resolving to the backend auth response with JWT tokens
|
|
73
|
+
*/
|
|
74
|
+
authenticateBackend(secretKey: string): Promise<BackendAuthResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* Refreshes an access token using a refresh token.
|
|
77
|
+
* @param refreshToken - The refresh token to use
|
|
78
|
+
* @returns Promise resolving to new access and refresh tokens
|
|
79
|
+
*/
|
|
80
|
+
refreshToken(refreshToken: string): Promise<TokenRefreshResponse>;
|
|
81
|
+
/**
|
|
82
|
+
* Revokes a refresh token.
|
|
83
|
+
* @param refreshToken - The refresh token to revoke
|
|
84
|
+
* @returns Promise resolving when the token is revoked
|
|
85
|
+
*/
|
|
86
|
+
revokeToken(refreshToken: string): Promise<void>;
|
|
73
87
|
}
|
|
74
88
|
/**
|
|
75
89
|
* Authentication state containing all tokens and metadata
|
|
76
90
|
*/
|
|
77
91
|
export interface AuthState {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
/** JWT access token for authenticated requests */
|
|
93
|
+
accessToken: string;
|
|
94
|
+
/** JWT refresh token for token renewal */
|
|
95
|
+
refreshToken: string;
|
|
96
|
+
/** Unix timestamp when the access token expires */
|
|
97
|
+
expiresAt: number;
|
|
98
|
+
/** Information about the authenticated user */
|
|
99
|
+
user: User;
|
|
100
|
+
/** When the auth state was created */
|
|
101
|
+
createdAt: number;
|
|
88
102
|
}
|
|
89
|
-
export type {
|
|
90
|
-
|
|
103
|
+
export type {
|
|
104
|
+
ChallengeResponse,
|
|
105
|
+
VerifyResponse,
|
|
106
|
+
BackendAuthResponse,
|
|
107
|
+
TokenRefreshResponse,
|
|
108
|
+
} from "./responses";
|
|
109
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,IAAI,EACJ,MAAM,aAAa,CAAC;AAMrB;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACvB;;;;;;;;;;OAUG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhD;;;;;;OAMG;IACH,eAAe,CACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE9B;;;;;;;;OAQG;IACH,eAAe,CACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;OAKG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAErE;;;;OAIG;IACH,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAElE;;;;OAIG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,IAAI,EAAE,IAAI,CAAC;IACX,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;CAClB;AAGD,YAAY,EACX,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/auth/responses.d.ts
CHANGED
|
@@ -7,60 +7,60 @@
|
|
|
7
7
|
* Response to a challenge request.
|
|
8
8
|
*/
|
|
9
9
|
export interface ChallengeResponse {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
/** Unique nonce for this challenge */
|
|
11
|
+
nonce: string;
|
|
12
|
+
/** Message to be signed by the user's wallet */
|
|
13
|
+
message: string;
|
|
14
|
+
/** Unix timestamp when the challenge expires */
|
|
15
|
+
expiresAt: number;
|
|
16
16
|
}
|
|
17
17
|
export interface User {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
/** Unique identifier for the user */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Wallet address of the user */
|
|
21
|
+
address: string;
|
|
22
|
+
/** Username of the user */
|
|
23
|
+
username?: string;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Response to a signature verification request.
|
|
27
27
|
*/
|
|
28
28
|
export interface VerifyResponse {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
/** JWT access token for authenticated requests */
|
|
30
|
+
accessToken: string;
|
|
31
|
+
/** JWT refresh token for token renewal */
|
|
32
|
+
refreshToken: string;
|
|
33
|
+
/** Unix timestamp when the access token expires */
|
|
34
|
+
expiresAt: number;
|
|
35
|
+
/** Information about the authenticated user */
|
|
36
|
+
user: User;
|
|
37
37
|
}
|
|
38
38
|
export interface ApplicationInfo {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
/** Unique identifier for the application */
|
|
40
|
+
id: string;
|
|
41
|
+
/** Human-readable name of the application */
|
|
42
|
+
name: string;
|
|
43
|
+
/** Client ID for frontend authentication */
|
|
44
|
+
clientId: string;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Response to a backend authentication request.
|
|
48
48
|
*/
|
|
49
49
|
export interface BackendAuthResponse {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
/** JWT access token for authenticated requests */
|
|
51
|
+
accessToken: string;
|
|
52
|
+
/** Unix timestamp when the access token expires */
|
|
53
|
+
expiresAt: number;
|
|
54
|
+
/** Information about the application */
|
|
55
|
+
application: ApplicationInfo;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Response to a token refresh request.
|
|
59
59
|
*/
|
|
60
60
|
export interface TokenRefreshResponse {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
/** New JWT access token */
|
|
62
|
+
accessToken: string;
|
|
63
|
+
/** Unix timestamp when the access token expires */
|
|
64
|
+
expiresAt: number;
|
|
65
65
|
}
|
|
66
|
-
//# sourceMappingURL=responses.d.ts.map
|
|
66
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/auth/responses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,iBAAiB;
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/auth/responses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,IAAI;IACpB,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,IAAI,EAAE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,eAAe;IAC/B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,WAAW,EAAE,eAAe,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -14,14 +14,14 @@ import { type Address } from "viem";
|
|
|
14
14
|
* @property name - Full token name
|
|
15
15
|
*/
|
|
16
16
|
export interface Token {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
/** Token contract address */
|
|
18
|
+
address: Address;
|
|
19
|
+
/** Token symbol (e.g. "ETH", "USDC") */
|
|
20
|
+
symbol: string;
|
|
21
|
+
/** Number of decimal places for token amounts */
|
|
22
|
+
decimals: number;
|
|
23
|
+
/** Full token name */
|
|
24
|
+
name: string;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Type representing a user's balance for a specific token in contract storage.
|
|
@@ -32,13 +32,13 @@ export interface Token {
|
|
|
32
32
|
* @property total - Total balance (available + locked)
|
|
33
33
|
*/
|
|
34
34
|
export interface UserBalance {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
/** Token address */
|
|
36
|
+
token: string;
|
|
37
|
+
/** Available balance for trading */
|
|
38
|
+
available: bigint;
|
|
39
|
+
/** Locked balance in open orders */
|
|
40
|
+
locked: bigint;
|
|
41
|
+
/** Total balance (available + locked) */
|
|
42
|
+
total: bigint;
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=balances.d.ts.map
|
|
44
|
+
//# sourceMappingURL=balances.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../../src/contracts/balances.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAMpC;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;
|
|
1
|
+
{"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../../src/contracts/balances.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAMpC;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IACrB,6BAA6B;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACb;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -11,8 +11,8 @@ import { CONTRACT_ABIS } from "@0xmonaco/contracts";
|
|
|
11
11
|
* @property VAULT - Vault contract address for managing user balances
|
|
12
12
|
*/
|
|
13
13
|
export interface ContractAddresses {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** Vault contract address for managing user balances */
|
|
15
|
+
VAULT: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Type representing all contract instances.
|
|
@@ -21,8 +21,8 @@ export interface ContractAddresses {
|
|
|
21
21
|
* @property vault - Vault contract instance for managing user balances
|
|
22
22
|
*/
|
|
23
23
|
export type ContractInstances = {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
/** Vault contract instance for managing user balances */
|
|
25
|
+
vault: GetContractReturnType<typeof CONTRACT_ABIS.vault>;
|
|
26
26
|
};
|
|
27
27
|
export type { Token, UserBalance } from "./balances";
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMpD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMpD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;CACd;AAMD;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,yDAAyD;IACzD,KAAK,EAAE,qBAAqB,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;CACzD,CAAC;AAGF,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* This package provides TypeScript types for the Monaco protocol.
|
|
5
5
|
* It includes SDK types, vault types, trading types, contract types, and common types.
|
|
6
6
|
*/
|
|
7
|
+
export * from "./api";
|
|
7
8
|
export * from "./sdk";
|
|
8
9
|
export * from "./vault";
|
|
9
10
|
export * from "./trading";
|
|
10
11
|
export * from "./contracts";
|
|
11
12
|
export * from "./auth";
|
|
13
|
+
export * from "./profile";
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* It includes SDK types, vault types, trading types, contract types, and common types.
|
|
6
6
|
*/
|
|
7
7
|
// Export everything from all modules
|
|
8
|
+
export * from "./api";
|
|
8
9
|
export * from "./sdk";
|
|
9
10
|
export * from "./vault";
|
|
10
11
|
export * from "./trading";
|
|
11
12
|
export * from "./contracts";
|
|
12
13
|
export * from "./auth";
|
|
14
|
+
export * from "./profile";
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qCAAqC;AACrC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qCAAqC;AACrC,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile Types
|
|
3
|
+
*
|
|
4
|
+
* Types for user profile operations including fetching user profile data.
|
|
5
|
+
*/
|
|
6
|
+
import { type BaseAPI } from "../api";
|
|
7
|
+
import { Balance } from "../vault/responses";
|
|
8
|
+
import { OrderSide, OrderStatus, OrderType } from "../trading/orders";
|
|
9
|
+
/**
|
|
10
|
+
* Account movement/transaction information.
|
|
11
|
+
* Represents transactions/movements returned in the profile's recent_movements array.
|
|
12
|
+
*/
|
|
13
|
+
export interface ProfileMovement {
|
|
14
|
+
/** Movement identifier */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Movement type */
|
|
17
|
+
type: "deposit" | "withdrawal" | "trade" | "transfer" | string;
|
|
18
|
+
/** Token address */
|
|
19
|
+
token: string;
|
|
20
|
+
/** Amount of the movement (as string to preserve precision) */
|
|
21
|
+
amount: string;
|
|
22
|
+
/** Movement timestamp (ISO string) */
|
|
23
|
+
timestamp: string;
|
|
24
|
+
/** Transaction hash if applicable */
|
|
25
|
+
hash?: string;
|
|
26
|
+
/** Movement status */
|
|
27
|
+
status: "pending" | "confirmed" | "failed" | string;
|
|
28
|
+
/** Optional description of the movement */
|
|
29
|
+
description?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Order information for recent orders.
|
|
33
|
+
* Represents orders returned in the profile's recent_orders array.
|
|
34
|
+
*/
|
|
35
|
+
export interface ProfileOrder {
|
|
36
|
+
/** Order identifier */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Trading pair/market identifier (e.g., "ETH-USD") */
|
|
39
|
+
trading_pair: string;
|
|
40
|
+
/** Order side */
|
|
41
|
+
side: OrderSide;
|
|
42
|
+
/** Order type */
|
|
43
|
+
order_type: OrderType;
|
|
44
|
+
/** Order price (null for market orders) */
|
|
45
|
+
price: string | null;
|
|
46
|
+
/** Order quantity */
|
|
47
|
+
quantity: string;
|
|
48
|
+
/** Order status */
|
|
49
|
+
status: OrderStatus;
|
|
50
|
+
/** Order creation timestamp (ISO string) */
|
|
51
|
+
created_at: string;
|
|
52
|
+
/** Order last update timestamp (ISO string) */
|
|
53
|
+
updated_at?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* User profile information returned by the /api/v1/accounts/me endpoint.
|
|
57
|
+
*/
|
|
58
|
+
export interface UserProfile {
|
|
59
|
+
/** Unique identifier for the user */
|
|
60
|
+
id: string;
|
|
61
|
+
/** Wallet address of the user */
|
|
62
|
+
address: string;
|
|
63
|
+
/** Username of the user (can be null) */
|
|
64
|
+
username: string | null;
|
|
65
|
+
/** Account type (e.g., "master") */
|
|
66
|
+
account_type: string;
|
|
67
|
+
/** Whether the user can withdraw funds */
|
|
68
|
+
can_withdraw: boolean;
|
|
69
|
+
/** Account creation timestamp (ISO string) */
|
|
70
|
+
created_at: string;
|
|
71
|
+
/** User's current balances */
|
|
72
|
+
balances: Balance[];
|
|
73
|
+
/** Recent account movements/transactions */
|
|
74
|
+
recent_movements: ProfileMovement[];
|
|
75
|
+
/** Recent trading orders */
|
|
76
|
+
recent_orders: ProfileOrder[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Profile API interface.
|
|
80
|
+
* Provides methods for fetching and managing user profile information.
|
|
81
|
+
*/
|
|
82
|
+
export interface ProfileAPI extends BaseAPI {
|
|
83
|
+
/**
|
|
84
|
+
* Get the current user's profile information.
|
|
85
|
+
*
|
|
86
|
+
* Fetches the profile data for the authenticated user using the /api/v1/accounts/me endpoint.
|
|
87
|
+
* Requires a valid access token to be set.
|
|
88
|
+
*
|
|
89
|
+
* @returns Promise resolving to the user's profile information
|
|
90
|
+
*/
|
|
91
|
+
getProfile(): Promise<UserProfile>;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMtE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/D,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpD,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,iBAAiB;IACjB,UAAU,EAAE,SAAS,CAAC;IACtB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,YAAY,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,4CAA4C;IAC5C,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,4BAA4B;IAC5B,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAMD;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO;IACzC;;;;;;;OAOG;IACH,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CAGpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -3,32 +3,25 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Core SDK configuration and main interface types.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import type { PublicClient, TransactionReceipt, Transport, WalletClient } from "viem";
|
|
7
|
+
import type { AuthAPI, AuthState } from "../auth";
|
|
8
|
+
import type { ProfileAPI } from "../profile";
|
|
9
|
+
import type { TradingAPI } from "../trading";
|
|
10
|
+
import type { VaultAPI } from "../vault";
|
|
11
|
+
import type { Network } from "./network";
|
|
11
12
|
/**
|
|
12
13
|
* Configuration options for the Monaco SDK.
|
|
13
14
|
*
|
|
14
|
-
* The SDK
|
|
15
|
-
*
|
|
16
|
-
* - `signer`: Viem PrivateKeyAccount for more control over account management
|
|
17
|
-
* - `account`: Custom Account implementation (overrides privateKey/signer)
|
|
18
|
-
*
|
|
19
|
-
* At least one authentication method must be provided.
|
|
20
|
-
*
|
|
21
|
-
* The SDK supports Sei Mainnet and Sei Testnet, defaulting to mainnet if no network is specified.
|
|
15
|
+
* The SDK requires a wallet client for signing operations.
|
|
16
|
+
* It also supports Sei Mainnet and Sei Testnet, defaulting to mainnet if no network is specified.
|
|
22
17
|
*/
|
|
23
18
|
export interface SDKConfig {
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
signer?: PrivateKeyAccount;
|
|
28
|
-
/** Custom Account implementation (overrides privateKey/signer) */
|
|
29
|
-
account?: Account;
|
|
30
|
-
/** Optional network override (defaults to 'mainnet') */
|
|
19
|
+
/** Wallet client for signing operations */
|
|
20
|
+
walletClient: WalletClient;
|
|
21
|
+
/** Optional: Network override (defaults to 'mainnet') */
|
|
31
22
|
network?: Network;
|
|
23
|
+
/** Optional: Transport for the public client */
|
|
24
|
+
transport?: Transport;
|
|
32
25
|
}
|
|
33
26
|
/**
|
|
34
27
|
* Core SDK interface providing access to all Monaco functionality.
|
|
@@ -40,6 +33,8 @@ export interface MonacoSDK {
|
|
|
40
33
|
vault: VaultAPI;
|
|
41
34
|
/** Trading operations API */
|
|
42
35
|
trading: TradingAPI;
|
|
36
|
+
/** Profile operations API */
|
|
37
|
+
profile: ProfileAPI;
|
|
43
38
|
/** Wallet client for all blockchain operations */
|
|
44
39
|
walletClient: WalletClient;
|
|
45
40
|
/** Public client for read-only blockchain operations */
|
|
@@ -58,12 +53,6 @@ export interface MonacoSDK {
|
|
|
58
53
|
getNetwork(): Network;
|
|
59
54
|
/** Get the current chain ID */
|
|
60
55
|
getChainId(): number;
|
|
61
|
-
/** Switch to a different account */
|
|
62
|
-
switchAccount(newAccount: Account): void;
|
|
63
|
-
/** Switch to a different private key */
|
|
64
|
-
switchPrivateKey(privateKey: Hex): void;
|
|
65
|
-
/** Check if the current account can sign messages */
|
|
66
|
-
canSign(): boolean;
|
|
67
56
|
/** Wait for a transaction to be confirmed */
|
|
68
57
|
waitForTransaction(hash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
|
|
69
58
|
}
|
package/dist/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACzB,2CAA2C;IAC3C,YAAY,EAAE,YAAY,CAAC;IAE3B,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,gDAAgD;IAChD,SAAS,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,0BAA0B;IAC1B,IAAI,EAAE,OAAO,CAAC;IAEd,2BAA2B;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAEhB,6BAA6B;IAC7B,OAAO,EAAE,UAAU,CAAC;IAEpB,6BAA6B;IAC7B,OAAO,EAAE,UAAU,CAAC;IAEpB,kDAAkD;IAClD,YAAY,EAAE,YAAY,CAAC;IAE3B,wDAAwD;IACxD,YAAY,EAAE,YAAY,CAAC;IAE3B,mCAAmC;IACnC,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAE5C,2CAA2C;IAC3C,YAAY,IAAI,SAAS,GAAG,SAAS,CAAC;IAEtC,yCAAyC;IACzC,eAAe,IAAI,OAAO,CAAC;IAE3B,8BAA8B;IAC9B,WAAW,IAAI,OAAO,CAAC;IAEvB,sCAAsC;IACtC,iBAAiB,IAAI,MAAM,CAAC;IAE5B,uDAAuD;IACvD,UAAU,IAAI,OAAO,CAAC;IAEtB,+BAA+B;IAC/B,UAAU,IAAI,MAAM,CAAC;IAErB,6CAA6C;IAC7C,kBAAkB,CACjB,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC/B;AAGD,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/sdk/network.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type Network = "mainnet" | "testnet";
|
|
|
15
15
|
* Contains the RPC URL and API URL for each supported network.
|
|
16
16
|
*/
|
|
17
17
|
export interface NetworkEndpoints {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
rpcUrl: string;
|
|
19
|
+
apiUrl: string;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=network.d.ts.map
|
|
21
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/sdk/network.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/sdk/network.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf"}
|
package/dist/trading/index.d.ts
CHANGED
|
@@ -3,19 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for trading operations including order placement and management.
|
|
5
5
|
*/
|
|
6
|
+
import { type BaseAPI } from "../api";
|
|
6
7
|
import { type OrderSide } from "./orders";
|
|
7
|
-
import { type CancelOrderResponse, type UpdateOrderResponse, type CreateOrderResponse } from "./responses";
|
|
8
|
+
import { type CancelOrderResponse, type UpdateOrderResponse, type CreateOrderResponse, type ReplaceOrderResponse, type GetPaginatedOrdersResponse, type GetPaginatedOrdersParams, type GetOrderResponse } from "./responses";
|
|
8
9
|
/**
|
|
9
10
|
* Trading API interface.
|
|
10
11
|
* Provides methods for placing and managing orders.
|
|
11
12
|
* Handles order placement, cancellation, and execution.
|
|
12
13
|
*/
|
|
13
|
-
export interface TradingAPI {
|
|
14
|
-
/**
|
|
15
|
-
* Set the access token for the TradingAPI
|
|
16
|
-
* @param token - The access token to set
|
|
17
|
-
*/
|
|
18
|
-
setAccessToken(token: string): void;
|
|
14
|
+
export interface TradingAPI extends BaseAPI {
|
|
19
15
|
/**
|
|
20
16
|
* Places a limit order on the order book.
|
|
21
17
|
* @param market - Market identifier (e.g., "ETH-USD")
|
|
@@ -59,7 +55,38 @@ export interface TradingAPI {
|
|
|
59
55
|
price?: string;
|
|
60
56
|
quantity?: string;
|
|
61
57
|
}): Promise<UpdateOrderResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Replaces an existing order with new parameters.
|
|
60
|
+
* Updates the order with new price, quantity, and balance settings.
|
|
61
|
+
* @param orderId - ID of the order to replace
|
|
62
|
+
* @param newOrder - New order parameters
|
|
63
|
+
* @param newOrder.price - New order price as string (optional)
|
|
64
|
+
* @param newOrder.quantity - New order quantity as string
|
|
65
|
+
* @param newOrder.useMasterBalance - Whether to use master balance (optional, defaults to false)
|
|
66
|
+
* @returns Promise resolving to the replace result
|
|
67
|
+
*/
|
|
68
|
+
replaceOrder(orderId: string, newOrder: {
|
|
69
|
+
price?: string;
|
|
70
|
+
quantity: string;
|
|
71
|
+
useMasterBalance?: boolean;
|
|
72
|
+
}): Promise<ReplaceOrderResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets paginated orders based on query parameters.
|
|
75
|
+
* @param params - Query parameters for filtering orders
|
|
76
|
+
* @param params.status - Filter by order status (optional)
|
|
77
|
+
* @param params.trading_pair - Filter by trading pair (optional)
|
|
78
|
+
* @param params.page - Page number for pagination (optional)
|
|
79
|
+
* @param params.page_size - Number of orders per page (optional)
|
|
80
|
+
* @returns Promise resolving to the paginated orders result
|
|
81
|
+
*/
|
|
82
|
+
getPaginatedOrders(params?: GetPaginatedOrdersParams): Promise<GetPaginatedOrdersResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Gets a single order by its ID.
|
|
85
|
+
* @param orderId - ID of the order to retrieve
|
|
86
|
+
* @returns Promise resolving to the order details
|
|
87
|
+
*/
|
|
88
|
+
getOrder(orderId: string): Promise<GetOrderResponse>;
|
|
62
89
|
}
|
|
63
|
-
export type { OrderSide, OrderType, } from "./orders";
|
|
64
|
-
export type { OrderResponse, CancelOrderResponse, UpdateOrderResponse, CreateOrderResponse } from "./responses";
|
|
90
|
+
export type { Order, OrderSide, OrderType, OrderStatus, TradingMode, } from "./orders";
|
|
91
|
+
export type { OrderResponse, CancelOrderResponse, UpdateOrderResponse, CreateOrderResponse, ReplaceOrderResponse, ClosePositionResponse, GetPaginatedOrdersResponse, GetPaginatedOrdersParams, GetOrderResponse, } from "./responses";
|
|
65
92
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trading/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAMrB;;;;GAIG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trading/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAMrB;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO;IAC1C;;;;;;;;;OASG;IACH,eAAe,CACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,GACC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC;;;;;;;;OAQG;IACH,gBAAgB,CACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,GACC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,WAAW,CACT,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GACA,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC;;;;;;;;;OASG;IACH,YAAY,CACV,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,GACA,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE3F;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAGD,YAAY,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,GACX,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
package/dist/trading/orders.d.ts
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for trading operations and order management.
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard order structure used across all order-related responses.
|
|
8
|
+
* This represents the complete order information as returned by the API.
|
|
9
|
+
*/
|
|
10
|
+
export interface Order {
|
|
11
|
+
/** Order identifier */
|
|
12
|
+
order_id: string;
|
|
13
|
+
/** Trading pair (e.g., "USDCo/MTK") */
|
|
14
|
+
trading_pair: string;
|
|
15
|
+
/** Order side */
|
|
16
|
+
side: OrderSide;
|
|
17
|
+
/** Order type */
|
|
18
|
+
order_type: OrderType;
|
|
19
|
+
/** Order status */
|
|
20
|
+
status: OrderStatus;
|
|
21
|
+
/** Order price */
|
|
22
|
+
price: string;
|
|
23
|
+
/** Order quantity */
|
|
24
|
+
quantity: string;
|
|
25
|
+
/** Filled quantity */
|
|
26
|
+
filled_quantity: string;
|
|
27
|
+
/** Remaining quantity */
|
|
28
|
+
remaining_quantity: string;
|
|
29
|
+
/** Trading mode */
|
|
30
|
+
trading_mode: TradingMode;
|
|
31
|
+
/** Order creation timestamp */
|
|
32
|
+
created_at: string;
|
|
33
|
+
/** Order update timestamp */
|
|
34
|
+
updated_at: string;
|
|
35
|
+
}
|
|
6
36
|
/**
|
|
7
37
|
* Order side for trading operations
|
|
8
38
|
*/
|
|
@@ -14,7 +44,7 @@ export type OrderType = "LIMIT" | "MARKET" | "POST_ONLY";
|
|
|
14
44
|
/**
|
|
15
45
|
* Order status for different order states
|
|
16
46
|
*/
|
|
17
|
-
export type OrderStatus = "SUBMITTED" | "FILLED" | "CANCELLED" | "REJECTED" | "PARTIALLY_FILLED";
|
|
47
|
+
export type OrderStatus = "PENDING" | "SUBMITTED" | "FILLED" | "CANCELLED" | "REJECTED" | "PARTIALLY_FILLED";
|
|
18
48
|
/**
|
|
19
49
|
* Trading mode
|
|
20
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/trading/orders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/trading/orders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;GAGG;AACH,MAAM,WAAW,KAAK;IACrB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,iBAAiB;IACjB,UAAU,EAAE,SAAS,CAAC;IACtB,mBAAmB;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB;IACnB,YAAY,EAAE,WAAW,CAAC;IAC1B,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,WAAW,GACpB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,GACX,UAAU,GACV,kBAAkB,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC"}
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Response types for trading operations.
|
|
5
5
|
*/
|
|
6
|
+
import type { Order, OrderStatus } from "./orders";
|
|
7
|
+
/**
|
|
8
|
+
* Response from placing an order (legacy - kept for backward compatibility).
|
|
9
|
+
*/
|
|
10
|
+
export interface OrderResponse {
|
|
11
|
+
/** Order identifier */
|
|
12
|
+
orderId: string;
|
|
13
|
+
/** Order status */
|
|
14
|
+
status: "accepted" | "rejected";
|
|
15
|
+
/** Timestamp of the response */
|
|
16
|
+
timestamp: number;
|
|
17
|
+
}
|
|
6
18
|
/**
|
|
7
19
|
* Response from creating an order.
|
|
8
20
|
*/
|
|
@@ -45,15 +57,22 @@ export interface UpdateOrderResponse {
|
|
|
45
57
|
};
|
|
46
58
|
}
|
|
47
59
|
/**
|
|
48
|
-
* Response from
|
|
60
|
+
* Response from replacing an order.
|
|
49
61
|
*/
|
|
50
|
-
export interface
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
|
|
62
|
+
export interface ReplaceOrderResponse {
|
|
63
|
+
/** Original order identifier that was replaced */
|
|
64
|
+
original_order_id: string;
|
|
65
|
+
/** New order identifier */
|
|
66
|
+
new_order_id: string;
|
|
67
|
+
/** Replace operation status */
|
|
68
|
+
status: "SUCCESS" | "FAILED";
|
|
69
|
+
/** Match result information for the new order */
|
|
70
|
+
match_result?: {
|
|
71
|
+
/** Remaining quantity after immediate matches */
|
|
72
|
+
remaining_quantity: string;
|
|
73
|
+
/** Status of the match */
|
|
74
|
+
status: string;
|
|
75
|
+
};
|
|
57
76
|
}
|
|
58
77
|
/**
|
|
59
78
|
* Response from closing a position (legacy - kept for backward compatibility).
|
|
@@ -70,4 +89,41 @@ export interface ClosePositionResponse {
|
|
|
70
89
|
/** Timestamp of the response */
|
|
71
90
|
timestamp: number;
|
|
72
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Query parameters for getting paginated orders
|
|
94
|
+
*/
|
|
95
|
+
export interface GetPaginatedOrdersParams {
|
|
96
|
+
/** Filter by order status */
|
|
97
|
+
status?: OrderStatus;
|
|
98
|
+
/** Filter by trading pair */
|
|
99
|
+
trading_pair?: string;
|
|
100
|
+
/** Page number for pagination (default: 1) */
|
|
101
|
+
page?: number;
|
|
102
|
+
/** Number of orders per page (default: 10, max: 100) */
|
|
103
|
+
page_size?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Response from getting paginated orders
|
|
107
|
+
*/
|
|
108
|
+
export interface GetPaginatedOrdersResponse {
|
|
109
|
+
/** Array of orders */
|
|
110
|
+
orders: Order[];
|
|
111
|
+
/** Total number of orders matching the query */
|
|
112
|
+
total: number;
|
|
113
|
+
/** Current page number */
|
|
114
|
+
page: number;
|
|
115
|
+
/** Number of orders per page */
|
|
116
|
+
page_size: number;
|
|
117
|
+
/** Total number of pages */
|
|
118
|
+
total_pages: number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Response from getting a single order by ID
|
|
122
|
+
*/
|
|
123
|
+
export interface GetOrderResponse {
|
|
124
|
+
/** Order data */
|
|
125
|
+
order: Order;
|
|
126
|
+
/** Request status */
|
|
127
|
+
status: "SUCCESS" | "FAILED";
|
|
128
|
+
}
|
|
73
129
|
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/trading/responses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/trading/responses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;IAChC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,+BAA+B;IAC/B,YAAY,CAAC,EAAE;QACd,iDAAiD;QACjD,kBAAkB,EAAE,MAAM,CAAC;QAC3B,0BAA0B;QAC1B,MAAM,EAAE,MAAM,CAAC;KACf,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,qBAAqB;IACrB,cAAc,EAAE;QACf,+BAA+B;QAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,kCAAkC;QAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,iDAAiD;IACjD,YAAY,CAAC,EAAE;QACb,iDAAiD;QACjD,kBAAkB,EAAE,MAAM,CAAC;QAC3B,0BAA0B;QAC1B,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,eAAe,CAAC;IACnD,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;CAClB;AAGD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,sBAAsB;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB;IACrB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B"}
|
package/dist/vault/index.d.ts
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for vault operations including deposits, withdrawals, and balance management.
|
|
5
5
|
*/
|
|
6
|
+
import { type BaseAPI } from "../api";
|
|
6
7
|
import { type Balance, type TransactionResult } from "./responses";
|
|
7
8
|
/**
|
|
8
9
|
* Vault API interface.
|
|
9
10
|
* Provides methods for managing token deposits and withdrawals.
|
|
10
11
|
* Handles token approvals and balance management.
|
|
11
12
|
*/
|
|
12
|
-
export interface VaultAPI {
|
|
13
|
+
export interface VaultAPI extends BaseAPI {
|
|
13
14
|
/**
|
|
14
15
|
* Approves the vault to spend tokens.
|
|
15
16
|
* @param token - Address of the token to approve
|
|
@@ -50,11 +51,6 @@ export interface VaultAPI {
|
|
|
50
51
|
* @returns Promise resolving to whether approval is needed
|
|
51
52
|
*/
|
|
52
53
|
needsApproval(token: string, amount: bigint): Promise<boolean>;
|
|
53
|
-
/**
|
|
54
|
-
* Set the access token for the VaultAPI
|
|
55
|
-
* @param token - The access token to set
|
|
56
|
-
*/
|
|
57
|
-
setAccessToken(token: string): void;
|
|
58
54
|
}
|
|
59
55
|
export type { Balance, TransactionResult } from "./responses";
|
|
60
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vault/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMnE;;;;GAIG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vault/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMnE;;;;GAIG;AACH,MAAM,WAAW,QAAS,SAAQ,OAAO;IACxC;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEnE;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEnE;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEpE;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7C;;;;;OAKG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAE/D;AAGD,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
* Response from a transaction.
|
|
8
8
|
*/
|
|
9
9
|
export interface TransactionResult {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
/** Transaction hash */
|
|
11
|
+
hash: string;
|
|
12
|
+
/** Transaction status */
|
|
13
|
+
status: "pending" | "confirmed" | "failed";
|
|
14
|
+
/** Nonce used for this operation */
|
|
15
|
+
nonce: bigint;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Token balance information.
|
|
19
19
|
*/
|
|
20
20
|
export interface Balance {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
/** Token address */
|
|
22
|
+
token: string;
|
|
23
|
+
/** Balance amount */
|
|
24
|
+
amount: bigint;
|
|
25
|
+
/** Formatted balance string */
|
|
26
|
+
formatted: string;
|
|
27
|
+
/** Token symbol */
|
|
28
|
+
symbol: string;
|
|
29
|
+
/** Token decimals */
|
|
30
|
+
decimals: number;
|
|
31
31
|
}
|
|
32
|
-
//# sourceMappingURL=responses.d.ts.map
|
|
32
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/vault/responses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,iBAAiB;
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/vault/responses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CACjB"}
|