@pear-protocol/hyperliquid-sdk 0.1.26 → 0.1.27
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/hooks/useAuth.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/hooks/useAuth.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare function useAuth(): {
|
|
|
5
5
|
readonly address: string | null;
|
|
6
6
|
readonly accessToken: string | null;
|
|
7
7
|
readonly refreshToken: string | null;
|
|
8
|
-
readonly getEip712: (address: string) => Promise<GetEIP712MessageResponse>;
|
|
9
|
-
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
8
|
+
readonly getEip712: (address: string, chainId?: number) => Promise<GetEIP712MessageResponse>;
|
|
9
|
+
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number, chainId?: number) => Promise<void>;
|
|
10
10
|
readonly loginWithPrivyToken: (address: string, appId: string, privyAccessToken: string) => Promise<void>;
|
|
11
11
|
readonly refreshTokens: () => Promise<import("../types").RefreshTokenResponse>;
|
|
12
12
|
readonly logout: () => Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1472,8 +1472,8 @@ declare function useAuth(): {
|
|
|
1472
1472
|
readonly address: string | null;
|
|
1473
1473
|
readonly accessToken: string | null;
|
|
1474
1474
|
readonly refreshToken: string | null;
|
|
1475
|
-
readonly getEip712: (address: string) => Promise<GetEIP712MessageResponse>;
|
|
1476
|
-
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
1475
|
+
readonly getEip712: (address: string, chainId?: number) => Promise<GetEIP712MessageResponse>;
|
|
1476
|
+
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number, chainId?: number) => Promise<void>;
|
|
1477
1477
|
readonly loginWithPrivyToken: (address: string, appId: string, privyAccessToken: string) => Promise<void>;
|
|
1478
1478
|
readonly refreshTokens: () => Promise<RefreshTokenResponse>;
|
|
1479
1479
|
readonly logout: () => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -8048,17 +8048,17 @@ function useAuth() {
|
|
|
8048
8048
|
clearTimeout(timer);
|
|
8049
8049
|
};
|
|
8050
8050
|
}, [address, refreshToken$1]);
|
|
8051
|
-
async function getEip712(address) {
|
|
8052
|
-
const { data } = await getEIP712Message(apiBaseUrl, address, clientId);
|
|
8051
|
+
async function getEip712(address, chainId) {
|
|
8052
|
+
const { data } = await getEIP712Message(apiBaseUrl, address, clientId, chainId);
|
|
8053
8053
|
return data;
|
|
8054
8054
|
}
|
|
8055
|
-
async function loginWithSignedMessage(address, signature, timestamp) {
|
|
8055
|
+
async function loginWithSignedMessage(address, signature, timestamp, chainId) {
|
|
8056
8056
|
try {
|
|
8057
8057
|
const { data } = await authenticate(apiBaseUrl, {
|
|
8058
8058
|
method: 'eip712',
|
|
8059
8059
|
address,
|
|
8060
8060
|
clientId,
|
|
8061
|
-
details: { signature, timestamp },
|
|
8061
|
+
details: { signature, timestamp, chainId },
|
|
8062
8062
|
});
|
|
8063
8063
|
const accessTokenKey = `${address}_accessToken`;
|
|
8064
8064
|
const refreshTokenKey = `${address}_refreshToken`;
|