@bluefin-exchange/bluefin-v2-client
Version:
The Bluefin client Library allows traders to sign, create, retrieve and listen to orders on Bluefin Exchange.
53 lines (52 loc) • 2.23 kB
TypeScript
import { Keypair, OnChainCalls, SignatureScheme, SignatureWithBytes } from "@firefly-exchange/library-sui";
import { ExtendedNetwork } from "../src/interfaces/routes";
import { Errors } from "../src/constants";
import type { IBluefinSpotContracts } from "@firefly-exchange/library-sui/spot";
import type { IDeployment } from "@firefly-exchange/library-sui/v3";
/**
* Generates random number
* @param multiplier number to multiply with random number generated
* @returns random number
*/
export declare const generateRandomNumber: (multiplier: number) => number;
export declare function getKeyPairFromSeed(seed: string, scheme?: SignatureScheme): Keypair;
export declare function getSignerFromSeed(seed: string): Keypair;
export declare function readFile(filePath: string): any;
export declare function setupTestAccounts(deployerWallet: OnChainCalls, testWallets: any[], faucetURL: string): Promise<boolean>;
/**
* @description
* Generate a new wallet
* @returns private key and public address
* */
export declare function createWallet(): {
privateKey: string;
publicAddress: string;
};
export declare function combineAndEncode({ bytes, signature }: SignatureWithBytes): string;
/**
* Utility function to throw a CustomError.
*
* @param {Error} error - The original error object.
* @param {Errors} code - The error code.
* @param {string} [name] - Optional custom name for the error.
* @throws {CustomError}
*/
export declare function throwCustomError({ error, code, extra, }: {
error: Error | string;
code?: Errors;
extra?: Record<any, any>;
}): never;
export declare function filterDelistedMarkets(exchangeInfo: any): string[];
/**
* Determines if the network is mainnet based on ExtendedNetwork
* @param network ExtendedNetwork
* @returns boolean indicating if network is mainnet
*/
export declare function isMainnet(network: ExtendedNetwork): boolean;
/**
* Reads spot deployment configuration based on network type
* @param network ExtendedNetwork
* @returns IBluefinSpotContracts configuration
*/
export declare function getSpotDeploymentConfig(network: ExtendedNetwork): IBluefinSpotContracts;
export declare function getProDeploymentConfig(network: ExtendedNetwork): IDeployment;