// SPDX-License-Identifier: Apache-2.0
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { CustodialWalletService, FireblocksConfig } from "@hashgraph/hedera-custodians-integration";
import { singleton } from "tsyringe";
import { WalletEvents } from "../../../../app/service/event/WalletEvent";
import LogService from "../../../../app/service/log/LogService";
import { SupportedWallets } from "../../../../domain/context/network/Wallet";
import { CustodialTransactionAdapter } from "./CustodialTransactionAdapter";
let FireblocksTransactionAdapter = class FireblocksTransactionAdapter extends CustodialTransactionAdapter {
    init() {
        this.eventService.emit(WalletEvents.walletInit, {
            wallet: this.getSupportedWallet(),
            initData: {},
        });
        LogService.logTrace("Fireblocks Initialized");
        return Promise.resolve(this.networkService.environment);
    }
    initCustodialWalletService(settings) {
        const { apiKey, apiSecretKey, baseUrl, vaultAccountId, assetId } = settings;
        this.custodialWalletService = new CustodialWalletService(new FireblocksConfig(apiKey, apiSecretKey, baseUrl, vaultAccountId, assetId));
    }
    getSupportedWallet() {
        return SupportedWallets.FIREBLOCKS;
    }
    stop() {
        this.client?.close();
        LogService.logTrace("Fireblocks stopped");
        this.eventService.emit(WalletEvents.walletDisconnect, {
            wallet: SupportedWallets.FIREBLOCKS,
        });
        return Promise.resolve(true);
    }
};
FireblocksTransactionAdapter = __decorate([
    singleton()
], FireblocksTransactionAdapter);
export { FireblocksTransactionAdapter };
