How to use deserialize method in wpt

Best JavaScript code snippet using wpt

rpc_grpc_pb.js

Source:rpc_grpc_pb.js Github

copy

Full Screen

1// GENERATED CODE -- DO NOT EDIT!2'use strict';3var grpc = require('@grpc/grpc-js');4var lnd_rpc_pb = require('../lnd/rpc_pb.js');5function serialize_lnrpc_AbandonChannelRequest(arg) {6 if (!(arg instanceof lnd_rpc_pb.AbandonChannelRequest)) {7 throw new Error('Expected argument of type lnrpc.AbandonChannelRequest');8 }9 return Buffer.from(arg.serializeBinary());10}11function deserialize_lnrpc_AbandonChannelRequest(buffer_arg) {12 return lnd_rpc_pb.AbandonChannelRequest.deserializeBinary(new Uint8Array(buffer_arg));13}14function serialize_lnrpc_AbandonChannelResponse(arg) {15 if (!(arg instanceof lnd_rpc_pb.AbandonChannelResponse)) {16 throw new Error('Expected argument of type lnrpc.AbandonChannelResponse');17 }18 return Buffer.from(arg.serializeBinary());19}20function deserialize_lnrpc_AbandonChannelResponse(buffer_arg) {21 return lnd_rpc_pb.AbandonChannelResponse.deserializeBinary(new Uint8Array(buffer_arg));22}23function serialize_lnrpc_AddInvoiceResponse(arg) {24 if (!(arg instanceof lnd_rpc_pb.AddInvoiceResponse)) {25 throw new Error('Expected argument of type lnrpc.AddInvoiceResponse');26 }27 return Buffer.from(arg.serializeBinary());28}29function deserialize_lnrpc_AddInvoiceResponse(buffer_arg) {30 return lnd_rpc_pb.AddInvoiceResponse.deserializeBinary(new Uint8Array(buffer_arg));31}32function serialize_lnrpc_BakeMacaroonRequest(arg) {33 if (!(arg instanceof lnd_rpc_pb.BakeMacaroonRequest)) {34 throw new Error('Expected argument of type lnrpc.BakeMacaroonRequest');35 }36 return Buffer.from(arg.serializeBinary());37}38function deserialize_lnrpc_BakeMacaroonRequest(buffer_arg) {39 return lnd_rpc_pb.BakeMacaroonRequest.deserializeBinary(new Uint8Array(buffer_arg));40}41function serialize_lnrpc_BakeMacaroonResponse(arg) {42 if (!(arg instanceof lnd_rpc_pb.BakeMacaroonResponse)) {43 throw new Error('Expected argument of type lnrpc.BakeMacaroonResponse');44 }45 return Buffer.from(arg.serializeBinary());46}47function deserialize_lnrpc_BakeMacaroonResponse(buffer_arg) {48 return lnd_rpc_pb.BakeMacaroonResponse.deserializeBinary(new Uint8Array(buffer_arg));49}50function serialize_lnrpc_BatchOpenChannelRequest(arg) {51 if (!(arg instanceof lnd_rpc_pb.BatchOpenChannelRequest)) {52 throw new Error('Expected argument of type lnrpc.BatchOpenChannelRequest');53 }54 return Buffer.from(arg.serializeBinary());55}56function deserialize_lnrpc_BatchOpenChannelRequest(buffer_arg) {57 return lnd_rpc_pb.BatchOpenChannelRequest.deserializeBinary(new Uint8Array(buffer_arg));58}59function serialize_lnrpc_BatchOpenChannelResponse(arg) {60 if (!(arg instanceof lnd_rpc_pb.BatchOpenChannelResponse)) {61 throw new Error('Expected argument of type lnrpc.BatchOpenChannelResponse');62 }63 return Buffer.from(arg.serializeBinary());64}65function deserialize_lnrpc_BatchOpenChannelResponse(buffer_arg) {66 return lnd_rpc_pb.BatchOpenChannelResponse.deserializeBinary(new Uint8Array(buffer_arg));67}68function serialize_lnrpc_ChanBackupExportRequest(arg) {69 if (!(arg instanceof lnd_rpc_pb.ChanBackupExportRequest)) {70 throw new Error('Expected argument of type lnrpc.ChanBackupExportRequest');71 }72 return Buffer.from(arg.serializeBinary());73}74function deserialize_lnrpc_ChanBackupExportRequest(buffer_arg) {75 return lnd_rpc_pb.ChanBackupExportRequest.deserializeBinary(new Uint8Array(buffer_arg));76}77function serialize_lnrpc_ChanBackupSnapshot(arg) {78 if (!(arg instanceof lnd_rpc_pb.ChanBackupSnapshot)) {79 throw new Error('Expected argument of type lnrpc.ChanBackupSnapshot');80 }81 return Buffer.from(arg.serializeBinary());82}83function deserialize_lnrpc_ChanBackupSnapshot(buffer_arg) {84 return lnd_rpc_pb.ChanBackupSnapshot.deserializeBinary(new Uint8Array(buffer_arg));85}86function serialize_lnrpc_ChanInfoRequest(arg) {87 if (!(arg instanceof lnd_rpc_pb.ChanInfoRequest)) {88 throw new Error('Expected argument of type lnrpc.ChanInfoRequest');89 }90 return Buffer.from(arg.serializeBinary());91}92function deserialize_lnrpc_ChanInfoRequest(buffer_arg) {93 return lnd_rpc_pb.ChanInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));94}95function serialize_lnrpc_ChannelAcceptRequest(arg) {96 if (!(arg instanceof lnd_rpc_pb.ChannelAcceptRequest)) {97 throw new Error('Expected argument of type lnrpc.ChannelAcceptRequest');98 }99 return Buffer.from(arg.serializeBinary());100}101function deserialize_lnrpc_ChannelAcceptRequest(buffer_arg) {102 return lnd_rpc_pb.ChannelAcceptRequest.deserializeBinary(new Uint8Array(buffer_arg));103}104function serialize_lnrpc_ChannelAcceptResponse(arg) {105 if (!(arg instanceof lnd_rpc_pb.ChannelAcceptResponse)) {106 throw new Error('Expected argument of type lnrpc.ChannelAcceptResponse');107 }108 return Buffer.from(arg.serializeBinary());109}110function deserialize_lnrpc_ChannelAcceptResponse(buffer_arg) {111 return lnd_rpc_pb.ChannelAcceptResponse.deserializeBinary(new Uint8Array(buffer_arg));112}113function serialize_lnrpc_ChannelBackup(arg) {114 if (!(arg instanceof lnd_rpc_pb.ChannelBackup)) {115 throw new Error('Expected argument of type lnrpc.ChannelBackup');116 }117 return Buffer.from(arg.serializeBinary());118}119function deserialize_lnrpc_ChannelBackup(buffer_arg) {120 return lnd_rpc_pb.ChannelBackup.deserializeBinary(new Uint8Array(buffer_arg));121}122function serialize_lnrpc_ChannelBackupSubscription(arg) {123 if (!(arg instanceof lnd_rpc_pb.ChannelBackupSubscription)) {124 throw new Error('Expected argument of type lnrpc.ChannelBackupSubscription');125 }126 return Buffer.from(arg.serializeBinary());127}128function deserialize_lnrpc_ChannelBackupSubscription(buffer_arg) {129 return lnd_rpc_pb.ChannelBackupSubscription.deserializeBinary(new Uint8Array(buffer_arg));130}131function serialize_lnrpc_ChannelBalanceRequest(arg) {132 if (!(arg instanceof lnd_rpc_pb.ChannelBalanceRequest)) {133 throw new Error('Expected argument of type lnrpc.ChannelBalanceRequest');134 }135 return Buffer.from(arg.serializeBinary());136}137function deserialize_lnrpc_ChannelBalanceRequest(buffer_arg) {138 return lnd_rpc_pb.ChannelBalanceRequest.deserializeBinary(new Uint8Array(buffer_arg));139}140function serialize_lnrpc_ChannelBalanceResponse(arg) {141 if (!(arg instanceof lnd_rpc_pb.ChannelBalanceResponse)) {142 throw new Error('Expected argument of type lnrpc.ChannelBalanceResponse');143 }144 return Buffer.from(arg.serializeBinary());145}146function deserialize_lnrpc_ChannelBalanceResponse(buffer_arg) {147 return lnd_rpc_pb.ChannelBalanceResponse.deserializeBinary(new Uint8Array(buffer_arg));148}149function serialize_lnrpc_ChannelEdge(arg) {150 if (!(arg instanceof lnd_rpc_pb.ChannelEdge)) {151 throw new Error('Expected argument of type lnrpc.ChannelEdge');152 }153 return Buffer.from(arg.serializeBinary());154}155function deserialize_lnrpc_ChannelEdge(buffer_arg) {156 return lnd_rpc_pb.ChannelEdge.deserializeBinary(new Uint8Array(buffer_arg));157}158function serialize_lnrpc_ChannelEventSubscription(arg) {159 if (!(arg instanceof lnd_rpc_pb.ChannelEventSubscription)) {160 throw new Error('Expected argument of type lnrpc.ChannelEventSubscription');161 }162 return Buffer.from(arg.serializeBinary());163}164function deserialize_lnrpc_ChannelEventSubscription(buffer_arg) {165 return lnd_rpc_pb.ChannelEventSubscription.deserializeBinary(new Uint8Array(buffer_arg));166}167function serialize_lnrpc_ChannelEventUpdate(arg) {168 if (!(arg instanceof lnd_rpc_pb.ChannelEventUpdate)) {169 throw new Error('Expected argument of type lnrpc.ChannelEventUpdate');170 }171 return Buffer.from(arg.serializeBinary());172}173function deserialize_lnrpc_ChannelEventUpdate(buffer_arg) {174 return lnd_rpc_pb.ChannelEventUpdate.deserializeBinary(new Uint8Array(buffer_arg));175}176function serialize_lnrpc_ChannelGraph(arg) {177 if (!(arg instanceof lnd_rpc_pb.ChannelGraph)) {178 throw new Error('Expected argument of type lnrpc.ChannelGraph');179 }180 return Buffer.from(arg.serializeBinary());181}182function deserialize_lnrpc_ChannelGraph(buffer_arg) {183 return lnd_rpc_pb.ChannelGraph.deserializeBinary(new Uint8Array(buffer_arg));184}185function serialize_lnrpc_ChannelGraphRequest(arg) {186 if (!(arg instanceof lnd_rpc_pb.ChannelGraphRequest)) {187 throw new Error('Expected argument of type lnrpc.ChannelGraphRequest');188 }189 return Buffer.from(arg.serializeBinary());190}191function deserialize_lnrpc_ChannelGraphRequest(buffer_arg) {192 return lnd_rpc_pb.ChannelGraphRequest.deserializeBinary(new Uint8Array(buffer_arg));193}194function serialize_lnrpc_ChannelPoint(arg) {195 if (!(arg instanceof lnd_rpc_pb.ChannelPoint)) {196 throw new Error('Expected argument of type lnrpc.ChannelPoint');197 }198 return Buffer.from(arg.serializeBinary());199}200function deserialize_lnrpc_ChannelPoint(buffer_arg) {201 return lnd_rpc_pb.ChannelPoint.deserializeBinary(new Uint8Array(buffer_arg));202}203function serialize_lnrpc_CheckMacPermRequest(arg) {204 if (!(arg instanceof lnd_rpc_pb.CheckMacPermRequest)) {205 throw new Error('Expected argument of type lnrpc.CheckMacPermRequest');206 }207 return Buffer.from(arg.serializeBinary());208}209function deserialize_lnrpc_CheckMacPermRequest(buffer_arg) {210 return lnd_rpc_pb.CheckMacPermRequest.deserializeBinary(new Uint8Array(buffer_arg));211}212function serialize_lnrpc_CheckMacPermResponse(arg) {213 if (!(arg instanceof lnd_rpc_pb.CheckMacPermResponse)) {214 throw new Error('Expected argument of type lnrpc.CheckMacPermResponse');215 }216 return Buffer.from(arg.serializeBinary());217}218function deserialize_lnrpc_CheckMacPermResponse(buffer_arg) {219 return lnd_rpc_pb.CheckMacPermResponse.deserializeBinary(new Uint8Array(buffer_arg));220}221function serialize_lnrpc_CloseChannelRequest(arg) {222 if (!(arg instanceof lnd_rpc_pb.CloseChannelRequest)) {223 throw new Error('Expected argument of type lnrpc.CloseChannelRequest');224 }225 return Buffer.from(arg.serializeBinary());226}227function deserialize_lnrpc_CloseChannelRequest(buffer_arg) {228 return lnd_rpc_pb.CloseChannelRequest.deserializeBinary(new Uint8Array(buffer_arg));229}230function serialize_lnrpc_CloseStatusUpdate(arg) {231 if (!(arg instanceof lnd_rpc_pb.CloseStatusUpdate)) {232 throw new Error('Expected argument of type lnrpc.CloseStatusUpdate');233 }234 return Buffer.from(arg.serializeBinary());235}236function deserialize_lnrpc_CloseStatusUpdate(buffer_arg) {237 return lnd_rpc_pb.CloseStatusUpdate.deserializeBinary(new Uint8Array(buffer_arg));238}239function serialize_lnrpc_ClosedChannelsRequest(arg) {240 if (!(arg instanceof lnd_rpc_pb.ClosedChannelsRequest)) {241 throw new Error('Expected argument of type lnrpc.ClosedChannelsRequest');242 }243 return Buffer.from(arg.serializeBinary());244}245function deserialize_lnrpc_ClosedChannelsRequest(buffer_arg) {246 return lnd_rpc_pb.ClosedChannelsRequest.deserializeBinary(new Uint8Array(buffer_arg));247}248function serialize_lnrpc_ClosedChannelsResponse(arg) {249 if (!(arg instanceof lnd_rpc_pb.ClosedChannelsResponse)) {250 throw new Error('Expected argument of type lnrpc.ClosedChannelsResponse');251 }252 return Buffer.from(arg.serializeBinary());253}254function deserialize_lnrpc_ClosedChannelsResponse(buffer_arg) {255 return lnd_rpc_pb.ClosedChannelsResponse.deserializeBinary(new Uint8Array(buffer_arg));256}257function serialize_lnrpc_ConnectPeerRequest(arg) {258 if (!(arg instanceof lnd_rpc_pb.ConnectPeerRequest)) {259 throw new Error('Expected argument of type lnrpc.ConnectPeerRequest');260 }261 return Buffer.from(arg.serializeBinary());262}263function deserialize_lnrpc_ConnectPeerRequest(buffer_arg) {264 return lnd_rpc_pb.ConnectPeerRequest.deserializeBinary(new Uint8Array(buffer_arg));265}266function serialize_lnrpc_ConnectPeerResponse(arg) {267 if (!(arg instanceof lnd_rpc_pb.ConnectPeerResponse)) {268 throw new Error('Expected argument of type lnrpc.ConnectPeerResponse');269 }270 return Buffer.from(arg.serializeBinary());271}272function deserialize_lnrpc_ConnectPeerResponse(buffer_arg) {273 return lnd_rpc_pb.ConnectPeerResponse.deserializeBinary(new Uint8Array(buffer_arg));274}275function serialize_lnrpc_CustomMessage(arg) {276 if (!(arg instanceof lnd_rpc_pb.CustomMessage)) {277 throw new Error('Expected argument of type lnrpc.CustomMessage');278 }279 return Buffer.from(arg.serializeBinary());280}281function deserialize_lnrpc_CustomMessage(buffer_arg) {282 return lnd_rpc_pb.CustomMessage.deserializeBinary(new Uint8Array(buffer_arg));283}284function serialize_lnrpc_DebugLevelRequest(arg) {285 if (!(arg instanceof lnd_rpc_pb.DebugLevelRequest)) {286 throw new Error('Expected argument of type lnrpc.DebugLevelRequest');287 }288 return Buffer.from(arg.serializeBinary());289}290function deserialize_lnrpc_DebugLevelRequest(buffer_arg) {291 return lnd_rpc_pb.DebugLevelRequest.deserializeBinary(new Uint8Array(buffer_arg));292}293function serialize_lnrpc_DebugLevelResponse(arg) {294 if (!(arg instanceof lnd_rpc_pb.DebugLevelResponse)) {295 throw new Error('Expected argument of type lnrpc.DebugLevelResponse');296 }297 return Buffer.from(arg.serializeBinary());298}299function deserialize_lnrpc_DebugLevelResponse(buffer_arg) {300 return lnd_rpc_pb.DebugLevelResponse.deserializeBinary(new Uint8Array(buffer_arg));301}302function serialize_lnrpc_DeleteAllPaymentsRequest(arg) {303 if (!(arg instanceof lnd_rpc_pb.DeleteAllPaymentsRequest)) {304 throw new Error('Expected argument of type lnrpc.DeleteAllPaymentsRequest');305 }306 return Buffer.from(arg.serializeBinary());307}308function deserialize_lnrpc_DeleteAllPaymentsRequest(buffer_arg) {309 return lnd_rpc_pb.DeleteAllPaymentsRequest.deserializeBinary(new Uint8Array(buffer_arg));310}311function serialize_lnrpc_DeleteAllPaymentsResponse(arg) {312 if (!(arg instanceof lnd_rpc_pb.DeleteAllPaymentsResponse)) {313 throw new Error('Expected argument of type lnrpc.DeleteAllPaymentsResponse');314 }315 return Buffer.from(arg.serializeBinary());316}317function deserialize_lnrpc_DeleteAllPaymentsResponse(buffer_arg) {318 return lnd_rpc_pb.DeleteAllPaymentsResponse.deserializeBinary(new Uint8Array(buffer_arg));319}320function serialize_lnrpc_DeleteMacaroonIDRequest(arg) {321 if (!(arg instanceof lnd_rpc_pb.DeleteMacaroonIDRequest)) {322 throw new Error('Expected argument of type lnrpc.DeleteMacaroonIDRequest');323 }324 return Buffer.from(arg.serializeBinary());325}326function deserialize_lnrpc_DeleteMacaroonIDRequest(buffer_arg) {327 return lnd_rpc_pb.DeleteMacaroonIDRequest.deserializeBinary(new Uint8Array(buffer_arg));328}329function serialize_lnrpc_DeleteMacaroonIDResponse(arg) {330 if (!(arg instanceof lnd_rpc_pb.DeleteMacaroonIDResponse)) {331 throw new Error('Expected argument of type lnrpc.DeleteMacaroonIDResponse');332 }333 return Buffer.from(arg.serializeBinary());334}335function deserialize_lnrpc_DeleteMacaroonIDResponse(buffer_arg) {336 return lnd_rpc_pb.DeleteMacaroonIDResponse.deserializeBinary(new Uint8Array(buffer_arg));337}338function serialize_lnrpc_DeletePaymentRequest(arg) {339 if (!(arg instanceof lnd_rpc_pb.DeletePaymentRequest)) {340 throw new Error('Expected argument of type lnrpc.DeletePaymentRequest');341 }342 return Buffer.from(arg.serializeBinary());343}344function deserialize_lnrpc_DeletePaymentRequest(buffer_arg) {345 return lnd_rpc_pb.DeletePaymentRequest.deserializeBinary(new Uint8Array(buffer_arg));346}347function serialize_lnrpc_DeletePaymentResponse(arg) {348 if (!(arg instanceof lnd_rpc_pb.DeletePaymentResponse)) {349 throw new Error('Expected argument of type lnrpc.DeletePaymentResponse');350 }351 return Buffer.from(arg.serializeBinary());352}353function deserialize_lnrpc_DeletePaymentResponse(buffer_arg) {354 return lnd_rpc_pb.DeletePaymentResponse.deserializeBinary(new Uint8Array(buffer_arg));355}356function serialize_lnrpc_DisconnectPeerRequest(arg) {357 if (!(arg instanceof lnd_rpc_pb.DisconnectPeerRequest)) {358 throw new Error('Expected argument of type lnrpc.DisconnectPeerRequest');359 }360 return Buffer.from(arg.serializeBinary());361}362function deserialize_lnrpc_DisconnectPeerRequest(buffer_arg) {363 return lnd_rpc_pb.DisconnectPeerRequest.deserializeBinary(new Uint8Array(buffer_arg));364}365function serialize_lnrpc_DisconnectPeerResponse(arg) {366 if (!(arg instanceof lnd_rpc_pb.DisconnectPeerResponse)) {367 throw new Error('Expected argument of type lnrpc.DisconnectPeerResponse');368 }369 return Buffer.from(arg.serializeBinary());370}371function deserialize_lnrpc_DisconnectPeerResponse(buffer_arg) {372 return lnd_rpc_pb.DisconnectPeerResponse.deserializeBinary(new Uint8Array(buffer_arg));373}374function serialize_lnrpc_EstimateFeeRequest(arg) {375 if (!(arg instanceof lnd_rpc_pb.EstimateFeeRequest)) {376 throw new Error('Expected argument of type lnrpc.EstimateFeeRequest');377 }378 return Buffer.from(arg.serializeBinary());379}380function deserialize_lnrpc_EstimateFeeRequest(buffer_arg) {381 return lnd_rpc_pb.EstimateFeeRequest.deserializeBinary(new Uint8Array(buffer_arg));382}383function serialize_lnrpc_EstimateFeeResponse(arg) {384 if (!(arg instanceof lnd_rpc_pb.EstimateFeeResponse)) {385 throw new Error('Expected argument of type lnrpc.EstimateFeeResponse');386 }387 return Buffer.from(arg.serializeBinary());388}389function deserialize_lnrpc_EstimateFeeResponse(buffer_arg) {390 return lnd_rpc_pb.EstimateFeeResponse.deserializeBinary(new Uint8Array(buffer_arg));391}392function serialize_lnrpc_ExportChannelBackupRequest(arg) {393 if (!(arg instanceof lnd_rpc_pb.ExportChannelBackupRequest)) {394 throw new Error('Expected argument of type lnrpc.ExportChannelBackupRequest');395 }396 return Buffer.from(arg.serializeBinary());397}398function deserialize_lnrpc_ExportChannelBackupRequest(buffer_arg) {399 return lnd_rpc_pb.ExportChannelBackupRequest.deserializeBinary(new Uint8Array(buffer_arg));400}401function serialize_lnrpc_FeeReportRequest(arg) {402 if (!(arg instanceof lnd_rpc_pb.FeeReportRequest)) {403 throw new Error('Expected argument of type lnrpc.FeeReportRequest');404 }405 return Buffer.from(arg.serializeBinary());406}407function deserialize_lnrpc_FeeReportRequest(buffer_arg) {408 return lnd_rpc_pb.FeeReportRequest.deserializeBinary(new Uint8Array(buffer_arg));409}410function serialize_lnrpc_FeeReportResponse(arg) {411 if (!(arg instanceof lnd_rpc_pb.FeeReportResponse)) {412 throw new Error('Expected argument of type lnrpc.FeeReportResponse');413 }414 return Buffer.from(arg.serializeBinary());415}416function deserialize_lnrpc_FeeReportResponse(buffer_arg) {417 return lnd_rpc_pb.FeeReportResponse.deserializeBinary(new Uint8Array(buffer_arg));418}419function serialize_lnrpc_ForwardingHistoryRequest(arg) {420 if (!(arg instanceof lnd_rpc_pb.ForwardingHistoryRequest)) {421 throw new Error('Expected argument of type lnrpc.ForwardingHistoryRequest');422 }423 return Buffer.from(arg.serializeBinary());424}425function deserialize_lnrpc_ForwardingHistoryRequest(buffer_arg) {426 return lnd_rpc_pb.ForwardingHistoryRequest.deserializeBinary(new Uint8Array(buffer_arg));427}428function serialize_lnrpc_ForwardingHistoryResponse(arg) {429 if (!(arg instanceof lnd_rpc_pb.ForwardingHistoryResponse)) {430 throw new Error('Expected argument of type lnrpc.ForwardingHistoryResponse');431 }432 return Buffer.from(arg.serializeBinary());433}434function deserialize_lnrpc_ForwardingHistoryResponse(buffer_arg) {435 return lnd_rpc_pb.ForwardingHistoryResponse.deserializeBinary(new Uint8Array(buffer_arg));436}437function serialize_lnrpc_FundingStateStepResp(arg) {438 if (!(arg instanceof lnd_rpc_pb.FundingStateStepResp)) {439 throw new Error('Expected argument of type lnrpc.FundingStateStepResp');440 }441 return Buffer.from(arg.serializeBinary());442}443function deserialize_lnrpc_FundingStateStepResp(buffer_arg) {444 return lnd_rpc_pb.FundingStateStepResp.deserializeBinary(new Uint8Array(buffer_arg));445}446function serialize_lnrpc_FundingTransitionMsg(arg) {447 if (!(arg instanceof lnd_rpc_pb.FundingTransitionMsg)) {448 throw new Error('Expected argument of type lnrpc.FundingTransitionMsg');449 }450 return Buffer.from(arg.serializeBinary());451}452function deserialize_lnrpc_FundingTransitionMsg(buffer_arg) {453 return lnd_rpc_pb.FundingTransitionMsg.deserializeBinary(new Uint8Array(buffer_arg));454}455function serialize_lnrpc_GetInfoRequest(arg) {456 if (!(arg instanceof lnd_rpc_pb.GetInfoRequest)) {457 throw new Error('Expected argument of type lnrpc.GetInfoRequest');458 }459 return Buffer.from(arg.serializeBinary());460}461function deserialize_lnrpc_GetInfoRequest(buffer_arg) {462 return lnd_rpc_pb.GetInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));463}464function serialize_lnrpc_GetInfoResponse(arg) {465 if (!(arg instanceof lnd_rpc_pb.GetInfoResponse)) {466 throw new Error('Expected argument of type lnrpc.GetInfoResponse');467 }468 return Buffer.from(arg.serializeBinary());469}470function deserialize_lnrpc_GetInfoResponse(buffer_arg) {471 return lnd_rpc_pb.GetInfoResponse.deserializeBinary(new Uint8Array(buffer_arg));472}473function serialize_lnrpc_GetRecoveryInfoRequest(arg) {474 if (!(arg instanceof lnd_rpc_pb.GetRecoveryInfoRequest)) {475 throw new Error('Expected argument of type lnrpc.GetRecoveryInfoRequest');476 }477 return Buffer.from(arg.serializeBinary());478}479function deserialize_lnrpc_GetRecoveryInfoRequest(buffer_arg) {480 return lnd_rpc_pb.GetRecoveryInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));481}482function serialize_lnrpc_GetRecoveryInfoResponse(arg) {483 if (!(arg instanceof lnd_rpc_pb.GetRecoveryInfoResponse)) {484 throw new Error('Expected argument of type lnrpc.GetRecoveryInfoResponse');485 }486 return Buffer.from(arg.serializeBinary());487}488function deserialize_lnrpc_GetRecoveryInfoResponse(buffer_arg) {489 return lnd_rpc_pb.GetRecoveryInfoResponse.deserializeBinary(new Uint8Array(buffer_arg));490}491function serialize_lnrpc_GetTransactionsRequest(arg) {492 if (!(arg instanceof lnd_rpc_pb.GetTransactionsRequest)) {493 throw new Error('Expected argument of type lnrpc.GetTransactionsRequest');494 }495 return Buffer.from(arg.serializeBinary());496}497function deserialize_lnrpc_GetTransactionsRequest(buffer_arg) {498 return lnd_rpc_pb.GetTransactionsRequest.deserializeBinary(new Uint8Array(buffer_arg));499}500function serialize_lnrpc_GraphTopologySubscription(arg) {501 if (!(arg instanceof lnd_rpc_pb.GraphTopologySubscription)) {502 throw new Error('Expected argument of type lnrpc.GraphTopologySubscription');503 }504 return Buffer.from(arg.serializeBinary());505}506function deserialize_lnrpc_GraphTopologySubscription(buffer_arg) {507 return lnd_rpc_pb.GraphTopologySubscription.deserializeBinary(new Uint8Array(buffer_arg));508}509function serialize_lnrpc_GraphTopologyUpdate(arg) {510 if (!(arg instanceof lnd_rpc_pb.GraphTopologyUpdate)) {511 throw new Error('Expected argument of type lnrpc.GraphTopologyUpdate');512 }513 return Buffer.from(arg.serializeBinary());514}515function deserialize_lnrpc_GraphTopologyUpdate(buffer_arg) {516 return lnd_rpc_pb.GraphTopologyUpdate.deserializeBinary(new Uint8Array(buffer_arg));517}518function serialize_lnrpc_Invoice(arg) {519 if (!(arg instanceof lnd_rpc_pb.Invoice)) {520 throw new Error('Expected argument of type lnrpc.Invoice');521 }522 return Buffer.from(arg.serializeBinary());523}524function deserialize_lnrpc_Invoice(buffer_arg) {525 return lnd_rpc_pb.Invoice.deserializeBinary(new Uint8Array(buffer_arg));526}527function serialize_lnrpc_InvoiceSubscription(arg) {528 if (!(arg instanceof lnd_rpc_pb.InvoiceSubscription)) {529 throw new Error('Expected argument of type lnrpc.InvoiceSubscription');530 }531 return Buffer.from(arg.serializeBinary());532}533function deserialize_lnrpc_InvoiceSubscription(buffer_arg) {534 return lnd_rpc_pb.InvoiceSubscription.deserializeBinary(new Uint8Array(buffer_arg));535}536function serialize_lnrpc_ListChannelsRequest(arg) {537 if (!(arg instanceof lnd_rpc_pb.ListChannelsRequest)) {538 throw new Error('Expected argument of type lnrpc.ListChannelsRequest');539 }540 return Buffer.from(arg.serializeBinary());541}542function deserialize_lnrpc_ListChannelsRequest(buffer_arg) {543 return lnd_rpc_pb.ListChannelsRequest.deserializeBinary(new Uint8Array(buffer_arg));544}545function serialize_lnrpc_ListChannelsResponse(arg) {546 if (!(arg instanceof lnd_rpc_pb.ListChannelsResponse)) {547 throw new Error('Expected argument of type lnrpc.ListChannelsResponse');548 }549 return Buffer.from(arg.serializeBinary());550}551function deserialize_lnrpc_ListChannelsResponse(buffer_arg) {552 return lnd_rpc_pb.ListChannelsResponse.deserializeBinary(new Uint8Array(buffer_arg));553}554function serialize_lnrpc_ListInvoiceRequest(arg) {555 if (!(arg instanceof lnd_rpc_pb.ListInvoiceRequest)) {556 throw new Error('Expected argument of type lnrpc.ListInvoiceRequest');557 }558 return Buffer.from(arg.serializeBinary());559}560function deserialize_lnrpc_ListInvoiceRequest(buffer_arg) {561 return lnd_rpc_pb.ListInvoiceRequest.deserializeBinary(new Uint8Array(buffer_arg));562}563function serialize_lnrpc_ListInvoiceResponse(arg) {564 if (!(arg instanceof lnd_rpc_pb.ListInvoiceResponse)) {565 throw new Error('Expected argument of type lnrpc.ListInvoiceResponse');566 }567 return Buffer.from(arg.serializeBinary());568}569function deserialize_lnrpc_ListInvoiceResponse(buffer_arg) {570 return lnd_rpc_pb.ListInvoiceResponse.deserializeBinary(new Uint8Array(buffer_arg));571}572function serialize_lnrpc_ListMacaroonIDsRequest(arg) {573 if (!(arg instanceof lnd_rpc_pb.ListMacaroonIDsRequest)) {574 throw new Error('Expected argument of type lnrpc.ListMacaroonIDsRequest');575 }576 return Buffer.from(arg.serializeBinary());577}578function deserialize_lnrpc_ListMacaroonIDsRequest(buffer_arg) {579 return lnd_rpc_pb.ListMacaroonIDsRequest.deserializeBinary(new Uint8Array(buffer_arg));580}581function serialize_lnrpc_ListMacaroonIDsResponse(arg) {582 if (!(arg instanceof lnd_rpc_pb.ListMacaroonIDsResponse)) {583 throw new Error('Expected argument of type lnrpc.ListMacaroonIDsResponse');584 }585 return Buffer.from(arg.serializeBinary());586}587function deserialize_lnrpc_ListMacaroonIDsResponse(buffer_arg) {588 return lnd_rpc_pb.ListMacaroonIDsResponse.deserializeBinary(new Uint8Array(buffer_arg));589}590function serialize_lnrpc_ListPaymentsRequest(arg) {591 if (!(arg instanceof lnd_rpc_pb.ListPaymentsRequest)) {592 throw new Error('Expected argument of type lnrpc.ListPaymentsRequest');593 }594 return Buffer.from(arg.serializeBinary());595}596function deserialize_lnrpc_ListPaymentsRequest(buffer_arg) {597 return lnd_rpc_pb.ListPaymentsRequest.deserializeBinary(new Uint8Array(buffer_arg));598}599function serialize_lnrpc_ListPaymentsResponse(arg) {600 if (!(arg instanceof lnd_rpc_pb.ListPaymentsResponse)) {601 throw new Error('Expected argument of type lnrpc.ListPaymentsResponse');602 }603 return Buffer.from(arg.serializeBinary());604}605function deserialize_lnrpc_ListPaymentsResponse(buffer_arg) {606 return lnd_rpc_pb.ListPaymentsResponse.deserializeBinary(new Uint8Array(buffer_arg));607}608function serialize_lnrpc_ListPeersRequest(arg) {609 if (!(arg instanceof lnd_rpc_pb.ListPeersRequest)) {610 throw new Error('Expected argument of type lnrpc.ListPeersRequest');611 }612 return Buffer.from(arg.serializeBinary());613}614function deserialize_lnrpc_ListPeersRequest(buffer_arg) {615 return lnd_rpc_pb.ListPeersRequest.deserializeBinary(new Uint8Array(buffer_arg));616}617function serialize_lnrpc_ListPeersResponse(arg) {618 if (!(arg instanceof lnd_rpc_pb.ListPeersResponse)) {619 throw new Error('Expected argument of type lnrpc.ListPeersResponse');620 }621 return Buffer.from(arg.serializeBinary());622}623function deserialize_lnrpc_ListPeersResponse(buffer_arg) {624 return lnd_rpc_pb.ListPeersResponse.deserializeBinary(new Uint8Array(buffer_arg));625}626function serialize_lnrpc_ListPermissionsRequest(arg) {627 if (!(arg instanceof lnd_rpc_pb.ListPermissionsRequest)) {628 throw new Error('Expected argument of type lnrpc.ListPermissionsRequest');629 }630 return Buffer.from(arg.serializeBinary());631}632function deserialize_lnrpc_ListPermissionsRequest(buffer_arg) {633 return lnd_rpc_pb.ListPermissionsRequest.deserializeBinary(new Uint8Array(buffer_arg));634}635function serialize_lnrpc_ListPermissionsResponse(arg) {636 if (!(arg instanceof lnd_rpc_pb.ListPermissionsResponse)) {637 throw new Error('Expected argument of type lnrpc.ListPermissionsResponse');638 }639 return Buffer.from(arg.serializeBinary());640}641function deserialize_lnrpc_ListPermissionsResponse(buffer_arg) {642 return lnd_rpc_pb.ListPermissionsResponse.deserializeBinary(new Uint8Array(buffer_arg));643}644function serialize_lnrpc_ListUnspentRequest(arg) {645 if (!(arg instanceof lnd_rpc_pb.ListUnspentRequest)) {646 throw new Error('Expected argument of type lnrpc.ListUnspentRequest');647 }648 return Buffer.from(arg.serializeBinary());649}650function deserialize_lnrpc_ListUnspentRequest(buffer_arg) {651 return lnd_rpc_pb.ListUnspentRequest.deserializeBinary(new Uint8Array(buffer_arg));652}653function serialize_lnrpc_ListUnspentResponse(arg) {654 if (!(arg instanceof lnd_rpc_pb.ListUnspentResponse)) {655 throw new Error('Expected argument of type lnrpc.ListUnspentResponse');656 }657 return Buffer.from(arg.serializeBinary());658}659function deserialize_lnrpc_ListUnspentResponse(buffer_arg) {660 return lnd_rpc_pb.ListUnspentResponse.deserializeBinary(new Uint8Array(buffer_arg));661}662function serialize_lnrpc_NetworkInfo(arg) {663 if (!(arg instanceof lnd_rpc_pb.NetworkInfo)) {664 throw new Error('Expected argument of type lnrpc.NetworkInfo');665 }666 return Buffer.from(arg.serializeBinary());667}668function deserialize_lnrpc_NetworkInfo(buffer_arg) {669 return lnd_rpc_pb.NetworkInfo.deserializeBinary(new Uint8Array(buffer_arg));670}671function serialize_lnrpc_NetworkInfoRequest(arg) {672 if (!(arg instanceof lnd_rpc_pb.NetworkInfoRequest)) {673 throw new Error('Expected argument of type lnrpc.NetworkInfoRequest');674 }675 return Buffer.from(arg.serializeBinary());676}677function deserialize_lnrpc_NetworkInfoRequest(buffer_arg) {678 return lnd_rpc_pb.NetworkInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));679}680function serialize_lnrpc_NewAddressRequest(arg) {681 if (!(arg instanceof lnd_rpc_pb.NewAddressRequest)) {682 throw new Error('Expected argument of type lnrpc.NewAddressRequest');683 }684 return Buffer.from(arg.serializeBinary());685}686function deserialize_lnrpc_NewAddressRequest(buffer_arg) {687 return lnd_rpc_pb.NewAddressRequest.deserializeBinary(new Uint8Array(buffer_arg));688}689function serialize_lnrpc_NewAddressResponse(arg) {690 if (!(arg instanceof lnd_rpc_pb.NewAddressResponse)) {691 throw new Error('Expected argument of type lnrpc.NewAddressResponse');692 }693 return Buffer.from(arg.serializeBinary());694}695function deserialize_lnrpc_NewAddressResponse(buffer_arg) {696 return lnd_rpc_pb.NewAddressResponse.deserializeBinary(new Uint8Array(buffer_arg));697}698function serialize_lnrpc_NodeInfo(arg) {699 if (!(arg instanceof lnd_rpc_pb.NodeInfo)) {700 throw new Error('Expected argument of type lnrpc.NodeInfo');701 }702 return Buffer.from(arg.serializeBinary());703}704function deserialize_lnrpc_NodeInfo(buffer_arg) {705 return lnd_rpc_pb.NodeInfo.deserializeBinary(new Uint8Array(buffer_arg));706}707function serialize_lnrpc_NodeInfoRequest(arg) {708 if (!(arg instanceof lnd_rpc_pb.NodeInfoRequest)) {709 throw new Error('Expected argument of type lnrpc.NodeInfoRequest');710 }711 return Buffer.from(arg.serializeBinary());712}713function deserialize_lnrpc_NodeInfoRequest(buffer_arg) {714 return lnd_rpc_pb.NodeInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));715}716function serialize_lnrpc_NodeMetricsRequest(arg) {717 if (!(arg instanceof lnd_rpc_pb.NodeMetricsRequest)) {718 throw new Error('Expected argument of type lnrpc.NodeMetricsRequest');719 }720 return Buffer.from(arg.serializeBinary());721}722function deserialize_lnrpc_NodeMetricsRequest(buffer_arg) {723 return lnd_rpc_pb.NodeMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg));724}725function serialize_lnrpc_NodeMetricsResponse(arg) {726 if (!(arg instanceof lnd_rpc_pb.NodeMetricsResponse)) {727 throw new Error('Expected argument of type lnrpc.NodeMetricsResponse');728 }729 return Buffer.from(arg.serializeBinary());730}731function deserialize_lnrpc_NodeMetricsResponse(buffer_arg) {732 return lnd_rpc_pb.NodeMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg));733}734function serialize_lnrpc_OpenChannelRequest(arg) {735 if (!(arg instanceof lnd_rpc_pb.OpenChannelRequest)) {736 throw new Error('Expected argument of type lnrpc.OpenChannelRequest');737 }738 return Buffer.from(arg.serializeBinary());739}740function deserialize_lnrpc_OpenChannelRequest(buffer_arg) {741 return lnd_rpc_pb.OpenChannelRequest.deserializeBinary(new Uint8Array(buffer_arg));742}743function serialize_lnrpc_OpenStatusUpdate(arg) {744 if (!(arg instanceof lnd_rpc_pb.OpenStatusUpdate)) {745 throw new Error('Expected argument of type lnrpc.OpenStatusUpdate');746 }747 return Buffer.from(arg.serializeBinary());748}749function deserialize_lnrpc_OpenStatusUpdate(buffer_arg) {750 return lnd_rpc_pb.OpenStatusUpdate.deserializeBinary(new Uint8Array(buffer_arg));751}752function serialize_lnrpc_PayReq(arg) {753 if (!(arg instanceof lnd_rpc_pb.PayReq)) {754 throw new Error('Expected argument of type lnrpc.PayReq');755 }756 return Buffer.from(arg.serializeBinary());757}758function deserialize_lnrpc_PayReq(buffer_arg) {759 return lnd_rpc_pb.PayReq.deserializeBinary(new Uint8Array(buffer_arg));760}761function serialize_lnrpc_PayReqString(arg) {762 if (!(arg instanceof lnd_rpc_pb.PayReqString)) {763 throw new Error('Expected argument of type lnrpc.PayReqString');764 }765 return Buffer.from(arg.serializeBinary());766}767function deserialize_lnrpc_PayReqString(buffer_arg) {768 return lnd_rpc_pb.PayReqString.deserializeBinary(new Uint8Array(buffer_arg));769}770function serialize_lnrpc_PaymentHash(arg) {771 if (!(arg instanceof lnd_rpc_pb.PaymentHash)) {772 throw new Error('Expected argument of type lnrpc.PaymentHash');773 }774 return Buffer.from(arg.serializeBinary());775}776function deserialize_lnrpc_PaymentHash(buffer_arg) {777 return lnd_rpc_pb.PaymentHash.deserializeBinary(new Uint8Array(buffer_arg));778}779function serialize_lnrpc_PeerEvent(arg) {780 if (!(arg instanceof lnd_rpc_pb.PeerEvent)) {781 throw new Error('Expected argument of type lnrpc.PeerEvent');782 }783 return Buffer.from(arg.serializeBinary());784}785function deserialize_lnrpc_PeerEvent(buffer_arg) {786 return lnd_rpc_pb.PeerEvent.deserializeBinary(new Uint8Array(buffer_arg));787}788function serialize_lnrpc_PeerEventSubscription(arg) {789 if (!(arg instanceof lnd_rpc_pb.PeerEventSubscription)) {790 throw new Error('Expected argument of type lnrpc.PeerEventSubscription');791 }792 return Buffer.from(arg.serializeBinary());793}794function deserialize_lnrpc_PeerEventSubscription(buffer_arg) {795 return lnd_rpc_pb.PeerEventSubscription.deserializeBinary(new Uint8Array(buffer_arg));796}797function serialize_lnrpc_PendingChannelsRequest(arg) {798 if (!(arg instanceof lnd_rpc_pb.PendingChannelsRequest)) {799 throw new Error('Expected argument of type lnrpc.PendingChannelsRequest');800 }801 return Buffer.from(arg.serializeBinary());802}803function deserialize_lnrpc_PendingChannelsRequest(buffer_arg) {804 return lnd_rpc_pb.PendingChannelsRequest.deserializeBinary(new Uint8Array(buffer_arg));805}806function serialize_lnrpc_PendingChannelsResponse(arg) {807 if (!(arg instanceof lnd_rpc_pb.PendingChannelsResponse)) {808 throw new Error('Expected argument of type lnrpc.PendingChannelsResponse');809 }810 return Buffer.from(arg.serializeBinary());811}812function deserialize_lnrpc_PendingChannelsResponse(buffer_arg) {813 return lnd_rpc_pb.PendingChannelsResponse.deserializeBinary(new Uint8Array(buffer_arg));814}815function serialize_lnrpc_PolicyUpdateRequest(arg) {816 if (!(arg instanceof lnd_rpc_pb.PolicyUpdateRequest)) {817 throw new Error('Expected argument of type lnrpc.PolicyUpdateRequest');818 }819 return Buffer.from(arg.serializeBinary());820}821function deserialize_lnrpc_PolicyUpdateRequest(buffer_arg) {822 return lnd_rpc_pb.PolicyUpdateRequest.deserializeBinary(new Uint8Array(buffer_arg));823}824function serialize_lnrpc_PolicyUpdateResponse(arg) {825 if (!(arg instanceof lnd_rpc_pb.PolicyUpdateResponse)) {826 throw new Error('Expected argument of type lnrpc.PolicyUpdateResponse');827 }828 return Buffer.from(arg.serializeBinary());829}830function deserialize_lnrpc_PolicyUpdateResponse(buffer_arg) {831 return lnd_rpc_pb.PolicyUpdateResponse.deserializeBinary(new Uint8Array(buffer_arg));832}833function serialize_lnrpc_QueryRoutesRequest(arg) {834 if (!(arg instanceof lnd_rpc_pb.QueryRoutesRequest)) {835 throw new Error('Expected argument of type lnrpc.QueryRoutesRequest');836 }837 return Buffer.from(arg.serializeBinary());838}839function deserialize_lnrpc_QueryRoutesRequest(buffer_arg) {840 return lnd_rpc_pb.QueryRoutesRequest.deserializeBinary(new Uint8Array(buffer_arg));841}842function serialize_lnrpc_QueryRoutesResponse(arg) {843 if (!(arg instanceof lnd_rpc_pb.QueryRoutesResponse)) {844 throw new Error('Expected argument of type lnrpc.QueryRoutesResponse');845 }846 return Buffer.from(arg.serializeBinary());847}848function deserialize_lnrpc_QueryRoutesResponse(buffer_arg) {849 return lnd_rpc_pb.QueryRoutesResponse.deserializeBinary(new Uint8Array(buffer_arg));850}851function serialize_lnrpc_RPCMiddlewareRequest(arg) {852 if (!(arg instanceof lnd_rpc_pb.RPCMiddlewareRequest)) {853 throw new Error('Expected argument of type lnrpc.RPCMiddlewareRequest');854 }855 return Buffer.from(arg.serializeBinary());856}857function deserialize_lnrpc_RPCMiddlewareRequest(buffer_arg) {858 return lnd_rpc_pb.RPCMiddlewareRequest.deserializeBinary(new Uint8Array(buffer_arg));859}860function serialize_lnrpc_RPCMiddlewareResponse(arg) {861 if (!(arg instanceof lnd_rpc_pb.RPCMiddlewareResponse)) {862 throw new Error('Expected argument of type lnrpc.RPCMiddlewareResponse');863 }864 return Buffer.from(arg.serializeBinary());865}866function deserialize_lnrpc_RPCMiddlewareResponse(buffer_arg) {867 return lnd_rpc_pb.RPCMiddlewareResponse.deserializeBinary(new Uint8Array(buffer_arg));868}869function serialize_lnrpc_RestoreBackupResponse(arg) {870 if (!(arg instanceof lnd_rpc_pb.RestoreBackupResponse)) {871 throw new Error('Expected argument of type lnrpc.RestoreBackupResponse');872 }873 return Buffer.from(arg.serializeBinary());874}875function deserialize_lnrpc_RestoreBackupResponse(buffer_arg) {876 return lnd_rpc_pb.RestoreBackupResponse.deserializeBinary(new Uint8Array(buffer_arg));877}878function serialize_lnrpc_RestoreChanBackupRequest(arg) {879 if (!(arg instanceof lnd_rpc_pb.RestoreChanBackupRequest)) {880 throw new Error('Expected argument of type lnrpc.RestoreChanBackupRequest');881 }882 return Buffer.from(arg.serializeBinary());883}884function deserialize_lnrpc_RestoreChanBackupRequest(buffer_arg) {885 return lnd_rpc_pb.RestoreChanBackupRequest.deserializeBinary(new Uint8Array(buffer_arg));886}887function serialize_lnrpc_SendCoinsRequest(arg) {888 if (!(arg instanceof lnd_rpc_pb.SendCoinsRequest)) {889 throw new Error('Expected argument of type lnrpc.SendCoinsRequest');890 }891 return Buffer.from(arg.serializeBinary());892}893function deserialize_lnrpc_SendCoinsRequest(buffer_arg) {894 return lnd_rpc_pb.SendCoinsRequest.deserializeBinary(new Uint8Array(buffer_arg));895}896function serialize_lnrpc_SendCoinsResponse(arg) {897 if (!(arg instanceof lnd_rpc_pb.SendCoinsResponse)) {898 throw new Error('Expected argument of type lnrpc.SendCoinsResponse');899 }900 return Buffer.from(arg.serializeBinary());901}902function deserialize_lnrpc_SendCoinsResponse(buffer_arg) {903 return lnd_rpc_pb.SendCoinsResponse.deserializeBinary(new Uint8Array(buffer_arg));904}905function serialize_lnrpc_SendCustomMessageRequest(arg) {906 if (!(arg instanceof lnd_rpc_pb.SendCustomMessageRequest)) {907 throw new Error('Expected argument of type lnrpc.SendCustomMessageRequest');908 }909 return Buffer.from(arg.serializeBinary());910}911function deserialize_lnrpc_SendCustomMessageRequest(buffer_arg) {912 return lnd_rpc_pb.SendCustomMessageRequest.deserializeBinary(new Uint8Array(buffer_arg));913}914function serialize_lnrpc_SendCustomMessageResponse(arg) {915 if (!(arg instanceof lnd_rpc_pb.SendCustomMessageResponse)) {916 throw new Error('Expected argument of type lnrpc.SendCustomMessageResponse');917 }918 return Buffer.from(arg.serializeBinary());919}920function deserialize_lnrpc_SendCustomMessageResponse(buffer_arg) {921 return lnd_rpc_pb.SendCustomMessageResponse.deserializeBinary(new Uint8Array(buffer_arg));922}923function serialize_lnrpc_SendManyRequest(arg) {924 if (!(arg instanceof lnd_rpc_pb.SendManyRequest)) {925 throw new Error('Expected argument of type lnrpc.SendManyRequest');926 }927 return Buffer.from(arg.serializeBinary());928}929function deserialize_lnrpc_SendManyRequest(buffer_arg) {930 return lnd_rpc_pb.SendManyRequest.deserializeBinary(new Uint8Array(buffer_arg));931}932function serialize_lnrpc_SendManyResponse(arg) {933 if (!(arg instanceof lnd_rpc_pb.SendManyResponse)) {934 throw new Error('Expected argument of type lnrpc.SendManyResponse');935 }936 return Buffer.from(arg.serializeBinary());937}938function deserialize_lnrpc_SendManyResponse(buffer_arg) {939 return lnd_rpc_pb.SendManyResponse.deserializeBinary(new Uint8Array(buffer_arg));940}941function serialize_lnrpc_SendRequest(arg) {942 if (!(arg instanceof lnd_rpc_pb.SendRequest)) {943 throw new Error('Expected argument of type lnrpc.SendRequest');944 }945 return Buffer.from(arg.serializeBinary());946}947function deserialize_lnrpc_SendRequest(buffer_arg) {948 return lnd_rpc_pb.SendRequest.deserializeBinary(new Uint8Array(buffer_arg));949}950function serialize_lnrpc_SendResponse(arg) {951 if (!(arg instanceof lnd_rpc_pb.SendResponse)) {952 throw new Error('Expected argument of type lnrpc.SendResponse');953 }954 return Buffer.from(arg.serializeBinary());955}956function deserialize_lnrpc_SendResponse(buffer_arg) {957 return lnd_rpc_pb.SendResponse.deserializeBinary(new Uint8Array(buffer_arg));958}959function serialize_lnrpc_SendToRouteRequest(arg) {960 if (!(arg instanceof lnd_rpc_pb.SendToRouteRequest)) {961 throw new Error('Expected argument of type lnrpc.SendToRouteRequest');962 }963 return Buffer.from(arg.serializeBinary());964}965function deserialize_lnrpc_SendToRouteRequest(buffer_arg) {966 return lnd_rpc_pb.SendToRouteRequest.deserializeBinary(new Uint8Array(buffer_arg));967}968function serialize_lnrpc_SignMessageRequest(arg) {969 if (!(arg instanceof lnd_rpc_pb.SignMessageRequest)) {970 throw new Error('Expected argument of type lnrpc.SignMessageRequest');971 }972 return Buffer.from(arg.serializeBinary());973}974function deserialize_lnrpc_SignMessageRequest(buffer_arg) {975 return lnd_rpc_pb.SignMessageRequest.deserializeBinary(new Uint8Array(buffer_arg));976}977function serialize_lnrpc_SignMessageResponse(arg) {978 if (!(arg instanceof lnd_rpc_pb.SignMessageResponse)) {979 throw new Error('Expected argument of type lnrpc.SignMessageResponse');980 }981 return Buffer.from(arg.serializeBinary());982}983function deserialize_lnrpc_SignMessageResponse(buffer_arg) {984 return lnd_rpc_pb.SignMessageResponse.deserializeBinary(new Uint8Array(buffer_arg));985}986function serialize_lnrpc_StopRequest(arg) {987 if (!(arg instanceof lnd_rpc_pb.StopRequest)) {988 throw new Error('Expected argument of type lnrpc.StopRequest');989 }990 return Buffer.from(arg.serializeBinary());991}992function deserialize_lnrpc_StopRequest(buffer_arg) {993 return lnd_rpc_pb.StopRequest.deserializeBinary(new Uint8Array(buffer_arg));994}995function serialize_lnrpc_StopResponse(arg) {996 if (!(arg instanceof lnd_rpc_pb.StopResponse)) {997 throw new Error('Expected argument of type lnrpc.StopResponse');998 }999 return Buffer.from(arg.serializeBinary());1000}1001function deserialize_lnrpc_StopResponse(buffer_arg) {1002 return lnd_rpc_pb.StopResponse.deserializeBinary(new Uint8Array(buffer_arg));1003}1004function serialize_lnrpc_SubscribeCustomMessagesRequest(arg) {1005 if (!(arg instanceof lnd_rpc_pb.SubscribeCustomMessagesRequest)) {1006 throw new Error('Expected argument of type lnrpc.SubscribeCustomMessagesRequest');1007 }1008 return Buffer.from(arg.serializeBinary());1009}1010function deserialize_lnrpc_SubscribeCustomMessagesRequest(buffer_arg) {1011 return lnd_rpc_pb.SubscribeCustomMessagesRequest.deserializeBinary(new Uint8Array(buffer_arg));1012}1013function serialize_lnrpc_Transaction(arg) {1014 if (!(arg instanceof lnd_rpc_pb.Transaction)) {1015 throw new Error('Expected argument of type lnrpc.Transaction');1016 }1017 return Buffer.from(arg.serializeBinary());1018}1019function deserialize_lnrpc_Transaction(buffer_arg) {1020 return lnd_rpc_pb.Transaction.deserializeBinary(new Uint8Array(buffer_arg));1021}1022function serialize_lnrpc_TransactionDetails(arg) {1023 if (!(arg instanceof lnd_rpc_pb.TransactionDetails)) {1024 throw new Error('Expected argument of type lnrpc.TransactionDetails');1025 }1026 return Buffer.from(arg.serializeBinary());1027}1028function deserialize_lnrpc_TransactionDetails(buffer_arg) {1029 return lnd_rpc_pb.TransactionDetails.deserializeBinary(new Uint8Array(buffer_arg));1030}1031function serialize_lnrpc_VerifyChanBackupResponse(arg) {1032 if (!(arg instanceof lnd_rpc_pb.VerifyChanBackupResponse)) {1033 throw new Error('Expected argument of type lnrpc.VerifyChanBackupResponse');1034 }1035 return Buffer.from(arg.serializeBinary());1036}1037function deserialize_lnrpc_VerifyChanBackupResponse(buffer_arg) {1038 return lnd_rpc_pb.VerifyChanBackupResponse.deserializeBinary(new Uint8Array(buffer_arg));1039}1040function serialize_lnrpc_VerifyMessageRequest(arg) {1041 if (!(arg instanceof lnd_rpc_pb.VerifyMessageRequest)) {1042 throw new Error('Expected argument of type lnrpc.VerifyMessageRequest');1043 }1044 return Buffer.from(arg.serializeBinary());1045}1046function deserialize_lnrpc_VerifyMessageRequest(buffer_arg) {1047 return lnd_rpc_pb.VerifyMessageRequest.deserializeBinary(new Uint8Array(buffer_arg));1048}1049function serialize_lnrpc_VerifyMessageResponse(arg) {1050 if (!(arg instanceof lnd_rpc_pb.VerifyMessageResponse)) {1051 throw new Error('Expected argument of type lnrpc.VerifyMessageResponse');1052 }1053 return Buffer.from(arg.serializeBinary());1054}1055function deserialize_lnrpc_VerifyMessageResponse(buffer_arg) {1056 return lnd_rpc_pb.VerifyMessageResponse.deserializeBinary(new Uint8Array(buffer_arg));1057}1058function serialize_lnrpc_WalletBalanceRequest(arg) {1059 if (!(arg instanceof lnd_rpc_pb.WalletBalanceRequest)) {1060 throw new Error('Expected argument of type lnrpc.WalletBalanceRequest');1061 }1062 return Buffer.from(arg.serializeBinary());1063}1064function deserialize_lnrpc_WalletBalanceRequest(buffer_arg) {1065 return lnd_rpc_pb.WalletBalanceRequest.deserializeBinary(new Uint8Array(buffer_arg));1066}1067function serialize_lnrpc_WalletBalanceResponse(arg) {1068 if (!(arg instanceof lnd_rpc_pb.WalletBalanceResponse)) {1069 throw new Error('Expected argument of type lnrpc.WalletBalanceResponse');1070 }1071 return Buffer.from(arg.serializeBinary());1072}1073function deserialize_lnrpc_WalletBalanceResponse(buffer_arg) {1074 return lnd_rpc_pb.WalletBalanceResponse.deserializeBinary(new Uint8Array(buffer_arg));1075}1076//1077// Comments in this file will be directly parsed into the API1078// Documentation as descriptions of the associated method, message, or field.1079// These descriptions should go right above the definition of the object, and1080// can be in either block or // comment format.1081//1082// An RPC method can be matched to an lncli command by placing a line in the1083// beginning of the description in exactly the following format:1084// lncli: `methodname`1085//1086// Failure to specify the exact name of the command will cause documentation1087// generation to fail.1088//1089// More information on how exactly the gRPC documentation is generated from1090// this proto file can be found here:1091// https://github.com/lightninglabs/lightning-api1092//1093// Lightning is the main RPC server of the daemon.1094var LightningService = exports.LightningService = {1095 // lncli: `walletbalance`1096// WalletBalance returns total unspent outputs(confirmed and unconfirmed), all1097// confirmed unspent outputs and all unconfirmed unspent outputs under control1098// of the wallet.1099walletBalance: {1100 path: '/lnrpc.Lightning/WalletBalance',1101 requestStream: false,1102 responseStream: false,1103 requestType: lnd_rpc_pb.WalletBalanceRequest,1104 responseType: lnd_rpc_pb.WalletBalanceResponse,1105 requestSerialize: serialize_lnrpc_WalletBalanceRequest,1106 requestDeserialize: deserialize_lnrpc_WalletBalanceRequest,1107 responseSerialize: serialize_lnrpc_WalletBalanceResponse,1108 responseDeserialize: deserialize_lnrpc_WalletBalanceResponse,1109 },1110 // lncli: `channelbalance`1111// ChannelBalance returns a report on the total funds across all open channels,1112// categorized in local/remote, pending local/remote and unsettled local/remote1113// balances.1114channelBalance: {1115 path: '/lnrpc.Lightning/ChannelBalance',1116 requestStream: false,1117 responseStream: false,1118 requestType: lnd_rpc_pb.ChannelBalanceRequest,1119 responseType: lnd_rpc_pb.ChannelBalanceResponse,1120 requestSerialize: serialize_lnrpc_ChannelBalanceRequest,1121 requestDeserialize: deserialize_lnrpc_ChannelBalanceRequest,1122 responseSerialize: serialize_lnrpc_ChannelBalanceResponse,1123 responseDeserialize: deserialize_lnrpc_ChannelBalanceResponse,1124 },1125 // lncli: `listchaintxns`1126// GetTransactions returns a list describing all the known transactions1127// relevant to the wallet.1128getTransactions: {1129 path: '/lnrpc.Lightning/GetTransactions',1130 requestStream: false,1131 responseStream: false,1132 requestType: lnd_rpc_pb.GetTransactionsRequest,1133 responseType: lnd_rpc_pb.TransactionDetails,1134 requestSerialize: serialize_lnrpc_GetTransactionsRequest,1135 requestDeserialize: deserialize_lnrpc_GetTransactionsRequest,1136 responseSerialize: serialize_lnrpc_TransactionDetails,1137 responseDeserialize: deserialize_lnrpc_TransactionDetails,1138 },1139 // lncli: `estimatefee`1140// EstimateFee asks the chain backend to estimate the fee rate and total fees1141// for a transaction that pays to multiple specified outputs.1142//1143// When using REST, the `AddrToAmount` map type can be set by appending1144// `&AddrToAmount[<address>]=<amount_to_send>` to the URL. Unfortunately this1145// map type doesn't appear in the REST API documentation because of a bug in1146// the grpc-gateway library.1147estimateFee: {1148 path: '/lnrpc.Lightning/EstimateFee',1149 requestStream: false,1150 responseStream: false,1151 requestType: lnd_rpc_pb.EstimateFeeRequest,1152 responseType: lnd_rpc_pb.EstimateFeeResponse,1153 requestSerialize: serialize_lnrpc_EstimateFeeRequest,1154 requestDeserialize: deserialize_lnrpc_EstimateFeeRequest,1155 responseSerialize: serialize_lnrpc_EstimateFeeResponse,1156 responseDeserialize: deserialize_lnrpc_EstimateFeeResponse,1157 },1158 // lncli: `sendcoins`1159// SendCoins executes a request to send coins to a particular address. Unlike1160// SendMany, this RPC call only allows creating a single output at a time. If1161// neither target_conf, or sat_per_vbyte are set, then the internal wallet will1162// consult its fee model to determine a fee for the default confirmation1163// target.1164sendCoins: {1165 path: '/lnrpc.Lightning/SendCoins',1166 requestStream: false,1167 responseStream: false,1168 requestType: lnd_rpc_pb.SendCoinsRequest,1169 responseType: lnd_rpc_pb.SendCoinsResponse,1170 requestSerialize: serialize_lnrpc_SendCoinsRequest,1171 requestDeserialize: deserialize_lnrpc_SendCoinsRequest,1172 responseSerialize: serialize_lnrpc_SendCoinsResponse,1173 responseDeserialize: deserialize_lnrpc_SendCoinsResponse,1174 },1175 // lncli: `listunspent`1176// Deprecated, use walletrpc.ListUnspent instead.1177//1178// ListUnspent returns a list of all utxos spendable by the wallet with a1179// number of confirmations between the specified minimum and maximum.1180listUnspent: {1181 path: '/lnrpc.Lightning/ListUnspent',1182 requestStream: false,1183 responseStream: false,1184 requestType: lnd_rpc_pb.ListUnspentRequest,1185 responseType: lnd_rpc_pb.ListUnspentResponse,1186 requestSerialize: serialize_lnrpc_ListUnspentRequest,1187 requestDeserialize: deserialize_lnrpc_ListUnspentRequest,1188 responseSerialize: serialize_lnrpc_ListUnspentResponse,1189 responseDeserialize: deserialize_lnrpc_ListUnspentResponse,1190 },1191 //1192// SubscribeTransactions creates a uni-directional stream from the server to1193// the client in which any newly discovered transactions relevant to the1194// wallet are sent over.1195subscribeTransactions: {1196 path: '/lnrpc.Lightning/SubscribeTransactions',1197 requestStream: false,1198 responseStream: true,1199 requestType: lnd_rpc_pb.GetTransactionsRequest,1200 responseType: lnd_rpc_pb.Transaction,1201 requestSerialize: serialize_lnrpc_GetTransactionsRequest,1202 requestDeserialize: deserialize_lnrpc_GetTransactionsRequest,1203 responseSerialize: serialize_lnrpc_Transaction,1204 responseDeserialize: deserialize_lnrpc_Transaction,1205 },1206 // lncli: `sendmany`1207// SendMany handles a request for a transaction that creates multiple specified1208// outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then1209// the internal wallet will consult its fee model to determine a fee for the1210// default confirmation target.1211sendMany: {1212 path: '/lnrpc.Lightning/SendMany',1213 requestStream: false,1214 responseStream: false,1215 requestType: lnd_rpc_pb.SendManyRequest,1216 responseType: lnd_rpc_pb.SendManyResponse,1217 requestSerialize: serialize_lnrpc_SendManyRequest,1218 requestDeserialize: deserialize_lnrpc_SendManyRequest,1219 responseSerialize: serialize_lnrpc_SendManyResponse,1220 responseDeserialize: deserialize_lnrpc_SendManyResponse,1221 },1222 // lncli: `newaddress`1223// NewAddress creates a new address under control of the local wallet.1224newAddress: {1225 path: '/lnrpc.Lightning/NewAddress',1226 requestStream: false,1227 responseStream: false,1228 requestType: lnd_rpc_pb.NewAddressRequest,1229 responseType: lnd_rpc_pb.NewAddressResponse,1230 requestSerialize: serialize_lnrpc_NewAddressRequest,1231 requestDeserialize: deserialize_lnrpc_NewAddressRequest,1232 responseSerialize: serialize_lnrpc_NewAddressResponse,1233 responseDeserialize: deserialize_lnrpc_NewAddressResponse,1234 },1235 // lncli: `signmessage`1236// SignMessage signs a message with this node's private key. The returned1237// signature string is `zbase32` encoded and pubkey recoverable, meaning that1238// only the message digest and signature are needed for verification.1239signMessage: {1240 path: '/lnrpc.Lightning/SignMessage',1241 requestStream: false,1242 responseStream: false,1243 requestType: lnd_rpc_pb.SignMessageRequest,1244 responseType: lnd_rpc_pb.SignMessageResponse,1245 requestSerialize: serialize_lnrpc_SignMessageRequest,1246 requestDeserialize: deserialize_lnrpc_SignMessageRequest,1247 responseSerialize: serialize_lnrpc_SignMessageResponse,1248 responseDeserialize: deserialize_lnrpc_SignMessageResponse,1249 },1250 // lncli: `verifymessage`1251// VerifyMessage verifies a signature over a msg. The signature must be1252// zbase32 encoded and signed by an active node in the resident node's1253// channel database. In addition to returning the validity of the signature,1254// VerifyMessage also returns the recovered pubkey from the signature.1255verifyMessage: {1256 path: '/lnrpc.Lightning/VerifyMessage',1257 requestStream: false,1258 responseStream: false,1259 requestType: lnd_rpc_pb.VerifyMessageRequest,1260 responseType: lnd_rpc_pb.VerifyMessageResponse,1261 requestSerialize: serialize_lnrpc_VerifyMessageRequest,1262 requestDeserialize: deserialize_lnrpc_VerifyMessageRequest,1263 responseSerialize: serialize_lnrpc_VerifyMessageResponse,1264 responseDeserialize: deserialize_lnrpc_VerifyMessageResponse,1265 },1266 // lncli: `connect`1267// ConnectPeer attempts to establish a connection to a remote peer. This is at1268// the networking level, and is used for communication between nodes. This is1269// distinct from establishing a channel with a peer.1270connectPeer: {1271 path: '/lnrpc.Lightning/ConnectPeer',1272 requestStream: false,1273 responseStream: false,1274 requestType: lnd_rpc_pb.ConnectPeerRequest,1275 responseType: lnd_rpc_pb.ConnectPeerResponse,1276 requestSerialize: serialize_lnrpc_ConnectPeerRequest,1277 requestDeserialize: deserialize_lnrpc_ConnectPeerRequest,1278 responseSerialize: serialize_lnrpc_ConnectPeerResponse,1279 responseDeserialize: deserialize_lnrpc_ConnectPeerResponse,1280 },1281 // lncli: `disconnect`1282// DisconnectPeer attempts to disconnect one peer from another identified by a1283// given pubKey. In the case that we currently have a pending or active channel1284// with the target peer, then this action will be not be allowed.1285disconnectPeer: {1286 path: '/lnrpc.Lightning/DisconnectPeer',1287 requestStream: false,1288 responseStream: false,1289 requestType: lnd_rpc_pb.DisconnectPeerRequest,1290 responseType: lnd_rpc_pb.DisconnectPeerResponse,1291 requestSerialize: serialize_lnrpc_DisconnectPeerRequest,1292 requestDeserialize: deserialize_lnrpc_DisconnectPeerRequest,1293 responseSerialize: serialize_lnrpc_DisconnectPeerResponse,1294 responseDeserialize: deserialize_lnrpc_DisconnectPeerResponse,1295 },1296 // lncli: `listpeers`1297// ListPeers returns a verbose listing of all currently active peers.1298listPeers: {1299 path: '/lnrpc.Lightning/ListPeers',1300 requestStream: false,1301 responseStream: false,1302 requestType: lnd_rpc_pb.ListPeersRequest,1303 responseType: lnd_rpc_pb.ListPeersResponse,1304 requestSerialize: serialize_lnrpc_ListPeersRequest,1305 requestDeserialize: deserialize_lnrpc_ListPeersRequest,1306 responseSerialize: serialize_lnrpc_ListPeersResponse,1307 responseDeserialize: deserialize_lnrpc_ListPeersResponse,1308 },1309 //1310// SubscribePeerEvents creates a uni-directional stream from the server to1311// the client in which any events relevant to the state of peers are sent1312// over. Events include peers going online and offline.1313subscribePeerEvents: {1314 path: '/lnrpc.Lightning/SubscribePeerEvents',1315 requestStream: false,1316 responseStream: true,1317 requestType: lnd_rpc_pb.PeerEventSubscription,1318 responseType: lnd_rpc_pb.PeerEvent,1319 requestSerialize: serialize_lnrpc_PeerEventSubscription,1320 requestDeserialize: deserialize_lnrpc_PeerEventSubscription,1321 responseSerialize: serialize_lnrpc_PeerEvent,1322 responseDeserialize: deserialize_lnrpc_PeerEvent,1323 },1324 // lncli: `getinfo`1325// GetInfo returns general information concerning the lightning node including1326// it's identity pubkey, alias, the chains it is connected to, and information1327// concerning the number of open+pending channels.1328getInfo: {1329 path: '/lnrpc.Lightning/GetInfo',1330 requestStream: false,1331 responseStream: false,1332 requestType: lnd_rpc_pb.GetInfoRequest,1333 responseType: lnd_rpc_pb.GetInfoResponse,1334 requestSerialize: serialize_lnrpc_GetInfoRequest,1335 requestDeserialize: deserialize_lnrpc_GetInfoRequest,1336 responseSerialize: serialize_lnrpc_GetInfoResponse,1337 responseDeserialize: deserialize_lnrpc_GetInfoResponse,1338 },1339 // * lncli: `getrecoveryinfo`1340// GetRecoveryInfo returns information concerning the recovery mode including1341// whether it's in a recovery mode, whether the recovery is finished, and the1342// progress made so far.1343getRecoveryInfo: {1344 path: '/lnrpc.Lightning/GetRecoveryInfo',1345 requestStream: false,1346 responseStream: false,1347 requestType: lnd_rpc_pb.GetRecoveryInfoRequest,1348 responseType: lnd_rpc_pb.GetRecoveryInfoResponse,1349 requestSerialize: serialize_lnrpc_GetRecoveryInfoRequest,1350 requestDeserialize: deserialize_lnrpc_GetRecoveryInfoRequest,1351 responseSerialize: serialize_lnrpc_GetRecoveryInfoResponse,1352 responseDeserialize: deserialize_lnrpc_GetRecoveryInfoResponse,1353 },1354 // TODO(roasbeef): merge with below with bool?1355//1356// lncli: `pendingchannels`1357// PendingChannels returns a list of all the channels that are currently1358// considered "pending". A channel is pending if it has finished the funding1359// workflow and is waiting for confirmations for the funding txn, or is in the1360// process of closure, either initiated cooperatively or non-cooperatively.1361pendingChannels: {1362 path: '/lnrpc.Lightning/PendingChannels',1363 requestStream: false,1364 responseStream: false,1365 requestType: lnd_rpc_pb.PendingChannelsRequest,1366 responseType: lnd_rpc_pb.PendingChannelsResponse,1367 requestSerialize: serialize_lnrpc_PendingChannelsRequest,1368 requestDeserialize: deserialize_lnrpc_PendingChannelsRequest,1369 responseSerialize: serialize_lnrpc_PendingChannelsResponse,1370 responseDeserialize: deserialize_lnrpc_PendingChannelsResponse,1371 },1372 // lncli: `listchannels`1373// ListChannels returns a description of all the open channels that this node1374// is a participant in.1375listChannels: {1376 path: '/lnrpc.Lightning/ListChannels',1377 requestStream: false,1378 responseStream: false,1379 requestType: lnd_rpc_pb.ListChannelsRequest,1380 responseType: lnd_rpc_pb.ListChannelsResponse,1381 requestSerialize: serialize_lnrpc_ListChannelsRequest,1382 requestDeserialize: deserialize_lnrpc_ListChannelsRequest,1383 responseSerialize: serialize_lnrpc_ListChannelsResponse,1384 responseDeserialize: deserialize_lnrpc_ListChannelsResponse,1385 },1386 //1387// SubscribeChannelEvents creates a uni-directional stream from the server to1388// the client in which any updates relevant to the state of the channels are1389// sent over. Events include new active channels, inactive channels, and closed1390// channels.1391subscribeChannelEvents: {1392 path: '/lnrpc.Lightning/SubscribeChannelEvents',1393 requestStream: false,1394 responseStream: true,1395 requestType: lnd_rpc_pb.ChannelEventSubscription,1396 responseType: lnd_rpc_pb.ChannelEventUpdate,1397 requestSerialize: serialize_lnrpc_ChannelEventSubscription,1398 requestDeserialize: deserialize_lnrpc_ChannelEventSubscription,1399 responseSerialize: serialize_lnrpc_ChannelEventUpdate,1400 responseDeserialize: deserialize_lnrpc_ChannelEventUpdate,1401 },1402 // lncli: `closedchannels`1403// ClosedChannels returns a description of all the closed channels that1404// this node was a participant in.1405closedChannels: {1406 path: '/lnrpc.Lightning/ClosedChannels',1407 requestStream: false,1408 responseStream: false,1409 requestType: lnd_rpc_pb.ClosedChannelsRequest,1410 responseType: lnd_rpc_pb.ClosedChannelsResponse,1411 requestSerialize: serialize_lnrpc_ClosedChannelsRequest,1412 requestDeserialize: deserialize_lnrpc_ClosedChannelsRequest,1413 responseSerialize: serialize_lnrpc_ClosedChannelsResponse,1414 responseDeserialize: deserialize_lnrpc_ClosedChannelsResponse,1415 },1416 //1417// OpenChannelSync is a synchronous version of the OpenChannel RPC call. This1418// call is meant to be consumed by clients to the REST proxy. As with all1419// other sync calls, all byte slices are intended to be populated as hex1420// encoded strings.1421openChannelSync: {1422 path: '/lnrpc.Lightning/OpenChannelSync',1423 requestStream: false,1424 responseStream: false,1425 requestType: lnd_rpc_pb.OpenChannelRequest,1426 responseType: lnd_rpc_pb.ChannelPoint,1427 requestSerialize: serialize_lnrpc_OpenChannelRequest,1428 requestDeserialize: deserialize_lnrpc_OpenChannelRequest,1429 responseSerialize: serialize_lnrpc_ChannelPoint,1430 responseDeserialize: deserialize_lnrpc_ChannelPoint,1431 },1432 // lncli: `openchannel`1433// OpenChannel attempts to open a singly funded channel specified in the1434// request to a remote peer. Users are able to specify a target number of1435// blocks that the funding transaction should be confirmed in, or a manual fee1436// rate to us for the funding transaction. If neither are specified, then a1437// lax block confirmation target is used. Each OpenStatusUpdate will return1438// the pending channel ID of the in-progress channel. Depending on the1439// arguments specified in the OpenChannelRequest, this pending channel ID can1440// then be used to manually progress the channel funding flow.1441openChannel: {1442 path: '/lnrpc.Lightning/OpenChannel',1443 requestStream: false,1444 responseStream: true,1445 requestType: lnd_rpc_pb.OpenChannelRequest,1446 responseType: lnd_rpc_pb.OpenStatusUpdate,1447 requestSerialize: serialize_lnrpc_OpenChannelRequest,1448 requestDeserialize: deserialize_lnrpc_OpenChannelRequest,1449 responseSerialize: serialize_lnrpc_OpenStatusUpdate,1450 responseDeserialize: deserialize_lnrpc_OpenStatusUpdate,1451 },1452 // lncli: `batchopenchannel`1453// BatchOpenChannel attempts to open multiple single-funded channels in a1454// single transaction in an atomic way. This means either all channel open1455// requests succeed at once or all attempts are aborted if any of them fail.1456// This is the safer variant of using PSBTs to manually fund a batch of1457// channels through the OpenChannel RPC.1458batchOpenChannel: {1459 path: '/lnrpc.Lightning/BatchOpenChannel',1460 requestStream: false,1461 responseStream: false,1462 requestType: lnd_rpc_pb.BatchOpenChannelRequest,1463 responseType: lnd_rpc_pb.BatchOpenChannelResponse,1464 requestSerialize: serialize_lnrpc_BatchOpenChannelRequest,1465 requestDeserialize: deserialize_lnrpc_BatchOpenChannelRequest,1466 responseSerialize: serialize_lnrpc_BatchOpenChannelResponse,1467 responseDeserialize: deserialize_lnrpc_BatchOpenChannelResponse,1468 },1469 //1470// FundingStateStep is an advanced funding related call that allows the caller1471// to either execute some preparatory steps for a funding workflow, or1472// manually progress a funding workflow. The primary way a funding flow is1473// identified is via its pending channel ID. As an example, this method can be1474// used to specify that we're expecting a funding flow for a particular1475// pending channel ID, for which we need to use specific parameters.1476// Alternatively, this can be used to interactively drive PSBT signing for1477// funding for partially complete funding transactions.1478fundingStateStep: {1479 path: '/lnrpc.Lightning/FundingStateStep',1480 requestStream: false,1481 responseStream: false,1482 requestType: lnd_rpc_pb.FundingTransitionMsg,1483 responseType: lnd_rpc_pb.FundingStateStepResp,1484 requestSerialize: serialize_lnrpc_FundingTransitionMsg,1485 requestDeserialize: deserialize_lnrpc_FundingTransitionMsg,1486 responseSerialize: serialize_lnrpc_FundingStateStepResp,1487 responseDeserialize: deserialize_lnrpc_FundingStateStepResp,1488 },1489 //1490// ChannelAcceptor dispatches a bi-directional streaming RPC in which1491// OpenChannel requests are sent to the client and the client responds with1492// a boolean that tells LND whether or not to accept the channel. This allows1493// node operators to specify their own criteria for accepting inbound channels1494// through a single persistent connection.1495channelAcceptor: {1496 path: '/lnrpc.Lightning/ChannelAcceptor',1497 requestStream: true,1498 responseStream: true,1499 requestType: lnd_rpc_pb.ChannelAcceptResponse,1500 responseType: lnd_rpc_pb.ChannelAcceptRequest,1501 requestSerialize: serialize_lnrpc_ChannelAcceptResponse,1502 requestDeserialize: deserialize_lnrpc_ChannelAcceptResponse,1503 responseSerialize: serialize_lnrpc_ChannelAcceptRequest,1504 responseDeserialize: deserialize_lnrpc_ChannelAcceptRequest,1505 },1506 // lncli: `closechannel`1507// CloseChannel attempts to close an active channel identified by its channel1508// outpoint (ChannelPoint). The actions of this method can additionally be1509// augmented to attempt a force close after a timeout period in the case of an1510// inactive peer. If a non-force close (cooperative closure) is requested,1511// then the user can specify either a target number of blocks until the1512// closure transaction is confirmed, or a manual fee rate. If neither are1513// specified, then a default lax, block confirmation target is used.1514closeChannel: {1515 path: '/lnrpc.Lightning/CloseChannel',1516 requestStream: false,1517 responseStream: true,1518 requestType: lnd_rpc_pb.CloseChannelRequest,1519 responseType: lnd_rpc_pb.CloseStatusUpdate,1520 requestSerialize: serialize_lnrpc_CloseChannelRequest,1521 requestDeserialize: deserialize_lnrpc_CloseChannelRequest,1522 responseSerialize: serialize_lnrpc_CloseStatusUpdate,1523 responseDeserialize: deserialize_lnrpc_CloseStatusUpdate,1524 },1525 // lncli: `abandonchannel`1526// AbandonChannel removes all channel state from the database except for a1527// close summary. This method can be used to get rid of permanently unusable1528// channels due to bugs fixed in newer versions of lnd. This method can also be1529// used to remove externally funded channels where the funding transaction was1530// never broadcast. Only available for non-externally funded channels in dev1531// build.1532abandonChannel: {1533 path: '/lnrpc.Lightning/AbandonChannel',1534 requestStream: false,1535 responseStream: false,1536 requestType: lnd_rpc_pb.AbandonChannelRequest,1537 responseType: lnd_rpc_pb.AbandonChannelResponse,1538 requestSerialize: serialize_lnrpc_AbandonChannelRequest,1539 requestDeserialize: deserialize_lnrpc_AbandonChannelRequest,1540 responseSerialize: serialize_lnrpc_AbandonChannelResponse,1541 responseDeserialize: deserialize_lnrpc_AbandonChannelResponse,1542 },1543 // lncli: `sendpayment`1544// Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a1545// bi-directional streaming RPC for sending payments through the Lightning1546// Network. A single RPC invocation creates a persistent bi-directional1547// stream allowing clients to rapidly send payments through the Lightning1548// Network with a single persistent connection.1549sendPayment: {1550 path: '/lnrpc.Lightning/SendPayment',1551 requestStream: true,1552 responseStream: true,1553 requestType: lnd_rpc_pb.SendRequest,1554 responseType: lnd_rpc_pb.SendResponse,1555 requestSerialize: serialize_lnrpc_SendRequest,1556 requestDeserialize: deserialize_lnrpc_SendRequest,1557 responseSerialize: serialize_lnrpc_SendResponse,1558 responseDeserialize: deserialize_lnrpc_SendResponse,1559 },1560 //1561// SendPaymentSync is the synchronous non-streaming version of SendPayment.1562// This RPC is intended to be consumed by clients of the REST proxy.1563// Additionally, this RPC expects the destination's public key and the payment1564// hash (if any) to be encoded as hex strings.1565sendPaymentSync: {1566 path: '/lnrpc.Lightning/SendPaymentSync',1567 requestStream: false,1568 responseStream: false,1569 requestType: lnd_rpc_pb.SendRequest,1570 responseType: lnd_rpc_pb.SendResponse,1571 requestSerialize: serialize_lnrpc_SendRequest,1572 requestDeserialize: deserialize_lnrpc_SendRequest,1573 responseSerialize: serialize_lnrpc_SendResponse,1574 responseDeserialize: deserialize_lnrpc_SendResponse,1575 },1576 // lncli: `sendtoroute`1577// Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional1578// streaming RPC for sending payment through the Lightning Network. This1579// method differs from SendPayment in that it allows users to specify a full1580// route manually. This can be used for things like rebalancing, and atomic1581// swaps.1582sendToRoute: {1583 path: '/lnrpc.Lightning/SendToRoute',1584 requestStream: true,1585 responseStream: true,1586 requestType: lnd_rpc_pb.SendToRouteRequest,1587 responseType: lnd_rpc_pb.SendResponse,1588 requestSerialize: serialize_lnrpc_SendToRouteRequest,1589 requestDeserialize: deserialize_lnrpc_SendToRouteRequest,1590 responseSerialize: serialize_lnrpc_SendResponse,1591 responseDeserialize: deserialize_lnrpc_SendResponse,1592 },1593 //1594// SendToRouteSync is a synchronous version of SendToRoute. It Will block1595// until the payment either fails or succeeds.1596sendToRouteSync: {1597 path: '/lnrpc.Lightning/SendToRouteSync',1598 requestStream: false,1599 responseStream: false,1600 requestType: lnd_rpc_pb.SendToRouteRequest,1601 responseType: lnd_rpc_pb.SendResponse,1602 requestSerialize: serialize_lnrpc_SendToRouteRequest,1603 requestDeserialize: deserialize_lnrpc_SendToRouteRequest,1604 responseSerialize: serialize_lnrpc_SendResponse,1605 responseDeserialize: deserialize_lnrpc_SendResponse,1606 },1607 // lncli: `addinvoice`1608// AddInvoice attempts to add a new invoice to the invoice database. Any1609// duplicated invoices are rejected, therefore all invoices *must* have a1610// unique payment preimage.1611addInvoice: {1612 path: '/lnrpc.Lightning/AddInvoice',1613 requestStream: false,1614 responseStream: false,1615 requestType: lnd_rpc_pb.Invoice,1616 responseType: lnd_rpc_pb.AddInvoiceResponse,1617 requestSerialize: serialize_lnrpc_Invoice,1618 requestDeserialize: deserialize_lnrpc_Invoice,1619 responseSerialize: serialize_lnrpc_AddInvoiceResponse,1620 responseDeserialize: deserialize_lnrpc_AddInvoiceResponse,1621 },1622 // lncli: `listinvoices`1623// ListInvoices returns a list of all the invoices currently stored within the1624// database. Any active debug invoices are ignored. It has full support for1625// paginated responses, allowing users to query for specific invoices through1626// their add_index. This can be done by using either the first_index_offset or1627// last_index_offset fields included in the response as the index_offset of the1628// next request. By default, the first 100 invoices created will be returned.1629// Backwards pagination is also supported through the Reversed flag.1630listInvoices: {1631 path: '/lnrpc.Lightning/ListInvoices',1632 requestStream: false,1633 responseStream: false,1634 requestType: lnd_rpc_pb.ListInvoiceRequest,1635 responseType: lnd_rpc_pb.ListInvoiceResponse,1636 requestSerialize: serialize_lnrpc_ListInvoiceRequest,1637 requestDeserialize: deserialize_lnrpc_ListInvoiceRequest,1638 responseSerialize: serialize_lnrpc_ListInvoiceResponse,1639 responseDeserialize: deserialize_lnrpc_ListInvoiceResponse,1640 },1641 // lncli: `lookupinvoice`1642// LookupInvoice attempts to look up an invoice according to its payment hash.1643// The passed payment hash *must* be exactly 32 bytes, if not, an error is1644// returned.1645lookupInvoice: {1646 path: '/lnrpc.Lightning/LookupInvoice',1647 requestStream: false,1648 responseStream: false,1649 requestType: lnd_rpc_pb.PaymentHash,1650 responseType: lnd_rpc_pb.Invoice,1651 requestSerialize: serialize_lnrpc_PaymentHash,1652 requestDeserialize: deserialize_lnrpc_PaymentHash,1653 responseSerialize: serialize_lnrpc_Invoice,1654 responseDeserialize: deserialize_lnrpc_Invoice,1655 },1656 //1657// SubscribeInvoices returns a uni-directional stream (server -> client) for1658// notifying the client of newly added/settled invoices. The caller can1659// optionally specify the add_index and/or the settle_index. If the add_index1660// is specified, then we'll first start by sending add invoice events for all1661// invoices with an add_index greater than the specified value. If the1662// settle_index is specified, the next, we'll send out all settle events for1663// invoices with a settle_index greater than the specified value. One or both1664// of these fields can be set. If no fields are set, then we'll only send out1665// the latest add/settle events.1666subscribeInvoices: {1667 path: '/lnrpc.Lightning/SubscribeInvoices',1668 requestStream: false,1669 responseStream: true,1670 requestType: lnd_rpc_pb.InvoiceSubscription,1671 responseType: lnd_rpc_pb.Invoice,1672 requestSerialize: serialize_lnrpc_InvoiceSubscription,1673 requestDeserialize: deserialize_lnrpc_InvoiceSubscription,1674 responseSerialize: serialize_lnrpc_Invoice,1675 responseDeserialize: deserialize_lnrpc_Invoice,1676 },1677 // lncli: `decodepayreq`1678// DecodePayReq takes an encoded payment request string and attempts to decode1679// it, returning a full description of the conditions encoded within the1680// payment request.1681decodePayReq: {1682 path: '/lnrpc.Lightning/DecodePayReq',1683 requestStream: false,1684 responseStream: false,1685 requestType: lnd_rpc_pb.PayReqString,1686 responseType: lnd_rpc_pb.PayReq,1687 requestSerialize: serialize_lnrpc_PayReqString,1688 requestDeserialize: deserialize_lnrpc_PayReqString,1689 responseSerialize: serialize_lnrpc_PayReq,1690 responseDeserialize: deserialize_lnrpc_PayReq,1691 },1692 // lncli: `listpayments`1693// ListPayments returns a list of all outgoing payments.1694listPayments: {1695 path: '/lnrpc.Lightning/ListPayments',1696 requestStream: false,1697 responseStream: false,1698 requestType: lnd_rpc_pb.ListPaymentsRequest,1699 responseType: lnd_rpc_pb.ListPaymentsResponse,1700 requestSerialize: serialize_lnrpc_ListPaymentsRequest,1701 requestDeserialize: deserialize_lnrpc_ListPaymentsRequest,1702 responseSerialize: serialize_lnrpc_ListPaymentsResponse,1703 responseDeserialize: deserialize_lnrpc_ListPaymentsResponse,1704 },1705 //1706// DeletePayment deletes an outgoing payment from DB. Note that it will not1707// attempt to delete an In-Flight payment, since that would be unsafe.1708deletePayment: {1709 path: '/lnrpc.Lightning/DeletePayment',1710 requestStream: false,1711 responseStream: false,1712 requestType: lnd_rpc_pb.DeletePaymentRequest,1713 responseType: lnd_rpc_pb.DeletePaymentResponse,1714 requestSerialize: serialize_lnrpc_DeletePaymentRequest,1715 requestDeserialize: deserialize_lnrpc_DeletePaymentRequest,1716 responseSerialize: serialize_lnrpc_DeletePaymentResponse,1717 responseDeserialize: deserialize_lnrpc_DeletePaymentResponse,1718 },1719 //1720// DeleteAllPayments deletes all outgoing payments from DB. Note that it will1721// not attempt to delete In-Flight payments, since that would be unsafe.1722deleteAllPayments: {1723 path: '/lnrpc.Lightning/DeleteAllPayments',1724 requestStream: false,1725 responseStream: false,1726 requestType: lnd_rpc_pb.DeleteAllPaymentsRequest,1727 responseType: lnd_rpc_pb.DeleteAllPaymentsResponse,1728 requestSerialize: serialize_lnrpc_DeleteAllPaymentsRequest,1729 requestDeserialize: deserialize_lnrpc_DeleteAllPaymentsRequest,1730 responseSerialize: serialize_lnrpc_DeleteAllPaymentsResponse,1731 responseDeserialize: deserialize_lnrpc_DeleteAllPaymentsResponse,1732 },1733 // lncli: `describegraph`1734// DescribeGraph returns a description of the latest graph state from the1735// point of view of the node. The graph information is partitioned into two1736// components: all the nodes/vertexes, and all the edges that connect the1737// vertexes themselves. As this is a directed graph, the edges also contain1738// the node directional specific routing policy which includes: the time lock1739// delta, fee information, etc.1740describeGraph: {1741 path: '/lnrpc.Lightning/DescribeGraph',1742 requestStream: false,1743 responseStream: false,1744 requestType: lnd_rpc_pb.ChannelGraphRequest,1745 responseType: lnd_rpc_pb.ChannelGraph,1746 requestSerialize: serialize_lnrpc_ChannelGraphRequest,1747 requestDeserialize: deserialize_lnrpc_ChannelGraphRequest,1748 responseSerialize: serialize_lnrpc_ChannelGraph,1749 responseDeserialize: deserialize_lnrpc_ChannelGraph,1750 },1751 // lncli: `getnodemetrics`1752// GetNodeMetrics returns node metrics calculated from the graph. Currently1753// the only supported metric is betweenness centrality of individual nodes.1754getNodeMetrics: {1755 path: '/lnrpc.Lightning/GetNodeMetrics',1756 requestStream: false,1757 responseStream: false,1758 requestType: lnd_rpc_pb.NodeMetricsRequest,1759 responseType: lnd_rpc_pb.NodeMetricsResponse,1760 requestSerialize: serialize_lnrpc_NodeMetricsRequest,1761 requestDeserialize: deserialize_lnrpc_NodeMetricsRequest,1762 responseSerialize: serialize_lnrpc_NodeMetricsResponse,1763 responseDeserialize: deserialize_lnrpc_NodeMetricsResponse,1764 },1765 // lncli: `getchaninfo`1766// GetChanInfo returns the latest authenticated network announcement for the1767// given channel identified by its channel ID: an 8-byte integer which1768// uniquely identifies the location of transaction's funding output within the1769// blockchain.1770getChanInfo: {1771 path: '/lnrpc.Lightning/GetChanInfo',1772 requestStream: false,1773 responseStream: false,1774 requestType: lnd_rpc_pb.ChanInfoRequest,1775 responseType: lnd_rpc_pb.ChannelEdge,1776 requestSerialize: serialize_lnrpc_ChanInfoRequest,1777 requestDeserialize: deserialize_lnrpc_ChanInfoRequest,1778 responseSerialize: serialize_lnrpc_ChannelEdge,1779 responseDeserialize: deserialize_lnrpc_ChannelEdge,1780 },1781 // lncli: `getnodeinfo`1782// GetNodeInfo returns the latest advertised, aggregated, and authenticated1783// channel information for the specified node identified by its public key.1784getNodeInfo: {1785 path: '/lnrpc.Lightning/GetNodeInfo',1786 requestStream: false,1787 responseStream: false,1788 requestType: lnd_rpc_pb.NodeInfoRequest,1789 responseType: lnd_rpc_pb.NodeInfo,1790 requestSerialize: serialize_lnrpc_NodeInfoRequest,1791 requestDeserialize: deserialize_lnrpc_NodeInfoRequest,1792 responseSerialize: serialize_lnrpc_NodeInfo,1793 responseDeserialize: deserialize_lnrpc_NodeInfo,1794 },1795 // lncli: `queryroutes`1796// QueryRoutes attempts to query the daemon's Channel Router for a possible1797// route to a target destination capable of carrying a specific amount of1798// satoshis. The returned route contains the full details required to craft and1799// send an HTLC, also including the necessary information that should be1800// present within the Sphinx packet encapsulated within the HTLC.1801//1802// When using REST, the `dest_custom_records` map type can be set by appending1803// `&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`1804// to the URL. Unfortunately this map type doesn't appear in the REST API1805// documentation because of a bug in the grpc-gateway library.1806queryRoutes: {1807 path: '/lnrpc.Lightning/QueryRoutes',1808 requestStream: false,1809 responseStream: false,1810 requestType: lnd_rpc_pb.QueryRoutesRequest,1811 responseType: lnd_rpc_pb.QueryRoutesResponse,1812 requestSerialize: serialize_lnrpc_QueryRoutesRequest,1813 requestDeserialize: deserialize_lnrpc_QueryRoutesRequest,1814 responseSerialize: serialize_lnrpc_QueryRoutesResponse,1815 responseDeserialize: deserialize_lnrpc_QueryRoutesResponse,1816 },1817 // lncli: `getnetworkinfo`1818// GetNetworkInfo returns some basic stats about the known channel graph from1819// the point of view of the node.1820getNetworkInfo: {1821 path: '/lnrpc.Lightning/GetNetworkInfo',1822 requestStream: false,1823 responseStream: false,1824 requestType: lnd_rpc_pb.NetworkInfoRequest,1825 responseType: lnd_rpc_pb.NetworkInfo,1826 requestSerialize: serialize_lnrpc_NetworkInfoRequest,1827 requestDeserialize: deserialize_lnrpc_NetworkInfoRequest,1828 responseSerialize: serialize_lnrpc_NetworkInfo,1829 responseDeserialize: deserialize_lnrpc_NetworkInfo,1830 },1831 // lncli: `stop`1832// StopDaemon will send a shutdown request to the interrupt handler, triggering1833// a graceful shutdown of the daemon.1834stopDaemon: {1835 path: '/lnrpc.Lightning/StopDaemon',1836 requestStream: false,1837 responseStream: false,1838 requestType: lnd_rpc_pb.StopRequest,1839 responseType: lnd_rpc_pb.StopResponse,1840 requestSerialize: serialize_lnrpc_StopRequest,1841 requestDeserialize: deserialize_lnrpc_StopRequest,1842 responseSerialize: serialize_lnrpc_StopResponse,1843 responseDeserialize: deserialize_lnrpc_StopResponse,1844 },1845 //1846// SubscribeChannelGraph launches a streaming RPC that allows the caller to1847// receive notifications upon any changes to the channel graph topology from1848// the point of view of the responding node. Events notified include: new1849// nodes coming online, nodes updating their authenticated attributes, new1850// channels being advertised, updates in the routing policy for a directional1851// channel edge, and when channels are closed on-chain.1852subscribeChannelGraph: {1853 path: '/lnrpc.Lightning/SubscribeChannelGraph',1854 requestStream: false,1855 responseStream: true,1856 requestType: lnd_rpc_pb.GraphTopologySubscription,1857 responseType: lnd_rpc_pb.GraphTopologyUpdate,1858 requestSerialize: serialize_lnrpc_GraphTopologySubscription,1859 requestDeserialize: deserialize_lnrpc_GraphTopologySubscription,1860 responseSerialize: serialize_lnrpc_GraphTopologyUpdate,1861 responseDeserialize: deserialize_lnrpc_GraphTopologyUpdate,1862 },1863 // lncli: `debuglevel`1864// DebugLevel allows a caller to programmatically set the logging verbosity of1865// lnd. The logging can be targeted according to a coarse daemon-wide logging1866// level, or in a granular fashion to specify the logging for a target1867// sub-system.1868debugLevel: {1869 path: '/lnrpc.Lightning/DebugLevel',1870 requestStream: false,1871 responseStream: false,1872 requestType: lnd_rpc_pb.DebugLevelRequest,1873 responseType: lnd_rpc_pb.DebugLevelResponse,1874 requestSerialize: serialize_lnrpc_DebugLevelRequest,1875 requestDeserialize: deserialize_lnrpc_DebugLevelRequest,1876 responseSerialize: serialize_lnrpc_DebugLevelResponse,1877 responseDeserialize: deserialize_lnrpc_DebugLevelResponse,1878 },1879 // lncli: `feereport`1880// FeeReport allows the caller to obtain a report detailing the current fee1881// schedule enforced by the node globally for each channel.1882feeReport: {1883 path: '/lnrpc.Lightning/FeeReport',1884 requestStream: false,1885 responseStream: false,1886 requestType: lnd_rpc_pb.FeeReportRequest,1887 responseType: lnd_rpc_pb.FeeReportResponse,1888 requestSerialize: serialize_lnrpc_FeeReportRequest,1889 requestDeserialize: deserialize_lnrpc_FeeReportRequest,1890 responseSerialize: serialize_lnrpc_FeeReportResponse,1891 responseDeserialize: deserialize_lnrpc_FeeReportResponse,1892 },1893 // lncli: `updatechanpolicy`1894// UpdateChannelPolicy allows the caller to update the fee schedule and1895// channel policies for all channels globally, or a particular channel.1896updateChannelPolicy: {1897 path: '/lnrpc.Lightning/UpdateChannelPolicy',1898 requestStream: false,1899 responseStream: false,1900 requestType: lnd_rpc_pb.PolicyUpdateRequest,1901 responseType: lnd_rpc_pb.PolicyUpdateResponse,1902 requestSerialize: serialize_lnrpc_PolicyUpdateRequest,1903 requestDeserialize: deserialize_lnrpc_PolicyUpdateRequest,1904 responseSerialize: serialize_lnrpc_PolicyUpdateResponse,1905 responseDeserialize: deserialize_lnrpc_PolicyUpdateResponse,1906 },1907 // lncli: `fwdinghistory`1908// ForwardingHistory allows the caller to query the htlcswitch for a record of1909// all HTLCs forwarded within the target time range, and integer offset1910// within that time range, for a maximum number of events. If no maximum number1911// of events is specified, up to 100 events will be returned. If no time-range1912// is specified, then events will be returned in the order that they occured.1913//1914// A list of forwarding events are returned. The size of each forwarding event1915// is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.1916// As a result each message can only contain 50k entries. Each response has1917// the index offset of the last entry. The index offset can be provided to the1918// request to allow the caller to skip a series of records.1919forwardingHistory: {1920 path: '/lnrpc.Lightning/ForwardingHistory',1921 requestStream: false,1922 responseStream: false,1923 requestType: lnd_rpc_pb.ForwardingHistoryRequest,1924 responseType: lnd_rpc_pb.ForwardingHistoryResponse,1925 requestSerialize: serialize_lnrpc_ForwardingHistoryRequest,1926 requestDeserialize: deserialize_lnrpc_ForwardingHistoryRequest,1927 responseSerialize: serialize_lnrpc_ForwardingHistoryResponse,1928 responseDeserialize: deserialize_lnrpc_ForwardingHistoryResponse,1929 },1930 // lncli: `exportchanbackup`1931// ExportChannelBackup attempts to return an encrypted static channel backup1932// for the target channel identified by it channel point. The backup is1933// encrypted with a key generated from the aezeed seed of the user. The1934// returned backup can either be restored using the RestoreChannelBackup1935// method once lnd is running, or via the InitWallet and UnlockWallet methods1936// from the WalletUnlocker service.1937exportChannelBackup: {1938 path: '/lnrpc.Lightning/ExportChannelBackup',1939 requestStream: false,1940 responseStream: false,1941 requestType: lnd_rpc_pb.ExportChannelBackupRequest,1942 responseType: lnd_rpc_pb.ChannelBackup,1943 requestSerialize: serialize_lnrpc_ExportChannelBackupRequest,1944 requestDeserialize: deserialize_lnrpc_ExportChannelBackupRequest,1945 responseSerialize: serialize_lnrpc_ChannelBackup,1946 responseDeserialize: deserialize_lnrpc_ChannelBackup,1947 },1948 //1949// ExportAllChannelBackups returns static channel backups for all existing1950// channels known to lnd. A set of regular singular static channel backups for1951// each channel are returned. Additionally, a multi-channel backup is returned1952// as well, which contains a single encrypted blob containing the backups of1953// each channel.1954exportAllChannelBackups: {1955 path: '/lnrpc.Lightning/ExportAllChannelBackups',1956 requestStream: false,1957 responseStream: false,1958 requestType: lnd_rpc_pb.ChanBackupExportRequest,1959 responseType: lnd_rpc_pb.ChanBackupSnapshot,1960 requestSerialize: serialize_lnrpc_ChanBackupExportRequest,1961 requestDeserialize: deserialize_lnrpc_ChanBackupExportRequest,1962 responseSerialize: serialize_lnrpc_ChanBackupSnapshot,1963 responseDeserialize: deserialize_lnrpc_ChanBackupSnapshot,1964 },1965 //1966// VerifyChanBackup allows a caller to verify the integrity of a channel backup1967// snapshot. This method will accept either a packed Single or a packed Multi.1968// Specifying both will result in an error.1969verifyChanBackup: {1970 path: '/lnrpc.Lightning/VerifyChanBackup',1971 requestStream: false,1972 responseStream: false,1973 requestType: lnd_rpc_pb.ChanBackupSnapshot,1974 responseType: lnd_rpc_pb.VerifyChanBackupResponse,1975 requestSerialize: serialize_lnrpc_ChanBackupSnapshot,1976 requestDeserialize: deserialize_lnrpc_ChanBackupSnapshot,1977 responseSerialize: serialize_lnrpc_VerifyChanBackupResponse,1978 responseDeserialize: deserialize_lnrpc_VerifyChanBackupResponse,1979 },1980 // lncli: `restorechanbackup`1981// RestoreChannelBackups accepts a set of singular channel backups, or a1982// single encrypted multi-chan backup and attempts to recover any funds1983// remaining within the channel. If we are able to unpack the backup, then the1984// new channel will be shown under listchannels, as well as pending channels.1985restoreChannelBackups: {1986 path: '/lnrpc.Lightning/RestoreChannelBackups',1987 requestStream: false,1988 responseStream: false,1989 requestType: lnd_rpc_pb.RestoreChanBackupRequest,1990 responseType: lnd_rpc_pb.RestoreBackupResponse,1991 requestSerialize: serialize_lnrpc_RestoreChanBackupRequest,1992 requestDeserialize: deserialize_lnrpc_RestoreChanBackupRequest,1993 responseSerialize: serialize_lnrpc_RestoreBackupResponse,1994 responseDeserialize: deserialize_lnrpc_RestoreBackupResponse,1995 },1996 //1997// SubscribeChannelBackups allows a client to sub-subscribe to the most up to1998// date information concerning the state of all channel backups. Each time a1999// new channel is added, we return the new set of channels, along with a2000// multi-chan backup containing the backup info for all channels. Each time a2001// channel is closed, we send a new update, which contains new new chan back2002// ups, but the updated set of encrypted multi-chan backups with the closed2003// channel(s) removed.2004subscribeChannelBackups: {2005 path: '/lnrpc.Lightning/SubscribeChannelBackups',2006 requestStream: false,2007 responseStream: true,2008 requestType: lnd_rpc_pb.ChannelBackupSubscription,2009 responseType: lnd_rpc_pb.ChanBackupSnapshot,2010 requestSerialize: serialize_lnrpc_ChannelBackupSubscription,2011 requestDeserialize: deserialize_lnrpc_ChannelBackupSubscription,2012 responseSerialize: serialize_lnrpc_ChanBackupSnapshot,2013 responseDeserialize: deserialize_lnrpc_ChanBackupSnapshot,2014 },2015 // lncli: `bakemacaroon`2016// BakeMacaroon allows the creation of a new macaroon with custom read and2017// write permissions. No first-party caveats are added since this can be done2018// offline.2019bakeMacaroon: {2020 path: '/lnrpc.Lightning/BakeMacaroon',2021 requestStream: false,2022 responseStream: false,2023 requestType: lnd_rpc_pb.BakeMacaroonRequest,2024 responseType: lnd_rpc_pb.BakeMacaroonResponse,2025 requestSerialize: serialize_lnrpc_BakeMacaroonRequest,2026 requestDeserialize: deserialize_lnrpc_BakeMacaroonRequest,2027 responseSerialize: serialize_lnrpc_BakeMacaroonResponse,2028 responseDeserialize: deserialize_lnrpc_BakeMacaroonResponse,2029 },2030 // lncli: `listmacaroonids`2031// ListMacaroonIDs returns all root key IDs that are in use.2032listMacaroonIDs: {2033 path: '/lnrpc.Lightning/ListMacaroonIDs',2034 requestStream: false,2035 responseStream: false,2036 requestType: lnd_rpc_pb.ListMacaroonIDsRequest,2037 responseType: lnd_rpc_pb.ListMacaroonIDsResponse,2038 requestSerialize: serialize_lnrpc_ListMacaroonIDsRequest,2039 requestDeserialize: deserialize_lnrpc_ListMacaroonIDsRequest,2040 responseSerialize: serialize_lnrpc_ListMacaroonIDsResponse,2041 responseDeserialize: deserialize_lnrpc_ListMacaroonIDsResponse,2042 },2043 // lncli: `deletemacaroonid`2044// DeleteMacaroonID deletes the specified macaroon ID and invalidates all2045// macaroons derived from that ID.2046deleteMacaroonID: {2047 path: '/lnrpc.Lightning/DeleteMacaroonID',2048 requestStream: false,2049 responseStream: false,2050 requestType: lnd_rpc_pb.DeleteMacaroonIDRequest,2051 responseType: lnd_rpc_pb.DeleteMacaroonIDResponse,2052 requestSerialize: serialize_lnrpc_DeleteMacaroonIDRequest,2053 requestDeserialize: deserialize_lnrpc_DeleteMacaroonIDRequest,2054 responseSerialize: serialize_lnrpc_DeleteMacaroonIDResponse,2055 responseDeserialize: deserialize_lnrpc_DeleteMacaroonIDResponse,2056 },2057 // lncli: `listpermissions`2058// ListPermissions lists all RPC method URIs and their required macaroon2059// permissions to access them.2060listPermissions: {2061 path: '/lnrpc.Lightning/ListPermissions',2062 requestStream: false,2063 responseStream: false,2064 requestType: lnd_rpc_pb.ListPermissionsRequest,2065 responseType: lnd_rpc_pb.ListPermissionsResponse,2066 requestSerialize: serialize_lnrpc_ListPermissionsRequest,2067 requestDeserialize: deserialize_lnrpc_ListPermissionsRequest,2068 responseSerialize: serialize_lnrpc_ListPermissionsResponse,2069 responseDeserialize: deserialize_lnrpc_ListPermissionsResponse,2070 },2071 //2072// CheckMacaroonPermissions checks whether a request follows the constraints2073// imposed on the macaroon and that the macaroon is authorized to follow the2074// provided permissions.2075checkMacaroonPermissions: {2076 path: '/lnrpc.Lightning/CheckMacaroonPermissions',2077 requestStream: false,2078 responseStream: false,2079 requestType: lnd_rpc_pb.CheckMacPermRequest,2080 responseType: lnd_rpc_pb.CheckMacPermResponse,2081 requestSerialize: serialize_lnrpc_CheckMacPermRequest,2082 requestDeserialize: deserialize_lnrpc_CheckMacPermRequest,2083 responseSerialize: serialize_lnrpc_CheckMacPermResponse,2084 responseDeserialize: deserialize_lnrpc_CheckMacPermResponse,2085 },2086 //2087// RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A2088// gRPC middleware is software component external to lnd that aims to add2089// additional business logic to lnd by observing/intercepting/validating2090// incoming gRPC client requests and (if needed) replacing/overwriting outgoing2091// messages before they're sent to the client. When registering the middleware2092// must identify itself and indicate what custom macaroon caveats it wants to2093// be responsible for. Only requests that contain a macaroon with that specific2094// custom caveat are then sent to the middleware for inspection. The other2095// option is to register for the read-only mode in which all requests/responses2096// are forwarded for interception to the middleware but the middleware is not2097// allowed to modify any responses. As a security measure, _no_ middleware can2098// modify responses for requests made with _unencumbered_ macaroons!2099registerRPCMiddleware: {2100 path: '/lnrpc.Lightning/RegisterRPCMiddleware',2101 requestStream: true,2102 responseStream: true,2103 requestType: lnd_rpc_pb.RPCMiddlewareResponse,2104 responseType: lnd_rpc_pb.RPCMiddlewareRequest,2105 requestSerialize: serialize_lnrpc_RPCMiddlewareResponse,2106 requestDeserialize: deserialize_lnrpc_RPCMiddlewareResponse,2107 responseSerialize: serialize_lnrpc_RPCMiddlewareRequest,2108 responseDeserialize: deserialize_lnrpc_RPCMiddlewareRequest,2109 },2110 // lncli: `sendcustom`2111// SendCustomMessage sends a custom peer message.2112sendCustomMessage: {2113 path: '/lnrpc.Lightning/SendCustomMessage',2114 requestStream: false,2115 responseStream: false,2116 requestType: lnd_rpc_pb.SendCustomMessageRequest,2117 responseType: lnd_rpc_pb.SendCustomMessageResponse,2118 requestSerialize: serialize_lnrpc_SendCustomMessageRequest,2119 requestDeserialize: deserialize_lnrpc_SendCustomMessageRequest,2120 responseSerialize: serialize_lnrpc_SendCustomMessageResponse,2121 responseDeserialize: deserialize_lnrpc_SendCustomMessageResponse,2122 },2123 // lncli: `subscribecustom`2124// SubscribeCustomMessages subscribes to a stream of incoming custom peer2125// messages.2126subscribeCustomMessages: {2127 path: '/lnrpc.Lightning/SubscribeCustomMessages',2128 requestStream: false,2129 responseStream: true,2130 requestType: lnd_rpc_pb.SubscribeCustomMessagesRequest,2131 responseType: lnd_rpc_pb.CustomMessage,2132 requestSerialize: serialize_lnrpc_SubscribeCustomMessagesRequest,2133 requestDeserialize: deserialize_lnrpc_SubscribeCustomMessagesRequest,2134 responseSerialize: serialize_lnrpc_CustomMessage,2135 responseDeserialize: deserialize_lnrpc_CustomMessage,2136 },2137};...

Full Screen

Full Screen

test_xml_module.py

Source:test_xml_module.py Github

copy

Full Screen

...266 self.assertDeserializeEqual(None, 'null')267class TestDeserializeInteger(TestDeserialize):268 """ Tests deserialize as related to Integer type. """269 test_field = Integer270 def test_deserialize(self):271 self.assertDeserializeEqual(-2, '-2')272 self.assertDeserializeEqual("450", '"450"')273 # False can be parsed as a int (converts to 0)274 self.assertDeserializeEqual(False, 'false')275 # True can be parsed as a int (converts to 1)276 self.assertDeserializeEqual(True, 'true')277 # 2.78 can be converted to int, so the string will be deserialized278 self.assertDeserializeEqual(-2.78, '-2.78')279 def test_deserialize_unsupported_types(self):280 self.assertDeserializeEqual('[3]', '[3]')281 # '2.78' cannot be converted to int, so input value is returned282 self.assertDeserializeEqual('"-2.78"', '"-2.78"')283 # 'false' cannot be converted to int, so input value is returned284 self.assertDeserializeEqual('"false"', '"false"')285 self.assertDeserializeNonString()286class TestDeserializeFloat(TestDeserialize):287 """ Tests deserialize as related to Float type. """288 test_field = Float289 def test_deserialize(self):290 self.assertDeserializeEqual(-2, '-2')291 self.assertDeserializeEqual("450", '"450"')292 self.assertDeserializeEqual(-2.78, '-2.78')293 self.assertDeserializeEqual("0.45", '"0.45"')294 # False can be parsed as a float (converts to 0)295 self.assertDeserializeEqual(False, 'false')296 # True can be parsed as a float (converts to 1)297 self.assertDeserializeEqual(True, 'true')298 def test_deserialize_unsupported_types(self):299 self.assertDeserializeEqual('[3]', '[3]')300 # 'false' cannot be converted to float, so input value is returned301 self.assertDeserializeEqual('"false"', '"false"')302 self.assertDeserializeNonString()303class TestDeserializeBoolean(TestDeserialize):304 """ Tests deserialize as related to Boolean type. """305 test_field = Boolean306 def test_deserialize(self):307 # json.loads converts the value to Python bool308 self.assertDeserializeEqual(False, 'false')309 self.assertDeserializeEqual(True, 'true')310 # json.loads fails, string value is returned.311 self.assertDeserializeEqual('False', 'False')312 self.assertDeserializeEqual('True', 'True')313 # json.loads deserializes as a string314 self.assertDeserializeEqual('false', '"false"')315 self.assertDeserializeEqual('fAlse', '"fAlse"')316 self.assertDeserializeEqual("TruE", '"TruE"')317 # 2.78 can be converted to a bool, so the string will be deserialized318 self.assertDeserializeEqual(-2.78, '-2.78')319 self.assertDeserializeNonString()320class TestDeserializeString(TestDeserialize):321 """ Tests deserialize as related to String type. """322 test_field = String323 def test_deserialize(self):324 self.assertDeserializeEqual('hAlf', '"hAlf"')325 self.assertDeserializeEqual('false', '"false"')326 self.assertDeserializeEqual('single quote', 'single quote')327 def test_deserialize_unsupported_types(self):328 self.assertDeserializeEqual('3.4', '3.4')329 self.assertDeserializeEqual('false', 'false')330 self.assertDeserializeEqual('2', '2')331 self.assertDeserializeEqual('[3]', '[3]')332 self.assertDeserializeNonString()333class TestDeserializeAny(TestDeserialize):334 """ Tests deserialize as related to Any type. """335 test_field = Any336 def test_deserialize(self):337 self.assertDeserializeEqual('hAlf', '"hAlf"')338 self.assertDeserializeEqual('false', '"false"')339 self.assertDeserializeEqual({'bar': 'hat', 'frog' : 'green'}, '{"bar": "hat", "frog": "green"}')340 self.assertDeserializeEqual([3.5, 5.6], '[3.5, 5.6]')341 self.assertDeserializeEqual('[', '[')342 self.assertDeserializeEqual(False, 'false')343 self.assertDeserializeEqual(3.4, '3.4')344 self.assertDeserializeNonString()345class TestDeserializeList(TestDeserialize):346 """ Tests deserialize as related to List type. """347 test_field = List348 def test_deserialize(self):349 self.assertDeserializeEqual(['foo', 'bar'], '["foo", "bar"]')350 self.assertDeserializeEqual([3.5, 5.6], '[3.5, 5.6]')351 self.assertDeserializeEqual([], '[]')352 def test_deserialize_unsupported_types(self):353 self.assertDeserializeEqual('3.4', '3.4')354 self.assertDeserializeEqual('false', 'false')355 self.assertDeserializeEqual('2', '2')356 self.assertDeserializeNonString()357class TestDeserializeDate(TestDeserialize):358 """ Tests deserialize as related to Date type. """359 test_field = Date360 def test_deserialize(self):361 self.assertDeserializeEqual('2012-12-31T23:59:59Z', "2012-12-31T23:59:59Z")362 self.assertDeserializeEqual('2012-12-31T23:59:59Z', '"2012-12-31T23:59:59Z"')363 self.assertDeserializeNonString()364class TestDeserializeTimedelta(TestDeserialize):365 """ Tests deserialize as related to Timedelta type. """366 test_field = Timedelta367 def test_deserialize(self):368 self.assertDeserializeEqual('1 day 12 hours 59 minutes 59 seconds',369 '1 day 12 hours 59 minutes 59 seconds')370 self.assertDeserializeEqual('1 day 12 hours 59 minutes 59 seconds',371 '"1 day 12 hours 59 minutes 59 seconds"')372 self.assertDeserializeNonString()373class TestDeserializeRelativeTime(TestDeserialize):374 """ Tests deserialize as related to Timedelta type. """375 test_field = RelativeTime376 def test_deserialize(self):377 """378 There is no check for379 self.assertDeserializeEqual('10:20:30', '10:20:30')380 self.assertDeserializeNonString()381 because these two tests work only because json.loads fires exception,382 and xml_module.deserialized_field catches it and returns same value,383 so there is nothing field-specific here.384 But other modules do it, so I'm leaving this comment for PR reviewers.385 """386 # test that from_json produces no exceptions387 self.assertDeserializeEqual('10:20:30', '"10:20:30"')388class TestXmlAttributes(XModuleXmlImportTest):389 def test_unknown_attribute(self):390 assert_false(hasattr(CourseDescriptor, 'unknown_attr'))...

Full Screen

Full Screen

sparse_serialization_ops_test.py

Source:sparse_serialization_ops_test.py Github

copy

Full Screen

1# Copyright 2015 The TensorFlow Authors. All Rights Reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14# ==============================================================================15"""Tests for SerializeSparse."""16from __future__ import absolute_import17from __future__ import division18from __future__ import print_function19import numpy as np20from tensorflow.python.framework import dtypes21from tensorflow.python.framework import sparse_tensor as sparse_tensor_lib22from tensorflow.python.framework import test_util23from tensorflow.python.ops import array_ops24from tensorflow.python.ops import sparse_ops25from tensorflow.python.platform import test26class SerializeSparseTest(test.TestCase):27 def _SparseTensorPlaceholder(self, dtype=None):28 if dtype is None:29 dtype = dtypes.int3230 return sparse_tensor_lib.SparseTensor(31 array_ops.placeholder(dtypes.int64),32 array_ops.placeholder(dtype), array_ops.placeholder(dtypes.int64))33 def _SparseTensorValue_5x6(self, permutation):34 ind = np.array([[0, 0], [1, 0], [1, 3], [1, 4], [3, 2],35 [3, 3]]).astype(np.int64)36 val = np.array([0, 10, 13, 14, 32, 33]).astype(np.int32)37 ind = ind[permutation]38 val = val[permutation]39 shape = np.array([5, 6]).astype(np.int64)40 return sparse_tensor_lib.SparseTensorValue(ind, val, shape)41 def _SparseTensorValue_3x4(self, permutation):42 ind = np.array([[0, 0], [1, 0], [1, 2], [1, 3], [2, 2],43 [2, 3]]).astype(np.int64)44 val = np.array([0, 10, 13, 14, 32, 33]).astype(np.int32)45 ind = ind[permutation]46 val = val[permutation]47 shape = np.array([3, 4]).astype(np.int64)48 return sparse_tensor_lib.SparseTensorValue(ind, val, shape)49 def _SparseTensorValue_1x1x1(self):50 ind = np.array([[0, 0, 0]]).astype(np.int64)51 val = np.array([0]).astype(np.int32)52 shape = np.array([3, 4, 5]).astype(np.int64)53 return sparse_tensor_lib.SparseTensorValue(ind, val, shape)54 def _testSerializeDeserializeHelper(self,55 serialize_fn,56 deserialize_fn,57 out_type=dtypes.string):58 with self.cached_session(use_gpu=False) as sess:59 sp_input = self._SparseTensorValue_5x6(np.arange(6))60 serialized = serialize_fn(sp_input, out_type=out_type)61 sp_deserialized = deserialize_fn(serialized, dtype=dtypes.int32)62 indices, values, shape = self.evaluate(sp_deserialized)63 self.assertAllEqual(indices, sp_input[0])64 self.assertAllEqual(values, sp_input[1])65 self.assertAllEqual(shape, sp_input[2])66 def testSerializeDeserialize(self):67 self._testSerializeDeserializeHelper(sparse_ops.serialize_sparse,68 sparse_ops.deserialize_sparse)69 def testVariantSerializeDeserialize(self):70 self._testSerializeDeserializeHelper(sparse_ops.serialize_sparse,71 sparse_ops.deserialize_sparse,72 dtypes.variant)73 def _testSerializeDeserializeBatchHelper(self,74 serialize_fn,75 deserialize_fn,76 out_type=dtypes.string):77 with self.cached_session(use_gpu=False) as sess:78 sp_input = self._SparseTensorValue_5x6(np.arange(6))79 serialized = serialize_fn(sp_input, out_type=out_type)80 serialized = array_ops.stack([serialized, serialized])81 sp_deserialized = deserialize_fn(serialized, dtype=dtypes.int32)82 combined_indices, combined_values, combined_shape = sess.run(83 sp_deserialized)84 self.assertAllEqual(combined_indices[:6, 0], [0] * 6) # minibatch 085 self.assertAllEqual(combined_indices[:6, 1:], sp_input[0])86 self.assertAllEqual(combined_indices[6:, 0], [1] * 6) # minibatch 187 self.assertAllEqual(combined_indices[6:, 1:], sp_input[0])88 self.assertAllEqual(combined_values[:6], sp_input[1])89 self.assertAllEqual(combined_values[6:], sp_input[1])90 self.assertAllEqual(combined_shape, [2, 5, 6])91 @test_util.run_deprecated_v192 def testSerializeDeserializeBatch(self):93 self._testSerializeDeserializeBatchHelper(sparse_ops.serialize_sparse,94 sparse_ops.deserialize_sparse)95 @test_util.run_deprecated_v196 def testSerializeDeserializeManyBatch(self):97 self._testSerializeDeserializeBatchHelper(98 sparse_ops.serialize_sparse, sparse_ops.deserialize_many_sparse)99 @test_util.run_deprecated_v1100 def testVariantSerializeDeserializeBatch(self):101 self._testSerializeDeserializeBatchHelper(sparse_ops.serialize_sparse,102 sparse_ops.deserialize_sparse,103 dtypes.variant)104 def _testSerializeDeserializeBatchInconsistentShapeHelper(105 self, serialize_fn, deserialize_fn, out_type=dtypes.string):106 with self.cached_session(use_gpu=False) as sess:107 sp_input0 = self._SparseTensorValue_5x6(np.arange(6))108 sp_input1 = self._SparseTensorValue_3x4(np.arange(6))109 serialized0 = serialize_fn(sp_input0, out_type=out_type)110 serialized1 = serialize_fn(sp_input1, out_type=out_type)111 serialized = array_ops.stack([serialized0, serialized1])112 sp_deserialized = deserialize_fn(serialized, dtype=dtypes.int32)113 combined_indices, combined_values, combined_shape = sess.run(114 sp_deserialized)115 self.assertAllEqual(combined_indices[:6, 0], [0] * 6) # minibatch 0116 self.assertAllEqual(combined_indices[:6, 1:], sp_input0[0])117 self.assertAllEqual(combined_indices[6:, 0], [1] * 6) # minibatch 1118 self.assertAllEqual(combined_indices[6:, 1:], sp_input1[0])119 self.assertAllEqual(combined_values[:6], sp_input0[1])120 self.assertAllEqual(combined_values[6:], sp_input1[1])121 self.assertAllEqual(combined_shape, [2, 5, 6])122 @test_util.run_deprecated_v1123 def testSerializeDeserializeBatchInconsistentShape(self):124 self._testSerializeDeserializeBatchInconsistentShapeHelper(125 sparse_ops.serialize_sparse, sparse_ops.deserialize_sparse)126 @test_util.run_deprecated_v1127 def testVariantSerializeDeserializeBatchInconsistentShape(self):128 self._testSerializeDeserializeBatchInconsistentShapeHelper(129 sparse_ops.serialize_sparse, sparse_ops.deserialize_sparse,130 dtypes.variant)131 def _testSerializeDeserializeNestedBatchHelper(self,132 serialize_fn,133 deserialize_fn,134 out_type=dtypes.string):135 with self.cached_session(use_gpu=False) as sess:136 sp_input = self._SparseTensorValue_5x6(np.arange(6))137 serialized = serialize_fn(sp_input, out_type=out_type)138 serialized = array_ops.stack([serialized, serialized])139 serialized = array_ops.stack([serialized, serialized])140 sp_deserialized = deserialize_fn(serialized, dtype=dtypes.int32)141 combined_indices, combined_values, combined_shape = sess.run(142 sp_deserialized)143 # minibatch 0144 self.assertAllEqual(combined_indices[:6, :2], [[0, 0]] * 6)145 self.assertAllEqual(combined_indices[:6, 2:], sp_input[0])146 self.assertAllEqual(combined_values[:6], sp_input[1])147 # minibatch 1148 self.assertAllEqual(combined_indices[6:12, :2], [[0, 1]] * 6)149 self.assertAllEqual(combined_indices[6:12, 2:], sp_input[0])150 self.assertAllEqual(combined_values[6:12], sp_input[1])151 # minibatch 2152 self.assertAllEqual(combined_indices[12:18, :2], [[1, 0]] * 6)153 self.assertAllEqual(combined_indices[12:18, 2:], sp_input[0])154 self.assertAllEqual(combined_values[12:18], sp_input[1])155 # minibatch 3156 self.assertAllEqual(combined_indices[18:, :2], [[1, 1]] * 6)157 self.assertAllEqual(combined_indices[18:, 2:], sp_input[0])158 self.assertAllEqual(combined_values[18:], sp_input[1])159 self.assertAllEqual(combined_shape, [2, 2, 5, 6])160 @test_util.run_deprecated_v1161 def testSerializeDeserializeNestedBatch(self):162 self._testSerializeDeserializeNestedBatchHelper(163 sparse_ops.serialize_sparse, sparse_ops.deserialize_sparse)164 @test_util.run_deprecated_v1165 def testVariantSerializeDeserializeNestedBatch(self):166 self._testSerializeDeserializeNestedBatchHelper(167 sparse_ops.serialize_sparse, sparse_ops.deserialize_sparse,168 dtypes.variant)169 def _testFeedSerializeDeserializeBatchHelper(self,170 serialize_fn,171 deserialize_fn,172 out_type=dtypes.string):173 with self.cached_session(use_gpu=False) as sess:174 sp_input0 = self._SparseTensorPlaceholder()175 sp_input1 = self._SparseTensorPlaceholder()176 input0_val = self._SparseTensorValue_5x6(np.arange(6))177 input1_val = self._SparseTensorValue_3x4(np.arange(6))178 serialized0 = serialize_fn(sp_input0, out_type=out_type)179 serialized1 = serialize_fn(sp_input1, out_type=out_type)180 serialized_concat = array_ops.stack([serialized0, serialized1])181 sp_deserialized = deserialize_fn(serialized_concat, dtype=dtypes.int32)182 combined_indices, combined_values, combined_shape = sess.run(183 sp_deserialized, {sp_input0: input0_val,184 sp_input1: input1_val})185 self.assertAllEqual(combined_indices[:6, 0], [0] * 6) # minibatch 0186 self.assertAllEqual(combined_indices[:6, 1:], input0_val[0])187 self.assertAllEqual(combined_indices[6:, 0], [1] * 6) # minibatch 1188 self.assertAllEqual(combined_indices[6:, 1:], input1_val[0])189 self.assertAllEqual(combined_values[:6], input0_val[1])190 self.assertAllEqual(combined_values[6:], input1_val[1])191 self.assertAllEqual(combined_shape, [2, 5, 6])192 @test_util.run_deprecated_v1193 def testFeedSerializeDeserializeBatch(self):194 self._testFeedSerializeDeserializeBatchHelper(sparse_ops.serialize_sparse,195 sparse_ops.deserialize_sparse)196 @test_util.run_deprecated_v1197 def testFeedSerializeDeserializeManyBatch(self):198 self._testFeedSerializeDeserializeBatchHelper(199 sparse_ops.serialize_sparse, sparse_ops.deserialize_many_sparse)200 @test_util.run_deprecated_v1201 def testFeedVariantSerializeDeserializeBatch(self):202 self._testFeedSerializeDeserializeBatchHelper(sparse_ops.serialize_sparse,203 sparse_ops.deserialize_sparse,204 dtypes.variant)205 def _testSerializeManyShapeHelper(self,206 serialize_many_fn,207 out_type=dtypes.string):208 with self.cached_session(use_gpu=False) as sess:209 # N == 4 because shape_value == [4, 5]210 indices_value = np.array([[0, 0], [0, 1], [2, 0]], dtype=np.int64)211 values_value = np.array([b"a", b"b", b"c"])212 shape_value = np.array([4, 5], dtype=np.int64)213 sparse_tensor = self._SparseTensorPlaceholder(dtype=dtypes.string)214 serialized = serialize_many_fn(sparse_tensor, out_type=out_type)215 serialized_value = sess.run(216 serialized,217 feed_dict={218 sparse_tensor.indices: indices_value,219 sparse_tensor.values: values_value,220 sparse_tensor.dense_shape: shape_value221 })222 self.assertEqual(serialized_value.shape, (4, 3))223 @test_util.run_deprecated_v1224 def testSerializeManyShape(self):225 self._testSerializeManyShapeHelper(sparse_ops.serialize_many_sparse)226 def testVariantSerializeManyShape(self):227 # NOTE: The following test is a no-op as it is currently not possible to228 # convert the serialized variant value to a numpy value.229 pass230 def _testSerializeManyDeserializeBatchHelper(self,231 serialize_many_fn,232 deserialize_fn,233 out_type=dtypes.string):234 with self.cached_session(use_gpu=False) as sess:235 # N == 4 because shape_value == [4, 5]236 indices_value = np.array([[0, 0], [0, 1], [2, 0]], dtype=np.int64)237 values_value = np.array([b"a", b"b", b"c"])238 shape_value = np.array([4, 5], dtype=np.int64)239 sparse_tensor = self._SparseTensorPlaceholder(dtype=dtypes.string)240 serialized = serialize_many_fn(sparse_tensor, out_type=out_type)241 deserialized = deserialize_fn(serialized, dtype=dtypes.string)242 deserialized_value = sess.run(243 deserialized,244 feed_dict={245 sparse_tensor.indices: indices_value,246 sparse_tensor.values: values_value,247 sparse_tensor.dense_shape: shape_value248 })249 self.assertAllEqual(deserialized_value.indices, indices_value)250 self.assertAllEqual(deserialized_value.values, values_value)251 self.assertAllEqual(deserialized_value.dense_shape, shape_value)252 @test_util.run_deprecated_v1253 def testSerializeManyDeserializeBatch(self):254 self._testSerializeManyDeserializeBatchHelper(255 sparse_ops.serialize_many_sparse, sparse_ops.deserialize_sparse)256 @test_util.run_deprecated_v1257 def testSerializeManyDeserializeManyBatch(self):258 self._testSerializeManyDeserializeBatchHelper(259 sparse_ops.serialize_many_sparse, sparse_ops.deserialize_many_sparse)260 @test_util.run_deprecated_v1261 def testVariantSerializeManyDeserializeBatch(self):262 self._testSerializeManyDeserializeBatchHelper(263 sparse_ops.serialize_many_sparse, sparse_ops.deserialize_sparse,264 dtypes.variant)265 @test_util.run_deprecated_v1266 def testVariantSerializeDeserializeScalar(self):267 with self.session(use_gpu=False) as sess:268 indices_value = np.array([[]], dtype=np.int64)269 values_value = np.array([37], dtype=np.int32)270 shape_value = np.array([], dtype=np.int64)271 sparse_tensor = self._SparseTensorPlaceholder()272 serialized = sparse_ops.serialize_sparse(273 sparse_tensor, out_type=dtypes.variant)274 deserialized = sparse_ops.deserialize_sparse(275 serialized, dtype=dtypes.int32)276 deserialized_value = sess.run(277 deserialized,278 feed_dict={279 sparse_tensor.indices: indices_value,280 sparse_tensor.values: values_value,281 sparse_tensor.dense_shape: shape_value282 })283 self.assertAllEqual(deserialized_value.indices, indices_value)284 self.assertAllEqual(deserialized_value.values, values_value)285 self.assertAllEqual(deserialized_value.dense_shape, shape_value)286 @test_util.run_deprecated_v1287 def testVariantSerializeDeserializeScalarBatch(self):288 with self.session(use_gpu=False) as sess:289 indices_value = np.array([[]], dtype=np.int64)290 values_value = np.array([37], dtype=np.int32)291 shape_value = np.array([], dtype=np.int64)292 sparse_tensor = self._SparseTensorPlaceholder()293 serialized = sparse_ops.serialize_sparse(294 sparse_tensor, out_type=dtypes.variant)295 stacked = array_ops.stack([serialized, serialized])296 deserialized = sparse_ops.deserialize_sparse(stacked, dtype=dtypes.int32)297 deserialized_value = sess.run(298 deserialized,299 feed_dict={300 sparse_tensor.indices: indices_value,301 sparse_tensor.values: values_value,302 sparse_tensor.dense_shape: shape_value303 })304 self.assertAllEqual(deserialized_value.indices,305 np.array([[0], [1]], dtype=np.int64))306 self.assertAllEqual(deserialized_value.values,307 np.array([37, 37], dtype=np.int32))308 self.assertAllEqual(deserialized_value.dense_shape,309 np.array([2], dtype=np.int64))310 def _testDeserializeFailsWrongTypeHelper(self,311 serialize_fn,312 deserialize_fn,313 out_type=dtypes.string):314 with self.cached_session(use_gpu=False) as sess:315 sp_input0 = self._SparseTensorPlaceholder()316 sp_input1 = self._SparseTensorPlaceholder()317 input0_val = self._SparseTensorValue_5x6(np.arange(6))318 input1_val = self._SparseTensorValue_3x4(np.arange(6))319 serialized0 = serialize_fn(sp_input0, out_type=out_type)320 serialized1 = serialize_fn(sp_input1, out_type=out_type)321 serialized_concat = array_ops.stack([serialized0, serialized1])322 sp_deserialized = deserialize_fn(serialized_concat, dtype=dtypes.int64)323 with self.assertRaisesOpError(324 r"Requested SparseTensor of type int64 but "325 r"SparseTensor\[0\].values.dtype\(\) == int32"):326 sess.run(sp_deserialized,327 {sp_input0: input0_val,328 sp_input1: input1_val})329 @test_util.run_deprecated_v1330 def testDeserializeFailsWrongType(self):331 self._testDeserializeFailsWrongTypeHelper(sparse_ops.serialize_sparse,332 sparse_ops.deserialize_sparse)333 @test_util.run_deprecated_v1334 def testDeserializeManyFailsWrongType(self):335 self._testDeserializeFailsWrongTypeHelper(336 sparse_ops.serialize_sparse, sparse_ops.deserialize_many_sparse)337 @test_util.run_deprecated_v1338 def testVariantDeserializeFailsWrongType(self):339 self._testDeserializeFailsWrongTypeHelper(sparse_ops.serialize_sparse,340 sparse_ops.deserialize_sparse,341 dtypes.variant)342 def _testDeserializeFailsInconsistentRankHelper(self,343 serialize_fn,344 deserialize_fn,345 out_type=dtypes.string):346 with self.cached_session(use_gpu=False) as sess:347 sp_input0 = self._SparseTensorPlaceholder()348 sp_input1 = self._SparseTensorPlaceholder()349 input0_val = self._SparseTensorValue_5x6(np.arange(6))350 input1_val = self._SparseTensorValue_1x1x1()351 serialized0 = serialize_fn(sp_input0, out_type=out_type)352 serialized1 = serialize_fn(sp_input1, out_type=out_type)353 serialized_concat = array_ops.stack([serialized0, serialized1])354 sp_deserialized = deserialize_fn(serialized_concat, dtype=dtypes.int32)355 with self.assertRaisesOpError(356 r"Inconsistent shape across SparseTensors: rank prior to "357 r"SparseTensor\[1\] was: 2 but rank of SparseTensor\[1\] is: 3"):358 sess.run(sp_deserialized,359 {sp_input0: input0_val,360 sp_input1: input1_val})361 @test_util.run_deprecated_v1362 def testDeserializeFailsInconsistentRank(self):363 self._testDeserializeFailsInconsistentRankHelper(364 sparse_ops.serialize_sparse, sparse_ops.deserialize_sparse)365 @test_util.run_deprecated_v1366 def testDeserializeManyFailsInconsistentRank(self):367 self._testDeserializeFailsInconsistentRankHelper(368 sparse_ops.serialize_sparse, sparse_ops.deserialize_many_sparse)369 @test_util.run_deprecated_v1370 def testVariantDeserializeFailsInconsistentRank(self):371 self._testDeserializeFailsInconsistentRankHelper(372 sparse_ops.serialize_sparse, sparse_ops.deserialize_sparse,373 dtypes.variant)374 def _testDeserializeFailsInvalidProtoHelper(self,375 serialize_fn,376 deserialize_fn,377 out_type=dtypes.string):378 with self.cached_session(use_gpu=False) as sess:379 sp_input0 = self._SparseTensorPlaceholder()380 input0_val = self._SparseTensorValue_5x6(np.arange(6))381 serialized0 = serialize_fn(sp_input0, out_type=out_type)382 serialized1 = ["a", "b", "c"]383 serialized_concat = array_ops.stack([serialized0, serialized1])384 sp_deserialized = deserialize_fn(serialized_concat, dtype=dtypes.int32)385 with self.assertRaisesOpError(r"Could not parse serialized proto"):386 sess.run(sp_deserialized, {sp_input0: input0_val})387 @test_util.run_deprecated_v1388 def testDeserializeFailsInvalidProto(self):389 self._testDeserializeFailsInvalidProtoHelper(sparse_ops.serialize_sparse,390 sparse_ops.deserialize_sparse)391 @test_util.run_deprecated_v1392 def testDeserializeManyFailsInvalidProto(self):393 self._testDeserializeFailsInvalidProtoHelper(394 sparse_ops.serialize_sparse, sparse_ops.deserialize_many_sparse)395if __name__ == "__main__":...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1from .deserialize_additional_data import deserialize_additional_data2from .deserialize_additional_query_params import deserialize_additional_query_params3from .deserialize_address import deserialize_address4from .deserialize_advance_data import deserialize_advance_data5from .deserialize_advance_payment_data import deserialize_advance_payment_data6from .deserialize_aggregate_invoice_line_data import deserialize_aggregate_invoice_line_data7from .deserialize_aircraft import deserialize_aircraft8from .deserialize_annulment_data import deserialize_annulment_data9from .deserialize_annulment_operation import deserialize_annulment_operation10from .deserialize_annulment_operation_list import deserialize_annulment_operation_list11from .deserialize_audit_data import deserialize_audit_data12from .deserialize_basic_header import deserialize_basic_header13from .deserialize_basic_online_invoice_request import deserialize_basic_online_invoice_request14from .deserialize_basic_online_invoice_response import deserialize_basic_online_invoice_response15from .deserialize_basic_request import deserialize_basic_request16from .deserialize_basic_response import deserialize_basic_response17from .deserialize_basic_result import deserialize_basic_result18from .deserialize_batch_invoice import deserialize_batch_invoice19from .deserialize_business_validation_result import deserialize_business_validation_result20from .deserialize_contract_numbers import deserialize_contract_numbers21from .deserialize_conventional_invoice_info import deserialize_conventional_invoice_info22from .deserialize_cost_centers import deserialize_cost_centers23from .deserialize_crypto import deserialize_crypto24from .deserialize_customer_company_codes import deserialize_customer_company_codes25from .deserialize_customer_declaration import deserialize_customer_declaration26from .deserialize_customer_info import deserialize_customer_info27from .deserialize_customer_tax_number import deserialize_customer_tax_number28from .deserialize_customer_vat_data import deserialize_customer_vat_data29from .deserialize_date_interval_param import deserialize_date_interval_param30from .deserialize_date_time_interval_param import deserialize_date_time_interval_param31from .deserialize_dealer_codes import deserialize_dealer_codes32from .deserialize_delivery_notes import deserialize_delivery_notes33from .deserialize_detailed_address import deserialize_detailed_address34from .deserialize_detailed_reason import deserialize_detailed_reason35from .deserialize_diesel_oil_purchase import deserialize_diesel_oil_purchase36from .deserialize_discount_data import deserialize_discount_data37from .deserialize_ekaer_ids import deserialize_ekaer_ids38from .deserialize_fiscal_representative import deserialize_fiscal_representative39from .deserialize_general_error_header_response import deserialize_general_error_header_response40from .deserialize_general_error_response import deserialize_general_error_response41from .deserialize_general_ledger_account_numbers import deserialize_general_ledger_account_numbers42from .deserialize_gln_numbers import deserialize_gln_numbers43from .deserialize_invoice import deserialize_invoice44from .deserialize_invoice_annulment import deserialize_invoice_annulment45from .deserialize_invoice_chain_digest import deserialize_invoice_chain_digest46from .deserialize_invoice_chain_digest_result import deserialize_invoice_chain_digest_result47from .deserialize_invoice_chain_element import deserialize_invoice_chain_element48from .deserialize_invoice_chain_query import deserialize_invoice_chain_query49from .deserialize_invoice_data import deserialize_invoice_data50from .deserialize_invoice_data_result import deserialize_invoice_data_result51from .deserialize_invoice_detail import deserialize_invoice_detail52from .deserialize_invoice_digest import deserialize_invoice_digest53from .deserialize_invoice_digest_result import deserialize_invoice_digest_result54from .deserialize_invoice_head import deserialize_invoice_head55from .deserialize_invoice_lines import deserialize_invoice_lines56from .deserialize_invoice_main import deserialize_invoice_main57from .deserialize_invoice_number_query import deserialize_invoice_number_query58from .deserialize_invoice_operation import deserialize_invoice_operation59from .deserialize_invoice_operation_list import deserialize_invoice_operation_list60from .deserialize_invoice_query_params import deserialize_invoice_query_params61from .deserialize_invoice_reference import deserialize_invoice_reference62from .deserialize_invoice_reference_data import deserialize_invoice_reference_data63from .deserialize_item_numbers import deserialize_item_numbers64from .deserialize_line import deserialize_line65from .deserialize_line_amounts_normal import deserialize_line_amounts_normal66from .deserialize_line_amounts_simplified import deserialize_line_amounts_simplified67from .deserialize_line_gross_amount_data import deserialize_line_gross_amount_data68from .deserialize_line_modification_reference import deserialize_line_modification_reference69from .deserialize_line_net_amount_data import deserialize_line_net_amount_data70from .deserialize_line_vat_data import deserialize_line_vat_data71from .deserialize_lines import deserialize_lines72from .deserialize_manage_annulment_request import deserialize_manage_annulment_request73from .deserialize_manage_invoice_request import deserialize_manage_invoice_request74from .deserialize_mandatory_query_params import deserialize_mandatory_query_params75from .deserialize_material_numbers import deserialize_material_numbers76from .deserialize_new_created_lines import deserialize_new_created_lines77from .deserialize_new_transport_mean import deserialize_new_transport_mean78from .deserialize_notification import deserialize_notification79from .deserialize_notifications import deserialize_notifications80from .deserialize_order_numbers import deserialize_order_numbers81from .deserialize_payment_evidence_document_data import deserialize_payment_evidence_document_data82from .deserialize_pointer import deserialize_pointer83from .deserialize_processing_result import deserialize_processing_result84from .deserialize_processing_result_list import deserialize_processing_result_list85from .deserialize_product_code import deserialize_product_code86from .deserialize_product_codes import deserialize_product_codes87from .deserialize_product_fee_clause import deserialize_product_fee_clause88from .deserialize_product_fee_data import deserialize_product_fee_data89from .deserialize_product_fee_summary import deserialize_product_fee_summary90from .deserialize_product_fee_takeover_data import deserialize_product_fee_takeover_data91from .deserialize_project_numbers import deserialize_project_numbers92from .deserialize_query_invoice_chain_digest_request import deserialize_query_invoice_chain_digest_request93from .deserialize_query_invoice_chain_digest_response import deserialize_query_invoice_chain_digest_response94from .deserialize_query_invoice_check_response import deserialize_query_invoice_check_response95from .deserialize_query_invoice_data_request import deserialize_query_invoice_data_request96from .deserialize_query_invoice_data_response import deserialize_query_invoice_data_response97from .deserialize_query_invoice_digest_request import deserialize_query_invoice_digest_request98from .deserialize_query_invoice_digest_response import deserialize_query_invoice_digest_response99from .deserialize_query_taxpayer_request import deserialize_query_taxpayer_request100from .deserialize_query_taxpayer_response import deserialize_query_taxpayer_response101from .deserialize_query_transaction_list_request import deserialize_query_transaction_list_request102from .deserialize_query_transaction_list_response import deserialize_query_transaction_list_response103from .deserialize_query_transaction_status_request import deserialize_query_transaction_status_request104from .deserialize_query_transaction_status_response import deserialize_query_transaction_status_response105from .deserialize_references_to_other_lines import deserialize_references_to_other_lines106from .deserialize_relation_query_date import deserialize_relation_query_date107from .deserialize_relation_query_monetary import deserialize_relation_query_monetary108from .deserialize_relational_query_params import deserialize_relational_query_params109from .deserialize_shipping_dates import deserialize_shipping_dates110from .deserialize_simple_address import deserialize_simple_address111from .deserialize_software import deserialize_software112from .deserialize_summary import deserialize_summary113from .deserialize_summary_by_vat_rate import deserialize_summary_by_vat_rate114from .deserialize_summary_gross_data import deserialize_summary_gross_data115from .deserialize_summary_normal import deserialize_summary_normal116from .deserialize_summary_simplified import deserialize_summary_simplified117from .deserialize_supplier_company_codes import deserialize_supplier_company_codes118from .deserialize_supplier_info import deserialize_supplier_info119from .deserialize_tax_number import deserialize_tax_number120from .deserialize_taxpayer_address_item import deserialize_taxpayer_address_item121from .deserialize_taxpayer_address_list import deserialize_taxpayer_address_list122from .deserialize_taxpayer_data import deserialize_taxpayer_data123from .deserialize_technical_validation_result import deserialize_technical_validation_result124from .deserialize_token_exchange_response import deserialize_token_exchange_response125from .deserialize_transaction import deserialize_transaction126from .deserialize_transaction_list_result import deserialize_transaction_list_result127from .deserialize_transaction_query_params import deserialize_transaction_query_params128from .deserialize_transaction_response import deserialize_transaction_response129from .deserialize_user_header import deserialize_user_header130from .deserialize_vat_amount_mismatch import deserialize_vat_amount_mismatch131from .deserialize_vat_rate import deserialize_vat_rate132from .deserialize_vat_rate_gross_data import deserialize_vat_rate_gross_data133from .deserialize_vat_rate_net_data import deserialize_vat_rate_net_data134from .deserialize_vat_rate_vat_data import deserialize_vat_rate_vat_data135from .deserialize_vehicle import deserialize_vehicle...

Full Screen

Full Screen

service_grpc_pb.js

Source:service_grpc_pb.js Github

copy

Full Screen

1// GENERATED CODE -- DO NOT EDIT!2'use strict';3var grpc = require('@grpc/grpc-js');4var category_pb = require('./category_pb.js');5var inventory_pb = require('./inventory_pb.js');6var product_pb = require('./product_pb.js');7function serialize_category_Category(arg) {8 if (!(arg instanceof category_pb.Category)) {9 throw new Error('Expected argument of type category.Category');10 }11 return Buffer.from(arg.serializeBinary());12}13function deserialize_category_Category(buffer_arg) {14 return category_pb.Category.deserializeBinary(new Uint8Array(buffer_arg));15}16function serialize_category_CategoryList(arg) {17 if (!(arg instanceof category_pb.CategoryList)) {18 throw new Error('Expected argument of type category.CategoryList');19 }20 return Buffer.from(arg.serializeBinary());21}22function deserialize_category_CategoryList(buffer_arg) {23 return category_pb.CategoryList.deserializeBinary(new Uint8Array(buffer_arg));24}25function serialize_inventory_Inventory(arg) {26 if (!(arg instanceof inventory_pb.Inventory)) {27 throw new Error('Expected argument of type inventory.Inventory');28 }29 return Buffer.from(arg.serializeBinary());30}31function deserialize_inventory_Inventory(buffer_arg) {32 return inventory_pb.Inventory.deserializeBinary(new Uint8Array(buffer_arg));33}34function serialize_inventory_InventoryList(arg) {35 if (!(arg instanceof inventory_pb.InventoryList)) {36 throw new Error('Expected argument of type inventory.InventoryList');37 }38 return Buffer.from(arg.serializeBinary());39}40function deserialize_inventory_InventoryList(buffer_arg) {41 return inventory_pb.InventoryList.deserializeBinary(new Uint8Array(buffer_arg));42}43function serialize_product_Product(arg) {44 if (!(arg instanceof product_pb.Product)) {45 throw new Error('Expected argument of type product.Product');46 }47 return Buffer.from(arg.serializeBinary());48}49function deserialize_product_Product(buffer_arg) {50 return product_pb.Product.deserializeBinary(new Uint8Array(buffer_arg));51}52function serialize_product_ProductList(arg) {53 if (!(arg instanceof product_pb.ProductList)) {54 throw new Error('Expected argument of type product.ProductList');55 }56 return Buffer.from(arg.serializeBinary());57}58function deserialize_product_ProductList(buffer_arg) {59 return product_pb.ProductList.deserializeBinary(new Uint8Array(buffer_arg));60}61var InventoryService = exports.InventoryService = {62 createCategory: {63 path: '/auth.Inventory/CreateCategory',64 requestStream: false,65 responseStream: false,66 requestType: category_pb.Category,67 responseType: category_pb.Category,68 requestSerialize: serialize_category_Category,69 requestDeserialize: deserialize_category_Category,70 responseSerialize: serialize_category_Category,71 responseDeserialize: deserialize_category_Category,72 },73 getCategory: {74 path: '/auth.Inventory/GetCategory',75 requestStream: false,76 responseStream: false,77 requestType: category_pb.Category,78 responseType: category_pb.Category,79 requestSerialize: serialize_category_Category,80 requestDeserialize: deserialize_category_Category,81 responseSerialize: serialize_category_Category,82 responseDeserialize: deserialize_category_Category,83 },84 listCategories: {85 path: '/auth.Inventory/ListCategories',86 requestStream: false,87 responseStream: false,88 requestType: category_pb.Category,89 responseType: category_pb.CategoryList,90 requestSerialize: serialize_category_Category,91 requestDeserialize: deserialize_category_Category,92 responseSerialize: serialize_category_CategoryList,93 responseDeserialize: deserialize_category_CategoryList,94 },95 updateCategory: {96 path: '/auth.Inventory/UpdateCategory',97 requestStream: false,98 responseStream: false,99 requestType: category_pb.Category,100 responseType: category_pb.Category,101 requestSerialize: serialize_category_Category,102 requestDeserialize: deserialize_category_Category,103 responseSerialize: serialize_category_Category,104 responseDeserialize: deserialize_category_Category,105 },106 deleteCategory: {107 path: '/auth.Inventory/DeleteCategory',108 requestStream: false,109 responseStream: false,110 requestType: category_pb.Category,111 responseType: category_pb.Category,112 requestSerialize: serialize_category_Category,113 requestDeserialize: deserialize_category_Category,114 responseSerialize: serialize_category_Category,115 responseDeserialize: deserialize_category_Category,116 },117 createInventory: {118 path: '/auth.Inventory/CreateInventory',119 requestStream: false,120 responseStream: false,121 requestType: inventory_pb.Inventory,122 responseType: inventory_pb.Inventory,123 requestSerialize: serialize_inventory_Inventory,124 requestDeserialize: deserialize_inventory_Inventory,125 responseSerialize: serialize_inventory_Inventory,126 responseDeserialize: deserialize_inventory_Inventory,127 },128 getInventory: {129 path: '/auth.Inventory/GetInventory',130 requestStream: false,131 responseStream: false,132 requestType: inventory_pb.Inventory,133 responseType: inventory_pb.Inventory,134 requestSerialize: serialize_inventory_Inventory,135 requestDeserialize: deserialize_inventory_Inventory,136 responseSerialize: serialize_inventory_Inventory,137 responseDeserialize: deserialize_inventory_Inventory,138 },139 listInventories: {140 path: '/auth.Inventory/ListInventories',141 requestStream: false,142 responseStream: false,143 requestType: inventory_pb.Inventory,144 responseType: inventory_pb.InventoryList,145 requestSerialize: serialize_inventory_Inventory,146 requestDeserialize: deserialize_inventory_Inventory,147 responseSerialize: serialize_inventory_InventoryList,148 responseDeserialize: deserialize_inventory_InventoryList,149 },150 updateInventory: {151 path: '/auth.Inventory/UpdateInventory',152 requestStream: false,153 responseStream: false,154 requestType: inventory_pb.Inventory,155 responseType: inventory_pb.Inventory,156 requestSerialize: serialize_inventory_Inventory,157 requestDeserialize: deserialize_inventory_Inventory,158 responseSerialize: serialize_inventory_Inventory,159 responseDeserialize: deserialize_inventory_Inventory,160 },161 deleteInventory: {162 path: '/auth.Inventory/DeleteInventory',163 requestStream: false,164 responseStream: false,165 requestType: inventory_pb.Inventory,166 responseType: inventory_pb.Inventory,167 requestSerialize: serialize_inventory_Inventory,168 requestDeserialize: deserialize_inventory_Inventory,169 responseSerialize: serialize_inventory_Inventory,170 responseDeserialize: deserialize_inventory_Inventory,171 },172 createProduct: {173 path: '/auth.Inventory/CreateProduct',174 requestStream: false,175 responseStream: false,176 requestType: product_pb.Product,177 responseType: product_pb.Product,178 requestSerialize: serialize_product_Product,179 requestDeserialize: deserialize_product_Product,180 responseSerialize: serialize_product_Product,181 responseDeserialize: deserialize_product_Product,182 },183 getProduct: {184 path: '/auth.Inventory/GetProduct',185 requestStream: false,186 responseStream: false,187 requestType: product_pb.Product,188 responseType: product_pb.Product,189 requestSerialize: serialize_product_Product,190 requestDeserialize: deserialize_product_Product,191 responseSerialize: serialize_product_Product,192 responseDeserialize: deserialize_product_Product,193 },194 listProducts: {195 path: '/auth.Inventory/ListProducts',196 requestStream: false,197 responseStream: false,198 requestType: product_pb.Product,199 responseType: product_pb.ProductList,200 requestSerialize: serialize_product_Product,201 requestDeserialize: deserialize_product_Product,202 responseSerialize: serialize_product_ProductList,203 responseDeserialize: deserialize_product_ProductList,204 },205 updateProduct: {206 path: '/auth.Inventory/UpdateProduct',207 requestStream: false,208 responseStream: false,209 requestType: product_pb.Product,210 responseType: product_pb.Product,211 requestSerialize: serialize_product_Product,212 requestDeserialize: deserialize_product_Product,213 responseSerialize: serialize_product_Product,214 responseDeserialize: deserialize_product_Product,215 },216 deleteProduct: {217 path: '/auth.Inventory/DeleteProduct',218 requestStream: false,219 responseStream: false,220 requestType: product_pb.Product,221 responseType: product_pb.Product,222 requestSerialize: serialize_product_Product,223 requestDeserialize: deserialize_product_Product,224 responseSerialize: serialize_product_Product,225 responseDeserialize: deserialize_product_Product,226 },227};...

Full Screen

Full Screen

util.py

Source:util.py Github

copy

Full Screen

1import datetime2import six3import typing4def _deserialize(data, klass):5 """Deserializes dict, list, str into an object.6 :param data: dict, list or str.7 :param klass: class literal, or string of class name.8 :return: object.9 """10 if data is None:11 return None12 if klass in six.integer_types or klass in (float, str, bool):13 return _deserialize_primitive(data, klass)14 elif klass == object:15 return _deserialize_object(data)16 elif klass == datetime.date:17 return deserialize_date(data)18 elif klass == datetime.datetime:19 return deserialize_datetime(data)20 elif type(klass) == typing.GenericMeta:21 if klass.__extra__ == list:22 return _deserialize_list(data, klass.__args__[0])23 if klass.__extra__ == dict:24 return _deserialize_dict(data, klass.__args__[1])25 else:26 return deserialize_model(data, klass)27def _deserialize_primitive(data, klass):28 """Deserializes to primitive type.29 :param data: data to deserialize.30 :param klass: class literal.31 :return: int, long, float, str, bool.32 :rtype: int | long | float | str | bool33 """34 try:35 value = klass(data)36 except UnicodeEncodeError:37 value = six.u(data)38 except TypeError:39 value = data40 return value41def _deserialize_object(value):42 """Return a original value.43 :return: object.44 """45 return value46def deserialize_date(string):47 """Deserializes string to date.48 :param string: str.49 :type string: str50 :return: date.51 :rtype: date52 """53 try:54 from dateutil.parser import parse55 return parse(string).date()56 except ImportError:57 return string58def deserialize_datetime(string):59 """Deserializes string to datetime.60 The string should be in iso8601 datetime format.61 :param string: str.62 :type string: str63 :return: datetime.64 :rtype: datetime65 """66 try:67 from dateutil.parser import parse68 return parse(string)69 except ImportError:70 return string71def deserialize_model(data, klass):72 """Deserializes list or dict to model.73 :param data: dict, list.74 :type data: dict | list75 :param klass: class literal.76 :return: model object.77 """78 instance = klass()79 if not instance.swagger_types:80 return data81 for attr, attr_type in six.iteritems(instance.swagger_types):82 if data is not None \83 and instance.attribute_map[attr] in data \84 and isinstance(data, (list, dict)):85 value = data[instance.attribute_map[attr]]86 setattr(instance, attr, _deserialize(value, attr_type))87 return instance88def _deserialize_list(data, boxed_type):89 """Deserializes a list and its elements.90 :param data: list to deserialize.91 :type data: list92 :param boxed_type: class literal.93 :return: deserialized list.94 :rtype: list95 """96 return [_deserialize(sub_data, boxed_type)97 for sub_data in data]98def _deserialize_dict(data, boxed_type):99 """Deserializes a dict and its elements.100 :param data: dict to deserialize.101 :type data: dict102 :param boxed_type: class literal.103 :return: deserialized dict.104 :rtype: dict105 """106 return {k: _deserialize(v, boxed_type)...

Full Screen

Full Screen

deserialize_conventional_invoice_info.py

Source:deserialize_conventional_invoice_info.py Github

copy

Full Screen

1from typing import Optional2import xml.etree.ElementTree as ET3from ...xml.XmlReader import XmlReader as XR4from ..namespaces import DATA5from ..dto.ConventionalInvoiceInfo import ConventionalInvoiceInfo6from .deserialize_contract_numbers import deserialize_contract_numbers7from .deserialize_cost_centers import deserialize_cost_centers8from .deserialize_customer_company_codes import deserialize_customer_company_codes9from .deserialize_dealer_codes import deserialize_dealer_codes10from .deserialize_delivery_notes import deserialize_delivery_notes11from .deserialize_ekaer_ids import deserialize_ekaer_ids12from .deserialize_general_ledger_account_numbers import deserialize_general_ledger_account_numbers13from .deserialize_gln_numbers import deserialize_gln_numbers14from .deserialize_item_numbers import deserialize_item_numbers15from .deserialize_material_numbers import deserialize_material_numbers16from .deserialize_order_numbers import deserialize_order_numbers17from .deserialize_project_numbers import deserialize_project_numbers18from .deserialize_shipping_dates import deserialize_shipping_dates19from .deserialize_supplier_company_codes import deserialize_supplier_company_codes20def deserialize_conventional_invoice_info(element: ET.Element) -> Optional[ConventionalInvoiceInfo]:21 if element is None:22 return None23 result = ConventionalInvoiceInfo(24 order_numbers=deserialize_order_numbers(25 XR.find_child(element, 'orderNumbers', DATA)26 ),27 delivery_notes=deserialize_delivery_notes(28 XR.find_child(element, 'deliveryNotes', DATA)29 ),30 shipping_dates=deserialize_shipping_dates(31 XR.find_child(element, 'shippingDates', DATA)32 ),33 contract_numbers=deserialize_contract_numbers(34 XR.find_child(element, 'contractNumbers', DATA)35 ),36 supplier_company_codes=deserialize_supplier_company_codes(37 XR.find_child(element, 'supplierCompanyCodes', DATA)38 ),39 customer_company_codes=deserialize_customer_company_codes(40 XR.find_child(element, 'customerCompanyCodes', DATA)41 ),42 dealer_codes=deserialize_dealer_codes(43 XR.find_child(element, 'dealerCodes', DATA)44 ),45 cost_centers=deserialize_cost_centers(46 XR.find_child(element, 'costCenters', DATA)47 ),48 project_numbers=deserialize_project_numbers(49 XR.find_child(element, 'projectNumbers', DATA)50 ),51 general_ledger_account_numbers=deserialize_general_ledger_account_numbers(52 XR.find_child(element, 'generalLedgerAccountNumbers', DATA)53 ),54 gln_numbers_supplier=deserialize_gln_numbers(55 XR.find_child(element, 'glnNumbersSupplier', DATA)56 ),57 gln_numbers_customer=deserialize_gln_numbers(58 XR.find_child(element, 'glnNumbersCustomer', DATA)59 ),60 material_numbers=deserialize_material_numbers(61 XR.find_child(element, 'materialNumbers', DATA)62 ),63 item_numbers=deserialize_item_numbers(64 XR.find_child(element, 'itemNumbers', DATA)65 ),66 ekaer_ids=deserialize_ekaer_ids(67 XR.find_child(element, 'ekaerIds', DATA)68 ),69 )...

Full Screen

Full Screen

test_grpc_pb.js

Source:test_grpc_pb.js Github

copy

Full Screen

1// GENERATED CODE -- DO NOT EDIT!2'use strict';3var grpc = require('@grpc/grpc-js');4var test_pb = require('./test_pb.js');5function serialize_test_TestMessage(arg) {6 if (!(arg instanceof test_pb.TestMessage)) {7 throw new Error('Expected argument of type test.TestMessage');8 }9 return Buffer.from(arg.serializeBinary());10}11function deserialize_test_TestMessage(buffer_arg) {12 return test_pb.TestMessage.deserializeBinary(new Uint8Array(buffer_arg));13}14var TestServiceService = exports.TestServiceService = {15 rpcTest: {16 path: '/test.TestService/RpcTest',17 requestStream: false,18 responseStream: false,19 requestType: test_pb.TestMessage,20 responseType: test_pb.TestMessage,21 requestSerialize: serialize_test_TestMessage,22 requestDeserialize: deserialize_test_TestMessage,23 responseSerialize: serialize_test_TestMessage,24 responseDeserialize: deserialize_test_TestMessage,25 },26 serverStreamTest: {27 path: '/test.TestService/ServerStreamTest',28 requestStream: false,29 responseStream: true,30 requestType: test_pb.TestMessage,31 responseType: test_pb.TestMessage,32 requestSerialize: serialize_test_TestMessage,33 requestDeserialize: deserialize_test_TestMessage,34 responseSerialize: serialize_test_TestMessage,35 responseDeserialize: deserialize_test_TestMessage,36 },37 clientStreamTest: {38 path: '/test.TestService/ClientStreamTest',39 requestStream: true,40 responseStream: false,41 requestType: test_pb.TestMessage,42 responseType: test_pb.TestMessage,43 requestSerialize: serialize_test_TestMessage,44 requestDeserialize: deserialize_test_TestMessage,45 responseSerialize: serialize_test_TestMessage,46 responseDeserialize: deserialize_test_TestMessage,47 },48 biDirStreamTest: {49 path: '/test.TestService/BiDirStreamTest',50 requestStream: true,51 responseStream: true,52 requestType: test_pb.TestMessage,53 responseType: test_pb.TestMessage,54 requestSerialize: serialize_test_TestMessage,55 requestDeserialize: deserialize_test_TestMessage,56 responseSerialize: serialize_test_TestMessage,57 responseDeserialize: deserialize_test_TestMessage,58 },59};...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2const options = {3};4wptools.page(options).then((page) => {5 page.get().then((data) => {6 console.log(data);7 });8});9{ title: 'Barack Obama',10 { P31: 11 [ { id: 'Q76$5A9D9D8E-7D2F-4B1E-8A5A-8F7C6EABF6C9',12 references: [Object] } ],13 [ { id: 'Q76$D4E4F8C4-4C4E-4C9F-AE8B-7D6C86F0F7A6',14 references: [Object] } ],15 [ { id: 'Q76$E8A9D6A7-0C33-4F7F-8E2A-2D1F0D9E9E8A',16 references: [Object] } ],17 [ { id: 'Q76$6B2C6F0D-7D5F-4D9B-8F8C-1C3B3B3F2C2B',18 references: [Object] } ],19 [ { id: 'Q76$5A9D9D8E-7D

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var fs = require('fs');3var data = fs.readFileSync('./test.xml');4var xml = data.toString();5var obj = wptoolkit.deserialize(xml);6console.log(obj);

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3var options = {4};5var testId = '170612_1A_1c1f1f18d7d2b8f3e3e3b3e3d3d3c3c3';6wpt.getTestResults(testId, function(err, data) {7 if (err) {8 console.error(err);9 } else {10 console.log(data);11 }12});13var wpt = require('webpagetest');14var wpt = new WebPageTest('www.webpagetest.org');15var options = {16};17var testId = '170612_1A_1c1f1f18d7d2b8f3e3e3b3e3d3d3c3c3';18wpt.getTestResults(testId, function(err, data) {19 if (err) {20 console.error(err);21 } else {22 console.log(data);23 }24});25var wpt = require('webpagetest');26var wpt = new WebPageTest('www.webpagetest.org');27var options = {28};

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptdriver = require('wptdriver');2var driver = new wptdriver.Driver();3var page = driver.createPage();4 if(err){5 console.log('error');6 }else{7 console.log('status: ' + status);8 }9});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.getTestResults('170622_1Q_4f61d4c9b5a4b8d5b5e5b5f5d5f5f5e5', function(err, data) {4 if (err) return console.error(err);5 console.log(data);6});7#### WebPageTest(url, [options])8- **url** - The URL of the WebPageTest instance. (default: `www.webpagetest.org`)9- **options** - The options for the WebPageTest instance. (default: `{}`)10var wpt = new WebPageTest();11#### WebPageTest#runTest(url, [options], [callback])12- **options** - The options for the test. (default: `{}`)13- **callback** - The callback function. (default: `undefined`)14 if (err) return console.error(err);15 console.log(data);16});17#### WebPageTest#getTestResults(testId, [callback])18- **callback** - The callback function. (default: `undefined`)19wpt.getTestResults('170622_1Q_4f61d4c9b5a4b8d5b5e5b5f5d5f5f5e5', function(err, data) {20 if (err) return console.error(err);21 console.log(data);22});23#### WebPageTest#getLocations([callback])24- **callback** - The callback function. (default: `undefined`)25wpt.getLocations(function(err, data) {26 if (err) return console.error(err);27 console.log(data);28});29#### WebPageTest#getLocation(location, [callback])

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful