// NOTE TO REACT-NATIVE-TURBO-LND CONTRIBUTORS: // This file is automatically generated by the protoc plugin inside the // protoc-generator folder. // Any changes to this file should be made there instead. /* eslint-disable */ import type { Spec } from "../core/NativeTurboLnd"; import { createElectrobunBackend } from "./backend/create-backend"; import { createBunffiDriver } from "./backend/bunffi-driver"; import { createNapiDriver } from "./backend/napi-driver"; import { logSelectedElectrobunBackend, resolveConfiguredElectrobunBackend, } from "./backend/select-driver"; import type { ElectrobunBackendDriver, ElectrobunBackendName, ElectrobunMethodLists, } from "./backend/types"; export const ELECTROBUN_UNARY_METHODS = [ "walletBalance", "channelBalance", "getTransactions", "estimateFee", "sendCoins", "listUnspent", "sendMany", "newAddress", "signMessage", "verifyMessage", "connectPeer", "disconnectPeer", "listPeers", "getInfo", "getDebugInfo", "getRecoveryInfo", "pendingChannels", "listChannels", "closedChannels", "openChannelSync", "batchOpenChannel", "fundingStateStep", "abandonChannel", "addInvoice", "listInvoices", "lookupInvoice", "deleteCanceledInvoice", "decodePayReq", "listPayments", "deletePayment", "deleteAllPayments", "describeGraph", "getNodeMetrics", "getChanInfo", "getNodeInfo", "queryRoutes", "getNetworkInfo", "stopDaemon", "debugLevel", "feeReport", "updateChannelPolicy", "forwardingHistory", "exportChannelBackup", "exportAllChannelBackups", "verifyChanBackup", "restoreChannelBackups", "bakeMacaroon", "listMacaroonIDs", "deleteMacaroonID", "listPermissions", "checkMacaroonPermissions", "sendCustomMessage", "sendOnionMessage", "listAliases", "lookupHtlcResolution", "genSeed", "initWallet", "unlockWallet", "changePassword", "getState", "autopilotStatus", "autopilotModifyStatus", "autopilotQueryScores", "autopilotSetScores", "invoicesCancelInvoice", "invoicesAddHoldInvoice", "invoicesSettleInvoice", "invoicesLookupInvoiceV2", "neutrinoKitStatus", "neutrinoKitAddPeer", "neutrinoKitDisconnectPeer", "neutrinoKitIsBanned", "neutrinoKitGetBlockHeader", "neutrinoKitGetBlock", "neutrinoKitGetCFilter", "neutrinoKitGetBlockHash", "peersUpdateNodeAnnouncement", "routerEstimateRouteFee", "routerSendToRouteV2", "routerResetMissionControl", "routerQueryMissionControl", "routerXImportMissionControl", "routerGetMissionControlConfig", "routerSetMissionControlConfig", "routerQueryProbability", "routerBuildRoute", "routerUpdateChanStatus", "routerXAddLocalChanAliases", "routerXDeleteLocalChanAliases", "routerXFindBaseLocalChanAlias", "routerDeleteForwardingHistory", "signerSignOutputRaw", "signerComputeInputScript", "signerSignMessage", "signerVerifyMessage", "signerDeriveSharedKey", "signerMuSig2CombineKeys", "signerMuSig2CreateSession", "signerMuSig2RegisterNonces", "signerMuSig2RegisterCombinedNonce", "signerMuSig2GetCombinedNonce", "signerMuSig2Sign", "signerMuSig2CombineSig", "signerMuSig2Cleanup", "versionerGetVersion", "walletKitListUnspent", "walletKitLeaseOutput", "walletKitReleaseOutput", "walletKitListLeases", "walletKitDeriveNextKey", "walletKitDeriveKey", "walletKitNextAddr", "walletKitGetTransaction", "walletKitListAccounts", "walletKitRequiredReserve", "walletKitListAddresses", "walletKitSignMessageWithAddr", "walletKitVerifyMessageWithAddr", "walletKitImportAccount", "walletKitImportPublicKey", "walletKitImportTapscript", "walletKitPublishTransaction", "walletKitSubmitPackage", "walletKitRemoveTransaction", "walletKitSendOutputs", "walletKitEstimateFee", "walletKitPendingSweeps", "walletKitBumpFee", "walletKitBumpForceCloseFee", "walletKitListSweeps", "walletKitLabelTransaction", "walletKitFundPsbt", "walletKitSignPsbt", "walletKitFinalizePsbt", "watchtowerGetInfo", "watchtowerClientAddTower", "watchtowerClientRemoveTower", "watchtowerClientDeactivateTower", "watchtowerClientTerminateSession", "watchtowerClientListTowers", "watchtowerClientGetTowerInfo", "watchtowerClientStats", "watchtowerClientPolicy", ] as const; export const ELECTROBUN_SERVER_STREAM_METHODS = [ "subscribeTransactions", "subscribePeerEvents", "subscribeChannelEvents", "openChannel", "closeChannel", "subscribeInvoices", "subscribeChannelGraph", "subscribeChannelBackups", "subscribeCustomMessages", "subscribeOnionMessages", "subscribeState", "chainNotifierRegisterConfirmationsNtfn", "chainNotifierRegisterSpendNtfn", "chainNotifierRegisterBlockEpochNtfn", "invoicesSubscribeSingleInvoice", "routerSendPaymentV2", "routerTrackPaymentV2", "routerTrackPayments", "routerSubscribeHtlcEvents", ] as const; export const ELECTROBUN_BIDI_STREAM_METHODS = [ "channelAcceptor", "registerRPCMiddleware", "invoicesHtlcModifier", "routerHtlcInterceptor", ] as const; type ElectrobunUnaryMethod = (typeof ELECTROBUN_UNARY_METHODS)[number]; type ElectrobunServerStreamMethod = (typeof ELECTROBUN_SERVER_STREAM_METHODS)[number]; type ElectrobunBidiStreamMethod = (typeof ELECTROBUN_BIDI_STREAM_METHODS)[number]; type TurboLndElectrobunDriver = ElectrobunBackendDriver< ElectrobunUnaryMethod, ElectrobunServerStreamMethod, ElectrobunBidiStreamMethod >; const electrobunMethods = { unaryMethods: ELECTROBUN_UNARY_METHODS, serverStreamMethods: ELECTROBUN_SERVER_STREAM_METHODS, bidiStreamMethods: ELECTROBUN_BIDI_STREAM_METHODS, } satisfies ElectrobunMethodLists< ElectrobunUnaryMethod, ElectrobunServerStreamMethod, ElectrobunBidiStreamMethod >; function selectElectrobunBackend(): { name: ElectrobunBackendName; driver: TurboLndElectrobunDriver; resolvedDllPath: string; } { const backendName = resolveConfiguredElectrobunBackend(); switch (backendName) { case "bunffi": { const bunffiBackend = createBunffiDriver(electrobunMethods); return { name: backendName, driver: bunffiBackend.driver, resolvedDllPath: bunffiBackend.resolvedDllPath, }; } case "napi": { const napiBackend = createNapiDriver(electrobunMethods); return { name: backendName, driver: napiBackend.driver, resolvedDllPath: napiBackend.resolvedDllPath, }; } } } const selectedBackend = selectElectrobunBackend(); logSelectedElectrobunBackend(selectedBackend.name); export const resolvedDllPath = selectedBackend.resolvedDllPath; const TurboLndElectrobunBackend = createElectrobunBackend({ driver: selectedBackend.driver, methods: electrobunMethods, }) satisfies Spec; export default TurboLndElectrobunBackend;