import { RespSendTx } from "."; declare enum NonceManagerType { OPTIMISTIC = "optimistic", PESSIMISTIC = "pessimistic" } export { NonceManagerType }; export declare class CreateOrder { static from_json(json: string): any; } export declare class CancelOrder { static from_json(json: string): any; } export declare class Withdraw { static from_json(json: string): any; } export declare class CreateGroupedOrders { static from_json(json: string): any; } /** * Initializes and loads the native signer library, binding all FFI functions. * * This function performs platform detection, locates the appropriate native library * (`.so`, `.dylib`, or `.dll`), loads it via koffi FFI, and binds all cryptographic * signing functions. The library and functions are cached after the first load to * avoid redundant initialization. * * @returns An object containing all bound FFI functions from the native library: * - GenerateAPIKey: Generates a new API key pair * - CreateClient: Creates a client instance for signing operations * - CheckClient: Validates client configuration * - SignChangePubKey: Signs a change public key transaction * - SignCreateOrder: Signs an order creation transaction * - SignCreateGroupedOrders: Signs multiple grouped orders * - SignCancelOrder: Signs an order cancellation transaction * - SignWithdraw: Signs a withdrawal transaction * - SignCreateSubAccount: Signs a sub-account creation transaction * - SignCancelAllOrders: Signs a cancel all orders transaction * - SignModifyOrder: Signs an order modification transaction * - SignTransfer: Signs a transfer transaction * - SignCreatePublicPool: Signs a public pool creation transaction * - SignUpdatePublicPool: Signs a public pool update transaction * - SignMintShares: Signs a share minting transaction * - SignBurnShares: Signs a share burning transaction * - SignUpdateLeverage: Signs a leverage update transaction * - CreateAuthToken: Creates an authentication token * * @throws {Error} If the platform/architecture is unsupported (only Linux x64, * macOS arm64, and Windows x64 are supported) * @throws {Error} If the signer library file is not found in the expected location * @throws {Error} If the library fails to load or bind functions * * @remarks * - The function uses caching to ensure the library is only loaded once per process * - Platform detection is based on `os.platform()` and `os.arch()` * - The signers directory is expected to be at `{projectRoot}/signers/` * - Library paths are resolved and normalized before loading */ export declare function initialize_signer(): any; export declare function create_api_key(seed?: string): [string | null, string | null, string | null]; export interface SignerClientOptions { max_api_key_index?: number; private_keys?: { [key: number]: string; }; nonce_management_type?: NonceManagerType; } export declare class SignerClient { static readonly USDC_TICKER_SCALE = 1000000; static readonly ETH_TICKER_SCALE = 100000000; static readonly TX_TYPE_CHANGE_PUB_KEY = 8; static readonly TX_TYPE_CREATE_SUB_ACCOUNT = 9; static readonly TX_TYPE_CREATE_PUBLIC_POOL = 10; static readonly TX_TYPE_UPDATE_PUBLIC_POOL = 11; static readonly TX_TYPE_TRANSFER = 12; static readonly TX_TYPE_WITHDRAW = 13; static readonly TX_TYPE_CREATE_ORDER = 14; static readonly TX_TYPE_CANCEL_ORDER = 15; static readonly TX_TYPE_CANCEL_ALL_ORDERS = 16; static readonly TX_TYPE_MODIFY_ORDER = 17; static readonly TX_TYPE_MINT_SHARES = 18; static readonly TX_TYPE_BURN_SHARES = 19; static readonly TX_TYPE_UPDATE_LEVERAGE = 20; static readonly TX_TYPE_CREATE_GROUP_ORDER = 28; static readonly ORDER_TYPE_LIMIT = 0; static readonly ORDER_TYPE_MARKET = 1; static readonly ORDER_TYPE_STOP_LOSS = 2; static readonly ORDER_TYPE_STOP_LOSS_LIMIT = 3; static readonly ORDER_TYPE_TAKE_PROFIT = 4; static readonly ORDER_TYPE_TAKE_PROFIT_LIMIT = 5; static readonly ORDER_TYPE_TWAP = 6; static readonly ORDER_TIME_IN_FORCE_IMMEDIATE_OR_CANCEL = 0; static readonly ORDER_TIME_IN_FORCE_GOOD_TILL_TIME = 1; static readonly ORDER_TIME_IN_FORCE_POST_ONLY = 2; static readonly CANCEL_ALL_TIF_IMMEDIATE = 0; static readonly CANCEL_ALL_TIF_SCHEDULED = 1; static readonly CANCEL_ALL_TIF_ABORT = 2; static readonly NIL_TRIGGER_PRICE = 0; static readonly DEFAULT_28_DAY_ORDER_EXPIRY = -1; static readonly DEFAULT_IOC_EXPIRY = 0; static readonly DEFAULT_10_MIN_AUTH_EXPIRY = -1; static readonly MINUTE = 60; static readonly CROSS_MARGIN_MODE = 0; static readonly ISOLATED_MARGIN_MODE = 1; static readonly ISOLATED_MARGIN_REMOVE_COLLATERAL = 0; static readonly ISOLATED_MARGIN_ADD_COLLATERAL = 1; static readonly ROUTE_PERP = 0; static readonly ROUTE_SPOT = 1; static readonly ASSET_ID_USDC = 3; static readonly ASSET_ID_ETH = 1; static readonly GROUPING_TYPE_ONE_TRIGGERS_THE_OTHER = 1; static readonly GROUPING_TYPE_ONE_CANCELS_THE_OTHER = 2; static readonly GROUPING_TYPE_ONE_TRIGGERS_A_ONE_CANCELS_THE_OTHER = 3; private url; private private_key; private chain_id; private api_key_index; private end_api_key_index; private api_key_dict; private account_index; private signer; private tx_api; private order_api; private nonce_manager; constructor(url: string, private_key: string, api_key_index: number, account_index: number, options?: SignerClientOptions); private validate_api_private_keys; private build_api_key_dict; private create_client; check_client(): string | null; switch_api_key(api_key: number): string | null; create_api_key(seed?: string): [string | null, string | null, string | null]; sign_change_api_key(eth_private_key: string, new_pubkey: string, nonce?: number, api_key_index?: number): Promise<[number | null, string | null, string | null, string | null]>; get_api_key_nonce(api_key_index: number, nonce: number): [number, number]; sign_create_order(market_index: number, client_order_index: number, base_amount: number, price: number, is_ask: boolean, order_type: number, time_in_force: number, reduce_only: boolean, trigger_price: number, order_expiry: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_create_grouped_orders(grouping_type: number, orders: any[], nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_cancel_order(market_index: number, order_index: bigint, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_withdraw(asset_index: number, route_type: number, amount: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_create_sub_account(nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_cancel_all_orders(time_in_force: number, timestamp_ms: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_modify_order(market_index: number, order_index: number, base_amount: number, price: number, trigger_price: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_transfer(eth_private_key: string, to_account_index: number, asset_id: number, route_from: number, route_to: number, usdc_amount: number, fee: number, memo: string, nonce?: number, api_key_index?: number): Promise<[number | null, string | null, string | null, string | null]>; sign_create_public_pool(operator_fee: number, initial_total_shares: number, min_operator_share_rate: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_update_public_pool(public_pool_index: number, status: number, operator_fee: number, min_operator_share_rate: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_mint_shares(public_pool_index: number, share_amount: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_burn_shares(public_pool_index: number, share_amount: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_update_leverage(market_index: number, fraction: number, margin_mode: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; sign_update_margin(market_index: number, usdc_amount: number, direction: number, nonce?: number, api_key_index?: number): [number | null, string | null, string | null, string | null]; create_auth_token_with_expiry(deadline?: number, timestamp?: number, api_key_index?: number): [string | null, string | null]; private process_api_key_and_nonce; change_api_key(eth_private_key: string, new_pubkey: string, nonce?: number, api_key_index?: number): Promise<[any, string | null]>; create_order(market_index: number, client_order_index: number, base_amount: number, price: number, is_ask: boolean, order_type: number, time_in_force: number, reduce_only?: boolean, trigger_price?: number, order_expiry?: number, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_grouped_orders(grouping_type: number, orders: any[], nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_market_order(market_index: number, client_order_index: number, base_amount: number, avg_execution_price: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_market_order_limited_slippage(market_index: number, client_order_index: number, base_amount: number, max_slippage: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number, ideal_price?: number): Promise<[any, RespSendTx | null, string | null]>; create_market_order_if_slippage(market_index: number, client_order_index: number, base_amount: number, max_slippage: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number, ideal_price?: number): Promise<[any, RespSendTx | null, string | null]>; cancel_order(market_index: number, order_index: bigint, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_tp_order(market_index: number, client_order_index: number, base_amount: number, trigger_price: number, price: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_tp_limit_order(market_index: number, client_order_index: number, base_amount: number, trigger_price: number, price: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_sl_order(market_index: number, client_order_index: number, base_amount: number, trigger_price: number, price: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_sl_limit_order(market_index: number, client_order_index: number, base_amount: number, trigger_price: number, price: number, is_ask: boolean, reduce_only?: boolean, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; withdraw(asset_id: number, route_type: number, amount: number, nonce?: number, api_key_index?: number): Promise<[any, RespSendTx | null, string | null]>; create_sub_account(nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; cancel_all_orders(time_in_force: number, timestamp_ms: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; modify_order(market_index: number, order_index: number, base_amount: number, price: number, trigger_price: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; transfer(eth_private_key: string, to_account_index: number, asset_id: number, route_from: number, route_to: number, amount: number, fee: number, memo: string, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; create_public_pool(operator_fee: number, initial_total_shares: number, min_operator_share_rate: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; update_public_pool(public_pool_index: number, status: number, operator_fee: number, min_operator_share_rate: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; mint_shares(public_pool_index: number, share_amount: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; burn_shares(public_pool_index: number, share_amount: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; update_leverage(market_index: number, margin_mode: number, leverage: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; update_margin(market_index: number, usdc_amount: number, direction: number, nonce?: number, api_key_index?: number): Promise<[string | null, RespSendTx | null, string | null]>; send_tx(tx_type: number, tx_info: string): Promise; close(): Promise; static are_keys_equal(key1: string, key2: string): boolean; } //# sourceMappingURL=signer.d.ts.map