// 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, DFNSConfig } from "@hashgraph/hedera-custodians-integration";
import { singleton } from "tsyringe";
import { WalletEvents } from "../../../../app/service/event/WalletEvent";
import { SupportedWallets } from "../../../../domain/context/network/Wallet";
import { CustodialTransactionAdapter } from "./CustodialTransactionAdapter";
import LogService from "../../../../app/service/log/LogService";
let DFNSTransactionAdapter = class DFNSTransactionAdapter extends CustodialTransactionAdapter {
    init() {
        this.eventService.emit(WalletEvents.walletInit, {
            wallet: SupportedWallets.DFNS,
            initData: {},
        });
        LogService.logTrace("DFNS Initialized");
        return Promise.resolve(this.networkService.environment);
    }
    initCustodialWalletService(settings) {
        this.custodialWalletService = new CustodialWalletService(new DFNSConfig(settings.serviceAccountSecretKey, settings.serviceAccountCredentialId, settings.serviceAccountAuthToken, settings.appOrigin, settings.appId, settings.baseUrl, settings.walletId, settings.publicKey));
    }
    getSupportedWallet() {
        return SupportedWallets.DFNS;
    }
    stop() {
        this.client?.close();
        LogService.logTrace("DFNS stopped");
        this.eventService.emit(WalletEvents.walletDisconnect, {
            wallet: SupportedWallets.DFNS,
        });
        return Promise.resolve(true);
    }
};
DFNSTransactionAdapter = __decorate([
    singleton()
], DFNSTransactionAdapter);
export { DFNSTransactionAdapter };
