import BN from 'bn.js';
import { AmmPoolRequestPatch, ChainId, ConnectorNames, CounterFactualInfo, DualOrderRequest, ExitAmmPoolRequest, JoinAmmPoolRequest, NFTMintRequestV3, NFTOrderRequestV3, NFTTradeRequestV3, NFTWithdrawRequestV3, OffChainWithdrawalRequestV3, OriginNFTTransferRequestV3, OriginTransferRequestV3, PublicKey, SubmitOrderRequestV3, UpdateAccountRequestV3 } from '../../defs';
/**
 * BigNumber -> BigInt
 * BigNumber.from() -> BigInt() or \dn
 * div -> /
 * sub -> -
 * gt -> >
 * lt -> <
 * gte -> >=
 * eq -> ==
 * and -> &&=
 */
import * as loopring_defs from '../../defs/loopring_defs';
import Web3 from 'web3';
import { TypedDataDomain, TypedDataField } from 'ethers';
export declare enum GetEcDSASigType {
    HasDataStruct = 0,
    WithoutDataStruct = 1,
    Contract = 2
}
export interface KeyPairParams {
    web3: any;
    address: string;
    walletType: ConnectorNames;
    keySeed: string;
    chainId: ChainId;
    accountId?: number;
    counterFactualInfo?: CounterFactualInfo;
    isMobile?: boolean;
}
export declare function generatePrivateKey(result: {
    sig: string;
    counterFactualInfo: any;
    error: any;
}): {
    keyPair: {
        publicKeyX: string;
        publicKeyY: string;
        secretKey: string;
    };
    formatedPx: string;
    formatedPy: string;
    sk: string;
    counterFactualInfo: any;
};
export declare function generateKeyPair({ web3, address, walletType, keySeed, chainId, accountId, counterFactualInfo, isMobile, }: KeyPairParams, publicKey?: {
    x: string;
    y: string;
} | undefined): Promise<{
    keyPair: {
        publicKeyX: string;
        publicKeyY: string;
        secretKey: string;
    };
    formatedPx: string;
    formatedPy: string;
    sk: string;
    counterFactualInfo: any;
}>;
export declare function getEdDSASig(method: string, basePath: string, api_url: string, requestInfo: any, PrivateKey: string | undefined): string;
export declare function creatEdDSASigHasH({ method, basePath, api_url, requestInfo, }: {
    method: string;
    basePath: string;
    api_url: string;
    requestInfo: any;
}): {
    hash: any;
    hashRaw: string;
};
export declare function verifyEdDSASig(hash: string, input: {
    Rx: string;
    Ry: string;
    s: string;
}): Boolean;
export declare const getEdDSASigWithPoseidon: (inputs: any, PrivateKey: string | undefined) => {
    hash: any;
    result: string;
};
/**
 * @description sign EIP712
 * @param web3
 * @param account
 * @param method
 * @param params
 * @returns {Promise.<*>}
 */
export declare function signEip712(web3: any, account: string, method: string, params: any): Promise<any>;
export declare function signEip712WalletConnect(web3: any, account: string, typedData: any): Promise<any>;
export declare function getEcDSASig(web3: any, typedData: TypedData, address: string | undefined, type: GetEcDSASigType, chainId: ChainId, accountId?: number, pwd?: string, walletType?: ConnectorNames, counterFactualInfo?: CounterFactualInfo): Promise<{
    ecdsaSig: any;
    counterFactualInfo?: undefined;
} | {
    ecdsaSig: any;
    counterFactualInfo: any;
}>;
export declare function convertPublicKey2(pk: PublicKey): BN;
export declare function convertPublicKey(pk: PublicKey): BN;
export declare function getUpdateAccountEcdsaTypedData(data: UpdateAccountRequestV3, chainId: ChainId): TypedData;
export declare function get_EddsaSig_OffChainWithdraw(request: OffChainWithdrawalRequestV3, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function getOrderHash(request: SubmitOrderRequestV3): any;
interface TypedData {
    types: Record<string, Array<TypedDataField>>;
    domain: TypedDataDomain;
    primaryType: string;
    message: Record<string, any>;
}
export declare function getWithdrawTypedData(data: OffChainWithdrawalRequestV3, chainId: ChainId): TypedData;
export declare function offchainWithdrawWrap({ withdraw, chainId, web3, accountId, isHWAddr, counterFactualInfo, }: {
    withdraw: loopring_defs.OffChainWithdrawalRequestV3;
    web3: any;
    chainId: ChainId;
    accountId: number;
    isHWAddr: boolean;
    counterFactualInfo?: CounterFactualInfo;
}): Promise<any>;
export declare function get_EddsaSig_NFT_Withdraw(request: NFTWithdrawRequestV3, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function getNftData(request: NFTMintRequestV3): any;
export declare function getNFTMintTypedData(data: NFTMintRequestV3, chainId: ChainId, web3: Web3): TypedData;
export declare function getNFTWithdrawTypedData(data: NFTWithdrawRequestV3, chainId: ChainId): TypedData;
export declare function withdrawNFTWrap({ withdraw, chainId, web3, accountId, isHWAddr, counterFactualInfo, }: {
    withdraw: loopring_defs.NFTWithdrawRequestV3;
    web3: any;
    chainId: ChainId;
    accountId: number;
    isHWAddr: boolean;
    counterFactualInfo?: CounterFactualInfo;
}): Promise<any>;
export declare function get_EddsaSig_NFT_Mint(request: NFTMintRequestV3, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function get_Is_Nft_Token(tokenId: number): boolean;
export declare function get_EddsaSig_NFT_Order(request: NFTOrderRequestV3, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function get_EddsaSig_Dual_Order(request: DualOrderRequest, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function mintNFTWrap({ mint, chainId, web3, accountId, isHWAddr, counterFactualInfo, }: {
    mint: loopring_defs.NFTMintRequestV3;
    chainId: ChainId;
    web3: any;
    accountId: number;
    isHWAddr: boolean;
    counterFactualInfo?: CounterFactualInfo;
}): Promise<any>;
export declare function get_EddsaSig_Transfer(request: OriginTransferRequestV3, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function getTransferOldTypedData(data: OriginTransferRequestV3, chainId: ChainId): TypedData;
export declare function getTransferTypedData(data: OriginTransferRequestV3, chainId: ChainId): TypedData;
export declare function transferWrap({ transfer, chainId, web3, isHWAddr, accountId, counterFactualInfo, }: {
    transfer: loopring_defs.OriginTransferRequestV3;
    web3: any;
    chainId: ChainId;
    accountId: number;
    isHWAddr: boolean;
    counterFactualInfo?: CounterFactualInfo;
}): Promise<string>;
export declare function transferNFTWrap({ transfer, chainId, web3, isHWAddr, accountId, counterFactualInfo, }: {
    transfer: loopring_defs.OriginNFTTransferRequestV3;
    chainId: ChainId;
    web3: any;
    accountId: number;
    isHWAddr: boolean;
    counterFactualInfo?: CounterFactualInfo;
}): Promise<string>;
export declare function get_EddsaSig_NFT_Transfer(request: OriginNFTTransferRequestV3, eddsaKey: string): {
    hash: any;
    result: string;
};
export declare function getNftTradeHash(request: NFTTradeRequestV3): any;
export declare function getNFTTransferTypedData(data: OriginNFTTransferRequestV3, chainId: ChainId): TypedData;
export declare function eddsaSign(typedData: TypedData, eddsaKey: string): {
    eddsaSig: string;
};
export declare function eddsaSignWithDomain(domainHax: string, primaryType: string, message: Record<string, any>, types: Record<string, Array<TypedDataField>>, eddsaKey: string): {
    eddsaSig: string;
};
export declare function getAmmJoinEcdsaTypedData(data: JoinAmmPoolRequest, patch: AmmPoolRequestPatch): {
    types: {
        PoolJoin: {
            name: string;
            type: string;
        }[];
    };
    primaryType: string;
    domain: {
        name: string;
        version: string;
        chainId: ChainId;
        verifyingContract: string;
    };
    message: {
        owner: string;
        joinAmounts: string[];
        joinStorageIDs: number[];
        mintMinAmount: string;
        fee: string;
        validUntil: number | undefined;
    };
};
export declare function get_EddsaSig_JoinAmmPool(data: JoinAmmPoolRequest, patch: AmmPoolRequestPatch): {
    eddsaSig: string;
};
export declare function getAmmExitEcdsaTypedData(data: ExitAmmPoolRequest, patch: AmmPoolRequestPatch): {
    types: {
        PoolExit: {
            name: string;
            type: string;
        }[];
    };
    primaryType: string;
    domain: {
        name: string;
        version: string;
        chainId: ChainId;
        verifyingContract: string;
    };
    message: any;
};
export declare function get_EddsaSig_ExitAmmPool(data: ExitAmmPoolRequest, patch: AmmPoolRequestPatch): {
    eddsaSig: string;
};
export {};
//# sourceMappingURL=sign_tools.d.ts.map