import { makeSync } from "../jsHelpers";
import { genericGetAccountShape } from "./getAccountShape";
import { getSerializedAddressParameters, makeAccountBridgeReceive, updateTransaction, } from "@ledgerhq/coin-framework/bridge/jsHelpers";
import getAddressWrapper from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
import { getSigner, getValidateAddress } from "./signer";
import { genericPrepareTransaction } from "./prepareTransaction";
import { genericGetTransactionStatus } from "./getTransactionStatus";
import { genericEstimateMaxSpendable } from "./estimateMaxSpendable";
import { createTransaction } from "./createTransaction";
import { genericBroadcast } from "./broadcast";
import { genericSignOperation } from "./signOperation";
import { genericSignRawOperation } from "./signRawOperation";
import { postSync } from "./postSync";
export function getAlpacaAccountBridge(network, kind, customSigner) {
    const signer = customSigner ?? getSigner(network);
    return {
        sync: makeSync({ getAccountShape: genericGetAccountShape(network, kind), postSync }),
        receive: makeAccountBridgeReceive(getAddressWrapper(signer.getAddress)),
        createTransaction: createTransaction,
        updateTransaction: (updateTransaction),
        prepareTransaction: genericPrepareTransaction(network, kind),
        getTransactionStatus: genericGetTransactionStatus(network, kind),
        estimateMaxSpendable: genericEstimateMaxSpendable(network, kind),
        broadcast: genericBroadcast(network, kind),
        signOperation: genericSignOperation(network, kind)(signer.context),
        signRawOperation: genericSignRawOperation(network, kind)(signer.context),
        getSerializedAddressParameters,
        validateAddress: getValidateAddress(network),
    };
}
//# sourceMappingURL=accountBridge.js.map