"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createReadOnlyMessageTransmitterProgramInterface = exports.createMessageTransmitterProgramInterface = exports.createReadOnlyTokenMessengerProgramInterface = exports.createTokenMessengerProgramInterface = void 0;
const web3_js_1 = require("@solana/web3.js");
const anchor_1 = require("@project-serum/anchor");
const connect_sdk_solana_1 = require("@wormhole-foundation/connect-sdk-solana");
const __1 = require("../");
function createTokenMessengerProgramInterface(programId, provider) {
    return new anchor_1.Program(__1.idl.TokenMessengerIdl, new web3_js_1.PublicKey(programId), provider === undefined ? { connection: null } : provider);
}
exports.createTokenMessengerProgramInterface = createTokenMessengerProgramInterface;
function createReadOnlyTokenMessengerProgramInterface(programId, connection) {
    return createTokenMessengerProgramInterface(programId, connect_sdk_solana_1.utils.createReadOnlyProvider(connection));
}
exports.createReadOnlyTokenMessengerProgramInterface = createReadOnlyTokenMessengerProgramInterface;
function createMessageTransmitterProgramInterface(programId, provider) {
    return new anchor_1.Program(__1.idl.MessageTransmitterIdl, new web3_js_1.PublicKey(programId), provider === undefined ? { connection: null } : provider);
}
exports.createMessageTransmitterProgramInterface = createMessageTransmitterProgramInterface;
function createReadOnlyMessageTransmitterProgramInterface(programId, connection) {
    return createMessageTransmitterProgramInterface(programId, connect_sdk_solana_1.utils.createReadOnlyProvider(connection));
}
exports.createReadOnlyMessageTransmitterProgramInterface = createReadOnlyMessageTransmitterProgramInterface;
//# sourceMappingURL=program.js.map