"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAlpacaAccountBridge = void 0;
const jsHelpers_1 = require("../jsHelpers");
const getAccountShape_1 = require("./getAccountShape");
const jsHelpers_2 = require("@ledgerhq/coin-framework/bridge/jsHelpers");
const getAddressWrapper_1 = __importDefault(require("@ledgerhq/coin-framework/bridge/getAddressWrapper"));
const signer_1 = require("./signer");
const prepareTransaction_1 = require("./prepareTransaction");
const getTransactionStatus_1 = require("./getTransactionStatus");
const estimateMaxSpendable_1 = require("./estimateMaxSpendable");
const createTransaction_1 = require("./createTransaction");
const broadcast_1 = require("./broadcast");
const signOperation_1 = require("./signOperation");
const signRawOperation_1 = require("./signRawOperation");
const postSync_1 = require("./postSync");
function getAlpacaAccountBridge(network, kind, customSigner) {
    const signer = customSigner ?? (0, signer_1.getSigner)(network);
    return {
        sync: (0, jsHelpers_1.makeSync)({ getAccountShape: (0, getAccountShape_1.genericGetAccountShape)(network, kind), postSync: postSync_1.postSync }),
        receive: (0, jsHelpers_2.makeAccountBridgeReceive)((0, getAddressWrapper_1.default)(signer.getAddress)),
        createTransaction: createTransaction_1.createTransaction,
        updateTransaction: (jsHelpers_2.updateTransaction),
        prepareTransaction: (0, prepareTransaction_1.genericPrepareTransaction)(network, kind),
        getTransactionStatus: (0, getTransactionStatus_1.genericGetTransactionStatus)(network, kind),
        estimateMaxSpendable: (0, estimateMaxSpendable_1.genericEstimateMaxSpendable)(network, kind),
        broadcast: (0, broadcast_1.genericBroadcast)(network, kind),
        signOperation: (0, signOperation_1.genericSignOperation)(network, kind)(signer.context),
        signRawOperation: (0, signRawOperation_1.genericSignRawOperation)(network, kind)(signer.context),
        getSerializedAddressParameters: jsHelpers_2.getSerializedAddressParameters,
        validateAddress: (0, signer_1.getValidateAddress)(network),
    };
}
exports.getAlpacaAccountBridge = getAlpacaAccountBridge;
//# sourceMappingURL=accountBridge.js.map