import { Signer, TypedDataDomain, TypedDataField } from "ethers";
import { APIReferPayload, APIReferralCodePayload, APIReferralCodeSelectionPayload } from "./nodeSDKTypes";
/**
 * This is a 'standalone' class that deals with signatures
 * required for referral codes:
 * - referrer creates a new referral code for trader (no agency involved)
 * - agency creates a new referral code for a referrer and their trader
 * - trader selects a referral code to trade with
 *
 * Note that since the back-end is chain specific, the referral code is typically bound to
 * one chain, unless the backend employs code transferrals
 */
export default class ReferralCodeSigner {
    private provider;
    private rpcURL;
    private signingFun;
    private signingTypedDataFun;
    private address;
    constructor(signer: Signer | string | ((x: string | Uint8Array) => Promise<string>) | ((domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>) => Promise<string>), address: string, _rpcURL: string);
    createSignerInstance(_privateKey: string): Signer;
    getSignatureForNewReferral(rp: APIReferPayload): Promise<string>;
    getSignatureForNewCode(rc: APIReferralCodePayload): Promise<string>;
    getSignatureForCodeSelection(rc: APIReferralCodeSelectionPayload): Promise<string>;
    getAddress(): Promise<string>;
    /**
     * New agency/broker to agency referral
     * rc.PassOnPercTDF must be in 100*percentage unit
     * @param rc payload to sign
     * @param signingFun signing function
     * @returns signature
     */
    static getSignatureForNewReferral(rp: APIReferPayload, signingFun: (x: string | Uint8Array) => Promise<string>): Promise<string>;
    /**
     * New code
     * rc.PassOnPercTDF must be in 100*percentage unit
     * @param rc APIReferralCodePayload without signature
     * @param signingFun function that signs
     * @returns signature string
     */
    static getSignatureForNewCode(rc: APIReferralCodePayload, signingFun: (x: string | Uint8Array) => Promise<string>): Promise<string>;
    static getSignatureForCodeSelection(rc: APIReferralCodeSelectionPayload, signingFun: (x: string | Uint8Array) => Promise<string>): Promise<string>;
    private static _referralNewToMessage;
    /**
     * Convert payload to data struct to sign
     * @param rc payload
     * @returns typed data
     */
    static newReferralPayloadToTypedData(rc: APIReferPayload): {
        ParentAddr: `0x${string}`;
        ReferToAddr: `0x${string}`;
        PassOnPercTDF: number;
        CreatedOn: bigint;
    };
    /**
     * Create digest for referralCodePayload that is to be signed
     * @param rc payload
     * @returns the hex-string to be signed
     */
    private static _referralCodeNewCodePayloadToMessage;
    /**
     * Convert payload to data struct to sign
     * @param rc payload
     * @returns typed data
     */
    static referralCodeNewCodePayloadToTypedData(rc: APIReferralCodePayload): {
        Code: string;
        ReferrerAddr: `0x${string}`;
        PassOnPercTDF: number;
        CreatedOn: bigint;
    };
    /**
     * Create digest for APIReferralCodeSelectionPayload that is to be signed
     * @param rc payload
     * @returns the hex-string to be signed
     */
    private static _codeSelectionPayloadToMessage;
    /**
     * Convert payload to data struct to sign
     * @param rc payload
     * @returns typed data
     */
    static codeSelectionPayloadToTypedData(rc: APIReferralCodeSelectionPayload): {
        Code: string;
        TraderAddr: `0x${string}`;
        CreatedOn: bigint;
    };
    /**
     * Check whether signature is correct on payload:
     * - the referrer always signs
     * - if the agency is not an agency for this referrer, the backend will reject
     * @param rc referralcode payload with a signature
     * @returns true if correctly signed, false otherwise
     */
    static checkNewCodeSignature(rc: APIReferralCodePayload): boolean;
    static checkCodeSelectionSignature(rc: APIReferralCodeSelectionPayload): boolean;
}
