"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Obtain Event data from WalletAPI App manifest
 *
 * @param {AppManifest} manifest
 * @returns Object - event data
 */
function getEventData(manifest) {
    return { walletAPI: manifest.name };
}
/**
 * Wrap call to underlying trackCall function.
 * @param trackCall
 * @returns a dictionary of event to trigger.
 */
// Disabling explicit module boundary types as we're using const
// in order to get the exact type matching the tracking wrapper API
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function trackingWrapper(trackCall) {
    const track = (event, properties) => trackCall(event, properties, null);
    return {
        // Sign message no params
        signMessageNoParams: (manifest) => {
            track("WalletAPI ACRE SignMessage no params", getEventData(manifest));
        },
        signMessageRequested: (manifest) => {
            track("WalletAPI ACRE sign message requested", getEventData(manifest));
        },
        signMessageSuccess: (manifest) => {
            track("WalletAPI ACRE sign message success", getEventData(manifest));
        },
        signMessageFail: (manifest) => {
            track("WalletAPI ACRE sign message fail", getEventData(manifest));
        },
        signMessageUserRefused: (manifest) => {
            track("WalletAPI ACRE sign message user refused", getEventData(manifest));
        },
        // Sign transaction no params
        signTransactionNoParams: (manifest) => {
            track("WalletAPI ACRE SignTransaction no params", getEventData(manifest));
        },
        // Sign transaction modal open
        signTransactionRequested: (manifest) => {
            track("WalletAPI ACRE SignTransaction", getEventData(manifest));
        },
        // Failed to sign transaction (cancel or error)
        signTransactionFail: (manifest) => {
            track("WalletAPI ACRE SignTransaction Fail", getEventData(manifest));
        },
        // Successfully signed transaction
        signTransactionSuccess: (manifest) => {
            track("WalletAPI ACRE SignTransaction Success", getEventData(manifest));
        },
        // Sign transaction and broadcast no params
        signTransactionAndBroadcastNoParams: (manifest) => {
            track("WalletAPI ACRE SignTransactionAndBroadcast no params", getEventData(manifest));
        },
        // Failed to broadcast a signed transaction
        broadcastFail: (manifest) => {
            track("WalletAPI ACRE Broadcast Fail", getEventData(manifest));
        },
        // Successfully broadcast a signed transaction
        broadcastSuccess: (manifest) => {
            track("WalletAPI ACRE Broadcast Success", getEventData(manifest));
        },
        // Successfully broadcast a signed transaction
        broadcastOperationDetailsClick: (manifest) => {
            track("WalletAPI ACRE Broadcast OpD Clicked", getEventData(manifest));
        },
    };
}
exports.default = trackingWrapper;
//# sourceMappingURL=tracking.js.map