"use strict";
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.migrateStrongholdSnapshotV2ToV3 = exports.listenMqtt = exports.getSecretManagerFromWallet = exports.getClientFromWallet = exports.destroyClient = exports.destroyWallet = exports.listenWalletAsync = exports.callWalletMethodAsync = exports.callUtilsMethod = exports.callSecretManagerMethodAsync = exports.callClientMethodAsync = exports.createSecretManager = exports.createWallet = exports.createClient = exports.initLogger = void 0;
// Import needs to be in a single line, otherwise it breaks
// prettier-ignore
// @ts-ignore: path is set to match runtime transpiled js path when bundled.
const iota_sdk_wasm_1 = require("../wasm/iota_sdk_wasm");
Object.defineProperty(exports, "initLogger", { enumerable: true, get: function () { return iota_sdk_wasm_1.initLogger; } });
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return iota_sdk_wasm_1.createClient; } });
Object.defineProperty(exports, "destroyClient", { enumerable: true, get: function () { return iota_sdk_wasm_1.destroyClient; } });
Object.defineProperty(exports, "createSecretManager", { enumerable: true, get: function () { return iota_sdk_wasm_1.createSecretManager; } });
Object.defineProperty(exports, "createWallet", { enumerable: true, get: function () { return iota_sdk_wasm_1.createWallet; } });
Object.defineProperty(exports, "callClientMethodAsync", { enumerable: true, get: function () { return iota_sdk_wasm_1.callClientMethodAsync; } });
Object.defineProperty(exports, "callSecretManagerMethodAsync", { enumerable: true, get: function () { return iota_sdk_wasm_1.callSecretManagerMethodAsync; } });
Object.defineProperty(exports, "callWalletMethodAsync", { enumerable: true, get: function () { return iota_sdk_wasm_1.callWalletMethodAsync; } });
Object.defineProperty(exports, "destroyWallet", { enumerable: true, get: function () { return iota_sdk_wasm_1.destroyWallet; } });
Object.defineProperty(exports, "listenWalletAsync", { enumerable: true, get: function () { return iota_sdk_wasm_1.listenWalletAsync; } });
Object.defineProperty(exports, "getClientFromWallet", { enumerable: true, get: function () { return iota_sdk_wasm_1.getClientFromWallet; } });
Object.defineProperty(exports, "getSecretManagerFromWallet", { enumerable: true, get: function () { return iota_sdk_wasm_1.getSecretManagerFromWallet; } });
Object.defineProperty(exports, "listenMqtt", { enumerable: true, get: function () { return iota_sdk_wasm_1.listenMqtt; } });
Object.defineProperty(exports, "migrateStrongholdSnapshotV2ToV3", { enumerable: true, get: function () { return iota_sdk_wasm_1.migrateStrongholdSnapshotV2ToV3; } });
const callUtilsMethod = (method) => {
    const response = JSON.parse((0, iota_sdk_wasm_1.callUtilsMethodRust)(JSON.stringify(method)));
    if (response.type == 'error' || response.type == 'panic') {
        throw response;
    }
    else {
        return response.payload;
    }
};
exports.callUtilsMethod = callUtilsMethod;
//# sourceMappingURL=bindings.js.map