You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@ambitlabs/hyperliquid-sdk

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ambitlabs/hyperliquid-sdk - npm Package Compare versions

Comparing version

to
0.0.1-beta11

2

dist/cjs/ExchangeEndpoint.d.ts
import { HyperliquidEnvironment } from './constants';
import { Signature, Signer } from './Signer';
import { Signer, Signature } from './Signer';
export type ActionResponse<TResponse extends any = {

@@ -4,0 +4,0 @@ type: 'default';

@@ -1,5 +0,5 @@

import { Signer as EthersSigner } from 'ethers';
import { ExchangeEndpoint, HyperliquidAction, SpotDeployAction } from './ExchangeEndpoint';
import { AllMidsResponse, ClearingHouseStateResponse, InfoEndpoint, SpotMetaResponse, VaultDetailsResponse } from './InfoEndpoint';
import { Price } from './Price';
import { TypedDataSigner } from './Signer';
import { Size } from './Size';

@@ -46,6 +46,6 @@ import { HyperliquidEnvironment } from './constants';

readonly environment: HyperliquidEnvironment;
readonly signer?: EthersSigner | undefined;
readonly signer?: TypedDataSigner | undefined;
readonly exchange: ExchangeEndpoint | undefined;
readonly info: InfoEndpoint;
constructor(environment: HyperliquidEnvironment, signer?: EthersSigner | undefined);
constructor(environment: HyperliquidEnvironment, signer?: TypedDataSigner | undefined);
fetchSpotMeta(): Promise<SpotMetaResponse>;

@@ -52,0 +52,0 @@ fetchSpotTokens(): Promise<Record<string, {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HyperliquidSDK = void 0;
const Signer_1 = require("./Signer");
const ExchangeEndpoint_1 = require("./ExchangeEndpoint");
const InfoEndpoint_1 = require("./InfoEndpoint");
const Signer_1 = require("./Signer");
const constants_1 = require("./constants");

@@ -8,0 +8,0 @@ class HyperliquidSDK {

@@ -1,3 +0,7 @@

import { TypedDataDomain, TypedDataField, Signer as EthersSigner } from 'ethers';
import { TypedDataDomain, TypedDataField } from 'ethers';
import { HyperliquidEnvironment } from './constants';
type TypedDataSignerAction = (domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, values: Record<string, any>) => Promise<string>;
export type TypedDataSigner = {
signTypedData: TypedDataSignerAction;
} | TypedDataSignerAction;
export type Signature = {

@@ -9,5 +13,5 @@ r: string;

export declare class Signer {
readonly signer: EthersSigner;
readonly signer: TypedDataSigner;
readonly environment: HyperliquidEnvironment;
constructor(signer: EthersSigner, environment: HyperliquidEnvironment);
constructor(signer: TypedDataSigner, environment: HyperliquidEnvironment);
signL1Action(action: Record<string, any>, vaultAddress: string | null, nonce: number): Promise<Signature>;

@@ -20,1 +24,2 @@ signUserAction(action: Record<string, any>, types: Record<string, Array<TypedDataField>>): Promise<Signature>;

}
export {};

@@ -37,3 +37,3 @@ "use strict";

version: '1',
//chainId: 421614,
chainId: 421614,
verifyingContract: '0x0000000000000000000000000000000000000000',

@@ -48,3 +48,4 @@ };

async signAction(domain, types, value) {
const signature = await this.signer.signTypedData(domain, types, value);
const signer = typeof this.signer === 'function' ? this.signer : this.signer.signTypedData.bind(this.signer);
const signature = await signer(domain, types, value);
return this.splitSig(signature);

@@ -51,0 +52,0 @@ }

import { HyperliquidEnvironment } from './constants';
import { Signature, Signer } from './Signer';
import { Signer, Signature } from './Signer';
export type ActionResponse<TResponse extends any = {

@@ -4,0 +4,0 @@ type: 'default';

@@ -1,5 +0,5 @@

import { Signer as EthersSigner } from 'ethers';
import { ExchangeEndpoint, HyperliquidAction, SpotDeployAction } from './ExchangeEndpoint';
import { AllMidsResponse, ClearingHouseStateResponse, InfoEndpoint, SpotMetaResponse, VaultDetailsResponse } from './InfoEndpoint';
import { Price } from './Price';
import { TypedDataSigner } from './Signer';
import { Size } from './Size';

@@ -46,6 +46,6 @@ import { HyperliquidEnvironment } from './constants';

readonly environment: HyperliquidEnvironment;
readonly signer?: EthersSigner | undefined;
readonly signer?: TypedDataSigner | undefined;
readonly exchange: ExchangeEndpoint | undefined;
readonly info: InfoEndpoint;
constructor(environment: HyperliquidEnvironment, signer?: EthersSigner | undefined);
constructor(environment: HyperliquidEnvironment, signer?: TypedDataSigner | undefined);
fetchSpotMeta(): Promise<SpotMetaResponse>;

@@ -52,0 +52,0 @@ fetchSpotTokens(): Promise<Record<string, {

@@ -1,4 +0,4 @@

import { Signer } from './Signer';
import { ExchangeEndpoint, } from './ExchangeEndpoint';
import { InfoEndpoint, } from './InfoEndpoint';
import { Signer } from './Signer';
import { HYPERLIQUID_API_URL } from './constants';

@@ -5,0 +5,0 @@ export class HyperliquidSDK {

@@ -1,3 +0,7 @@

import { TypedDataDomain, TypedDataField, Signer as EthersSigner } from 'ethers';
import { TypedDataDomain, TypedDataField } from 'ethers';
import { HyperliquidEnvironment } from './constants';
type TypedDataSignerAction = (domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, values: Record<string, any>) => Promise<string>;
export type TypedDataSigner = {
signTypedData: TypedDataSignerAction;
} | TypedDataSignerAction;
export type Signature = {

@@ -9,5 +13,5 @@ r: string;

export declare class Signer {
readonly signer: EthersSigner;
readonly signer: TypedDataSigner;
readonly environment: HyperliquidEnvironment;
constructor(signer: EthersSigner, environment: HyperliquidEnvironment);
constructor(signer: TypedDataSigner, environment: HyperliquidEnvironment);
signL1Action(action: Record<string, any>, vaultAddress: string | null, nonce: number): Promise<Signature>;

@@ -20,1 +24,2 @@ signUserAction(action: Record<string, any>, types: Record<string, Array<TypedDataField>>): Promise<Signature>;

}
export {};

@@ -34,3 +34,3 @@ // NOTE: this has been adapted from the following

version: '1',
//chainId: 421614,
chainId: 421614,
verifyingContract: '0x0000000000000000000000000000000000000000',

@@ -45,3 +45,4 @@ };

async signAction(domain, types, value) {
const signature = await this.signer.signTypedData(domain, types, value);
const signer = typeof this.signer === 'function' ? this.signer : this.signer.signTypedData.bind(this.signer);
const signature = await signer(domain, types, value);
return this.splitSig(signature);

@@ -48,0 +49,0 @@ }

{
"name": "@ambitlabs/hyperliquid-sdk",
"version": "0.0.1-beta10",
"version": "0.0.1-beta11",
"types": "./dist/esm/index.d.ts",

@@ -5,0 +5,0 @@ "module": "./dist/esm/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet