/**
 * Obtain Event data from Platform App manifest
 *
 * @param {LiveAppManifest} manifest
 * @returns Object - event data
 */
function getEventData(manifest) {
    return { platform: manifest.name };
}
/**
 * Wrap call to underlying trackCall function.
 * @param trackCall
 * @returns a dictionary of event to trigger.
 */
export default function trackingWrapper(trackCall) {
    const track = (event, properties) => trackCall(event, properties, null);
    return {
        // Failed to load the iframe
        platformLoad: (manifest) => {
            track("Platform Load", getEventData(manifest));
        },
        // Failed to load the iframe
        platformReload: (manifest) => {
            track("Platform Reload", getEventData(manifest));
        },
        // Failed to load the iframe
        platformLoadFail: (manifest) => {
            // TODO: handle iframe failed
            track("Platform Load Fail", getEventData(manifest));
        },
        // Successfully loaded the iframe
        platformLoadSuccess: (manifest) => {
            track("Platform Load Success", getEventData(manifest));
        },
        // Sign transaction modal open
        platformSignTransactionRequested: (manifest) => {
            track("Platform SignTransaction", getEventData(manifest));
        },
        // Failed to sign transaction (cancel or error)
        platformSignTransactionFail: (manifest) => {
            track("Platform SignTransaction Fail", getEventData(manifest));
        },
        // Successfully signed transaction
        platformSignTransactionSuccess: (manifest) => {
            track("Platform SignTransaction Success", getEventData(manifest));
        },
        // Select account modal open
        platformRequestAccountRequested: (manifest) => {
            track("Platform RequestAccount", getEventData(manifest));
        },
        // Failed to select account (cancel or error)
        platformRequestAccountFail: (manifest) => {
            track("Platform RequestAccount Fail", getEventData(manifest));
        },
        // The user successfully selected an account
        platformRequestAccountSuccess: (manifest) => {
            track("Platform RequestAccount Success", getEventData(manifest));
        },
        // Select account modal open
        platformReceiveRequested: (manifest) => {
            track("Platform Receive", getEventData(manifest));
        },
        // Failed to select account (cancel or error)
        platformReceiveFail: (manifest) => {
            track("Platform Receive Fail", getEventData(manifest));
        },
        // The user successfully selected an account
        platformReceiveSuccess: (manifest) => {
            track("Platform Receive Success", getEventData(manifest));
        },
        // Failed to broadcast a signed transaction
        platformBroadcastFail: (manifest) => {
            track("Platform Broadcast Fail", getEventData(manifest));
        },
        // Successfully broadcast a signed transaction
        platformBroadcastSuccess: (manifest) => {
            track("Platform Broadcast Success", getEventData(manifest));
        },
        // Successfully broadcast a signed transaction
        platformBroadcastOperationDetailsClick: (manifest) => {
            track("Platform Broadcast OpD Clicked", getEventData(manifest));
        },
        // Generate Exchange nonce modal open
        platformStartExchangeRequested: (manifest) => {
            track("Platform start Exchange Nonce request", getEventData(manifest));
        },
        // Successfully generated an Exchange app nonce
        platformStartExchangeSuccess: (manifest) => {
            track("Platform start Exchange Nonce success", getEventData(manifest));
        },
        // Failed to generate an Exchange app nonce
        platformStartExchangeFail: (manifest) => {
            track("Platform start Exchange Nonce fail", getEventData(manifest));
        },
        platformCompleteExchangeRequested: (manifest) => {
            track("Platform complete Exchange requested", getEventData(manifest));
        },
        // Successfully completed an Exchange
        platformCompleteExchangeSuccess: (manifest) => {
            track("Platform complete Exchange success", getEventData(manifest));
        },
        // Failed to complete an Exchange
        platformCompleteExchangeFail: (manifest) => {
            track("Platform complete Exchange Nonce fail", getEventData(manifest));
        },
        platformSignMessageRequested: (manifest) => {
            track("Platform sign message requested", getEventData(manifest));
        },
        platformSignMessageSuccess: (manifest) => {
            track("Platform sign message success", getEventData(manifest));
        },
        platformSignMessageFail: (manifest) => {
            track("Platform sign message fail", getEventData(manifest));
        },
        platformSignMessageUserRefused: (manifest) => {
            track("Platform sign message user refused", getEventData(manifest));
        },
    };
}
//# sourceMappingURL=tracking.js.map