diff --git a/.gitignore b/.gitignore index 8ec5b63..8201b1d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ lib/ .DS_Store coverage .env +*.tgz \ No newline at end of file diff --git a/package.json b/package.json index 3cfe2cd..2496c86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@socket.tech/socket-v2-sdk", - "version": "1.23.2", + "version": "1.23.3", "module": "lib/src/index.js", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", diff --git a/spec.json b/spec.json index e6f848f..6ac1949 100644 --- a/spec.json +++ b/spec.json @@ -1,37 +1,6 @@ { "openapi": "3.0.0", "paths": { - "/v2/health": { - "get": { - "operationId": "AppController_getHealth", - "parameters": [], - "responses": { - "200": { - "description": "Health Check for Fund Movr API", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthResponseDTO" - } - } - } - } - }, - "tags": ["Health"] - } - }, - "/v2/health-rpc": { - "get": { - "operationId": "AppController_getHealthRPC", - "parameters": [], - "responses": { - "200": { - "description": "Health Check for Fund Movr API RPCS" - } - }, - "tags": ["Health"] - } - }, "/v2/gas-price": { "get": { "operationId": "AppController_getGasPrice", @@ -1540,7 +1509,7 @@ "servers": [], "components": { "schemas": { - "HealthResponseDTO": { + "ResponseDTO": { "type": "object", "properties": { "ok": { diff --git a/src/baseSocket.ts b/src/baseSocket.ts index 62f7056..4cbbc02 100644 --- a/src/baseSocket.ts +++ b/src/baseSocket.ts @@ -102,6 +102,36 @@ export abstract class BaseSocket { return chain; } + /** + * get Balances for a user address + * @param userAddress The user address + */ + async getBalances({userAddress}) { + return await Balances.getBalances({userAddress}) + } + + + /** + * get Balance for a user address + * @param tokenAddress The token address + * @param chainId The chain id + * @param userAddress The user address + * @returns The balance + */ + + async getBalance({ + tokenAddress, + chainId, + userAddress, + }) { + return await Balances.getBalance({ + tokenAddress, + chainId, + userAddress, + }) + } + + /** * Get the list of tokens available for each chain for a given path * @param options diff --git a/src/client/index.ts b/src/client/index.ts index c4bb784..2ff7b51 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -17,7 +17,6 @@ export type { ChainDetails } from "./models/ChainDetails"; export type { ChainGasBalances } from "./models/ChainGasBalances"; export type { GasPriceResponseDTO } from "./models/GasPriceResponseDTO"; export type { GasTokenDetails } from "./models/GasTokenDetails"; -export type { HealthResponseDTO } from "./models/HealthResponseDTO"; export type { MinGasBalances } from "./models/MinGasBalances"; export type { NextTxOutputDTO } from "./models/NextTxOutputDTO"; export { NextTxResponse } from "./models/NextTxResponse"; diff --git a/src/client/services/Balances.ts b/src/client/services/Balances.ts index 64856e8..b98b141 100644 --- a/src/client/services/Balances.ts +++ b/src/client/services/Balances.ts @@ -43,6 +43,9 @@ export class Balances { return __request(OpenAPI, { method: "GET", url: "/v2/balances/token-balance", + headers: { + "API-KEY": OpenAPI.API_KEY, + }, query: { tokenAddress: tokenAddress, chainId: chainId, diff --git a/src/client/services/Server.ts b/src/client/services/Server.ts index 6c268e2..2a94089 100644 --- a/src/client/services/Server.ts +++ b/src/client/services/Server.ts @@ -1,6 +1,5 @@ import type { BridgeStatusResponseDTO } from "../models/BridgeStatusResponseDTO"; import type { GasPriceResponseDTO } from "../models/GasPriceResponseDTO"; -import type { HealthResponseDTO } from "../models/HealthResponseDTO"; import type { SingleTxDTO } from "../models/SingleTxDTO"; import type { SingleTxOutputDTO } from "../models/SingleTxOutputDTO"; import type { TokenPriceResponseDTO } from "../models/TokenPriceResponseDTO"; @@ -13,27 +12,8 @@ import { BridgeName } from "../models/BridgeDetails"; import { ChainId } from "../models/ChainId"; export class Server { - /** - * @returns HealthResponseDTO Health Check for Fund Movr API - * @throws ApiError - */ - public static getHealth(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/v2/health", - }); - } - /** - * @returns any Health Check for Fund Movr API RPCS - * @throws ApiError - */ - public static getHealthRpc(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/v2/health-rpc", - }); - } + /** * @returns GasPriceResponseDTO Current gas prices for a chain @@ -51,6 +31,9 @@ export class Server { query: { chainId: chainId, }, + headers: { + "API-KEY": OpenAPI.API_KEY, + } }); } @@ -70,6 +53,9 @@ export class Server { return __request(OpenAPI, { method: "GET", url: "/v2/token-price", + headers: { + "API-KEY": OpenAPI.API_KEY, + }, query: { tokenAddress: tokenAddress, chainId: chainId, diff --git a/src/client/services/Supported.ts b/src/client/services/Supported.ts index 32a86b0..1e9e197 100644 --- a/src/client/services/Supported.ts +++ b/src/client/services/Supported.ts @@ -15,6 +15,9 @@ export class Supported { return __request(OpenAPI, { method: "GET", url: "/v2/supported/bridges", + headers: { + "API-KEY": OpenAPI.API_KEY, + }, }); }