Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ lib/
.DS_Store
coverage
.env
*.tgz
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
33 changes: 1 addition & 32 deletions spec.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -1540,7 +1509,7 @@
"servers": [],
"components": {
"schemas": {
"HealthResponseDTO": {
"ResponseDTO": {
"type": "object",
"properties": {
"ok": {
Expand Down
30 changes: 30 additions & 0 deletions src/baseSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 3 additions & 0 deletions src/client/services/Balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
28 changes: 7 additions & 21 deletions src/client/services/Server.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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<HealthResponseDTO> {
return __request(OpenAPI, {
method: "GET",
url: "/v2/health",
});
}

/**
* @returns any Health Check for Fund Movr API RPCS
* @throws ApiError
*/
public static getHealthRpc(): CancelablePromise<any> {
return __request(OpenAPI, {
method: "GET",
url: "/v2/health-rpc",
});
}


/**
* @returns GasPriceResponseDTO Current gas prices for a chain
Expand All @@ -51,6 +31,9 @@ export class Server {
query: {
chainId: chainId,
},
headers: {
"API-KEY": OpenAPI.API_KEY,
}
});
}

Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/client/services/Supported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export class Supported {
return __request(OpenAPI, {
method: "GET",
url: "/v2/supported/bridges",
headers: {
"API-KEY": OpenAPI.API_KEY,
},
});
}

Expand Down