UNPKG

@edgex-fe/typescript-sdk

Version:

Official TypeScript SDK for EdgeX API - Comprehensive trading and market data integration

879 lines (861 loc) 28.2 kB
import BN from 'bn.js'; /** * Configuration type definitions */ /** * Coin information in metadata */ interface CoinInfo { coinId: string; coinName: string; stepSize: string; showStepSize: string; iconUrl: string; starkExAssetId: string | null; starkExResolution: string | null; } /** * Risk tier information for contracts */ interface RiskTier { tier: number; positionValueUpperBound: string; maxLeverage: string; maintenanceMarginRate: string; starkExRisk: string; starkExUpperBound: string; } /** * Contract information in metadata */ interface ContractInfo { contractId: string; contractName: string; baseCoinId: string; quoteCoinId: string; tickSize: string; stepSize: string; minOrderSize: string; maxOrderSize: string; maxOrderBuyPriceRatio: string; minOrderSellPriceRatio: string; maxPositionSize: string; maxMarketPositionSize: string; riskTierList: RiskTier[]; defaultTakerFeeRate: string; defaultMakerFeeRate: string; defaultLeverage: string; liquidateFeeRate: string; enableTrade: boolean; enableDisplay: boolean; enableOpenPosition: boolean; fundingInterestRate: string; fundingImpactMarginNotional: string; fundingMaxRate: string; fundingMinRate: string; fundingRateIntervalMin: string; displayDigitMerge: string; displayMaxLeverage: string; displayMinLeverage: string; displayNewIcon: boolean; displayHotIcon: boolean; matchServerName: string; starkExSyntheticAssetId: string; starkExResolution: string; starkExOraclePriceQuorum: string; starkExOraclePriceSignedAssetId: string[]; starkExOraclePriceSigner: string[]; } /** * Token information in chain */ interface TokenInfo { tokenAddress: string; decimals: string; iconUrl: string; token: string; pullOff: boolean; withdrawEnable: boolean; useFixedRate: boolean; fixedRate: string; contractAddress: string; } /** * Chain information in multiChain */ interface ChainInfo { chain: string; chainId: string; chainIconUrl: string; contractAddress: string; depositGasFeeLess: boolean; feeLess: boolean; feeRate: string; gasLess: boolean; gasToken: string; minFee: string; rpcUrl: string; webTxUrl: string; withdrawGasFeeLess: boolean; tokenList: TokenInfo[]; txConfirm: string; blockTime: string; allowAaDeposit: boolean; allowAaWithdraw: boolean; allowDeposit: boolean; allowWithdraw: boolean; appRpcUrl: string; } /** * Global configuration in metadata */ interface GlobalConfig { appName: string; appEnv: string; appOnlySignOn: string; feeAccountId: string; feeAccountL2Key: string; poolAccountId: string; poolAccountL2Key: string; fastWithdrawAccountId: string; fastWithdrawAccountL2Key: string; fastWithdrawMaxAmount: string; fastWithdrawRegistryAddress: string; starkExChainId: string; starkExContractAddress: string; starkExCollateralCoin: CoinInfo; starkExMaxFundingRate: number; starkExOrdersTreeHeight: number; starkExPositionsTreeHeight: number; starkExFundingValidityPeriod: number; starkExPriceValidityPeriod: number; maintenanceReason: string; } /** * MultiChain configuration in metadata */ interface MultiChainConfig { coinId: string; maxWithdraw: string; minWithdraw: string; minDeposit: string; chainList: ChainInfo[]; } /** * Complete metadata structure */ interface Metadata { coinList: CoinInfo[]; contractList: ContractInfo[]; global: GlobalConfig; multiChain: MultiChainConfig; } /** * EdgeX SDK Configuration */ interface EdgeXConfig { /** Metadata configuration for StarkEx operations */ metadata?: Metadata; /** Custom client ID to include with all requests */ clientId?: string; } /** * Environment-specific endpoints */ declare const ENDPOINTS: { readonly PRODUCTION: "https://pro.edgex.exchange"; readonly TESTNET: "https://testnet.edgex.exchange"; }; /** * Authentication-related type definitions */ /** * API key credentials generated from wallet signature */ interface ApiKeyData { /** UUID format API key */ apiKey: string; /** Base64URL encoded passphrase */ apiPassphrase: string; /** Base64URL encoded secret for signing */ apiSecret: string; } /** * Layer 2 key pair for StarkEx operations */ interface L2KeyPair { /** Private key for L2 operations */ l2PrivateKey: string; /** Public key for L2 operations */ l2PublicKey: string; /** Y coordinate of public key */ l2PublicKeyY: string; } /** * Complete EdgeX keystore containing both API and L2 credentials */ interface EdgeXKeystore extends ApiKeyData, L2KeyPair { } /** * Authentication headers for API requests */ interface AuthHeaders { [key: string]: string; } /** * Parameters for generating API signatures */ interface SignatureParams { /** Request timestamp in milliseconds */ timestamp: string; /** HTTP method (GET, POST, etc.) */ httpMethod: string; /** Request URI path */ requestUri: string; /** Request body as query string */ requestBody: string; /** API secret for signing */ secret: string; } /** * Parameters for creating authentication headers */ interface CreateAuthHeadersParams { /** API key */ apiKey: string; /** API secret */ apiSecret: string; /** API passphrase */ passphrase: string; /** HTTP method */ method: string; /** Request path */ path: string; /** URL query params for GET requests (optional) */ params?: Record<string, unknown>; /** Request body (optional) */ body?: Record<string, unknown> | string | null; /** Request timestamp in milliseconds (optional, default: current time) */ timestamp?: string; } /** * Wallet signature data for keystore generation */ interface WalletSignatures { /** API signature from wallet */ apiSignature: string; /** Stark signature from wallet */ starkSignature: string; } /** * Symbol model for trading operations */ interface SymbolModel { /** Contract ID */ contractId: string; /** Symbol name */ symbol: string; /** Contract name */ contractName: string; /** Tick size */ tickSize: string; /** Taker fee rate */ takerFeeRate: string; /** Maker fee rate */ makerFeeRate: string; /** Oracle price */ oraclePrice: string; } /** * Take profit/Stop loss order parameters */ interface TpSlOrderParams { /** Order side: BUY, SELL */ side: string; /** Order size */ size: string; /** Order price */ price: string; /** Trigger price */ triggerPrice: string; /** Trigger price type: LAST_PRICE, INDEX_PRICE, ORACLE_PRICE */ triggerPriceType: string; } /** * Trade order parameters for generateTradeParams */ interface TradeOrderParams { /** Account ID */ accountId: string; /** Contract ID */ contractId: string; /** Order type: MARKET, LIMIT, STOP_MARKET, STOP_LIMIT, TAKE_PROFIT_MARKET, TAKE_PROFIT_LIMIT */ type: string; /** Order side: BUY, SELL */ side: string; /** Order size */ size: string; /** Order price */ price: string; /** Time in force: GOOD_TIL_CANCEL, IMMEDIATE_OR_CANCEL, FILL_OR_KILL */ timeInForce: string; /** Reduce only flag */ reduceOnly: boolean; /** Trigger price for conditional orders */ triggerPrice?: string; /** Trigger price type for conditional orders */ triggerPriceType?: string; /** Is position TP/SL */ isPositionTpsl: boolean; /** Is setting open TP */ isSetOpenTp: boolean; /** Is setting open SL */ isSetOpenSl: boolean; /** Extra type field */ extraType?: string; /** Extra data JSON field */ extraDataJson?: string; /** Open take profit parameters */ openTp?: TpSlOrderParams; /** Open stop loss parameters */ openSl?: TpSlOrderParams; } interface AccountInfo { accountId: string; } /** * Parameters for generateTradeParams function */ interface GenerateTradeParamsInput { /** Trade order parameters */ tradeParams: TradeOrderParams; /** Symbol information */ symbolInfo: SymbolModel; /** API keys */ apiKeys: ApiKeyData; /** L2 key pair */ l2KeyPair: L2KeyPair; /** Chain information */ chainInfo: { chainId: string; }; /** Account information */ accountInfo: AccountInfo; /** Request timestamp in milliseconds */ timestamp?: string; /** Request path */ requestPath?: string; /** HTTP method */ requestMethod?: string; } /** * Generated trade parameters output */ interface GenerateTradeParamsOutput { /** Authentication headers */ headers: AuthHeaders; /** Trade request parameters */ params: Record<string, unknown>; } declare enum TradeOrderSignatureType { MAIN_ORDER = "mainOrder", OPEN_TAKE_PROFIT = "openTp", OPEN_STOP_LOSS = "openSl" } /** * ETH withdrawal parameters input */ interface ETHWithdrawInput { /** Account ID */ accountId: string; /** Coin ID */ coinId: string; /** Withdrawal amount */ amount: string; /** Ethereum address for withdrawal */ ethAddress: string; /** Client withdrawal ID */ clientWithdrawId: string; /** Expiration time in milliseconds */ expireTime: string; /** L2 signature */ l2Signature?: string; } /** * ETH withdrawal parameters output */ interface ETHWithdrawOutput { /** Authentication headers */ headers: AuthHeaders; /** Withdrawal request parameters */ params: ETHWithdrawInput; } /** * Cross-chain withdrawal parameters input */ interface CrossWithdrawInput { /** Account ID */ accountId: string; /** Coin ID */ coinId: string; /** Withdrawal amount */ amount: string; /** Ethereum address for withdrawal */ ethAddress: string; /** ERC20 token address */ erc20Address: string; /** LP account ID */ lpAccountId: string; /** Client cross withdrawal ID */ clientCrossWithdrawId: string; /** Expiration time in milliseconds */ expireTime: string; /** Fee amount */ fee: string; /** Chain ID */ chainId: number; /** Cross withdraw L2 key */ crossWithdrawL2Key: string; /** L2 signature */ l2Signature?: string; } /** * Cross-chain withdrawal parameters output */ interface CrossWithdrawOutput { /** Authentication headers */ headers: AuthHeaders; /** Cross-chain withdrawal request parameters */ params: CrossWithdrawInput; } declare const TYPE_orderType: { LIMIT: string; MARKET: string; STOP_LIMIT: string; STOP_MARKET: string; TAKE_PROFIT_LIMIT: string; TAKE_PROFIT_MARKET: string; }; declare class EdgeXSDK { private static instance; private config; private apiKeys?; private l2KeyPair?; constructor(config?: EdgeXConfig); static getInstance(config?: EdgeXConfig): EdgeXSDK; static resetInstance(): void; setMetadata(metadata: Metadata): void; getMetadata(): Metadata | null; hasMetadata(): boolean; setApiKeys(apiKeys: ApiKeyData): void; getApiKeys(): ApiKeyData | undefined; setL2KeyPair(l2KeyPair: L2KeyPair): void; getL2KeyPair(): L2KeyPair | undefined; generateApiKeyFromSignature(signature: string): ApiKeyData; generateL2KeyPairFromSignature(signature: string): L2KeyPair; private updateHeaders; createAuthHeaders(params: Omit<CreateAuthHeadersParams, 'apiKey' | 'apiSecret' | 'passphrase'>): AuthHeaders; generateTradeParams(input: Omit<GenerateTradeParamsInput, 'apiKeys' | 'l2KeyPair'>): Promise<GenerateTradeParamsOutput>; generateETHWithdrawParams(input: ETHWithdrawInput, networkId: number, requestPath?: string, requestMethod?: string): Promise<ETHWithdrawOutput>; generateCrossWithdrawParams(input: CrossWithdrawInput, networkId: number, requestPath?: string, requestMethod?: string, timestamp?: string): Promise<CrossWithdrawOutput>; } /** * API Client type definitions */ /** * HTTP methods supported by the API client */ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; /** * Base API response structure */ interface ApiResponse<T = any> { /** Response data */ data: T; /** Response status code */ status: number; /** Response headers */ headers: Record<string, string>; } /** * API error response structure */ interface ApiErrorResponse { /** Error code */ code: string | number; /** Error message */ message: string; /** Additional error details */ details?: any; } /** * Request configuration for API calls */ interface RequestConfig { /** HTTP method */ method: HttpMethod; /** Request URL */ url: string; /** Request headers */ headers?: Record<string, string>; /** Request parameters (for GET) or body (for POST/PUT) */ data?: any; /** Request timeout */ timeout?: number; } /** * API Client interface */ interface ApiClient { /** Set keystore for authentication */ setKeystore(keystore: EdgeXKeystore): void; /** Get current keystore */ getKeystore(): EdgeXKeystore | undefined; /** Generate keystore from wallet signatures */ generateKeystore(apiSignature: string, starkSignature: string): EdgeXKeystore; /** Make authenticated API request */ request<T = any>(config: RequestConfig): Promise<ApiResponse<T>>; } /** * API-specific type definitions */ /** * Standard EdgeX API response wrapper */ interface EdgeXApiResponse<T = unknown> { /** Response code (0 for success) */ code: number; /** Response message */ msg: string; /** Response data */ data: T; /** Request timestamp */ timestamp?: number; } /** * Authentication header generation response */ interface AuthHeadersResponse { /** Generated authentication headers */ headers: Record<string, string>; /** Timestamp used for signature */ timestamp: number; /** Generated signature */ signature: string; } /** * Error type definitions */ /** * Base EdgeX SDK error */ declare class EdgeXError extends Error { readonly code: string | number; readonly details?: any; constructor(message: string, code?: string | number, details?: any); } /** * API-related errors */ declare class ApiError extends EdgeXError { constructor(message: string, code?: string | number, details?: any); } /** * Authentication-related errors */ declare class AuthError extends EdgeXError { constructor(message: string, code?: string | number, details?: any); } /** * Configuration-related errors */ declare class ConfigError extends EdgeXError { constructor(message: string, code?: string | number, details?: any); } /** * Network-related errors */ declare class NetworkError extends EdgeXError { constructor(message: string, code?: string | number, details?: any); } /** * Signature generation utilities * Using viem's keccak256 and js-sha256 to match edgex-web implementation */ /** * Generate API signature for authenticated requests * Using js-sha256 to match edgex-web implementation exactly */ declare function genApiSignature(params: SignatureParams): string; /** * Generate L2 signature parameters for main order */ declare function generateOrderSignature({ input, signatureType, }: { input: GenerateTradeParamsInput; signatureType: TradeOrderSignatureType; }): Promise<Record<string, string>>; /** * Generate L2 signature for ETH withdrawal */ declare function generateWithdrawalSignature({ amount, expireTime, clientWithdrawId, accountId, ethAddress, coinId, l2PrivateKey, networkId, }: { amount: string; expireTime: string; clientWithdrawId: string; accountId: string; ethAddress: string; coinId: string; l2PrivateKey: string; networkId?: number; }): Promise<string>; /** * Generate L2 signature for cross-chain withdrawal using SignableTransfer */ declare function generateCrossWithdrawSignature({ amount, expireTime, clientCrossWithdrawId, accountId, lpAccountId, crossWithdrawL2Key, l2PrivateKey, chainId, }: { amount: string; expireTime: string; clientCrossWithdrawId: string; accountId: string; lpAccountId: string; crossWithdrawL2Key: string; l2PrivateKey: string; chainId: number; }): Promise<string>; /** * Keystore generation utilities * Using viem's keccak256 to match edgex-web implementation */ /** * Generate API key data from wallet signature */ declare function generateApiKeyFromSignature(signature: string): ApiKeyData; /** * Generate L2 key pair from Stark signature */ declare function generateL2KeyPairFromSignature(signature: string): L2KeyPair; /** * Generate complete EdgeX keystore from wallet signatures */ declare function generateKeystore(apiSignature: string, starkSignature: string): EdgeXKeystore; /** * Validate keystore completeness */ declare function validateKeystore(keystore: Partial<EdgeXKeystore>): keystore is EdgeXKeystore; /** * Authentication headers generation */ /** * Create authentication headers for EdgeX API requests */ declare function createAuthHeaders(params: CreateAuthHeadersParams): AuthHeaders; /** * Create authentication headers with keystore * Convenience method that extracts credentials from keystore */ declare function createAuthHeadersFromKeystore(keystore: { apiKey: string; apiSecret: string; apiPassphrase: string; }, method: string, path: string, data?: any): AuthHeaders; /** * Generate trade parameters with signatures for trading requests */ declare function generateTradeParams(input: GenerateTradeParamsInput): Promise<GenerateTradeParamsOutput>; /** * Generate ETH withdrawal parameters with L2 signature and authentication headers */ declare function generateETHWithdrawParams(input: ETHWithdrawInput, apiKeys: ApiKeyData, l2KeyPair: L2KeyPair, networkId: number, requestPath?: string, requestMethod?: string, timestamp?: string): Promise<ETHWithdrawOutput>; /** * Generate cross-chain withdrawal parameters with L2 signature and authentication headers */ declare function generateCrossWithdrawParams(input: CrossWithdrawInput, apiKeys: ApiKeyData, l2KeyPair: L2KeyPair, networkId: number, requestPath?: string, requestMethod?: string, timestamp?: string): Promise<CrossWithdrawOutput>; /** * Convert a hexadecimal string to a BigNumber (BN) instance * Automatically removes '0x' prefix if present * * @param hex - Hexadecimal string (with or without '0x' prefix) * @returns BN instance representing the hex value in base 16 * @example hexToBn('0x1a2b') // returns BN representing 6699 */ declare function hexToBn(hex: string): BN; /** * Remove '0x' prefix from hex string if present * Used to normalize hex strings for cryptographic operations * * @param input - Hex string that may or may not have '0x' prefix * @returns Hex string without '0x' prefix * @example stripHexPrefix('0x1a2b') // returns '1a2b' * @example stripHexPrefix('1a2b') // returns '1a2b' */ declare function stripHexPrefix(input: string): string; /** * Create a StarkEx elliptic curve key pair from a private key * Accepts either a private key string or an object containing a privateKey property * * @param privateKeyOrKeyPair - Private key as hex string or object with privateKey property * @returns StarkEx elliptic curve key pair for cryptographic operations * @throws Error if the private key is invalid or cannot be normalized */ declare function asEcKeyPair(privateKeyOrKeyPair: string | any): any; /** * Extract key components from a StarkEx elliptic curve key pair * Converts the EC key pair into a simple object with hex string representations * * @param ecKeyPair - StarkEx elliptic curve key pair object * @returns Object containing publicKey, publicKeyYCoordinate, and privateKey as hex strings * @throws Error if the key pair has no private key */ declare function asSimpleKeyPair(ecKeyPair: any): { publicKey: string; publicKeyYCoordinate: string; privateKey: string; }; /** * Convert a BigNumber to a normalized 32-byte hex string * Ensures the output is exactly 64 characters (32 bytes) with leading zeros if needed * * @param bn - BigNumber instance to convert * @returns 64-character hex string (32 bytes) without '0x' prefix * @example bnToHex32(new BN(255)) // returns '00000000000000000000000000000000000000000000000000000000000000ff' */ declare function bnToHex32(bn: BN): string; /** * Normalize a hex string to a lowercase 32-byte (64 character) hex string without '0x' prefix * Pads with leading zeros if the input is shorter than 64 characters * Used to ensure consistent formatting for StarkEx cryptographic operations * * @param hex - Hex string to normalize (with or without '0x' prefix) * @returns 64-character lowercase hex string without '0x' prefix * @throws Error if the input is longer than 64 characters (more than 32 bytes) * @example normalizeHex32('0x1a2b') // returns '000000000000000000000000000000000000000000000000000000000001a2b' */ declare function normalizeHex32(hex: string): string; /** * Convert a hexadecimal string to a Uint8Array byte array * Automatically removes '0x' prefix if present * Each pair of hex characters becomes one byte in the array * * @param hex - Hexadecimal string (with or without '0x' prefix) * @returns Uint8Array containing the byte representation of the hex string * @example hexToByteArray('0x1a2b') // returns Uint8Array([26, 43]) * @example hexToByteArray('ff00') // returns Uint8Array([255, 0]) */ declare function hexToByteArray(hex: string): Uint8Array; /** * Convert a Uint8Array byte array to a hexadecimal string * Each byte is converted to a 2-character hex representation with leading zeros if needed * * @param byteArray - Uint8Array to convert to hex string * @returns Lowercase hex string without '0x' prefix * @example byteArrayToHex(new Uint8Array([26, 43, 255])) // returns '1a2bff' */ declare function byteArrayToHex(byteArray: Uint8Array): string; /** * Format a 32-character hex string as a UUID (8-4-4-4-12 format) * Used to convert API keys from hex format to standard UUID format * * @param apiKey - 32-character hex string (without dashes) * @returns UUID formatted string with dashes * @example uuidFormat('be923ec2aea9c91a2c2833ddcefaf7c1') // returns 'be923ec2-aea9-c91a-2c28-33ddcefaf7c1' */ declare function uuidFormat(apiKey: string): string; /** * Encode a byte array to URL-safe Base64 string * Removes padding characters and replaces URL-unsafe characters * Used for generating API secrets and passphrases * * @param byteArray - Uint8Array to encode * @returns URL-safe Base64 encoded string without padding * @example urlBase64Encode(new Uint8Array([72, 101, 108, 108, 111])) // returns 'SGVsbG8' */ declare function urlBase64Encode(byteArray: Uint8Array): string; /** * Extract a sub-array from a Uint8Array * Similar to Array.slice() but specifically for Uint8Array operations * * @param array - Source Uint8Array * @param start - Starting index (inclusive) * @param length - Number of bytes to extract * @returns New Uint8Array containing the specified range * @example subArray(new Uint8Array([1, 2, 3, 4, 5]), 1, 3) // returns Uint8Array([2, 3, 4]) */ declare function subArray(array: Uint8Array, start: number, length: number): Uint8Array; /** * Convert an object to a URL query string format * Handles nested objects, arrays, and special encoding rules for EdgeX API * Matches edgex-web implementation exactly for API signature compatibility * * @param obj - Object to convert to query string * @param prefix - Optional prefix for nested object keys * @returns URL-encoded query string * @example * toQueryString({a: 1, b: {c: 2}}) // returns 'a=1&b=c%3D2' * toQueryString({arr: [1, 2]}) // returns 'arr=1&2' */ declare function toQueryString(obj: any, prefix?: string): string; /** * Sort object keys recursively in ASCII order * Required for consistent API signature generation across different JavaScript engines * Matches edgex-web implementation exactly for signature compatibility * * @param obj - Object to sort (can be nested) * @returns New object with keys sorted alphabetically, or original value if not an object * @example * sortObjectByKeys({z: 1, a: {c: 3, b: 2}}) // returns {a: {b: 2, c: 3}, z: 1} */ declare function sortObjectByKeys(obj: any): any; /** * Add a prefix to a string if it's not already present * Commonly used to ensure hex strings have '0x' prefix for blockchain operations * * @param str - String to check and potentially modify * @param prefix - Prefix to add if not present * @returns String with prefix guaranteed to be present * @example checkPrefix('1a2b', '0x') // returns '0x1a2b' * @example checkPrefix('0x1a2b', '0x') // returns '0x1a2b' (unchanged) */ declare function checkPrefix(str: string, prefix: string): string; /** * Get current timestamp in milliseconds as a string * Used for API request timestamps and nonce generation * * @returns Current timestamp in milliseconds as string * @example getCurrentTimestamp() // returns '1640995200000' */ declare function getCurrentTimestamp(): string; /** * Generate a random client ID for API requests * Combines current timestamp with random digits for uniqueness * Used to identify individual API requests and prevent replay attacks * * @returns Unique client ID string combining timestamp and random digits * @example generateRandomClientId() // returns '1640995200000123456' */ declare function generateRandomClientId(): string; /** * Check if an order type represents a market order * Market orders execute immediately at current market price * Used to determine order processing logic and validation rules * * @param orderType - Order type string to check * @returns True if the order type is a market order variant * @example isMarketOrder('MARKET') // returns true * @example isMarketOrder('LIMIT') // returns false */ declare function isMarketOrder(orderType: string): boolean; /** * Calculate L2 price based on order type and side * Using BigNumber for precise calculations like edgex-web useCreateOrder */ declare function calculateL2Price(tradeParams: { type: string; side: string; price: string; }, symbolInfo: SymbolModel): string; /** * EdgeX TypeScript SDK - Main Entry Point * * A comprehensive TypeScript SDK for the EdgeX trading platform * providing seamless integration with REST API services. */ declare const VERSION: string; export { type AccountInfo, type ApiClient, ApiError, type ApiErrorResponse, type ApiKeyData, type ApiResponse, AuthError, type AuthHeaders, type AuthHeadersResponse, type ChainInfo, type CoinInfo, ConfigError, type ContractInfo, type CreateAuthHeadersParams, type CrossWithdrawInput, type CrossWithdrawOutput, ENDPOINTS, type ETHWithdrawInput, type ETHWithdrawOutput, type EdgeXApiResponse, type EdgeXConfig, EdgeXError, type EdgeXKeystore, EdgeXSDK, type GenerateTradeParamsInput, type GenerateTradeParamsOutput, type GlobalConfig, type HttpMethod, type L2KeyPair, type Metadata, type MultiChainConfig, NetworkError, type RequestConfig, type RiskTier, type SignatureParams, type SymbolModel, TYPE_orderType, type TokenInfo, type TpSlOrderParams, type TradeOrderParams, TradeOrderSignatureType, VERSION, type WalletSignatures, asEcKeyPair, asSimpleKeyPair, bnToHex32, byteArrayToHex, calculateL2Price, checkPrefix, createAuthHeaders, createAuthHeadersFromKeystore, EdgeXSDK as default, genApiSignature, generateApiKeyFromSignature, generateCrossWithdrawParams, generateCrossWithdrawSignature, generateETHWithdrawParams, generateKeystore, generateL2KeyPairFromSignature, generateOrderSignature, generateRandomClientId, generateTradeParams, generateWithdrawalSignature, getCurrentTimestamp, hexToBn, hexToByteArray, isMarketOrder, normalizeHex32, sortObjectByKeys, stripHexPrefix, subArray, toQueryString, urlBase64Encode, uuidFormat, validateKeystore };